npm ci
npx nx lint <project name>
npx nx test <project name>
npx nx build <project name>
Read more about running tasks with Nx
npm run generate:package <project name>
In the package dist
folder run npm link
And then in your consumer run npm link @%template%@<project>
Run npm unlink
in the package dist
folder to remove the link.
Run nx build <project>
to take changes you make into the consumer.
We are using verdaccio for the local registry.
We have some commands to make it even more easy:
npm run local-registry help
See more in local-registry.mjs
npm run local-registry publish <project name>
By default, the version is 0.0.0-local.1
with the tag local
and the registry is http://localhost:4873
, you can explore more in publish.mjs and local-registry.mjs
In local environment, the version is being overwritten if it is already exist.
npm:
npm install @%template%/<package name>@local --registry=http://localhost:4873
yarn:
yarn add @%template%/<package name>@local --registry=http://localhost:4873
- Search and replace
@%template%
scopes to another. - Search and replace
https://registry.npmjs.org
registry to yours.
You can check your changes with Nx tasks, for example you can run:
npx nx affected --target=lint --base=origin/master
npx nx affected --target=test --base=origin/master
npx nx affected --target=build --base=origin/master
One way of determine which package should be deployed is by using git tags with the format <project name>/<version>
. Then, your can run in your CD npx nx publish $project_name --args="--ver=$version --env=production"
.