This is a Lerna monorepo using npm workspaces, so a single install at the root wires up both packages:
npm installcontentchef-node/
packages/
contentchef-node/
contentchef-media/
contentchef-nodepackage contains the client to retrieve contents from ContentChef. Click here for more detailscontentchef-mediapackage contains methods to help managing and interacting with ContentChef's media. Click here for more details
Run from the repo root via Lerna; each command fans out to both packages:
npm run lint # eslint
npm test # jest with coverage
npm run build # dual CJS + ESM buildBoth packages are released in lockstep (fixed mode) — lerna.json carries the shared version and lerna version bumps every package to match. The publish pipeline relies on each package's prepublishOnly hook, which runs npm test && npm run lint && npm run build before anything is uploaded to npm.
Bumps versions, generates the changelog, commits, tags, pushes, and publishes in one go:
npx lerna publishSeparate the version commit from the publish step so the tag exists on master before publishing:
# 1. Bump versions, write CHANGELOG, commit, tag, push
npx lerna version
# 2. Publish whatever versions are now tagged in git
npx lerna publish from-gitThe current line is 7.0.0-beta.*. Bump to the next prerelease and publish under the beta dist-tag so it doesn't replace latest:
# bump 7.0.0-beta.2 → 7.0.0-beta.3 across all packages
npx lerna version prerelease --preid beta
# publish under the `beta` tag
npx lerna publish from-git --dist-tag betaWhen the line stabilises, graduate the prerelease and publish under latest:
npx lerna version 7.0.0
npx lerna publish from-gitLerna has no native --dry-run, but you can preview each phase safely:
# Preview the version bump — updates package.json + lerna.json in the working tree
# but creates no commit, no tag, and pushes nothing. Revert with `git restore .`.
npx lerna version prerelease --preid beta --no-git-tag-version --no-push --yes
# Preview what would be uploaded to npm (runs prepack lint+build hooks too)
npm publish --dry-run --workspaces
# or per-package
npm pack --dry-run -w @contentchef/contentchef-nodeIf package.json versions are already bumped (e.g. by a release PR) and you just want to push to npm:
npx lerna publish from-packageTo properly generate a changelog based off PRs the following labels must be used:
breaking(💥 Breaking Change)enhancement(🚀 Enhancement)bug(🐛 Bug Fix)documentation(📝 Documentation)internal(🏠 Internal)
Regenerate with npm run changelog (uses lerna-changelog).