├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── __doc__
├── configuration.png
└── vue-ui.png
├── generator
├── componentFixtureHelper.js
├── fileHelper.js
├── index.js
├── readmeUpdater.js
└── template
│ └── src
│ ├── App.vue
│ ├── components
│ └── HelloWorld.vue
│ └── index.js
├── index.js
├── logo.png
├── package-lock.json
├── package.json
└── prompts.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw*
22 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | __tests__
2 | __mocks__
3 | __doc__
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Copyright (c) 2017-2018 David Desmaisons
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 |
6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 |
8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-cli-plugin-component
2 | [](https://www.npmjs.com/package/vue-cli-plugin-component)
3 | [](https://npmjs.com/package/vue-cli-plugin-component)
4 | [](https://github.com/David-Desmaisons/vue-cli-plugin-component/blob/master/LICENSE)
5 | > component plugin for vue-cli
6 |
7 | 
8 |
9 | ```
10 | project
11 | │ README.md
12 | │ LICENSE (optional)
13 | └───src
14 | │ ├── index.js
15 | │ └───components
16 | │ └───Mycomponent.vue
17 | │
18 | └───example
19 | ├── App.vue
20 | ├── main.js
21 | ```
22 |
23 | ## Features
24 |
25 | * Adjust build script to only build the component. Use serve script to serve a demo page.
26 |
27 | * Create a prepublishOnly script to run the build(s) before publishing the component
28 |
29 | * Update README.md with component information
30 |
31 | * Optional
32 | * Use [ComponentFixture](https://github.com/David-Desmaisons/ComponentFixture) to develop and test the component
33 |
34 | * Automatically document the component with [vue-styleguidist](https://github.com/vue-styleguidist/vue-styleguidist) and [vuedoc.md](https://gitlab.com/vuedoc/md) .
35 |
36 | * Create a license file for the project
37 |
38 | * Add projects badges
39 |
40 | ## Scripts
41 |
42 | Use build to build the component
43 | ``` sh
44 | npm run build
45 | ```
46 |
47 | Use serve to serve the application example in the example folder
48 | ``` sh
49 | npm run serve
50 | ```
51 |
52 | ### When using vue.doc
53 |
54 | Use doc:build to update the API section of README.md with generated documentation
55 | ```
56 | npm run doc:build
57 | ```
58 |
59 | ### When using vueStyleguide
60 |
61 | Use styleguide to run style guide dev server
62 | ```
63 | npm run styleguide
64 | ```
65 |
66 | Use styleguide:build to generate a static HTML style guide
67 | ```
68 | npm run styleguide:build
69 | ```
70 |
71 |
72 | ## Configuration
73 |
74 | 
75 |
76 |
77 | * **componentName:** the name of the component.
78 |
79 | * **useVueStyleguidist:** true to install [vue-styleguidist](https://github.com/vue-styleguidist/vue-styleguidist), default: true
80 |
81 | * **useVueDoc:** true to install [vuedoc.md](https://gitlab.com/vuedoc/md), default: true
82 |
83 | * **addLicense** true to add a License file to the project, default: false
84 |
85 | * **licenseName** type of the license file to create, default: MIT
86 |
87 | * **copyrightHolders** Project copy holders, used when creating the license file.
88 |
89 | ## Injected Commands
90 |
91 | No command will be injected.
92 |
93 |
94 | ## Installing in an Already Created Project
95 |
96 | ``` sh
97 | vue add component
98 | ```
99 |
100 | ## Injected webpack-chain Rules
101 | No Changes are performed
102 |
--------------------------------------------------------------------------------
/__doc__/configuration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Desmaisons/vue-cli-plugin-component/159613c4eb1bd439bc16825e5cef7d018d1cf029/__doc__/configuration.png
--------------------------------------------------------------------------------
/__doc__/vue-ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/David-Desmaisons/vue-cli-plugin-component/159613c4eb1bd439bc16825e5cef7d018d1cf029/__doc__/vue-ui.png
--------------------------------------------------------------------------------
/generator/componentFixtureHelper.js:
--------------------------------------------------------------------------------
1 | const templateUpdater = (m) => `
2 |
3 | ${m}
4 |
5 | `;
6 |
7 | const script = '