@modern-js/plugin-changeset 2.0.0-beta.3 → 2.0.0-beta.4
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 +31 -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 +82 -36
- package/dist/js/node/commands/change.js +69 -32
- package/dist/js/node/commands/index.js +22 -71
- package/dist/js/node/commands/pre.js +51 -13
- package/dist/js/node/commands/release-note.js +153 -97
- package/dist/js/node/commands/release.js +95 -53
- package/dist/js/node/commands/status.js +60 -26
- package/dist/js/node/index.js +66 -39
- package/dist/js/node/locale/en.js +43 -28
- package/dist/js/node/locale/index.js +27 -15
- package/dist/js/node/locale/zh.js +43 -28
- package/dist/js/node/utils/changeset.js +35 -14
- package/dist/js/node/utils/index.js +18 -27
- package/dist/js/node/utils/language.js +24 -8
- package/dist/types/index.d.ts +2 -0
- package/package.json +6 -6
|
@@ -1,14 +1,52 @@
|
|
|
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 stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
pre: () => pre
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_utils = require("../utils");
|
|
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
|
+
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
|
+
}
|
|
@@ -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 stdin_exports = {};
|
|
25
|
+
__export(stdin_exports, {
|
|
26
|
+
genReleaseNote: () => genReleaseNote,
|
|
27
|
+
getReleaseInfo: () => getReleaseInfo,
|
|
28
|
+
getReleaseNoteLine: () => getReleaseNoteLine
|
|
5
29
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
30
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
31
|
+
var import_path = __toESM(require("path"));
|
|
32
|
+
var import_resolve_from = __toESM(require("resolve-from"));
|
|
33
|
+
var import_utils = require("@modern-js/utils");
|
|
34
|
+
var import_read = __toESM(require("@changesets/read"));
|
|
35
|
+
var __async = (__this, __arguments, generator) => {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
var fulfilled = (value) => {
|
|
38
|
+
try {
|
|
39
|
+
step(generator.next(value));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
reject(e);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var rejected = (value) => {
|
|
45
|
+
try {
|
|
46
|
+
step(generator.throw(value));
|
|
47
|
+
} catch (e) {
|
|
48
|
+
reject(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
52
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
53
|
+
});
|
|
54
|
+
};
|
|
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,124 @@ 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
|
+
}
|
|
@@ -1,54 +1,96 @@
|
|
|
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 stdin_exports = {};
|
|
25
|
+
__export(stdin_exports, {
|
|
26
|
+
release: () => release
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
29
|
+
var import_path = __toESM(require("path"));
|
|
30
|
+
var import_utils = require("@modern-js/utils");
|
|
31
|
+
var import_git = require("@changesets/git");
|
|
32
|
+
var import_utils2 = require("../utils");
|
|
33
|
+
var __async = (__this, __arguments, generator) => {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
var fulfilled = (value) => {
|
|
36
|
+
try {
|
|
37
|
+
step(generator.next(value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var rejected = (value) => {
|
|
43
|
+
try {
|
|
44
|
+
step(generator.throw(value));
|
|
45
|
+
} catch (e) {
|
|
46
|
+
reject(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
+
});
|
|
52
|
+
};
|
|
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
|
+
}
|
|
@@ -1,27 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = options;
|
|
15
|
-
if (verbose) {
|
|
16
|
-
params.push('--verbose');
|
|
17
|
-
}
|
|
18
|
-
if (output) {
|
|
19
|
-
params.push('--output');
|
|
20
|
-
params.push(output);
|
|
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 });
|
|
21
14
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
status: () => status
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_utils = require("../utils");
|
|
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
|
+
function status(options) {
|
|
45
|
+
return __async(this, null, function* () {
|
|
46
|
+
const params = [import_utils.CHANGESET_PATH, "status"];
|
|
47
|
+
const { verbose, output, since } = options;
|
|
48
|
+
if (verbose) {
|
|
49
|
+
params.push("--verbose");
|
|
50
|
+
}
|
|
51
|
+
if (output) {
|
|
52
|
+
params.push("--output");
|
|
53
|
+
params.push(output);
|
|
54
|
+
}
|
|
55
|
+
if (since) {
|
|
56
|
+
params.push("--since");
|
|
57
|
+
params.push(since);
|
|
58
|
+
}
|
|
59
|
+
yield (0, import_utils.execaWithStreamLog)(process.execPath, params);
|
|
60
|
+
});
|
|
61
|
+
}
|