@releasekit/version 0.4.0 → 0.4.1

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.
@@ -466,7 +466,7 @@ function createVersionError(code, details) {
466
466
  };
467
467
  const suggestions = {
468
468
  ["CONFIG_REQUIRED" /* CONFIG_REQUIRED */]: [
469
- "Create a version.config.json file in your project root",
469
+ "Create a releasekit.config.json file in your project root",
470
470
  "Check the documentation for configuration examples"
471
471
  ],
472
472
  ["PACKAGES_NOT_FOUND" /* PACKAGES_NOT_FOUND */]: [
@@ -480,14 +480,14 @@ function createVersionError(code, details) {
480
480
  "Ensure proper monorepo structure"
481
481
  ],
482
482
  ["INVALID_CONFIG" /* INVALID_CONFIG */]: [
483
- "Validate version.config.json syntax",
483
+ "Validate releasekit.config.json syntax",
484
484
  "Check configuration against schema",
485
485
  "Review documentation for valid configuration options"
486
486
  ],
487
487
  ["PACKAGE_NOT_FOUND" /* PACKAGE_NOT_FOUND */]: [
488
488
  "Verify package name spelling and case",
489
489
  "Check if package exists in workspace",
490
- "Review packages configuration in version.config.json"
490
+ "Review packages configuration in releasekit.config.json"
491
491
  ],
492
492
  ["VERSION_CALCULATION_ERROR" /* VERSION_CALCULATION_ERROR */]: [
493
493
  "Ensure git repository has commits",
@@ -1375,7 +1375,7 @@ function extractCommitsFromGitLog(projectDir, revisionRange, filterToPath) {
1375
1375
  const tagName = revisionRange.split("..")[0] || revisionRange;
1376
1376
  if (tagName.startsWith("v") && !tagName.includes("@")) {
1377
1377
  log(
1378
- `Error: Tag "${tagName}" not found. If you're using package-specific tags (like "package-name@v1.0.0"), you may need to configure "tagTemplate" in your version.config.json to use: \${packageName}@\${prefix}\${version}`,
1378
+ `Error: Tag "${tagName}" not found. If you're using package-specific tags (like "package-name@v1.0.0"), you may need to configure "tagTemplate" in your releasekit.config.json to use: \${packageName}@\${prefix}\${version}`,
1379
1379
  "error"
1380
1380
  );
1381
1381
  } else {
@@ -1980,22 +1980,9 @@ function createSyncStrategy(config) {
1980
1980
  repoUrl: null,
1981
1981
  entries: changelogEntries
1982
1982
  });
1983
- let tagPackageName = null;
1984
- if (config.packageSpecificTags && packages.packages.length === 1) {
1985
- tagPackageName = packages.packages[0].packageJson.name;
1986
- }
1987
1983
  const workspaceNames = updatedPackages.filter((n) => n !== "root");
1988
1984
  const commitPackageName = workspaceNames.length > 0 ? workspaceNames.join(", ") : void 0;
1989
- const nextTag = formatTag(
1990
- nextVersion,
1991
- formattedPrefix,
1992
- tagPackageName,
1993
- // Only pass tagTemplate when we have a package name to substitute into it.
1994
- // In multi-package sync mode tagPackageName is null, so omit the template to
1995
- // avoid a spurious ${packageName} warning and a malformed tag like "-v1.0.0".
1996
- tagPackageName ? tagTemplate : void 0,
1997
- config.packageSpecificTags || false
1998
- );
1985
+ const nextTags = config.packageSpecificTags && workspaceNames.length > 0 ? workspaceNames.map((pkgName) => formatTag(nextVersion, formattedPrefix, pkgName, tagTemplate, true)) : [formatTag(nextVersion, formattedPrefix, null, void 0, false)];
1999
1986
  let formattedCommitMessage;
2000
1987
  const hasPackageNamePlaceholder = commitMessage.includes("${packageName}");
2001
1988
  if (commitPackageName === void 0 && !hasPackageNamePlaceholder) {
@@ -2006,12 +1993,14 @@ function createSyncStrategy(config) {
2006
1993
  formattedCommitMessage = formatCommitMessage(commitMessage, nextVersion, commitPackageName, void 0);
2007
1994
  }
2008
1995
  formattedCommitMessage = formattedCommitMessage.replace(/\s{2,}/g, " ").trim();
2009
- addTag(nextTag);
1996
+ for (const tag of nextTags) {
1997
+ addTag(tag);
1998
+ }
2010
1999
  setCommitMessage(formattedCommitMessage);
2011
2000
  if (!dryRun) {
2012
- log(`Version ${nextVersion} prepared (tag: ${nextTag})`, "success");
2001
+ log(`Version ${nextVersion} prepared (tags: ${nextTags.join(", ")})`, "success");
2013
2002
  } else {
2014
- log(`Would create tag: ${nextTag}`, "info");
2003
+ log(`Would create tags: ${nextTags.join(", ")}`, "info");
2015
2004
  }
2016
2005
  } catch (error) {
2017
2006
  if (BaseVersionError.isVersionError(error)) {
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  loadConfig,
6
6
  log,
7
7
  printJsonOutput
8
- } from "./chunk-ZTFI7TXV.js";
8
+ } from "./chunk-P3KG635S.js";
9
9
  import {
10
10
  readPackageVersion
11
11
  } from "./chunk-2MN2VLZF.js";
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  flushPendingWrites,
12
12
  getJsonData,
13
13
  loadConfig
14
- } from "./chunk-ZTFI7TXV.js";
14
+ } from "./chunk-P3KG635S.js";
15
15
  import {
16
16
  BaseVersionError
17
17
  } from "./chunk-2MN2VLZF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/version",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Semantic versioning based on Git history and conventional commits",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -41,7 +41,8 @@
41
41
  "files": [
42
42
  "dist",
43
43
  "docs",
44
- "version.schema.json"
44
+ "README.md",
45
+ "LICENSE"
45
46
  ],
46
47
  "publishConfig": {
47
48
  "access": "public"
@@ -72,8 +73,8 @@
72
73
  "tsup": "^8.5.1",
73
74
  "typescript": "^5.9.3",
74
75
  "vitest": "^4.1.0",
75
- "@releasekit/core": "0.0.0",
76
- "@releasekit/config": "0.0.0"
76
+ "@releasekit/config": "0.0.0",
77
+ "@releasekit/core": "0.0.0"
77
78
  },
78
79
  "engines": {
79
80
  "node": ">=20"
@@ -84,6 +85,7 @@
84
85
  "clean": "rm -rf dist coverage .turbo",
85
86
  "test": "vitest run --dir test/unit",
86
87
  "test:unit": "vitest run --coverage --dir test/unit",
88
+ "test:integration": "VITEST_INTEGRATION=true vitest run --dir test/integration",
87
89
  "test:coverage": "vitest run --coverage --dir test/unit",
88
90
  "lint": "biome check .",
89
91
  "typecheck": "tsc --noEmit"
@@ -1,148 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "$schema": {
6
- "type": "string",
7
- "description": "JSON schema reference"
8
- },
9
- "versionPrefix": {
10
- "type": "string",
11
- "minLength": 1,
12
- "description": "The prefix used for Git tags",
13
- "default": "v"
14
- },
15
- "tagTemplate": {
16
- "type": "string",
17
- "minLength": 1,
18
- "default": "${prefix}${version}",
19
- "description": "Template for formatting Git tags"
20
- },
21
- "packageSpecificTags": {
22
- "type": "boolean",
23
- "default": false,
24
- "description": "Whether to enable package-specific tagging behaviour"
25
- },
26
- "preset": {
27
- "type": "string",
28
- "enum": ["angular", "conventional"],
29
- "default": "angular",
30
- "description": "The commit message convention preset"
31
- },
32
- "changelogFormat": {
33
- "type": "string",
34
- "enum": ["keep-a-changelog", "angular"],
35
- "default": "keep-a-changelog",
36
- "description": "The format to use for generating changelogs"
37
- },
38
- "baseBranch": {
39
- "type": "string",
40
- "minLength": 1,
41
- "description": "The main branch for versioning",
42
- "default": "main"
43
- },
44
- "sync": {
45
- "type": "boolean",
46
- "default": false,
47
- "description": "Whether packages should be versioned together"
48
- },
49
- "packages": {
50
- "type": "array",
51
- "items": {
52
- "type": "string",
53
- "minLength": 1
54
- },
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/*'), path patterns (e.g., 'packages/**/*', 'examples/**'), and global wildcards (e.g., '*')."
57
- },
58
- "mainPackage": {
59
- "type": "string",
60
- "minLength": 1,
61
- "description": "The package to use for version determination"
62
- },
63
- "versionStrategy": {
64
- "type": "string",
65
- "enum": ["branchPattern", "commitMessage"],
66
- "default": "commitMessage",
67
- "description": "How to determine version changes"
68
- },
69
- "branchPattern": {
70
- "type": "array",
71
- "items": {
72
- "type": "string",
73
- "minLength": 1
74
- },
75
- "default": ["major:", "minor:", "patch:"],
76
- "description": "Patterns to match against branch names"
77
- },
78
- "updateInternalDependencies": {
79
- "type": "string",
80
- "enum": ["major", "minor", "patch", "no-internal-update"],
81
- "default": "patch",
82
- "description": "How to update dependencies between packages"
83
- },
84
- "skip": {
85
- "type": "array",
86
- "items": {
87
- "type": "string",
88
- "minLength": 1
89
- },
90
- "default": [],
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
- },
93
- "commitMessage": {
94
- "type": "string",
95
- "minLength": 1,
96
- "default": "chore: release ${packageName} v${version}",
97
- "description": "Template for commit messages. Available variables: ${version}, ${packageName}, ${scope}"
98
- },
99
- "prereleaseIdentifier": {
100
- "type": "string",
101
- "minLength": 1,
102
- "description": "Identifier for prerelease versions"
103
- },
104
- "skipHooks": {
105
- "type": "boolean",
106
- "default": false,
107
- "description": "Whether to skip Git hooks"
108
- },
109
- "writeChangelog": {
110
- "type": "boolean",
111
- "default": true,
112
- "description": "Whether to write changelog files to disk"
113
- },
114
- "strictReachable": {
115
- "type": "boolean",
116
- "default": false,
117
- "description": "Only use reachable tags (no fallback to unreachable tags)"
118
- },
119
- "mismatchStrategy": {
120
- "type": "string",
121
- "enum": ["error", "warn", "ignore", "prefer-package", "prefer-git"],
122
- "default": "error",
123
- "description": "How to handle version mismatches between git tags and package.json. 'error' throws and stops execution (default), 'warn' logs a warning but continues, 'prefer-package' uses package.json version, 'prefer-git' uses git tag, 'ignore' silently continues."
124
- },
125
- "cargo": {
126
- "type": "object",
127
- "properties": {
128
- "enabled": {
129
- "type": "boolean",
130
- "default": true,
131
- "description": "Whether to enable Cargo.toml version handling"
132
- },
133
- "paths": {
134
- "type": "array",
135
- "items": {
136
- "type": "string",
137
- "minLength": 1
138
- },
139
- "description": "Specify directories to search for Cargo.toml files"
140
- }
141
- },
142
- "additionalProperties": false,
143
- "description": "Configuration options for Rust/Cargo support"
144
- }
145
- },
146
- "required": ["versionPrefix", "preset", "updateInternalDependencies"],
147
- "additionalProperties": false
148
- }