release-it 15.4.3 → 15.5.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.
@@ -27,6 +27,7 @@
27
27
  "otp": null,
28
28
  "ignoreVersion": false,
29
29
  "allowSameVersion": false,
30
+ "versionArgs": [],
30
31
  "skipChecks": false,
31
32
  "timeout": 10
32
33
  },
@@ -83,8 +83,9 @@ class npm extends Plugin {
83
83
 
84
84
  if (!this.config.isIncrement) return false;
85
85
 
86
- const allowSameVersion = this.options.allowSameVersion ? ' --allow-same-version' : '';
87
- const task = () => this.exec(`npm version ${version} --no-git-tag-version${allowSameVersion}`);
86
+ const { versionArgs, allowSameVersion } = this.options;
87
+ const args = [version, '--no-git-tag-version', allowSameVersion && '--allow-same-version', ...fixArgs(versionArgs)];
88
+ const task = () => this.exec(`npm version ${args.filter(Boolean).join(' ')}`);
88
89
  return this.spinner.show({ task, label: 'npm version' });
89
90
  }
90
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "15.4.3",
3
+ "version": "15.5.0",
4
4
  "description": "Generic CLI tool to automate versioning and package publishing related tasks.",
5
5
  "keywords": [
6
6
  "build",
@@ -100,7 +100,7 @@
100
100
  "nock": "13.2.9",
101
101
  "nyc": "15.1.0",
102
102
  "prettier": "2.7.1",
103
- "sinon": "14.0.0",
103
+ "sinon": "14.0.1",
104
104
  "strip-ansi": "7.0.1"
105
105
  },
106
106
  "engines": {
package/test/npm.js CHANGED
@@ -356,3 +356,12 @@ test('should add allow-same-version argument', async t => {
356
356
  const version = exec.args.filter(arg => arg[0].startsWith('npm version'));
357
357
  t.regex(version[0][0], / --allow-same-version/);
358
358
  });
359
+
360
+ test('should add version arguments', async t => {
361
+ const options = { npm: { skipChecks: true, versionArgs: ['--workspaces-update=false', '--allow-same-version'] } };
362
+ const npmClient = factory(npm, { options });
363
+ const exec = sinon.stub(npmClient.shell, 'exec').resolves();
364
+ await runTasks(npmClient);
365
+ const version = exec.args.filter(arg => arg[0].startsWith('npm version'));
366
+ t.regex(version[0][0], / --workspaces-update=false --allow-same-version/);
367
+ });