bbump 1.0.2 → 1.1.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.
- package/index.js +8 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5,6 +5,9 @@ import inquirer from 'inquirer';
|
|
|
5
5
|
|
|
6
6
|
// Check if the project uses Yarn (by checking for yarn.lock)
|
|
7
7
|
const isYarn = existsSync('yarn.lock');
|
|
8
|
+
// Yarn berry (v2+) signals: .yarnrc.yml config or .yarn/ cache/version folder.
|
|
9
|
+
// Yarn classic (1.x) uses .yarnrc (no .yml) and no .yarn/ directory.
|
|
10
|
+
const isYarnBerry = existsSync('.yarnrc.yml') || existsSync('.yarn');
|
|
8
11
|
|
|
9
12
|
// Get the current branch name
|
|
10
13
|
const currentBranch = execSync('git branch --show-current', { encoding: 'utf-8' }).trim();
|
|
@@ -29,8 +32,12 @@ const { versionType } = await inquirer.prompt(questions);
|
|
|
29
32
|
|
|
30
33
|
try {
|
|
31
34
|
// Execute version command based on the package manager
|
|
35
|
+
// Yarn berry (v2+) uses positional strategy arg and does not create git tags.
|
|
36
|
+
// Yarn classic (1.x) uses --<strategy> --no-git-tag-version.
|
|
32
37
|
const versionCommand = isYarn
|
|
33
|
-
?
|
|
38
|
+
? (isYarnBerry
|
|
39
|
+
? `yarn version ${versionType}`
|
|
40
|
+
: `yarn version --${versionType} --no-git-tag-version`)
|
|
34
41
|
: `npm version ${versionType} --no-git-tag-version`;
|
|
35
42
|
execSync(versionCommand, { stdio: 'inherit' });
|
|
36
43
|
|