Click one of this badge for more info
This template is to help authoring Vue component with it's use case in story-scenario (storybook) format.
vue init DrSensor/vue-authoring-template
In case you need to convince your Lead Dev to give you permission open-sourcing your work :
"Authoring component and publish it to npm
for later use can help reduce complexity by delegating the work of finding bug and adding feature of big/long-running project to the community"
- There is a time when developer involved in a project then build component to solve specific problem ๐
- One day this developer happen to do the same thing again in different project with slight alteration ๐
- Then doing it again, and again, and again ๐ซ
- Now this developer have build many component with the same topic ๐
- So, why not publish it as a single component with that one topic in mind to
npm
? ๐ฒ - However, the component must be showcased in mvce style to make it easy to understand and maintainable ๐
- As the time passed, he/she is to lazy to do that because no template/config/cli/whatever for authoring the component in that way ๐ฉ
- Write your storybook
story-scenario
(a.k.a use case) in.vue
single-file-component format, not.js
or.jsx
- Option to generate circleci config to:
- publish vue component to
npm
andunpkg
(need togit push --tags
) - deploy storybook page to surge.sh
- evaluate pull-requests and temporarily deploy storybook page to
<name><#PR_number>.surge.sh
(auto teardown when PR is merged)
- publish vue component to
- Choose pre-installed and configured storybook addon:
- Order the story and scenario alphabetically or manually re-order using
Array|Object
insrc/stories/config.js
- Auto generate
README.md
vue init DrSensor/vue-authoring-template
After that, you can:
- start in development mode
npm run dev # or
yarn dev
- deploy storybook page directly to http://surge.sh
npm run deploy # or
yarn deploy
- publish component directly to http://npmjs.com
# see https://docs.npmjs.com/getting-started/semantic-versioning#semver-for-publishers
npm version [patch|minor|major]
npm publish
- build vue component
# the output will be in dist/
npm run build:component # or
yarn build:component
- build the storybook page
# the output will be in .storybook/dist/
npm run build:storybook # or
yarn build:storybook
.
โโโ package.json
โโโ .bilirc // choose and configure the component you want to package in here
โโโ .editorconfig
โโโ .gitignore
โ
โโโ .circleci
โ โโโ config.yml
โ
โโโ .storybook // storybook related config
โ โโโ addons.js
โ โโโ config.js
โ โโโ webpack.config.js
โ
โโโ src
โโโ components // place 1 or more components to author here
โ โโโ HelloWorld.vue
โ
โโโ mixins // if needed, reduce complexity by separating any long code as mixins
โ โโโ mix1.js
โ โโโ mix2.js
โ
โโโ stories // use-case/usage of the component written in story-scenario analogy
โโโ Story1
โ โโโ Scenario1.vue
โโโ Story2
โโโ Story3
โโโ config.js // config to re-order the story and the scenario
โโโ index.js // chain and add the addon here
- How to customize style of the storybook
- Authoring
Vuex
module? Is it necessary? - any others?
See CONTRIBUTING.md for contributing directly via:
MIT License
Modify/clone/fork/do-anything to this template and generated README and any others content as you wish.