{"name":"semantic-release-monorepo","version":"8.0.0","description":"Plugins for `semantic-release` allowing it to be used with a monorepo.","main":"src/index.js","scripts":{"format":"prettier --write --single-quote --trailing-comma es5","format:all":"yarn format \"./**/*.js\"","test":"vitest run --no-threads"},"license":"MIT","peerDependencies":{"semantic-release":">=20"},"dependencies":{"debug":"^4.3.4","execa":"^5.1.1","file-url":"^3.0.0","fs-extra":"^10.0.1","get-stream":"^6.0.1","git-log-parser":"^1.2.0","p-each-series":"^2.1.0","p-limit":"^3.1.0","pkg-up":"^3.1.0","ramda":"^0.27.2","read-pkg":"^5.2.0","semantic-release-plugin-decorators":"^4.0.0","tempy":"1.0.1"},"devDependencies":{"husky":"^8.0.1","lint-staged":"^13.0.3","prettier":"^3.2.4","vitest":"0.34.6"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["yarn format"]},"_id":"semantic-release-monorepo@8.0.0","gitHead":"c9b94c82c355c03e5e9e920521ea538363326ffa","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-mCJ0W8oUxcaYBKdBwqzcDVjPgVs4+CYVZzRMSg8F9Eo5kelZFF5v/SBpHhpWI/LXXHxmwtwZ5y6Qe+uoJ8A7QQ==","shasum":"0263f1942119c9c41795ddfe025e0d385fe5f4ca","tarball":"http://registry-npm.ywwl.com/semantic-release-monorepo/download/semantic-release-monorepo-8.0.0.tgz","fileCount":13,"unpackedSize":25577,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHjSlP3YEnlTBAIUVoOe+l3ffVajIY7LI9GFiR/xT8kAiEAx8DZPzgWEs8HFapO+tfPO5M24DNjEeQsFdgyPHXespU="}],"size":7692,"noattachment":false,"key":"/semantic-release-monorepo/-/semantic-release-monorepo-8.0.0.tgz"},"_npmUser":{"name":"pmowrer","email":"pmowrer@gmail.com"},"directories":{},"maintainers":[{"name":"pmowrer","email":"pmowrer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/semantic-release-monorepo_8.0.0_1705508835608_0.3501037625031074"},"_hasShrinkwrap":false,"readme":"# semantic-release-monorepo\n\n![Tests workflow](https://github.com/pmowrer/semantic-release-monorepo/actions/workflows/tests.yml/badge.svg) [![npm](https://img.shields.io/npm/v/semantic-release-monorepo.svg)](https://www.npmjs.com/package/semantic-release-monorepo) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nApply [`semantic-release`'s](https://github.com/semantic-release/semantic-release) automatic publishing to a monorepo.\n\n## Why\n\nThe default configuration of `semantic-release` assumes a one-to-one relationship between a GitHub repository and an `npm` package.\n\nThis library allows using `semantic-release` with a single GitHub repository containing many `npm` packages.\n\n## How\n\nInstead of attributing all commits to a single package, commits are assigned to packages based on the files that a commit touched.\n\nIf a commit touched a file in or below a package's root, it will be considered for that package's next release. A single commit can belong to multiple packages and may trigger the release of multiple packages.\n\nIn order to avoid version collisions, generated git tags are namespaced using the given package's name: `<package-name>-<version>`.\n\n## Install\n\nBoth `semantic-release` and `semantic-release-monorepo` must be accessible in each monorepo package.\n\n```bash\nnpm install -D semantic-release semantic-release-monorepo\n```\n\n## Usage\n\nRun `semantic-release` in an **individual monorepo package** and apply `semantic-release-monorepo` via the [`extends`](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#extends) option.\n\nOn the command line:\n\n```bash\n$ npm run semantic-release -e semantic-release-monorepo\n```\n\nOr in the [release config](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration-file):\n\n```json\n{\n  \"extends\": \"semantic-release-monorepo\"\n}\n```\n\nNOTE: This library **CAN'T** be applied via the `plugins` option.\n\n```json\n{\n  \"plugins\": [\n    \"semantic-release-monorepo\" // This WON'T work\n  ]\n}\n```\n\n### With Yarn Workspaces\n\n```bash\n$ yarn workspaces run semantic-release -e semantic-release-monorepo\n```\n\n### With Lerna\n\nThe monorepo management tool [`lerna`](https://github.com/lerna/lerna) can be used to run `semantic-release-monorepo` across all packages in a monorepo with a single command:\n\n```bash\nlerna exec --concurrency 1 -- npx --no-install semantic-release -e semantic-release-monorepo\n```\n\n### With pnpm\n\n[pnpm](https://pnpm.io/) has built-in [workspace](https://pnpm.io/workspaces) functionality for monorepos. Similarly to the above, you can use pnpm to make release in all packages:\n\n```bash\npnpm -r --workspace-concurrency=1 exec -- npx --no-install semantic-release -e semantic-release-monorepo\n```\n\nThanks to how [`npx's package resolution works`](https://github.com/npm/npx#description), if the repository root is in `$PATH` (typically true on CI), `semantic-release` and `semantic-release-monorepo` can be installed once in the repo root instead of in each individual package, likely saving both time and disk space.\n\n## Advanced\n\nThis library modifies the `context` object passed to `semantic-release` plugins in the following way to make them compatible with a monorepo.\n\n| Step             | Description                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `analyzeCommits` | Filters `context.commits` to only include the given monorepo package's commits.                                                                                                                                                                                                                                                                                                                                                  |\n| `generateNotes`  | <ul><li>Filters `context.commits` to only include the given monorepo package's commits.</li><li>Modifies `context.nextRelease.version` to use the [monorepo git tag format](#how). The wrapped (default) `generateNotes` implementation uses this variable as the header for the release notes. Since all release notes end up in the same Github repository, using just the version as a header introduces ambiguity.</li></ul> |\n\n### tagFormat\n\nPre-configures the [`tagFormat` option](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/configuration.md#tagformat) to use the [monorepo git tag format](#how).\n\nIf you are using Lerna, you can customize the format using the following command:\n\n```\n\"semantic-release\": \"lerna exec --concurrency 1 -- semantic-release -e semantic-release-monorepo --tag-format='${LERNA_PACKAGE_NAME}-v\\\\${version}'\"\n```\n\nWhere `'${LERNA_PACKAGE_NAME}-v\\\\${version}'` is the string you want to customize. By default it will be `<PACKAGE_NAME>-v<VERSION>` (e.g. `foobar-v1.2.3`).\n","publish_time":1705508835785,"_cnpm_publish_time":1705508835785,"dist-tags":{"latest":"8.0.2","next":"5.0.0"}}