package-versioner 0.8.2 → 0.8.4
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 +12 -3
- package/dist/index.cjs +442 -476
- package/dist/index.js +452 -486
- package/docs/versioning.md +51 -2
- package/package-versioner.schema.json +2 -2
- package/package.json +7 -2
package/docs/versioning.md
CHANGED
|
@@ -198,13 +198,62 @@ Target all packages in the workspace:
|
|
|
198
198
|
```
|
|
199
199
|
|
|
200
200
|
#### Mixed Patterns
|
|
201
|
-
|
|
201
|
+
Target different types of packages using a combination of patterns:
|
|
202
202
|
```json
|
|
203
203
|
{
|
|
204
204
|
"packages": ["@mycompany/*", "@utils/logger", "legacy-package"]
|
|
205
205
|
}
|
|
206
206
|
```
|
|
207
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
|
+
|
|
208
257
|
### Behaviour
|
|
209
258
|
|
|
210
259
|
- **When `packages` is specified**: Only packages matching those patterns will be processed for versioning
|
|
@@ -299,7 +348,7 @@ This would produce tags like `release-1.2.3` instead of `v1.2.3`.
|
|
|
299
348
|
"packageSpecificTags": true
|
|
300
349
|
}
|
|
301
350
|
```
|
|
302
|
-
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`.
|
|
303
352
|
|
|
304
353
|
### Behaviour in Different Modes
|
|
305
354
|
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"minLength": 1
|
|
54
54
|
},
|
|
55
55
|
"default": [],
|
|
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., '*')"
|
|
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/*'), path patterns (e.g., 'packages/**/*', 'examples/**'), 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.
|
|
4
|
+
"version": "0.8.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@types/node": "^24.0.10",
|
|
43
43
|
"@types/semver": "^7.3.13",
|
|
44
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",
|
|
@@ -51,13 +52,17 @@
|
|
|
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
67
|
"smol-toml": "^1.4.1"
|
|
63
68
|
},
|
|
@@ -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 .",
|