package-versioner 0.8.1 → 0.8.3

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.
@@ -154,7 +154,7 @@ git push origin "v$NEW_VERSION"
154
154
  `package-versioner` respects the following environment variables:
155
155
 
156
156
  - `NO_COLOR=1`: Disables colored output in logs (automatically detected in CI environments)
157
- - `CI=true`: Most CI environments set this automatically, which helps the tool adjust its output behavior
157
+ - `CI=true`: Most CI environments set this automatically, which helps the tool adjust its output behaviour
158
158
 
159
159
  ## Skipping CI for Version Commits
160
160
 
@@ -170,13 +170,6 @@ This dual support makes `package-versioner` suitable for both JavaScript/TypeScr
170
170
 
171
171
  When working with monorepos, you can control which packages are processed for versioning using the `packages` configuration option. This provides flexible targeting with support for various pattern types.
172
172
 
173
- ### Package Discovery vs. Targeting
174
-
175
- It's important to understand the distinction:
176
-
177
- - **Package Discovery**: Handled by your workspace configuration (pnpm-workspace.yaml, package.json workspaces, etc.)
178
- - **Package Targeting**: Controlled by the `packages` option in version.config.json to filter which discovered packages to process
179
-
180
173
  ### Targeting Patterns
181
174
 
182
175
  #### Exact Package Names
@@ -205,13 +198,68 @@ Target all packages in the workspace:
205
198
  ```
206
199
 
207
200
  #### Mixed Patterns
208
- Combine different pattern types for flexible targeting:
201
+ Target different types of packages using a combination of patterns:
209
202
  ```json
210
203
  {
211
204
  "packages": ["@mycompany/*", "@utils/logger", "legacy-package"]
212
205
  }
213
206
  ```
214
207
 
208
+ ### Skip Patterns
209
+
210
+ The `skip` configuration option allows you to exclude specific packages from versioning using the same pattern matching capabilities as package targeting.
211
+
212
+ #### Pattern Types
213
+
214
+ 1. **Exact Package Names**
215
+ ```json
216
+ {
217
+ "skip": ["@internal/docs", "test-utils"]
218
+ }
219
+ ```
220
+
221
+ 2. **Scope Wildcards**
222
+ ```json
223
+ {
224
+ "skip": ["@internal/*"]
225
+ }
226
+ ```
227
+ This will skip all packages whose names start with `@internal/`.
228
+
229
+ 3. **Path Patterns**
230
+ ```json
231
+ {
232
+ "skip": ["packages/**/test-*", "examples/**/*"]
233
+ }
234
+ ```
235
+ This will skip packages matching the specified path patterns.
236
+
237
+ 4. **Mixed Patterns**
238
+ ```json
239
+ {
240
+ "skip": ["@internal/*", "test-*", "packages/examples/**/*"]
241
+ }
242
+ ```
243
+
244
+ #### Skip Pattern Priority
245
+
246
+ Skip patterns take precedence over include patterns. If a package matches both a pattern in `packages` and a pattern in `skip`, it will be excluded from versioning.
247
+
248
+ Example:
249
+ ```json
250
+ {
251
+ "packages": ["@company/*"],
252
+ "skip": ["@company/internal-*"]
253
+ }
254
+ ```
255
+ In this case, all packages under the `@company` scope will be versioned except those starting with `@company/internal-`.
256
+
257
+ ### Behaviour
258
+
259
+ - **When `packages` is specified**: Only packages matching those patterns will be processed for versioning
260
+ - **When `packages` is empty or not specified**: All workspace packages will be processed
261
+ - **Error handling**: If no packages match the specified patterns, a warning is displayed
262
+
215
263
  ### Excluding Packages
216
264
 
217
265
  Use the `skip` option to exclude specific packages from processing:
@@ -224,6 +272,8 @@ Use the `skip` option to exclude specific packages from processing:
224
272
 
225
273
  This configuration will process all packages in the `@mycompany` scope except for `@mycompany/deprecated-package`.
226
274
 
275
+ **Note**: Your workspace configuration (pnpm-workspace.yaml, package.json workspaces, etc.) determines which packages are available in your workspace, but the `packages` option directly controls which ones get versioned.
276
+
227
277
  ## Tag Templates and Configuration
228
278
 
229
279
  `package-versioner` provides flexible configuration for how Git tags are formatted, allowing you to customize the tag structure for both single package repositories and monorepos.
@@ -298,7 +348,7 @@ This would produce tags like `release-1.2.3` instead of `v1.2.3`.
298
348
  "packageSpecificTags": true
299
349
  }
300
350
  ```
301
- This would produce package tags like `@scope/package-name-v1.2.3` instead of `@scope/package-name@v1.2.3`.
351
+ This would produce package tags like `@scope/package-name-v1.2.3` instead of `@scope/package-name@v1.2.3`.
302
352
 
303
353
  ### Behaviour in Different Modes
304
354
 
@@ -21,7 +21,7 @@
21
21
  "packageSpecificTags": {
22
22
  "type": "boolean",
23
23
  "default": false,
24
- "description": "Whether to enable package-specific tagging behavior"
24
+ "description": "Whether to enable package-specific tagging behaviour"
25
25
  },
26
26
  "preset": {
27
27
  "type": "string",
@@ -53,7 +53,7 @@
53
53
  "minLength": 1
54
54
  },
55
55
  "default": [],
56
- "description": "Array of package names or patterns to target for versioning. Supports exact names (e.g., '@scope/package-a'), scope wildcards (e.g., '@scope/*'), and global wildcards (e.g., '*')"
56
+ "description": "Array of package names or patterns that determines which packages will be processed for versioning. When specified, only packages matching these patterns will be versioned. When empty or not specified, all workspace packages will be processed. Supports exact names (e.g., '@scope/package-a'), scope wildcards (e.g., '@scope/*'), and global wildcards (e.g., '*')"
57
57
  },
58
58
  "mainPackage": {
59
59
  "type": "string",
@@ -88,7 +88,7 @@
88
88
  "minLength": 1
89
89
  },
90
90
  "default": [],
91
- "description": "Packages to exclude from versioning"
91
+ "description": "Packages to exclude from versioning. Supports exact package names (e.g., '@internal/docs'), scope wildcards (e.g., '@internal/*'), and path patterns (e.g., 'packages/**/test-*', 'examples/**/*')"
92
92
  },
93
93
  "commitMessage": {
94
94
  "type": "string",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "package-versioner",
3
3
  "description": "A lightweight yet powerful CLI tool for automated semantic versioning based on Git history and conventional commits.",
4
- "version": "0.8.1",
4
+ "version": "0.8.3",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -37,29 +37,34 @@
37
37
  ]
38
38
  },
39
39
  "devDependencies": {
40
- "@biomejs/biome": "^1.9.4",
40
+ "@biomejs/biome": "^2.0.6",
41
41
  "@types/figlet": "^1.5.5",
42
- "@types/node": "^24.0.3",
42
+ "@types/node": "^24.0.10",
43
43
  "@types/semver": "^7.3.13",
44
- "@vitest/coverage-v8": "^3.2.3",
44
+ "@vitest/coverage-v8": "^3.2.4",
45
+ "cross-env": "^7.0.3",
45
46
  "husky": "^9.1.7",
46
47
  "lint-staged": "^16.1.2",
47
48
  "tsup": "^8.5.0",
48
49
  "tsx": "^4.20.3",
49
50
  "typescript": "^5.8.3",
50
- "vitest": "^3.2.3"
51
+ "vitest": "^3.2.4"
51
52
  },
52
53
  "dependencies": {
53
54
  "@manypkg/get-packages": "^3.0.0",
55
+ "@types/micromatch": "^4.0.9",
54
56
  "chalk": "^5.4.1",
55
57
  "commander": "^14.0.0",
56
58
  "conventional-changelog-angular": "^8.0.0",
59
+ "conventional-changelog-conventional-commits": "npm:conventional-changelog-conventionalcommits@^9.0.0",
60
+ "conventional-changelog-conventionalcommits": "^9.0.0",
57
61
  "conventional-commits-filter": "^5.0.0",
58
62
  "conventional-recommended-bump": "^11.2.0",
59
63
  "figlet": "^1.8.1",
60
64
  "git-semver-tags": "^8.0.0",
65
+ "micromatch": "^4.0.8",
61
66
  "semver": "^7.7.2",
62
- "smol-toml": "^1.3.4"
67
+ "smol-toml": "^1.4.1"
63
68
  },
64
69
  "scripts": {
65
70
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -67,7 +72,7 @@
67
72
  "clean": "rm -rf node_modules && rm -rf dist",
68
73
  "test": "pnpm run test:unit && pnpm run test:integration",
69
74
  "test:watch": "vitest --coverage",
70
- "test:integration": "vitest --run --dir test/integration",
75
+ "test:integration": "pnpm run build && cross-env VITEST_INTEGRATION=true vitest --run --dir test/integration",
71
76
  "posttest:integration": "pnpm tsx scripts/cleanup-fixtures.ts",
72
77
  "test:unit": "vitest --run --coverage --dir test/unit",
73
78
  "lint": "biome check .",