release-it 14.11.7-caret.0 → 14.11.7
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/README.md +1 -1
- package/lib/plugin/github/GitHub.js +1 -1
- package/lib/tasks.js +1 -1
- package/package.json +1 -1
- package/test/tasks.js +41 -0
- package/test/util/index.js +1 -1
package/README.md
CHANGED
|
@@ -321,7 +321,7 @@ While mostly used as a CLI tool, release-it can be used as a dependency to integ
|
|
|
321
321
|
- [blockchain/blockchain-wallet-v4-frontend](https://github.com/blockchain/blockchain-wallet-v4-frontend)
|
|
322
322
|
- [callstack/linaria](https://github.com/callstack/linaria)
|
|
323
323
|
- [ember-cli/ember-cli](https://github.com/ember-cli/ember-cli)
|
|
324
|
-
|
|
324
|
+
- [react-native-paper](https://github.com/callstack/react-native-paper)
|
|
325
325
|
- [js-cookie/js-cookie](https://github.com/js-cookie/js-cookie)
|
|
326
326
|
- [mirumee/saleor](https://github.com/mirumee/saleor)
|
|
327
327
|
- [mozilla/readability](https://github.com/mozilla/readability)
|
|
@@ -22,7 +22,7 @@ const parseErrormsg = err => {
|
|
|
22
22
|
let msg = err;
|
|
23
23
|
if (err instanceof Error) {
|
|
24
24
|
const { status, message } = err;
|
|
25
|
-
const
|
|
25
|
+
const headers = err.response ? err.response.headers : {};
|
|
26
26
|
msg = `${_.get(headers, 'status', status)} (${message})`;
|
|
27
27
|
}
|
|
28
28
|
return msg;
|
package/lib/tasks.js
CHANGED
|
@@ -65,7 +65,7 @@ const runTasks = async (opts, di) => {
|
|
|
65
65
|
|
|
66
66
|
const name = await reduceUntil(plugins, plugin => plugin.getName());
|
|
67
67
|
const latestVersion = (await reduceUntil(plugins, plugin => plugin.getLatestVersion())) || '0.0.0';
|
|
68
|
-
const changelog = await reduceUntil(plugins, plugin => plugin.getChangelog(
|
|
68
|
+
const changelog = await reduceUntil(plugins, plugin => plugin.getChangelog());
|
|
69
69
|
|
|
70
70
|
const incrementBase = { latestVersion, increment, isPreRelease, preReleaseId };
|
|
71
71
|
|
package/package.json
CHANGED
package/test/tasks.js
CHANGED
|
@@ -397,6 +397,47 @@ test.serial('should propagate errors', async t => {
|
|
|
397
397
|
t.is(log.error.callCount, 1);
|
|
398
398
|
});
|
|
399
399
|
|
|
400
|
+
test.serial('should use custom changelog command with context', async t => {
|
|
401
|
+
const { bare } = t.context;
|
|
402
|
+
const project = path.basename(bare);
|
|
403
|
+
const owner = path.basename(path.dirname(bare));
|
|
404
|
+
sh.exec('git tag v1.0.0');
|
|
405
|
+
gitAdd('line', 'file', 'More file');
|
|
406
|
+
|
|
407
|
+
interceptGitHubAuthentication();
|
|
408
|
+
interceptGitHubCollaborator({ owner, project });
|
|
409
|
+
interceptGitHubCreate({
|
|
410
|
+
owner,
|
|
411
|
+
project,
|
|
412
|
+
body: {
|
|
413
|
+
tag_name: 'v1.1.0',
|
|
414
|
+
name: 'Release 1.1.0',
|
|
415
|
+
body: 'custom-changelog-generator --from=v1.0.0 --to=v1.1.0',
|
|
416
|
+
draft: false,
|
|
417
|
+
prerelease: false
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
const container = getContainer({
|
|
422
|
+
increment: 'minor',
|
|
423
|
+
github: {
|
|
424
|
+
release: true,
|
|
425
|
+
releaseNotes: 'echo custom-changelog-generator --from=${latestTag} --to=${tagName}',
|
|
426
|
+
pushRepo: `https://github.com/${owner}/${project}`
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
const exec = sinon.spy(container.shell, 'execStringCommand');
|
|
431
|
+
|
|
432
|
+
await runTasks({}, container);
|
|
433
|
+
|
|
434
|
+
const command = exec.args.find(([command]) => command.includes('custom-changelog-generator'));
|
|
435
|
+
|
|
436
|
+
t.is(command[0], 'echo custom-changelog-generator --from=v1.0.0 --to=v1.1.0');
|
|
437
|
+
|
|
438
|
+
exec.restore();
|
|
439
|
+
});
|
|
440
|
+
|
|
400
441
|
{
|
|
401
442
|
class MyPlugin extends Plugin {}
|
|
402
443
|
const statics = { isEnabled: () => true, disablePlugin: () => null };
|
package/test/util/index.js
CHANGED
|
@@ -56,7 +56,7 @@ module.exports.runTasks = async plugin => {
|
|
|
56
56
|
|
|
57
57
|
const name = (await plugin.getName()) || '__test__';
|
|
58
58
|
const latestVersion = (await plugin.getLatestVersion()) || '1.0.0';
|
|
59
|
-
const changelog = (await plugin.getChangelog(
|
|
59
|
+
const changelog = (await plugin.getChangelog()) || null;
|
|
60
60
|
const increment = getIncrement(plugin, { latestVersion });
|
|
61
61
|
|
|
62
62
|
plugin.config.setContext({ name, latestVersion, latestTag: latestVersion, changelog });
|