Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storybookにcontainerを乗っけた #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,12 @@ jobs:
- run:
name: Regression
command: yarn run regression

workflows:
version: 2
test:
jobs:
- lint
- unit_test
- build_storybook
- visual_regression_test
1 change: 1 addition & 0 deletions config/storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import { configure } from '@storybook/vue'
import '@/plugins/vuetify'

const req = require.context('../../src/stories', true, /.stories.js$/)

Expand Down
1 change: 1 addition & 0 deletions config/storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons' rel="stylesheet">
15 changes: 15 additions & 0 deletions config/storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const path = require('path')
const merge = require('webpack-merge')
const VueAutoRoutingPlugin = require('vue-auto-routing/lib/webpack-plugin')
const rootPath = path.resolve(__dirname, '../../')

module.exports = (baseConfig, env, defaultConfig) => {
return merge(defaultConfig, {
plugins: [
new VueAutoRoutingPlugin({
pages: 'src/pages',
importPrefix: '@/pages/',
})
]
})
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"marked": "^0.5.1",
"pring": "^0.21.4",
"reflect-metadata": "^0.1.12",
"storybook-readme": "^4.0.2",
"vue": "^2.5.17",
"vue-class-component": "^6.0.0",
"vue-property-decorator": "^7.0.0",
Expand All @@ -34,6 +35,7 @@
"vuex": "^3.0.1"
},
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@cypress/webpack-preprocessor": "^3.0.0",
"@google-cloud/firestore": "^0.19.0",
"@storybook/addon-actions": "4.0.0-alpha.20",
Expand All @@ -48,6 +50,7 @@
"@vue/test-utils": "^1.0.0-beta.20",
"babel-core": "7.0.0-bridge.0",
"babel-loader": "^8.0.4",
"babel-plugin-dynamic-import-node": "^2.2.0",
"dotenv-webpack": "^1.5.7",
"flush-promises": "^1.0.2",
"lint-staged": "^7.2.2",
Expand Down
34 changes: 21 additions & 13 deletions src/stories/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@
import { storiesOf } from '@storybook/vue'
import { action } from '@storybook/addon-actions'

import '@/store/resolveTestConfiguration'
import MyButton from '../components/MyButton.vue'
import LoginForm from '@/components/containers/loginForm/index.vue'
import UserRegistrationForm from '@/components/containers/userRegistrationForm.vue'
import UserLoginPage from '@/pages/user/login.vue'
import UserRegistrationPage from '@/pages/user/registration.vue'

storiesOf('Button', module)
.add('with text', () => ({
components: { MyButton },
template: '<my-button @click="action">Hello Button</my-button>',
methods: { action: action('clicked') }
storiesOf('Containers', module)
.add('LoginForm', () => ({
components: { LoginForm },
template: '<v-app><LoginForm/></v-app>',
}))
.add('with text2', () => ({
components: { MyButton },
template: '<my-button @click="action">Hello Button 2</my-button>',
methods: { action: action('clicked') }
.add('UserRegistrationForm', () => ({
components: { UserRegistrationForm },
template: '<v-app><UserRegistrationForm/></v-app>',
}))
.add('with some emoji', () => ({
components: { MyButton },
template: '<my-button @click="action">😀 😎 👍 💯</my-button>',
methods: { action: action('clicked') }

storiesOf('Page', module)
.add('UserLoginPage', () => ({
components: { UserLoginPage },
template: '<v-app><UserLoginPage/></v-app>',
}))
.add('UserRegistrationPage', () => ({
components: { UserRegistrationPage },
template: '<v-app><UserRegistrationPage/></v-app>',
}))
107 changes: 103 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2373,6 +2373,10 @@ assign-symbols@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"

[email protected]:
version "0.9.6"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9"

astral-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
Expand Down Expand Up @@ -3420,6 +3424,14 @@ cli-width@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"

clipboard@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.4.tgz#836dafd66cf0fea5d71ce5d5b0bf6e958009112d"
dependencies:
good-listener "^1.2.2"
select "^1.1.2"
tiny-emitter "^2.0.0"

clipboardy@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.3.tgz#0526361bf78724c1f20be248d428e365433c07ef"
Expand Down Expand Up @@ -4253,6 +4265,10 @@ delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"

delegate@^3.1.2:
version "3.2.0"
resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166"

delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
Expand Down Expand Up @@ -4631,6 +4647,13 @@ es6-shim@^0.35.3:
version "0.35.4"
resolved "https://registry.yarnpkg.com/es6-shim/-/es6-shim-0.35.4.tgz#8d5a4109756383d3f0323421089c423acf8378f1"

es6-templates@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/es6-templates/-/es6-templates-0.2.3.tgz#5cb9ac9fb1ded6eb1239342b81d792bbb4078ee4"
dependencies:
recast "~0.11.12"
through "~2.3.6"

escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
Expand Down Expand Up @@ -4663,7 +4686,7 @@ eslint-scope@^4.0.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"

esprima@^3.1.3:
esprima@^3.1.3, esprima@~3.1.0:
version "3.1.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"

Expand Down Expand Up @@ -5558,6 +5581,12 @@ globule@^1.0.0:
lodash "~4.17.10"
minimatch "~3.0.2"

good-listener@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50"
dependencies:
delegate "^3.1.2"

google-auth-library@^1.3.1, google-auth-library@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-1.6.1.tgz#9c73d831ad720c0c3048ab89d0ffdec714d07dd2"
Expand Down Expand Up @@ -5896,7 +5925,17 @@ html-entities@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f"

html-minifier@^3.2.3:
html-loader@^0.5.5:
version "0.5.5"
resolved "https://registry.yarnpkg.com/html-loader/-/html-loader-0.5.5.tgz#6356dbeb0c49756d8ebd5ca327f16ff06ab5faea"
dependencies:
es6-templates "^0.2.3"
fastparse "^1.1.1"
html-minifier "^3.5.8"
loader-utils "^1.1.0"
object-assign "^4.1.1"

html-minifier@^3.2.3, html-minifier@^3.5.8:
version "3.5.21"
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c"
dependencies:
Expand Down Expand Up @@ -7429,6 +7468,10 @@ lodash.throttle@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"

lodash.toarray@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561"

lodash.transform@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.transform/-/lodash.transform-4.6.0.tgz#12306422f63324aed8483d3f38332b5f670547a0"
Expand Down Expand Up @@ -7544,6 +7587,17 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"

markdown-loader@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/markdown-loader/-/markdown-loader-4.0.0.tgz#502eb94f5db1673beb1721bed82dac9e1d333b9a"
dependencies:
loader-utils "^1.1.0"
marked "^0.5.0"

marked@^0.5.0:
version "0.5.2"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.5.2.tgz#3efdb27b1fd0ecec4f5aba362bddcd18120e5ba9"

marked@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.5.1.tgz#062f43b88b02ee80901e8e8d8e6a620ddb3aa752"
Expand Down Expand Up @@ -7906,6 +7960,12 @@ node-cache@^4.1.1:
clone "2.x"
lodash "4.x"

[email protected]:
version "1.8.1"
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.8.1.tgz#6eec6bfb07421e2148c75c6bba72421f8530a826"
dependencies:
lodash.toarray "^4.4.0"

node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
Expand Down Expand Up @@ -9095,7 +9155,13 @@ pring@^0.21.4:
reflect-metadata "^0.1.12"
uuid "^3.3.2"

private@^0.1.6, private@^0.1.8:
prismjs@^1.9.0:
version "1.15.0"
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.15.0.tgz#8801d332e472091ba8def94976c8877ad60398d9"
optionalDependencies:
clipboard "^2.0.0"

private@^0.1.6, private@^0.1.8, private@~0.1.5:
version "0.1.8"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"

Expand Down Expand Up @@ -9520,6 +9586,15 @@ realpath-native@^1.0.0:
dependencies:
util.promisify "^1.0.0"

recast@~0.11.12:
version "0.11.23"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3"
dependencies:
ast-types "0.9.6"
esprima "~3.1.0"
private "~0.1.5"
source-map "~0.5.0"

rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
Expand Down Expand Up @@ -10061,6 +10136,10 @@ select-hose@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"

select@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d"

selfsigned@^1.9.1:
version "1.10.4"
resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.4.tgz#cdd7eccfca4ed7635d47a08bf2d5d3074092e2cd"
Expand Down Expand Up @@ -10339,7 +10418,7 @@ source-map@^0.4.2:
dependencies:
amdefine ">=0.0.4"

source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7:
source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.0:
version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"

Expand Down Expand Up @@ -10480,6 +10559,18 @@ stealthy-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"

storybook-readme@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/storybook-readme/-/storybook-readme-4.0.2.tgz#35304e7dad1157ecb8dc9b678400db812337202c"
dependencies:
html-loader "^0.5.5"
lodash "^4.17.4"
markdown-loader "^4.0.0"
marked "^0.5.0"
node-emoji "1.8.1"
prismjs "^1.9.0"
string-raw "^1.0.1"

stream-browserify@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db"
Expand Down Expand Up @@ -10533,6 +10624,10 @@ string-length@^2.0.0:
astral-regex "^1.0.0"
strip-ansi "^4.0.0"

string-raw@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/string-raw/-/string-raw-1.0.1.tgz#01be2665a1cfa2c57520c910698f6ca276a4c726"

string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
Expand Down Expand Up @@ -10836,6 +10931,10 @@ tiny-commit-walker@^1.1.2:
lru-cache "^4.1.1"
util.promisify "^1.0.0"

tiny-emitter@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.0.2.tgz#82d27468aca5ade8e5fd1e6d22b57dd43ebdfb7c"

[email protected]:
version "0.0.31"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7"
Expand Down