package-versioner 0.5.3 → 0.6.0

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.
@@ -134,6 +134,35 @@ This applies to all standard bump types:
134
134
  - `--bump minor`: 1.0.0-beta.1 -> 1.1.0
135
135
  - `--bump patch`: 1.0.0-beta.1 -> 1.0.1
136
136
 
137
+ ## Package Type Support
138
+
139
+ `package-versioner` supports both JavaScript/TypeScript projects using `package.json` and Rust projects using `Cargo.toml`:
140
+
141
+ ### JavaScript/TypeScript Projects
142
+
143
+ For JavaScript/TypeScript projects, the tool looks for and updates the `version` field in `package.json` files according to the versioning strategies described above.
144
+
145
+ ### Rust Projects
146
+
147
+ For Rust projects, the tool looks for and updates the `package.version` field in `Cargo.toml` files using the same versioning strategies.
148
+
149
+ When no tags are found for a project, `package-versioner` will:
150
+ 1. Look for the `version` in `package.json` if it exists
151
+ 2. Look for the `package.version` in `Cargo.toml` if it exists
152
+ 3. Fall back to the configured `initialVersion` (default: "0.1.0")
153
+
154
+ ### Mixed Projects with Both Manifests
155
+
156
+ When both `package.json` and `Cargo.toml` exist in the same directory, `package-versioner` will:
157
+
158
+ 1. Update both manifest files independently with the same calculated version
159
+ 2. First check `package.json` for the current version (when no tags exist)
160
+ 3. Fall back to checking `Cargo.toml` only if `package.json` doesn't exist or doesn't have a version
161
+
162
+ This allows you to maintain consistent versioning across JavaScript and Rust components in the same package.
163
+
164
+ This dual support makes `package-versioner` suitable for both JavaScript/TypeScript and Rust repositories, as well as monorepos or projects containing both types of packages.
165
+
137
166
  ## Tag Templates and Configuration
138
167
 
139
168
  `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.
@@ -184,4 +213,4 @@ This would produce tags like `release-1.2.3` instead of `v1.2.3`.
184
213
  "packageTagTemplate": "${packageName}-${prefix}${version}"
185
214
  }
186
215
  ```
187
- This would produce package tags like `@scope/package-name-v1.2.3` instead of `@scope/package-name@v1.2.3`.
216
+ This would produce package tags like `@scope/package-name-v1.2.3` instead of `@scope/package-name@v1.2.3`.
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.5.3",
4
+ "version": "0.6.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -32,31 +32,33 @@
32
32
  },
33
33
  "lint-staged": {
34
34
  "*.{js,ts,jsx,tsx}": [
35
- "biome check --apply",
35
+ "biome check --write",
36
36
  "biome format --write"
37
37
  ]
38
38
  },
39
39
  "devDependencies": {
40
40
  "@biomejs/biome": "^1.9.4",
41
41
  "@types/figlet": "^1.5.5",
42
- "@types/node": "^22.14.1",
42
+ "@types/node": "^22.15.3",
43
43
  "@types/semver": "^7.3.13",
44
- "@vitest/coverage-v8": "^3.1.1",
44
+ "@vitest/coverage-v8": "^3.1.2",
45
45
  "husky": "^9.1.7",
46
46
  "lint-staged": "^15.5.1",
47
47
  "tsup": "^8.4.0",
48
48
  "typescript": "^5.8.3",
49
- "vitest": "^3.1.1"
49
+ "vitest": "^3.1.2"
50
50
  },
51
51
  "dependencies": {
52
- "@manypkg/get-packages": "^2.2.2",
52
+ "@manypkg/get-packages": "^3.0.0",
53
53
  "chalk": "^5.4.1",
54
54
  "commander": "^13.1.0",
55
55
  "conventional-changelog-angular": "^8.0.0",
56
+ "conventional-commits-filter": "^5.0.0",
56
57
  "conventional-recommended-bump": "^11.0.0",
57
58
  "figlet": "^1.8.1",
58
59
  "git-semver-tags": "^8.0.0",
59
- "semver": "^7.7.1"
60
+ "semver": "^7.7.1",
61
+ "smol-toml": "^1.3.4"
60
62
  },
61
63
  "scripts": {
62
64
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -65,7 +67,7 @@
65
67
  "test": "vitest run --coverage",
66
68
  "test:watch": "vitest --coverage",
67
69
  "lint": "biome check .",
68
- "lint:fix": "biome check --apply .",
70
+ "lint:fix": "biome check --write .",
69
71
  "format": "biome format --write .",
70
72
  "format:check": "biome format .",
71
73
  "fix": "pnpm run lint:fix && pnpm run format"