@modern-js/plugin-changeset 2.0.0-beta.3 → 2.0.0-beta.6
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/CHANGELOG.md +63 -0
- package/dist/js/modern/commands/bump.js +63 -30
- package/dist/js/modern/commands/change.js +54 -25
- package/dist/js/modern/commands/index.js +1 -1
- package/dist/js/modern/commands/pre.js +32 -7
- package/dist/js/modern/commands/release-note.js +131 -91
- package/dist/js/modern/commands/release.js +75 -46
- package/dist/js/modern/commands/status.js +41 -20
- package/dist/js/modern/index.js +44 -19
- package/dist/js/modern/locale/en.js +27 -24
- package/dist/js/modern/locale/index.js +6 -6
- package/dist/js/modern/locale/zh.js +27 -24
- package/dist/js/modern/utils/changeset.js +11 -7
- package/dist/js/modern/utils/index.js +1 -1
- package/dist/js/modern/utils/language.js +6 -3
- package/dist/js/node/commands/bump.js +86 -36
- package/dist/js/node/commands/change.js +73 -32
- package/dist/js/node/commands/index.js +22 -71
- package/dist/js/node/commands/pre.js +55 -13
- package/dist/js/node/commands/release-note.js +159 -97
- package/dist/js/node/commands/release.js +99 -53
- package/dist/js/node/commands/status.js +64 -26
- package/dist/js/node/index.js +68 -39
- package/dist/js/node/locale/en.js +47 -28
- package/dist/js/node/locale/index.js +31 -14
- package/dist/js/node/locale/zh.js +47 -28
- package/dist/js/node/utils/changeset.js +40 -14
- package/dist/js/node/utils/index.js +18 -27
- package/dist/js/node/utils/language.js +28 -8
- package/dist/types/index.d.ts +2 -0
- package/package.json +6 -6
|
@@ -1,71 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get: function () {
|
|
24
|
-
return _bump[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _pre = require("./pre");
|
|
29
|
-
Object.keys(_pre).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _pre[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _pre[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _release = require("./release");
|
|
40
|
-
Object.keys(_release).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _release[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _release[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _status = require("./status");
|
|
51
|
-
Object.keys(_status).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _status[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _status[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _releaseNote = require("./release-note");
|
|
62
|
-
Object.keys(_releaseNote).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _releaseNote[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _releaseNote[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var commands_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(commands_exports);
|
|
17
|
+
__reExport(commands_exports, require("./change"), module.exports);
|
|
18
|
+
__reExport(commands_exports, require("./bump"), module.exports);
|
|
19
|
+
__reExport(commands_exports, require("./pre"), module.exports);
|
|
20
|
+
__reExport(commands_exports, require("./release"), module.exports);
|
|
21
|
+
__reExport(commands_exports, require("./status"), module.exports);
|
|
22
|
+
__reExport(commands_exports, require("./release-note"), module.exports);
|
|
@@ -1,14 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __async = (__this, __arguments, generator) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
var fulfilled = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var rejected = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.throw(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var pre_exports = {};
|
|
39
|
+
__export(pre_exports, {
|
|
40
|
+
pre: () => pre
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(pre_exports);
|
|
43
|
+
var import_utils = require("../utils");
|
|
44
|
+
function pre(type, tag = "next") {
|
|
45
|
+
return __async(this, null, function* () {
|
|
46
|
+
const params = [import_utils.CHANGESET_PATH, "pre", type];
|
|
47
|
+
if (type === "enter") {
|
|
48
|
+
params.push(tag);
|
|
49
|
+
}
|
|
50
|
+
yield (0, import_utils.execaWithStreamLog)(process.execPath, params);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
pre
|
|
56
|
+
});
|
|
@@ -1,19 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var __async = (__this, __arguments, generator) => {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
var fulfilled = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.next(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var rejected = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.throw(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var release_note_exports = {};
|
|
45
|
+
__export(release_note_exports, {
|
|
46
|
+
genReleaseNote: () => genReleaseNote,
|
|
47
|
+
getReleaseInfo: () => getReleaseInfo,
|
|
48
|
+
getReleaseNoteLine: () => getReleaseNoteLine
|
|
5
49
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _utils = require("@modern-js/utils");
|
|
12
|
-
var _read = _interopRequireDefault(require("@changesets/read"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
|
+
module.exports = __toCommonJS(release_note_exports);
|
|
51
|
+
var import_path = __toESM(require("path"));
|
|
52
|
+
var import_resolve_from = __toESM(require("resolve-from"));
|
|
53
|
+
var import_utils = require("@modern-js/utils");
|
|
54
|
+
var import_read = __toESM(require("@changesets/read"));
|
|
14
55
|
function getReleaseInfo(commit, commitObj) {
|
|
15
56
|
const commitRegex = /(.*)\(#(\d*)\)/;
|
|
16
|
-
const [, message, author] = commit.split(
|
|
57
|
+
const [, message, author] = commit.split("--");
|
|
17
58
|
commitObj.author = author;
|
|
18
59
|
if ((message || commitObj.summary).match(commitRegex)) {
|
|
19
60
|
const [, messageShort, pullRequestId] = (message || commitObj.summary).match(commitRegex);
|
|
@@ -23,109 +64,130 @@ function getReleaseInfo(commit, commitObj) {
|
|
|
23
64
|
return commitObj;
|
|
24
65
|
}
|
|
25
66
|
function formatSummary(summary, pullRequestId) {
|
|
26
|
-
const [firstLine, ...futureLines] = summary.split(
|
|
67
|
+
const [firstLine, ...futureLines] = summary.split("\n").map((l) => l.trimRight());
|
|
27
68
|
let returnVal = firstLine;
|
|
28
69
|
if (futureLines.length > 0) {
|
|
29
70
|
if (pullRequestId) {
|
|
30
|
-
returnVal =
|
|
71
|
+
returnVal = `
|
|
72
|
+
|
|
73
|
+
${returnVal}`;
|
|
31
74
|
} else {
|
|
32
|
-
returnVal =
|
|
75
|
+
returnVal = `
|
|
76
|
+
${returnVal}`;
|
|
33
77
|
}
|
|
34
|
-
returnVal +=
|
|
78
|
+
returnVal += `
|
|
79
|
+
|
|
80
|
+
${futureLines.filter((l) => Boolean(l)).map((l) => l).join("\n\n")}`;
|
|
35
81
|
}
|
|
36
82
|
return returnVal;
|
|
37
83
|
}
|
|
38
84
|
function getReleaseNoteLine(commit, customReleaseNoteFunction) {
|
|
39
|
-
if (customReleaseNoteFunction
|
|
85
|
+
if (customReleaseNoteFunction == null ? void 0 : customReleaseNoteFunction.getReleaseNoteLine) {
|
|
40
86
|
return customReleaseNoteFunction.getReleaseNoteLine(commit);
|
|
41
87
|
}
|
|
42
|
-
const {
|
|
43
|
-
repository,
|
|
44
|
-
pullRequestId,
|
|
45
|
-
summary
|
|
46
|
-
} = commit;
|
|
88
|
+
const { repository, pullRequestId, summary } = commit;
|
|
47
89
|
if (pullRequestId && repository) {
|
|
48
|
-
return `- [#${pullRequestId}](https://github.com/${repository}/pull/${pullRequestId}) ${formatSummary(
|
|
90
|
+
return `- [#${pullRequestId}](https://github.com/${repository}/pull/${pullRequestId}) ${formatSummary(
|
|
91
|
+
summary,
|
|
92
|
+
pullRequestId
|
|
93
|
+
)}
|
|
94
|
+
`;
|
|
49
95
|
}
|
|
50
96
|
if (pullRequestId) {
|
|
51
|
-
return `#${pullRequestId} ${formatSummary(summary, pullRequestId)}
|
|
97
|
+
return `#${pullRequestId} ${formatSummary(summary, pullRequestId)}
|
|
98
|
+
`;
|
|
52
99
|
}
|
|
53
|
-
return `${formatSummary(summary, pullRequestId)}
|
|
100
|
+
return `${formatSummary(summary, pullRequestId)}
|
|
101
|
+
`;
|
|
54
102
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
repo,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const pkg = await _utils.fs.readJSON(_path.default.join(cwd, 'package.json'));
|
|
65
|
-
({
|
|
66
|
-
repository
|
|
67
|
-
} = pkg);
|
|
68
|
-
}
|
|
69
|
-
if (custom) {
|
|
70
|
-
let possibleReleaseNoteFunc;
|
|
71
|
-
const releasenotePath = (0, _resolveFrom.default)(cwd, custom);
|
|
72
|
-
possibleReleaseNoteFunc = require(releasenotePath);
|
|
73
|
-
if (possibleReleaseNoteFunc.default) {
|
|
74
|
-
possibleReleaseNoteFunc = possibleReleaseNoteFunc.default;
|
|
103
|
+
function genReleaseNote(options) {
|
|
104
|
+
return __async(this, null, function* () {
|
|
105
|
+
const cwd = process.cwd();
|
|
106
|
+
const { repo, custom } = options;
|
|
107
|
+
let repository = repo;
|
|
108
|
+
let customReleaseNoteFunction;
|
|
109
|
+
if (!repo) {
|
|
110
|
+
const pkg = yield import_utils.fs.readJSON(import_path.default.join(cwd, "package.json"));
|
|
111
|
+
({ repository } = pkg);
|
|
75
112
|
}
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
113
|
+
if (custom) {
|
|
114
|
+
let possibleReleaseNoteFunc;
|
|
115
|
+
const releasenotePath = (0, import_resolve_from.default)(cwd, custom);
|
|
116
|
+
possibleReleaseNoteFunc = require(releasenotePath);
|
|
117
|
+
if (possibleReleaseNoteFunc.default) {
|
|
118
|
+
possibleReleaseNoteFunc = possibleReleaseNoteFunc.default;
|
|
119
|
+
}
|
|
120
|
+
if (typeof possibleReleaseNoteFunc.getReleaseInfo === "function" && typeof possibleReleaseNoteFunc.getReleaseNoteLine === "function") {
|
|
121
|
+
customReleaseNoteFunction = possibleReleaseNoteFunc;
|
|
122
|
+
} else {
|
|
123
|
+
throw new Error("Could not resolve relesae note generation functions");
|
|
124
|
+
}
|
|
80
125
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// eslint-disable-next-line no-process-exit
|
|
86
|
-
process.exit(1);
|
|
87
|
-
}
|
|
88
|
-
const features = [];
|
|
89
|
-
const bugFix = [];
|
|
90
|
-
for (const changeset of changesets) {
|
|
91
|
-
var _customReleaseNoteFun;
|
|
92
|
-
const {
|
|
93
|
-
stdout
|
|
94
|
-
} = await (0, _utils.execa)('git', ['log', '--pretty=format:%h--%s--%an', `.changeset/${changeset.id}.md`]);
|
|
95
|
-
const [id, message] = stdout.split('--');
|
|
96
|
-
let commitObj = {
|
|
97
|
-
id,
|
|
98
|
-
type: (message || changeset.summary).startsWith('fix') ? 'fix' : 'feature',
|
|
99
|
-
repository,
|
|
100
|
-
message: (message || changeset.summary).trim(),
|
|
101
|
-
summary: changeset.summary
|
|
102
|
-
};
|
|
103
|
-
if ((_customReleaseNoteFun = customReleaseNoteFunction) !== null && _customReleaseNoteFun !== void 0 && _customReleaseNoteFun.getReleaseInfo) {
|
|
104
|
-
commitObj = await customReleaseNoteFunction.getReleaseInfo(stdout, commitObj);
|
|
105
|
-
} else {
|
|
106
|
-
commitObj = getReleaseInfo(stdout, commitObj);
|
|
126
|
+
const changesets = yield (0, import_read.default)(cwd);
|
|
127
|
+
if (changesets.length === 0) {
|
|
128
|
+
console.warn("No unreleased changesets found.");
|
|
129
|
+
process.exit(1);
|
|
107
130
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
131
|
+
const features = [];
|
|
132
|
+
const bugFix = [];
|
|
133
|
+
for (const changeset of changesets) {
|
|
134
|
+
const { stdout } = yield (0, import_utils.execa)("git", [
|
|
135
|
+
"log",
|
|
136
|
+
"--pretty=format:%h--%s--%an",
|
|
137
|
+
`.changeset/${changeset.id}.md`
|
|
138
|
+
]);
|
|
139
|
+
const [id, message] = stdout.split("--");
|
|
140
|
+
let commitObj = {
|
|
141
|
+
id,
|
|
142
|
+
type: (message || changeset.summary).startsWith("fix") ? "fix" : "feature",
|
|
143
|
+
repository,
|
|
144
|
+
message: (message || changeset.summary).trim(),
|
|
145
|
+
summary: changeset.summary
|
|
146
|
+
};
|
|
147
|
+
if (customReleaseNoteFunction == null ? void 0 : customReleaseNoteFunction.getReleaseInfo) {
|
|
148
|
+
commitObj = yield customReleaseNoteFunction.getReleaseInfo(
|
|
149
|
+
stdout,
|
|
150
|
+
commitObj
|
|
151
|
+
);
|
|
152
|
+
} else {
|
|
153
|
+
commitObj = getReleaseInfo(stdout, commitObj);
|
|
154
|
+
}
|
|
155
|
+
if (commitObj.type === "fix") {
|
|
156
|
+
bugFix.push(commitObj);
|
|
157
|
+
} else {
|
|
158
|
+
features.push(commitObj);
|
|
159
|
+
}
|
|
112
160
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (features.length) {
|
|
118
|
-
console.info('## Features:\n');
|
|
119
|
-
for (const commit of features) {
|
|
120
|
-
const releaseNote = await getReleaseNoteLine(commit, customReleaseNoteFunction);
|
|
121
|
-
console.info(releaseNote);
|
|
161
|
+
if (!features.length && !bugFix.length) {
|
|
162
|
+
console.warn(
|
|
163
|
+
"no release note found, you can run `pnpm run add` to add changeset"
|
|
164
|
+
);
|
|
122
165
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
166
|
+
if (features.length) {
|
|
167
|
+
console.info("## Features:\n");
|
|
168
|
+
for (const commit of features) {
|
|
169
|
+
const releaseNote = yield getReleaseNoteLine(
|
|
170
|
+
commit,
|
|
171
|
+
customReleaseNoteFunction
|
|
172
|
+
);
|
|
173
|
+
console.info(releaseNote);
|
|
174
|
+
}
|
|
129
175
|
}
|
|
130
|
-
|
|
131
|
-
|
|
176
|
+
if (bugFix.length) {
|
|
177
|
+
console.info("## Bug Fix:\n");
|
|
178
|
+
for (const commit of bugFix) {
|
|
179
|
+
const relesaeNote = yield getReleaseNoteLine(
|
|
180
|
+
commit,
|
|
181
|
+
customReleaseNoteFunction
|
|
182
|
+
);
|
|
183
|
+
console.info(relesaeNote);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
189
|
+
0 && (module.exports = {
|
|
190
|
+
genReleaseNote,
|
|
191
|
+
getReleaseInfo,
|
|
192
|
+
getReleaseNoteLine
|
|
193
|
+
});
|
|
@@ -1,54 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
tag,
|
|
18
|
-
otp,
|
|
19
|
-
ignoreScripts,
|
|
20
|
-
gitChecks
|
|
21
|
-
} = options;
|
|
22
|
-
if (tag) {
|
|
23
|
-
params.push('--tag');
|
|
24
|
-
params.push(tag);
|
|
25
|
-
}
|
|
26
|
-
if (otp) {
|
|
27
|
-
params.push('--otp');
|
|
28
|
-
params.push(otp);
|
|
29
|
-
}
|
|
30
|
-
if (!(0, _utils.isMonorepo)(appDir) || packageManager === 'yarn' || packageManager === 'npm') {
|
|
31
|
-
await (0, _utils2.execaWithStreamLog)(process.execPath, [_utils2.CHANGESET_PATH, ...params]);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
params.push('-r');
|
|
35
|
-
params.push('--filter');
|
|
36
|
-
const pnpmVersion = await (0, _utils.getPnpmVersion)();
|
|
37
|
-
if (pnpmVersion.startsWith('6')) {
|
|
38
|
-
params.push('./packages/');
|
|
39
|
-
} else {
|
|
40
|
-
params.push('{./packages/**}');
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
41
16
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var __async = (__this, __arguments, generator) => {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
var fulfilled = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.next(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var rejected = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.throw(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var release_exports = {};
|
|
45
|
+
__export(release_exports, {
|
|
46
|
+
release: () => release
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(release_exports);
|
|
49
|
+
var import_path = __toESM(require("path"));
|
|
50
|
+
var import_utils = require("@modern-js/utils");
|
|
51
|
+
var import_git = require("@changesets/git");
|
|
52
|
+
var import_utils2 = require("../utils");
|
|
53
|
+
function release(options) {
|
|
54
|
+
return __async(this, null, function* () {
|
|
55
|
+
const appDir = process.cwd();
|
|
56
|
+
const packageManager = yield (0, import_utils.getPackageManager)(process.cwd());
|
|
57
|
+
const params = ["publish"];
|
|
58
|
+
const { tag, otp, ignoreScripts, gitChecks } = options;
|
|
59
|
+
if (tag) {
|
|
60
|
+
params.push("--tag");
|
|
61
|
+
params.push(tag);
|
|
62
|
+
}
|
|
63
|
+
if (otp) {
|
|
64
|
+
params.push("--otp");
|
|
65
|
+
params.push(otp);
|
|
66
|
+
}
|
|
67
|
+
if (!(0, import_utils.isMonorepo)(appDir) || packageManager === "yarn" || packageManager === "npm") {
|
|
68
|
+
yield (0, import_utils2.execaWithStreamLog)(process.execPath, [import_utils2.CHANGESET_PATH, ...params]);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
params.push("-r");
|
|
72
|
+
params.push("--filter");
|
|
73
|
+
const pnpmVersion = yield (0, import_utils.getPnpmVersion)();
|
|
74
|
+
if (pnpmVersion.startsWith("6")) {
|
|
75
|
+
params.push("./packages/");
|
|
76
|
+
} else {
|
|
77
|
+
params.push("{./packages/**}");
|
|
78
|
+
}
|
|
79
|
+
params.push("--report-summary");
|
|
80
|
+
if (ignoreScripts) {
|
|
81
|
+
params.push("--ignore-scripts");
|
|
82
|
+
}
|
|
83
|
+
if (!gitChecks) {
|
|
84
|
+
params.push("--no-git-checks");
|
|
85
|
+
}
|
|
86
|
+
yield (0, import_utils2.execaWithStreamLog)(packageManager, params);
|
|
87
|
+
const pnpmPublishSummaryFile = import_path.default.join(appDir, "pnpm-publish-summary.json");
|
|
88
|
+
const publishInfo = yield import_utils.fs.readJSON(pnpmPublishSummaryFile, "utf-8");
|
|
89
|
+
yield Promise.all(
|
|
90
|
+
(publishInfo.publishedPackages || []).map(
|
|
91
|
+
(pkg) => (0, import_git.tag)(`${pkg.name}@${pkg.version}`, appDir)
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
yield import_utils.fs.remove(pnpmPublishSummaryFile);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
release
|
|
100
|
+
});
|