0.1.11 • Published 3 years ago
pdp-ui-vue-test v0.1.11
pdp-ui-vue
Project setup
npm install
Compiles and hot-reloads for development
npm run serve
Compiles and minifies for production
npm run build
Run your unit tests
npm run test:unit
Lints and fixes files
npm run lint
Storybook
npm run storybook
Customize configuration
Publish PDP manually
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.
Setup npm account
To publish on npm you have to create an account and connect your local npm to it:
npm adduser
to register a new usernpm login
to login as an existing usernpm whoami
to verify your username
Modification for publication
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
Build & Publication
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.
Unpublish
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.