You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2021. It is now read-only.
- remove addon-info until it support Vue
- generated readme section for Installation
- generated readme section for Extending component
- more feature explanation
- more template usage explanation
This template is to help authoring Vue component with it's use case in story-scenario (storybook) format.
10
14
11
15

12
16
13
-
Authoring component and publish it to `npm` for later use can help reduce complexity <sup><sup><sup><sup><sup>by delegating the work of finding bug and adding feature</sup></sup></sup></sup></sup> of big/long-running project <sub><sub><sub><sub><sub>to the community</sub></sub></sub></sub></sub>
17
+
> In case you need to convince your Lead Dev to give you permission open-sourcing your work :
18
+
19
+
"Authoring component and publish it to `npm` for later use can help reduce complexity <sup><sup><sup><sup><sup>by delegating the work of finding bug and adding feature</sup></sup></sup></sup></sup> of big/long-running project <sub><sub><sub><sub><sub>to the community</sub></sub></sub></sub></sub>"
20
+
14
21
## Motivation
15
-
1. There is a time when developer involved in a project then build component to solve specific problem 😎.
16
-
2. One day this developer happen to do the same thing again in different project with slight alteration 😏.
17
-
3. Then doing it again, and again, and again 😫.
18
-
4. Now this developer have build many component with the same topic 😂.
19
-
5. So, why not publish it as a single component with that one topic in mind to [`npm`](https://www.npmjs.com/)? 😲
20
-
6. However, the component must be showcased in [mvce](https://stackoverflow.com/help/mcve) style to make it easy to understand and maintainable 😖.
21
-
7. 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 :poop:.
22
+
23
+
1. There is a time when developer involved in a project then build component to solve specific problem 😎
24
+
1. One day this developer happen to do the same thing again in different project with slight alteration 😏
25
+
1. Then doing it again, and again, and again 😫
26
+
1. Now this developer have build many component with the same topic 😂
27
+
1. So, why not publish it as a single component with that one topic in mind to [`npm`](https://www.npmjs.com/)? 😲
28
+
1. However, the component must be showcased in [mvce](https://stackoverflow.com/help/mcve) style to make it easy to understand and maintainable 😖
29
+
1. 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 :poop:
30
+
31
+
## Features
32
+
33
+
- Support `vue init` workflow
34
+
- Minimal configuration. Thanks to [poi](https://poi.js.org)
35
+
- Write your storybook `story-scenario` (a.k.a *use case*) in `.vue`**single-file-component format**, not `.js` or `.jsx`
36
+
- Option to generate [circleci](https:circleci.com) config to:
37
+
- publish vue component to `npm` and `unpkg` <sub>(need to `git push --tags`)</sub>
38
+
- deploy storybook page to [surge.sh](https://surge.sh)
39
+
- evaluate pull-requests and temporarily deploy storybook page to `<name><#PR_number>.surge.sh` <sub>(auto teardown when PR is merged)</sub>
40
+
- Choose pre-installed and configured storybook addon:
- Order the story and scenario *alphabetically* or manually re-order using `Array|Object` in `src/stories/config.js`
47
+
- Auto generate [`README.md`](./template/README.md)
48
+
- Custom blocks (experimental, looking for feedback)
22
49
23
50
## Usage
51
+
24
52
```bash
25
53
vue init DrSensor/vue-authoring-template
26
54
```
27
-
After that,
28
55
29
-
- to build vue component use
30
-
```
31
-
[npm|yarn] build:component
56
+
After that, you can:
57
+
58
+
- start in development mode
59
+
60
+
```bash
61
+
[npm|yarn] dev
32
62
```
33
-
- to build the storybook use
63
+
64
+
- deploy storybook page directly to http://surge.sh
65
+
66
+
```bash
67
+
[npm|yarn] run deploy
34
68
```
35
-
[npm|yarn] build:storybook
69
+
70
+
- publish component directly to http://npmjs.com
71
+
72
+
```bash
73
+
# see https://docs.npmjs.com/getting-started/semantic-versioning#semver-for-publishers
74
+
npm version [patch|minor|major]
75
+
npm publish
36
76
```
37
-
- to start it in development mode use
77
+
78
+
- build vue component
79
+
80
+
```bash
81
+
[npm|yarn] build:component # as CJS module, the output will be in dist/
82
+
[npm|yarn] build:component:umd # as UMD module, the output will be in umd/
38
83
```
39
-
[npm|yarn] dev
84
+
85
+
- build the storybook page
86
+
87
+
```bash
88
+
[npm|yarn] build:storybook # the output will be in .storybook/dist/
40
89
```
41
90
42
91
## Project Structure
92
+
43
93
```markdown
44
94
.
45
95
├── package.json // choose and configure the component you want to package in here (still need to edit `scripts: {}` block)
@@ -49,9 +99,7 @@ After that,
49
99
├── .circleci
50
100
│ └── config.yml
51
101
├── .loader // loader for processing custom blocks
52
-
│ ├── docs-loader.js
53
-
│ ├── info-loader.js
54
-
│ └── notes-loader.js
102
+
│ └── docs-loader.js
55
103
├── .storybook
56
104
│ ├── addons.js
57
105
│ ├── config.js
@@ -74,21 +122,10 @@ After that,
74
122
└── index.js // chain and add the addon here
75
123
```
76
124
77
-
## Features
78
-
- Support `vue init` workflow
79
-
- Minimal configuration. Thanks to [poi](https://poi.js.org).
80
-
- Prebuilt [circleci](https:circleci.com) config to build, deploy, and evaluate pull-requests. By default its deployed to [surge.sh](https://surge.sh).
81
-
- Order the story-scenario *alphabetically* or define it using `Array`|`Object` in `src/stories/config.js`.
82
-
- Preinstall and configured storybook addon:
83
-
- knobs
84
-
- readme, info(experimental), and notes
85
-
- actions
86
-
- Custom blocks (experimental, looking for feedback).
87
-
88
-
## Looking for suggestion (Open New Issues)
89
-
- Make chaining storybook-addon on each scenario in elegant way
125
+
## Looking for suggestion! (Open/Comment New Issues)
126
+
90
127
- How to customize style of the storybook
91
-
- Authoring `Vuex` module? (is it necessary?)
128
+
- Authoring `Vuex` module? [Is it necessary?](https://github.com/DrSensor/vue-authoring-template/issues/3)
0 commit comments