enablement-build-monorepo-version 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,25 +22,25 @@ npx enablement-build-monorepo-version@latest [flags]
22
22
 
23
23
  ## CLI flags
24
24
 
25
- | Flag | Default | Description |
26
- |---|---|---|
27
- | `--hash` | off | Compute and **save** current hashes to the hash state file. Must be run before `--changed` / `--version` to establish a baseline. |
28
- | `--changed` | off | Print the list of changed packages and emit a `changed` pipeline variable. |
29
- | `--version` | off | Emit a pipeline variable per changed package containing its next version. |
30
- | `--save` | off | Write the bumped version back into each changed package's version manifest (`package.json`, `version.json`, or `pyproject.toml`). Requires `--version`. |
31
- | `--tag` | off | Create a git tag (`<short-name>/<version>`) for each changed package, where `short-name` is the npm package name with its scope prefix removed (e.g. `@scope/lib-foo` → `lib-foo/1.2.3`). |
32
- | `--retag` | off | Convert existing tags that use the old folder-name format to the new short-package-name format. Non-destructive: old tags are left in place. |
33
- | `--init` | off | Inject `release:*` scripts into the root `package.json` of the target project. Adds scripts that are missing; strips `--children` from any that already exist. Combine with `--try` to preview changes. |
34
- | `--try` | off | Dry-run mode. Prints what each operation **would** do without writing any files, creating tags, or modifying any manifests. Combine with any other flags to preview their effect. |
35
- | `--debug` | off | Verbose logging of hashes, comparisons, and version resolution. |
36
- | `--children <dirs>` | auto-detect | Comma- or space-separated list of top-level directories to scan (e.g. `components,saas`). When omitted, directories are read from `pnpm-workspace.yaml` or `package.json` workspaces automatically. Falls back to `packages` if neither file is found. |
37
- | `--platform <name>` | auto-detect | Force the CI output format: `ado` (Azure DevOps) or `github` (GitHub Actions). Auto-detected from the presence of a `.github/` directory. |
38
- | `--prefixPath <path>` | `./` | Root path prepended to all file lookups. Useful when running from a different working directory. |
39
- | `--hashFile <path>` | auto-detect | Path (relative to `prefixPath`) where hash state is stored between runs. Defaults to `.github/manifest.json` or `.cicd/manifest.json` when those files exist (hashes stored inside `cicd[packageName].hash`); falls back to `.github/hash.json` or `.cicd/hash.json` for legacy standalone hash files. |
40
- | `--dependencies <path>` | `dependencies.json` | Path to the NX-style dependency graph used for transitive change propagation. By default, manifest dependencies are used when `{configDir}/manifest.json` exists; passing this flag explicitly overrides that and forces file-based dependency input. |
41
- | `--hashExcludeFolders <list>` | see below | Comma-separated folder names to skip when hashing. |
42
- | `--hashExcludeFiles <list>` | see below | Comma-separated file names to skip when hashing. |
43
- | `--hashFiles <list>` | — | Comma-separated individual file paths to include in the hash state (outside of `children` folders). |
25
+ | Flag | Default | Description |
26
+ | ----------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
27
+ | `--hash` | off | Compute and **save** current hashes to the hash state file. Must be run before `--changed` / `--version` to establish a baseline. |
28
+ | `--changed` | off | Print the list of changed packages and emit a `changed` pipeline variable. |
29
+ | `--version` | off | Emit a pipeline variable per changed package containing its next version. |
30
+ | `--save` | off | Write the bumped version back into each changed package's version manifests (`package.json`, `version.json`, and/or `pyproject.toml`). Requires `--version`. |
31
+ | `--tag` | off | Create a git tag (`<short-name>/<version>`) for each changed package, where `short-name` is the npm package name with its scope prefix removed (e.g. `@scope/lib-foo` → `lib-foo/1.2.3`). |
32
+ | `--retag` | off | Convert existing tags that use the old folder-name format to the new short-package-name format. Non-destructive: old tags are left in place. |
33
+ | `--init` | off | Inject `release:*` scripts into the root `package.json` of the target project. Adds scripts that are missing; strips `--children` from any that already exist. Combine with `--try` to preview changes. |
34
+ | `--try` | off | Dry-run mode. Prints what each operation **would** do without writing any files, creating tags, or modifying any manifests. Combine with any other flags to preview their effect. |
35
+ | `--debug` | off | Verbose logging of hashes, comparisons, and version resolution. |
36
+ | `--children <dirs>` | auto-detect | Comma- or space-separated list of top-level directories to scan (e.g. `components,saas`). When omitted, directories are read from `pnpm-workspace.yaml` or `package.json` workspaces automatically. Falls back to `packages` if neither file is found. |
37
+ | `--platform <name>` | auto-detect | Force the CI output format: `ado` (Azure DevOps) or `github` (GitHub Actions). Auto-detected from the presence of a `.github/` directory. |
38
+ | `--prefixPath <path>` | `./` | Root path prepended to all file lookups. Useful when running from a different working directory. |
39
+ | `--hashFile <path>` | auto-detect | Path (relative to `prefixPath`) where hash state is stored between runs. Defaults to `.github/manifest.json` or `.cicd/manifest.json` when those files exist (hashes stored inside `cicd[packageName].hash`); falls back to `.github/hash.json` or `.cicd/hash.json` for legacy standalone hash files. |
40
+ | `--dependencies <path>` | `dependencies.json` | Path to the NX-style dependency graph used for transitive change propagation. By default, manifest dependencies are used when `{configDir}/manifest.json` exists; passing this flag explicitly overrides that and forces file-based dependency input. |
41
+ | `--hashExcludeFolders <list>` | see below | Comma-separated folder names to skip when hashing. |
42
+ | `--hashExcludeFiles <list>` | see below | Comma-separated file names to skip when hashing. |
43
+ | `--hashFiles <list>` | — | Comma-separated individual file paths to include in the hash state (outside of `children` folders). |
44
44
 
45
45
  **Default excluded folders:** `node_modules`, `coverage`, `dist`, `bin`, `obj`, `__pycache__`, `.vs`, `.nx`, `.vscode`, `.idea`, `.git`, `.github`, `.azuredevops`, `.release`
46
46
 
@@ -52,13 +52,13 @@ npx enablement-build-monorepo-version@latest [flags]
52
52
 
53
53
  Each package directory is scanned for a version manifest in this priority order:
54
54
 
55
- | File | Format | Version field |
56
- |---|---|---|
57
- | `package.json` | JSON | `"version": "1.2.3"` |
58
- | `version.json` | JSON (same shape as `package.json`) | `"version": "1.2.3"` |
59
- | `pyproject.toml` | TOML | `version = "1.2.3"` under `[project]` or `[tool.poetry]` |
55
+ | File | Format | Version field |
56
+ | ---------------- | ----------------------------------- | -------------------------------------------------------- |
57
+ | `package.json` | JSON | `"version": "1.2.3"` |
58
+ | `version.json` | JSON (same shape as `package.json`) | `"version": "1.2.3"` |
59
+ | `pyproject.toml` | TOML | `version = "1.2.3"` under `[project]` or `[tool.poetry]` |
60
60
 
61
- The first file found is used. If none exists the package is treated as version `0.0.0`.
61
+ The first file found is used to determine the current version. When `--save` is enabled, all existing manifests in this set are updated. If none exists the package is treated as version `0.0.0`.
62
62
 
63
63
  ---
64
64
 
@@ -66,10 +66,10 @@ The first file found is used. If none exists the package is treated as version `
66
66
 
67
67
  Versions follow semver and are bumped based on the **current version** in the package's version manifest:
68
68
 
69
- | Trigger | Bump | Example |
70
- |---|---|---|
71
- | `fix:` prefix in any recent commit message | Patch (`0.0.x`) | `1.2.3` → `1.2.4` |
72
- | `feat:` prefix in any recent commit message | Minor (`0.x.0`) | `1.2.3` → `1.3.0` |
69
+ | Trigger | Bump | Example |
70
+ | ------------------------------------------------ | --------------- | ----------------- |
71
+ | `fix:` prefix in any recent commit message | Patch (`0.0.x`) | `1.2.3` → `1.2.4` |
72
+ | `feat:` prefix in any recent commit message | Minor (`0.x.0`) | `1.2.3` → `1.3.0` |
73
73
  | `BREAKING` anywhere in any recent commit message | Major (`x.0.0`) | `1.2.3` → `2.0.0` |
74
74
 
75
75
  > Currently the version bump always applies a patch increment — conventional-commit scanning via `git log` is stubbed. The bump logic is in `src/version.mjs`.
@@ -106,11 +106,11 @@ Consume them in a subsequent step with `${{ steps.<step-id>.outputs.<name> }}`.
106
106
 
107
107
  ### Variable reference
108
108
 
109
- | Variable | Value |
110
- |---|---|
109
+ | Variable | Value |
110
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
111
111
  | `<safeName>` (per changed package) | Next version for changed packages; previous version for unchanged ones. `safeName` is the folder name with `-`, `_`, and `.` removed. |
112
- | `changed` | JSON array of changed package folder names. |
113
- | `<folderName>` | `true` for each top-level folder containing at least one changed package. |
112
+ | `changed` | JSON array of changed package folder names. |
113
+ | `<folderName>` | `true` for each top-level folder containing at least one changed package. |
114
114
 
115
115
  ---
116
116
 
@@ -125,7 +125,11 @@ To force file-based dependency input, pass `--dependencies <path>`. The file mus
125
125
  "graph": {
126
126
  "dependencies": {
127
127
  "@scope/pkg-a": [
128
- { "source": "@scope/pkg-a", "target": "@scope/shared-lib", "type": "static" }
128
+ {
129
+ "source": "@scope/pkg-a",
130
+ "target": "@scope/shared-lib",
131
+ "type": "static"
132
+ }
129
133
  ]
130
134
  }
131
135
  }
@@ -157,7 +161,7 @@ If the file is missing or the `--dependencies` path doesn't exist, change propag
157
161
  - script: echo "$(versions.mypackagename)"
158
162
  ```
159
163
 
160
- To bump and persist the new versions back to `package.json`:
164
+ To bump and persist the new versions back to the package version manifests (`package.json`, `version.json`, and `pyproject.toml` when present):
161
165
 
162
166
  ```bash
163
167
  npx enablement-build-monorepo-version --changed --version --save
@@ -189,13 +193,13 @@ npx enablement-build-monorepo-version --init --try
189
193
 
190
194
  The following scripts are injected (skipped if already present; `--children` stripped if already there):
191
195
 
192
- | Script | Command |
193
- |---|---|
194
- | `release:try` | dry-run of the full release flow |
195
- | `release:changed` | list changed packages |
196
- | `release:version` | bump and save versions |
197
- | `release:finalize` | write hashes |
198
- | `release:retag` | migrate tags to package-name format |
196
+ | Script | Command |
197
+ | ------------------ | ----------------------------------- |
198
+ | `release:try` | dry-run of the full release flow |
199
+ | `release:changed` | list changed packages |
200
+ | `release:version` | bump and save versions |
201
+ | `release:finalize` | write hashes |
202
+ | `release:retag` | migrate tags to package-name format |
199
203
 
200
204
  ---
201
205
 
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "enablement-build-monorepo-version",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "This detects changes in the children packages of a monorepo.",
5
5
  "type": "module",
6
6
  "module": "./src/index.mjs",
7
+ "bin": "./src/index.mjs",
7
8
  "license": "MIT",
8
9
  "author": "Contributors",
9
10
  "jest": {
@@ -22,8 +23,5 @@
22
23
  "start": "node src/index.mjs",
23
24
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
24
25
  "test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch"
25
- },
26
- "bin": {
27
- "enablement-build-monorepo-version": "./src/index.mjs"
28
26
  }
29
27
  }