The DTaaS software is developed as a monorepo with multiple npm packages. Since publishing to npmjs is irrevocable and public, developers are encouraged to setup their own private npm registry for local development.
A private npm registry will help with local publish and unpublish steps.
We recommend using verdaccio for this task. The following commands help you create a working private npm registry for development.
docker run -d --name verdaccio -p 4873:4873 verdaccio/verdaccio
npm adduser --registry http://localhost:4873 #create a user on the verdaccio registry
npm set registry http://localhost:4873/
yarn config set registry "http://localhost:4873"
yarn login --registry "http://localhost:4873" #login with the credentials for yarn utility
npm login #login with the credentials for npm utility
You can open http://localhost:4873
in your browser, login with
the user credentials to see the packages published.
To publish a package to your local registry, do:
yarn install
yarn build #the dist/ directory is needed for publishing step
yarn publish --no-git-tag-version #increments version in package.json, publishes to registry
yarn publish #increments version in package.json, publishes to registry and adds a git tag
The package version in package.json gets updated as well. You can
open http://localhost:4873
in your browser, login with the user credentials
to see the packages published. Please see
verdaccio docs
for more information.
If there is a need to unpublish a package, ex: @dtaas/[email protected]
, do:
npm unpublish --registry http://localhost:4873/ @dtaas/[email protected]
To install / uninstall this utility for all users, do:
sudo npm install --registry http://localhost:4873 -g @dtaas/runner
sudo npm list -g # should list @dtaas/runner in the packages
sudo npm remove --global @dtaas/runner
The packages available in private npm registry can be used like the regular npm packages installed from npmjs.
For example, to use @dtaas/[email protected]
package, do:
sudo npm install --registry http://localhost:4873 -g @dtaas/runner
runner # launch the digital twin runner