npm install
npm run serve
npm run build
npm run test:unit
npm run lint
npm run storybook
There is an existing automatic release when there is a push on master branch (WIP). But you may need to create a new release without pushing on master to test something. The easiest solution is to publish the package on npmjs.
To publish on npm you have to create an account and connect your local npm to it:
-
npm adduser
to register a new user -
npm login
to login as an existing user -
npm whoami
to verify your username
Most of the modification to do are in the package.json
file:
- Set the name of the package:
"name": "pdp-ui-vue-test"
- The version of the package:
"version": "0.1.2"
- Remove the privacy of the package: delete line
"private": true
- Set the main package file:
"main": "./dist/pdp-ui-vue-test.common.js"
- Write the package build script:
"build:bundle": "vue-cli-service build --target lib --name pdp-ui-vue-test ./src/components/index.js"
- Add the filter of files for the package:
"files": [ "dist/*", "src/*", "public/*", "*.json", "*.js" ]
- Create the components export file: named
index.js
insrc/components/
. For an example see here
After these modifications you can build and publish your package on npmjs:
npm run build:bundle
npm publish --access public
Your package is now published and public on npm. You can install it on your project like other dependencies.
After your tests if you do not need your package again you should delete it from npm. You can follow this documentation to do it.