├── .commitlintrc.json ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── meta.js ├── package-lock.json ├── package.json ├── release.config.js └── template ├── .DS_Store ├── .babelrc ├── .commitlintrc.json ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github ├── CODE_OF_CONDUCT.md ├── COMMIT_CONVENTION.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .npmignore ├── .nvmrc ├── .storybook ├── config.js └── webpack.config.js ├── LICENSE.md ├── README.md ├── jest.config.js ├── jest.setup.js ├── package.json ├── rollup.config.js ├── src ├── __tests__ │ └── index.js ├── components │ ├── HelloWorld.vue │ └── __tests__ │ │ ├── HelloWorld.js │ │ └── __snapshots__ │ │ └── HelloWorld.js.snap ├── index.js └── index.umd.js └── stories └── index.stories.js /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "@commitlint/config-conventional" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/node,visualstudiocode 2 | 3 | ### Node ### 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | yarn-debug.log* 9 | yarn-error.log* 10 | 11 | # Runtime data 12 | pids 13 | *.pid 14 | *.seed 15 | *.pid.lock 16 | 17 | # Directory for instrumented libs generated by jscoverage/JSCover 18 | lib-cov 19 | 20 | # Coverage directory used by tools like istanbul 21 | coverage 22 | 23 | # nyc test coverage 24 | .nyc_output 25 | 26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 27 | .grunt 28 | 29 | # Bower dependency directory (https://bower.io/) 30 | bower_components 31 | 32 | # node-waf configuration 33 | .lock-wscript 34 | 35 | # Compiled binary addons (http://nodejs.org/api/addons.html) 36 | build/Release 37 | 38 | # Dependency directories 39 | node_modules/ 40 | jspm_packages/ 41 | 42 | # Typescript v1 declaration files 43 | typings/ 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | 63 | # Generated code 64 | dist/ 65 | 66 | ### VisualStudioCode ### 67 | .vscode/* 68 | !.vscode/settings.json 69 | !.vscode/tasks.json 70 | !.vscode/launch.json 71 | !.vscode/extensions.json 72 | 73 | # End of https://www.gitignore.io/api/node,visualstudiocode 74 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | cache: 3 | directories: 4 | - ~/.npm 5 | notifications: 6 | email: false 7 | node_js: 8 | - '9' 9 | - '8' 10 | after_success: 11 | - npm install -g travis-deploy-once@4 12 | - travis-deploy-once "npm run semantic-release" 13 | branches: 14 | except: 15 | - /^v\d+\.\d+\.\d+$/ 16 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## [1.2.2](https://github.com/julon/vue-cli-template-library/compare/v1.2.1...v1.2.2) (2018-03-10) 3 | 4 | 5 | ### Bug Fixes 6 | 7 | * add release.config.js ([e2af552](https://github.com/julon/vue-cli-template-library/commit/e2af552)) 8 | 9 | 10 | ## [1.2.1](https://github.com/julon/vue-cli-template-library/compare/6a11b7671e6a07a4d366cc67da987aab790b7c94...v1.2.1) (2018-01-19) 11 | 12 | 13 | ### Bug Fixes 14 | 15 | * add dependencies property test ([47a2ef1](https://github.com/julon/vue-cli-template-library/commit/47a2ef1)) 16 | * replace globals func by assign to merge obj ([f7c316f](https://github.com/julon/vue-cli-template-library/commit/f7c316f)) 17 | 18 | 19 | # [1.2.0](https://github.com/julon/vue-cli-template-library/compare/e24dbfe0b5a1876dc89f9f06839896d59eb84310...v1.2.0) (2018-01-19) 20 | 21 | 22 | ### Bug Fixes 23 | 24 | * using npm instead of yarn in scripts ([6a11b76](https://github.com/julon/vue-cli-template-library/commit/6a11b76)) 25 | 26 | 27 | ### Features 28 | 29 | * **build:** add globals and externals ([586aa9a](https://github.com/julon/vue-cli-template-library/commit/586aa9a)) 30 | 31 | 32 | ## [1.1.7](https://github.com/julon/vue-cli-template-library/compare/86901db27f73f731cd78cebee06c8b64b1a58ca3...v1.1.7) (2018-01-17) 33 | 34 | 35 | ### Bug Fixes 36 | 37 | * **package:** bump packages versions in template ([e24dbfe](https://github.com/julon/vue-cli-template-library/commit/e24dbfe)) 38 | 39 | 40 | ## [1.1.6](https://github.com/julon/vue-cli-template-library/compare/e14a2478feb6d99ec84af52d07f3a07969672c97...v1.1.6) (2018-01-11) 41 | 42 | 43 | ### Bug Fixes 44 | 45 | * remove unused alias @ support ([86901db](https://github.com/julon/vue-cli-template-library/commit/86901db)) 46 | 47 | 48 | ## [1.1.5](https://github.com/julon/vue-cli-template-library/compare/83a77e09b49e970f1047a446636fcee0511a6cc7...v1.1.5) (2018-01-10) 49 | 50 | 51 | ### Bug Fixes 52 | 53 | * add complete message in meta and update docs ([e14a247](https://github.com/julon/vue-cli-template-library/commit/e14a247)) 54 | 55 | 56 | ## [1.1.4](https://github.com/julon/vue-cli-template-library/compare/fd1640fff063d04b578e56b98213dc125376cfea...v1.1.4) (2018-01-09) 57 | 58 | 59 | ### Bug Fixes 60 | 61 | * update license.md ([83a77e0](https://github.com/julon/vue-cli-template-library/commit/83a77e0)) 62 | 63 | 64 | ## [1.1.3](https://github.com/julon/vue-cli-template-library/compare/e4fca996214f63c26a6cb3b717d75aa79306b0b8...v1.1.3) (2018-01-08) 65 | 66 | 67 | ### Bug Fixes 68 | 69 | * change regex of jest transform ([fd1640f](https://github.com/julon/vue-cli-template-library/commit/fd1640f)) 70 | 71 | 72 | ## [1.1.2](https://github.com/julon/vue-cli-template-library/compare/b35a4c70d94d8775410c5d7494feba75c95f901b...v1.1.2) (2018-01-07) 73 | 74 | 75 | ### Bug Fixes 76 | 77 | * move documentation to Contributing.md ([e4fca99](https://github.com/julon/vue-cli-template-library/commit/e4fca99)) 78 | 79 | 80 | ## [1.1.1](https://github.com/julon/vue-cli-template-library/compare/42189801ce39fe4ff74ab05c1ccc9ff257996ce7...v1.1.1) (2018-01-07) 81 | 82 | 83 | ### Bug Fixes 84 | 85 | * Update the README ([b35a4c7](https://github.com/julon/vue-cli-template-library/commit/b35a4c7)) 86 | 87 | 88 | # [1.1.0](https://github.com/julon/vue-cli-template-library/compare/572e2ff82c6e7b9a41582cf3fbef971bd47e89a2...v1.1.0) (2018-01-07) 89 | 90 | 91 | ### Features 92 | 93 | * Update the README ([4218980](https://github.com/julon/vue-cli-template-library/commit/4218980)) 94 | 95 | 96 | # 1.0.0 (2018-01-07) 97 | 98 | 99 | ### Features 100 | 101 | * add vue-lib-template files ([71e72ef](https://github.com/julon/vue-lib-template/commit/71e72ef)) 102 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2017 Julon Lou 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-cli-template-library 2 | ![Commitizen](https://img.shields.io/badge/Commitizen-enabled-brightgreen.svg) 3 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 4 | ![Npm badge](https://img.shields.io/npm/v/vue-cli-template-library.svg) 5 | ![Travis badge](https://img.shields.io/travis/julon/vue-cli-template-library.svg) 6 | [![Greenkeeper badge](https://badges.greenkeeper.io/julon/vue-cli-template-library.svg)](https://greenkeeper.io/) 7 | 8 | > Template for developing open-source vue.js libraries 9 | 10 | > You fell in love with Vue.js and want to create your own unit-tested and documented library to share with everyone but you don't want to spend the whole time set things up? This template is for you! It will take care of managing versioning and publishing to github and npm automatically, so you just need to focus on commiting your pieces of code. Packed with best-practices stuff(linters, preprocessors..) and publishable skeleton. 11 | 12 | > Rollup + Jest + Babel + Storybook + TravisCI + SemanticRelease + ❤️ 13 | 14 | ## Usage 15 | 16 | ```bash 17 | $ npm install -g vue-cli 18 | $ vue init julon/vue-cli-template-library my-project 19 | $ cd my-project 20 | $ npm install 21 | $ npm run storybook 22 | ``` 23 | 24 | ## What's included 25 | 26 | * `npm run build` : Production-ready build. 27 | * Export to CommonJS, ES Modules, UMD(dev & minified) 28 | * CSS is embedded in the JS by default 29 | * Using Rollup to compute Vue, ES6 js files 30 | * Pugjs and Stylus supported in vue files 31 | * `npm run storybook` : The UI Development Environment 32 | * Based on webpack 33 | * Pre-configured to work out of the box 34 | * `npm run test` : eslint & Unit-test with Jest 35 | * Supports ES2015+ in test files 36 | * Use `npm run test:watch` to start Jest in watch-mode 37 | * Use `npm run test:update` to start Jest and update component snapshot 38 | * `npm run lint` 39 | * Rules based on prettier:recommended, vue:recommended 40 | * Import errors and warning detection 41 | * Use `npm run lint:fix` to fix eslint errors 42 | * `npm run cz` : Commitizen support 43 | * Loaded with Conventional-changelog rules 44 | * Entrypoint to semantic-release automation 45 | * Semantic-release auto-deployment configuration 46 | * Auto-generate changelog 47 | * Auto-commit computed package version in git 48 | * Auto-release in github 49 | * Auto-publish to npm 50 | * Enable this features by using the semantic-release-cli 51 | 52 | 53 | ## Fork It And Make Your Own 54 | You can fork this repo to create your own boilerplate, and use it with vue-cli: 55 | ```bash 56 | vue init username/repo my-project 57 | ``` -------------------------------------------------------------------------------- /meta.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | prompts: { 3 | name: { 4 | type: "string", 5 | required: true, 6 | label: "Project name (kebab-case only)" 7 | }, 8 | description: { 9 | type: "string", 10 | required: true, 11 | label: "Project description", 12 | default: "A Vue.js 2.0 library project" 13 | }, 14 | author: { 15 | type: "string", 16 | label: "Author" 17 | }, 18 | email: { 19 | type: "string", 20 | required: true, 21 | label: "Email" 22 | }, 23 | repos: { 24 | type: "string", 25 | required: true, 26 | label: "Github repository URL", 27 | default: "user/repository" 28 | } 29 | }, 30 | "skipInterpolation": "src/**/*.{html,vue}", 31 | "completeMessage": "To get started and/or setup your automatic deployment, please read the contributing documentation: {{destDirName}}/.github/CONTRIBUTING.md" 32 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-cli-template-library", 3 | "version": "1.2.1", 4 | "license": "MIT", 5 | "description": "Template for developing open-source vue.js libraries", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/julon/vue-cli-template-library.git" 9 | }, 10 | "bugs": { 11 | "url": "https://github.com/julon/vue-cli-template-library/issues" 12 | }, 13 | "homepage": "https://github.com/julon/vue-cli-template-library#readme", 14 | "keywords": [ 15 | "vue", 16 | "vue-component", 17 | "vue-library", 18 | "vue-template" 19 | ], 20 | "scripts": { 21 | "cz": "git-cz", 22 | "commitmsg": "commitlint -e $GIT_PARAMS", 23 | "semantic-release": "semantic-release" 24 | }, 25 | "devDependencies": { 26 | "@commitlint/cli": "^6.0.2", 27 | "@commitlint/config-conventional": "^6.0.4", 28 | "@semantic-release/changelog": "^2.0.1", 29 | "@semantic-release/git": "^4.0.1", 30 | "@semantic-release/github": "^4.2.7", 31 | "@semantic-release/npm": "^3.2.2", 32 | "commitizen": "^2.9.6", 33 | "cz-conventional-changelog": "^2.1.0", 34 | "husky": "^0.14.3", 35 | "semantic-release": "^15.0.2", 36 | "vue-cli": "^2.9.3" 37 | }, 38 | "config": { 39 | "commitizen": { 40 | "path": "cz-conventional-changelog" 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /release.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | verifyConditions: [ 3 | "@semantic-release/changelog", 4 | "@semantic-release/npm", 5 | "@semantic-release/git", 6 | "@semantic-release/github" 7 | ], 8 | getLastRelease: "@semantic-release/npm", 9 | prepare: ["@semantic-release/changelog", "@semantic-release/git"], 10 | publish: ["@semantic-release/npm", "@semantic-release/github"] 11 | }; 12 | -------------------------------------------------------------------------------- /template/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julon/vue-cli-template-library/a3555d873deb59a1724392963711b889a4ccc974/template/.DS_Store -------------------------------------------------------------------------------- /template/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["vue-app", { 4 | "modules": false 5 | }] 6 | ], 7 | "plugins": [ 8 | ["module-resolver", { 9 | "extensions": [".js", ".vue", ".json"] 10 | }] 11 | ], 12 | "env": { 13 | "test": { 14 | "plugins": ["dynamic-import-node"] 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /template/.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "@commitlint/config-conventional" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /template/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /template/.eslintignore: -------------------------------------------------------------------------------- 1 | .github/ 2 | _book/ 3 | docs/ 4 | coverage/ 5 | dist/ -------------------------------------------------------------------------------- /template/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // https://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parserOptions: { 6 | parser: 'babel-eslint', 7 | ecmaVersion: 2017, 8 | sourceType: 'module' 9 | }, 10 | plugins: ['html', 'vue'], 11 | extends: [ 12 | 'eslint:recommended', 13 | 'plugin:prettier/recommended', 14 | 'plugin:vue/recommended', 15 | 'plugin:import/errors', 16 | 'plugin:import/warnings' 17 | ], 18 | env: { 19 | browser: true, 20 | node: true, 21 | commonjs: true, 22 | es6: true, 23 | jest: true 24 | }, 25 | rules: { 26 | // allow async-await 27 | 'generator-star-spacing': 'off', 28 | // don't require .vue extension when importing 29 | 'import/extensions': ['error', 'always', { 30 | 'js': 'never', 31 | 'vue': 'never' 32 | }], 33 | // disallow reassignment of function parameters 34 | // disallow parameter object manipulation except for specific exclusions 35 | 'no-param-reassign': ['error', { 36 | props: true, 37 | ignorePropertyModificationsFor: [ 38 | 'state', // for vuex state 39 | 'acc', // for reduce accumulators 40 | 'e' // for e.returnvalue 41 | ] 42 | }], 43 | // allow optionalDependencies 44 | 'import/no-extraneous-dependencies': ['error', { 45 | optionalDependencies: ['test/index.js'] 46 | }], 47 | // allow debugger during development 48 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 49 | }, 50 | "settings": { 51 | // resolve using plugin babel module resolver 52 | "import/resolver": { 53 | "babel-module": {} 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /template/.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at {{ email }}. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ -------------------------------------------------------------------------------- /template/.github/COMMIT_CONVENTION.md: -------------------------------------------------------------------------------- 1 | ## Git Commit Message Convention 2 | 3 | > This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md). 4 | 5 | #### Examples 6 | 7 | Appears under "Features" header, `compiler` subheader: 8 | 9 | ``` 10 | feat(compiler): add 'comments' option 11 | ``` 12 | 13 | Appears under "Bug Fixes" header, `v-model` subheader, with a link to issue #28: 14 | 15 | ``` 16 | fix(v-model): handle events on blur 17 | 18 | close #28 19 | ``` 20 | 21 | Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: 22 | 23 | ``` 24 | perf(core): improve vdom diffing by removing 'foo' option 25 | 26 | BREAKING CHANGE: The 'foo' option has been removed. 27 | ``` 28 | 29 | The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. 30 | 31 | ``` 32 | revert: feat(compiler): add 'comments' option 33 | 34 | This reverts commit 667ecc1654a317a13331b17617d973392f415f02. 35 | ``` 36 | 37 | ### Full Message Format 38 | 39 | A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: 40 | 41 | ``` 42 | (): 43 | 44 | 45 | 46 |