release-it 15.4.3 → 15.5.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.
@@ -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
  },
@@ -65,7 +65,8 @@ class Plugin {
65
65
  step(options) {
66
66
  const context = Object.assign({}, this.config.getContext(), { [this.namespace]: this.getContext() });
67
67
  const opts = Object.assign({}, options, { context });
68
- return this.config.isCI ? this.spinner.show(opts) : this.showPrompt(opts);
68
+ const isException = this.config.isPromptOnlyVersion && ['incrementList', 'publish', 'otp'].includes(opts.prompt);
69
+ return this.config.isCI && !isException ? this.spinner.show(opts) : this.showPrompt(opts);
69
70
  }
70
71
  }
71
72
 
@@ -83,15 +83,17 @@ 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
 
91
92
  release() {
92
93
  if (this.options.publish === false) return false;
93
94
  const publish = () => this.publish({ otpCallback });
94
- const otpCallback = this.config.isCI ? null : task => this.step({ prompt: 'otp', task });
95
+ const otpCallback =
96
+ this.config.isCI && !this.config.isPromptOnlyVersion ? null : task => this.step({ prompt: 'otp', task });
95
97
  return this.step({ task: publish, label: 'npm publish', prompt: 'publish' });
96
98
  }
97
99
 
package/lib/util.js CHANGED
@@ -20,8 +20,6 @@ const getSystemInfo = () => {
20
20
  };
21
21
  };
22
22
 
23
- const clean = args => args.filter(arg => arg != null);
24
-
25
23
  const format = (template = '', context = {}) => {
26
24
  try {
27
25
  return _.template(template)(context);
@@ -95,7 +93,6 @@ const e = (message, docs) => new Error(docs ? `${message}${EOL}Documentation: ${
95
93
 
96
94
  export {
97
95
  getSystemInfo,
98
- clean,
99
96
  format,
100
97
  truncateLines,
101
98
  rejectAfter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "15.4.3",
3
+ "version": "15.5.1",
4
4
  "description": "Generic CLI tool to automate versioning and package publishing related tasks.",
5
5
  "keywords": [
6
6
  "build",
@@ -60,27 +60,27 @@
60
60
  "license": "MIT",
61
61
  "dependencies": {
62
62
  "@iarna/toml": "2.2.5",
63
- "@octokit/rest": "19.0.4",
63
+ "@octokit/rest": "19.0.5",
64
64
  "async-retry": "1.3.3",
65
- "chalk": "5.0.1",
66
- "cosmiconfig": "7.0.1",
65
+ "chalk": "5.1.2",
66
+ "cosmiconfig": "8.0.0",
67
67
  "execa": "6.1.0",
68
68
  "form-data": "4.0.0",
69
69
  "git-url-parse": "13.1.0",
70
70
  "globby": "13.1.2",
71
- "got": "12.5.1",
72
- "inquirer": "9.1.2",
71
+ "got": "12.5.3",
72
+ "inquirer": "9.1.4",
73
73
  "is-ci": "3.0.1",
74
74
  "lodash": "4.17.21",
75
75
  "mime-types": "2.1.35",
76
76
  "new-github-release-url": "2.0.0",
77
- "node-fetch": "3.2.10",
77
+ "node-fetch": "3.3.0",
78
78
  "open": "8.4.0",
79
79
  "ora": "6.1.2",
80
80
  "os-name": "5.0.1",
81
- "promise.allsettled": "1.0.5",
81
+ "promise.allsettled": "1.0.6",
82
82
  "proxy-agent": "5.0.0",
83
- "semver": "7.3.7",
83
+ "semver": "7.3.8",
84
84
  "shelljs": "0.8.5",
85
85
  "update-notifier": "6.0.2",
86
86
  "url-join": "5.0.0",
@@ -88,19 +88,19 @@
88
88
  "yargs-parser": "21.1.1"
89
89
  },
90
90
  "devDependencies": {
91
- "@octokit/request-error": "3.0.1",
92
- "ava": "4.3.3",
93
- "eslint": "8.24.0",
91
+ "@octokit/request-error": "3.0.2",
92
+ "ava": "5.1.0",
93
+ "eslint": "8.28.0",
94
94
  "eslint-config-prettier": "8.5.0",
95
95
  "eslint-plugin-ava": "13.2.0",
96
96
  "eslint-plugin-import": "2.26.0",
97
97
  "eslint-plugin-prettier": "4.2.1",
98
- "mock-fs": "5.1.4",
98
+ "mock-fs": "5.2.0",
99
99
  "mock-stdio": "1.0.3",
100
100
  "nock": "13.2.9",
101
101
  "nyc": "15.1.0",
102
- "prettier": "2.7.1",
103
- "sinon": "14.0.0",
102
+ "prettier": "2.8.0",
103
+ "sinon": "15.0.0",
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
+ });