Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Commit 66648c6

Browse files
committed
Fix #13, use bili and remove poi
- Relate #2, reason for removing poi - Relate #1, open possibility to deploy to gh-pages
1 parent ec95c12 commit 66648c6

File tree

7 files changed

+60
-80
lines changed

7 files changed

+60
-80
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<!-- [![CircleCI](https://circleci.com/gh/DrSensor/vue-authoring-template.svg?style=shield)](https://circleci.com/gh/DrSensor/vue-authoring-template) -->
33
<sub>Click one of this badge for more info</sub>
44

5-
[![minimal config](https://img.shields.io/badge/config-minimal-grey.svg?maxAge=2592000&style=flat-square)](https://poi.js.org)
65
[![circleci support](https://img.shields.io/badge/circleci-support-blue.svg?maxAge=2592000&style=flat-square)](https://circleci.com/docs/1.0/npm-continuous-deployment/)
76
[![surge support](https://img.shields.io/badge/deploy_to-surge-63c299.svg?maxAge=2592000&style=flat-square)](https://surge.sh/help/integrating-with-circleci)
87
[![vue 2.x](https://img.shields.io/badge/vue-2.x-4fc08d.svg?maxAge=2592000&style=flat-square)](https://vuejs.org/)
@@ -12,6 +11,10 @@
1211
---
1312
This template is to help authoring Vue component with it's use case in story-scenario (storybook) format.
1413

14+
```bash
15+
vue init DrSensor/vue-authoring-template
16+
```
17+
1518
![](./screenplay.gif)
1619

1720
> In case you need to convince your Lead Dev to give you permission open-sourcing your work :
@@ -30,8 +33,6 @@ This template is to help authoring Vue component with it's use case in story-sce
3033

3134
## Features
3235

33-
- Support `vue init` workflow
34-
- Minimal configuration. Thanks to [poi](https://poi.js.org)
3536
- Write your storybook `story-scenario` (a.k.a *use case*) in `.vue` **single-file-component format**, not `.js` or `.jsx`
3637
- Option to generate [circleci](https:circleci.com) config to:
3738
- publish vue component to `npm` and `unpkg` <sub>(need to `git push --tags`)</sub>
@@ -92,37 +93,38 @@ npm publish
9293

9394
```markdown
9495
.
95-
├── package.json // choose and configure the component you want to package in here (still need to edit `scripts: {}` block)
96+
├── package.json
97+
├── .bilirc // choose and configure the component you want to package in here
9698
├── .editorconfig
9799
├── .gitignore
98100
99101
├── .circleci
100102
│ └── config.yml
101103
├── .loader // loader for processing custom blocks
102104
│ └── docs-loader.js
103-
├── .storybook
105+
├── .storybook // storybook related config
104106
│ ├── addons.js
105107
│ ├── config.js
106-
│ └── poi.config.js // currently the template project use `poi` as alternative of `vue build`
108+
│ └── webpack.config.js
107109
108110
└── src
109111
├── components // place 1 or more components to author here
110112
│ └── HelloWorld.vue
111113
112-
├── mixins // reduce complexity by separating any long code here
114+
├── mixins // if needed, reduce complexity by separating any long code as mixins
113115
│ ├── mix1.js
114116
│ └── mix2.js
115117
116-
└── stories // use case or usage of the component written in story-scenario analogy
118+
└── stories // use-case/usage of the component written in story-scenario analogy
117119
├── Story1
118120
│ └── Scenario1.vue
119121
├── Story2
120122
├── Story3
121-
├── config.js // config to order the story and the scenario
123+
├── config.js // config to re-order the story and the scenario
122124
└── index.js // chain and add the addon here
123125
```
124126

125-
## Looking for suggestion! (Open/Comment New Issues)
127+
## Looking for suggestion!
126128

127129
- How to customize style of the storybook
128130
- Authoring `Vuex` module? [Is it necessary?](https://github.com/DrSensor/vue-authoring-template/issues/3)
@@ -135,3 +137,6 @@ See [CONTRIBUTING.md](https://github.com/DrSensor/vue-authoring-template/blob/ma
135137

136138
## License
137139
[MIT](https://github.com/DrSensor/vue-authoring-template/blob/master/LICENSE) License
140+
141+
---
142+
Modify/clone/fork/do-anything to this template and generated README and any others content as you wish.

template/.bilirc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "{{name}}",
3+
"moduleName": "{{pascalCase name}}",
4+
"input": [
5+
"src/components/*"
6+
],
7+
"format": ["cjs", "umd-min", "es"]
8+
}

template/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
node_modules
22
.DS_Store
33
dist/
4-
umd/
54
.storybook/dist
65
*.lock
76
out*

template/.storybook/poi.config.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

template/.storybook/webpack.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{#isEnabled addons 'readme'}}
2+
const updateWebpackConfig = require('storybook-readme/env/vue/updateWebpackConfig')
3+
{{/isEnabled}}
4+
5+
module.exports = (storybookBaseConfig, configType, defaultConfig) => {
6+
// configType has a value of 'DEVELOPMENT' or 'PRODUCTION'
7+
// You can change the configuration based on that.
8+
// 'PRODUCTION' is used when building the static version of storybook.
9+
10+
/** For more info @see https://storybook.js.org/configurations/custom-webpack-config/#full-control-mode--default
11+
defaultConfig.module.rules.push({
12+
test: /\.(ts|tsx)$/,
13+
include: path.resolve(__dirname, '../src'),
14+
loader: require.resolve('ts-loader')
15+
});
16+
defaultConfig.resolve.extensions.push('.ts', '.tsx')
17+
*/
18+
19+
// Return the altered config
20+
{{#isEnabled addons 'readme'}}
21+
return updateWebpackConfig(defaultConfig)
22+
{{else}}
23+
return defaultConfig
24+
{{/isEnabled}}
25+
}

template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ export default {
102102
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development guide.
103103

104104
---
105-
This component was generated with [vue-authoring-template](https://github.com/DrSensor/vue-authoring-template) using [vue-cli](https://github.com/vuejs/vue-cli).
105+
<sup>This library was generated with [vue-authoring-template](https://github.com/DrSensor/vue-authoring-template) using [vue-cli](https://github.com/vuejs/vue-cli).</sup>

template/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"vue",
88
"component"
99
],
10+
"unpkg": "dist/{{name}}.min.js",
11+
"jsdelivr": "dist/{{name}}.min.js",
1012
"main": "dist/{{name}}.js",
11-
"unpkg": "umd/{{name}}.js",
13+
"module": "dist/{{name}}.es.js",
1214
"files": [
1315
"dist/",
1416
"umd/",
@@ -18,13 +20,12 @@
1820
"license": "MIT",
1921
"private": false,
2022
"scripts": {
21-
"dev": "poi --config .storybook/poi.config.js --storybook --open",
22-
"build:storybook": "poi build --config .storybook/poi.config.js --storybook",
23-
"build:component": "poi build src/components/{{pascalCase name}}.vue --library",
24-
"build:component:umd": "poi build src/components/{{pascalCase name}}.vue --library {{pascalCase name}} --dist umd",
23+
"dev": "start-storybook --static-dir static",
24+
"build:storybook": "build-storybook --static-dir static --output-dir .storybook/dist",
25+
"build:component": "bili --plugin vue --jsx vue",
2526
"deploy": "surge .storybook/dist",
2627
"predeploy": "npm run build:storybook",
27-
"prepublish": "concurrently --kill-others 'npm run build:component' 'npm run build:component:umd'"
28+
"prepublish": "npm run build:component"
2829
},
2930
"devDependencies": {
3031
{{#isEnabled addons 'actions'}}
@@ -44,14 +45,13 @@
4445
{{/isEnabled}}
4546
"@storybook/addon-options": "^3.3.0",
4647
"@storybook/vue": "^3.3.0",
48+
"@storybook/cli": "^3.3.0",
4749
{{#if customBlocks}}
4850
"marked": "^0.3.0",
4951
{{/if}}
50-
"poi": "^9.4.0",
51-
"poi-preset-resolve-alias": "^1.0.0",
52-
"poi-preset-storybook": "^0.1.4",
53-
"surge": "^0.19.0",
54-
"concurrently": "^3.5.1"
52+
"bili": "^1.6.5",
53+
"rollup-plugin-vue": "^3.0.0",
54+
"surge": "^0.19.0"
5555
},
5656
"peerDependencies": {},
5757
"dependencies": {}

0 commit comments

Comments
 (0)