deploi
is tiny cli tool that combines the functionality of athloi
's version
and publish
commands to allow npm workspace-based monorepos to publish their public packages to npm in a single step.
The --version
option is parsed with semver to determine the appropriate tag: if it contains alpha
, beta
, or similar, it will be published as a pre-release version.
- Node.js 18 or later
- npm 8 or later
Running
npx deploi --version 2.0.0
Will...
- Update the version of all packages in the monorepo to
2.0.0
- Publish all non-private packages to npm as the latest version
Running
npx deploi --version 2.0.0-alpha.1
Will...
- Update the version of all packages in the monorepo to
2.0.0-alpha.1
- Publish all non-private packages to npm tagged as pre-release versions
Add the following to your .circleci/config.yml
:
jobs:
publish_version:
<<: *container_config_node
steps:
- *attach_workspace
- run:
name: Set npm auth token
command: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc
- run:
name: Build packages
command: npm run build
- run:
name: NPM publish
command: npx deploi --version ${CIRCLE_TAG}
To run the tests:
npm t
To see the CLI in action:
npx . --version <version>
To see the CLI help:
npx . --help
To run the tests in watch mode:
npm run dev