@modern-js/plugin-changeset 2.15.0 → 2.17.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.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/commands/bump.js +20 -35
- package/dist/cjs/commands/change.js +21 -38
- package/dist/cjs/commands/index.js +23 -22
- package/dist/cjs/commands/pre.js +14 -28
- package/dist/cjs/commands/release.js +31 -53
- package/dist/cjs/commands/releaseNote.js +33 -66
- package/dist/cjs/commands/status.js +13 -28
- package/dist/cjs/index.js +37 -67
- package/dist/cjs/locale/en.js +7 -25
- package/dist/cjs/locale/index.js +18 -28
- package/dist/cjs/locale/zh.js +7 -25
- package/dist/cjs/utils/changeset.js +13 -36
- package/dist/cjs/utils/index.js +18 -17
- package/dist/esm/commands/bump.js +5 -5
- package/dist/esm/commands/change.js +9 -16
- package/dist/esm/commands/pre.js +6 -5
- package/dist/esm/commands/release.js +10 -17
- package/dist/esm/commands/releaseNote.js +10 -29
- package/dist/esm/commands/status.js +5 -5
- package/dist/esm/index.js +10 -38
- package/dist/esm/locale/en.js +1 -4
- package/dist/esm/locale/index.js +5 -5
- package/dist/esm/locale/zh.js +1 -4
- package/dist/esm/utils/changeset.js +2 -6
- package/package.json +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @modern-js/plugin-changeset
|
|
2
2
|
|
|
3
|
+
## 2.17.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @modern-js/plugin-i18n@2.17.0
|
|
8
|
+
- @modern-js/utils@2.17.0
|
|
9
|
+
|
|
10
|
+
## 2.16.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 4e876ab: chore: package.json include the monorepo-relative directory
|
|
15
|
+
|
|
16
|
+
chore: 在 package.json 中声明 monorepo 的子路径
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [5954330]
|
|
19
|
+
- Updated dependencies [7596520]
|
|
20
|
+
- Updated dependencies [4e876ab]
|
|
21
|
+
- @modern-js/utils@2.16.0
|
|
22
|
+
- @modern-js/plugin-i18n@2.16.0
|
|
23
|
+
|
|
3
24
|
## 2.15.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var bump_exports = {};
|
|
19
|
-
__export(bump_exports, {
|
|
20
|
-
bump: () => bump
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "bump", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => bump
|
|
21
8
|
});
|
|
22
|
-
|
|
23
|
-
var import_utils = require("../utils");
|
|
9
|
+
const _utils = require("../utils");
|
|
24
10
|
async function bump(options) {
|
|
25
11
|
const { snapshot, canary, preid, ignore } = options;
|
|
26
|
-
const params = [
|
|
12
|
+
const params = [
|
|
13
|
+
_utils.CHANGESET_PATH,
|
|
14
|
+
"version"
|
|
15
|
+
];
|
|
27
16
|
if (snapshot) {
|
|
28
17
|
params.push("--snapshot");
|
|
29
18
|
if (typeof snapshot === "string") {
|
|
@@ -37,31 +26,27 @@ async function bump(options) {
|
|
|
37
26
|
});
|
|
38
27
|
}
|
|
39
28
|
if (canary) {
|
|
40
|
-
await (0,
|
|
41
|
-
|
|
29
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, [
|
|
30
|
+
_utils.CHANGESET_PATH,
|
|
42
31
|
"pre",
|
|
43
32
|
"enter",
|
|
44
33
|
preid || "next"
|
|
45
34
|
]);
|
|
46
35
|
try {
|
|
47
|
-
await (0,
|
|
48
|
-
await (0,
|
|
49
|
-
|
|
36
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, params);
|
|
37
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, [
|
|
38
|
+
_utils.CHANGESET_PATH,
|
|
50
39
|
"pre",
|
|
51
40
|
"exit"
|
|
52
41
|
]);
|
|
53
42
|
} catch (e) {
|
|
54
|
-
await (0,
|
|
55
|
-
|
|
43
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, [
|
|
44
|
+
_utils.CHANGESET_PATH,
|
|
56
45
|
"pre",
|
|
57
46
|
"exit"
|
|
58
47
|
]);
|
|
59
48
|
}
|
|
60
49
|
} else {
|
|
61
|
-
await (0,
|
|
50
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, params);
|
|
62
51
|
}
|
|
63
52
|
}
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
bump
|
|
67
|
-
});
|
|
@@ -1,53 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var change_exports = {};
|
|
19
|
-
__export(change_exports, {
|
|
20
|
-
change: () => change
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "change", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => change
|
|
21
8
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var import_locale = require("../locale");
|
|
9
|
+
const _utils = require("@modern-js/utils");
|
|
10
|
+
const _utils1 = require("../utils");
|
|
11
|
+
const _locale = require("../locale");
|
|
26
12
|
async function change(options) {
|
|
27
13
|
const appDir = process.cwd();
|
|
28
|
-
if ((0,
|
|
29
|
-
const packages = (0,
|
|
14
|
+
if ((0, _utils.isMonorepo)(appDir)) {
|
|
15
|
+
const packages = (0, _utils.getMonorepoPackages)(appDir);
|
|
30
16
|
if (packages.length === 0) {
|
|
31
|
-
const packageManager = await (0,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
);
|
|
17
|
+
const packageManager = await (0, _utils.getPackageManager)(appDir);
|
|
18
|
+
_utils.logger.warn(_locale.i18n.t(_locale.localeKeys.command.change.no_packages, {
|
|
19
|
+
packageManager: packageManager === "yarn" ? "yarn" : `${packageManager} run`
|
|
20
|
+
}));
|
|
37
21
|
return;
|
|
38
22
|
}
|
|
39
23
|
}
|
|
40
24
|
const { empty, open } = options;
|
|
41
|
-
const params = [
|
|
25
|
+
const params = [
|
|
26
|
+
_utils1.CHANGESET_PATH,
|
|
27
|
+
"add"
|
|
28
|
+
];
|
|
42
29
|
if (empty) {
|
|
43
30
|
params.push("--empty");
|
|
44
31
|
}
|
|
45
32
|
if (open) {
|
|
46
33
|
params.push("--open");
|
|
47
34
|
}
|
|
48
|
-
await (0,
|
|
35
|
+
await (0, _utils1.execaWithStreamLog)(process.execPath, params);
|
|
49
36
|
}
|
|
50
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
-
0 && (module.exports = {
|
|
52
|
-
change
|
|
53
|
-
});
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./change"), exports);
|
|
6
|
+
_export_star(require("./bump"), exports);
|
|
7
|
+
_export_star(require("./pre"), exports);
|
|
8
|
+
_export_star(require("./release"), exports);
|
|
9
|
+
_export_star(require("./status"), exports);
|
|
10
|
+
_export_star(require("./releaseNote"), exports);
|
|
11
|
+
function _export_star(from, to) {
|
|
12
|
+
Object.keys(from).forEach(function(k) {
|
|
13
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
14
|
+
Object.defineProperty(to, k, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return from[k];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return from;
|
|
23
|
+
}
|
package/dist/cjs/commands/pre.js
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var pre_exports = {};
|
|
19
|
-
__export(pre_exports, {
|
|
20
|
-
pre: () => pre
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "pre", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => pre
|
|
21
8
|
});
|
|
22
|
-
|
|
23
|
-
var import_utils = require("../utils");
|
|
9
|
+
const _utils = require("../utils");
|
|
24
10
|
async function pre(type, tag = "next") {
|
|
25
|
-
const params = [
|
|
11
|
+
const params = [
|
|
12
|
+
_utils.CHANGESET_PATH,
|
|
13
|
+
"pre",
|
|
14
|
+
type
|
|
15
|
+
];
|
|
26
16
|
if (type === "enter") {
|
|
27
17
|
params.push(tag);
|
|
28
18
|
}
|
|
29
|
-
await (0,
|
|
19
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, params);
|
|
30
20
|
}
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
pre
|
|
34
|
-
});
|
|
@@ -1,43 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var release_exports = {};
|
|
29
|
-
__export(release_exports, {
|
|
30
|
-
release: () => release
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "release", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => release
|
|
31
8
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
const _path = /* @__PURE__ */ _interop_require_default(require("path"));
|
|
10
|
+
const _utils = require("@modern-js/utils");
|
|
11
|
+
const _git = require("@changesets/git");
|
|
12
|
+
const _utils1 = require("../utils");
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
37
18
|
async function release(options) {
|
|
38
19
|
const appDir = process.cwd();
|
|
39
|
-
const packageManager = await (0,
|
|
40
|
-
const params = [
|
|
20
|
+
const packageManager = await (0, _utils.getPackageManager)(process.cwd());
|
|
21
|
+
const params = [
|
|
22
|
+
"publish"
|
|
23
|
+
];
|
|
41
24
|
const { tag, otp, ignoreScripts, gitChecks } = options;
|
|
42
25
|
if (tag) {
|
|
43
26
|
params.push("--tag");
|
|
@@ -47,13 +30,16 @@ async function release(options) {
|
|
|
47
30
|
params.push("--otp");
|
|
48
31
|
params.push(otp);
|
|
49
32
|
}
|
|
50
|
-
if (!(0,
|
|
51
|
-
await (0,
|
|
33
|
+
if (!(0, _utils.isMonorepo)(appDir) || packageManager === "yarn" || packageManager === "npm") {
|
|
34
|
+
await (0, _utils1.execaWithStreamLog)(process.execPath, [
|
|
35
|
+
_utils1.CHANGESET_PATH,
|
|
36
|
+
...params
|
|
37
|
+
]);
|
|
52
38
|
return;
|
|
53
39
|
}
|
|
54
40
|
params.push("-r");
|
|
55
41
|
params.push("--filter");
|
|
56
|
-
const pnpmVersion = await (0,
|
|
42
|
+
const pnpmVersion = await (0, _utils.getPnpmVersion)();
|
|
57
43
|
if (pnpmVersion.startsWith("6")) {
|
|
58
44
|
params.push("./packages/");
|
|
59
45
|
} else {
|
|
@@ -66,17 +52,9 @@ async function release(options) {
|
|
|
66
52
|
if (!gitChecks) {
|
|
67
53
|
params.push("--no-git-checks");
|
|
68
54
|
}
|
|
69
|
-
await (0,
|
|
70
|
-
const pnpmPublishSummaryFile =
|
|
71
|
-
const publishInfo = await
|
|
72
|
-
await Promise.all(
|
|
73
|
-
|
|
74
|
-
(pkg) => (0, import_git.tag)(`${pkg.name}@${pkg.version}`, appDir)
|
|
75
|
-
)
|
|
76
|
-
);
|
|
77
|
-
await import_utils.fs.remove(pnpmPublishSummaryFile);
|
|
55
|
+
await (0, _utils1.execaWithStreamLog)(packageManager, params);
|
|
56
|
+
const pnpmPublishSummaryFile = _path.default.join(appDir, "pnpm-publish-summary.json");
|
|
57
|
+
const publishInfo = await _utils.fs.readJSON(pnpmPublishSummaryFile, "utf-8");
|
|
58
|
+
await Promise.all((publishInfo.publishedPackages || []).map((pkg) => (0, _git.tag)(`${pkg.name}@${pkg.version}`, appDir)));
|
|
59
|
+
await _utils.fs.remove(pnpmPublishSummaryFile);
|
|
78
60
|
}
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
release
|
|
82
|
-
});
|
|
@@ -1,41 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
8
6
|
for (var name in all)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var releaseNote_exports = {};
|
|
29
|
-
__export(releaseNote_exports, {
|
|
30
|
-
genReleaseNote: () => genReleaseNote,
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
31
13
|
getReleaseInfo: () => getReleaseInfo,
|
|
32
|
-
getReleaseNoteLine: () => getReleaseNoteLine
|
|
14
|
+
getReleaseNoteLine: () => getReleaseNoteLine,
|
|
15
|
+
genReleaseNote: () => genReleaseNote
|
|
33
16
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
const _path = /* @__PURE__ */ _interop_require_default(require("path"));
|
|
18
|
+
const _resolvefrom = /* @__PURE__ */ _interop_require_default(require("resolve-from"));
|
|
19
|
+
const _utils = require("@modern-js/utils");
|
|
20
|
+
const _read = /* @__PURE__ */ _interop_require_default(require("@changesets/read"));
|
|
21
|
+
function _interop_require_default(obj) {
|
|
22
|
+
return obj && obj.__esModule ? obj : {
|
|
23
|
+
default: obj
|
|
24
|
+
};
|
|
25
|
+
}
|
|
39
26
|
function getReleaseInfo(commit, commitObj) {
|
|
40
27
|
const commitRegex = /(.*)\(#(\d*)\)/;
|
|
41
28
|
const [, message, author] = commit.split("--");
|
|
@@ -66,15 +53,12 @@ function formatSummary(summary, pullRequestId) {
|
|
|
66
53
|
return returnVal;
|
|
67
54
|
}
|
|
68
55
|
function getReleaseNoteLine(commit, customReleaseNoteFunction) {
|
|
69
|
-
if (customReleaseNoteFunction
|
|
56
|
+
if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseNoteLine) {
|
|
70
57
|
return customReleaseNoteFunction.getReleaseNoteLine(commit);
|
|
71
58
|
}
|
|
72
59
|
const { repository, pullRequestId, summary } = commit;
|
|
73
60
|
if (pullRequestId && repository) {
|
|
74
|
-
return `- [#${pullRequestId}](https://github.com/${repository}/pull/${pullRequestId}) ${formatSummary(
|
|
75
|
-
summary,
|
|
76
|
-
pullRequestId
|
|
77
|
-
)}
|
|
61
|
+
return `- [#${pullRequestId}](https://github.com/${repository}/pull/${pullRequestId}) ${formatSummary(summary, pullRequestId)}
|
|
78
62
|
`;
|
|
79
63
|
}
|
|
80
64
|
if (pullRequestId) {
|
|
@@ -90,12 +74,12 @@ async function genReleaseNote(options) {
|
|
|
90
74
|
let repository = repo;
|
|
91
75
|
let customReleaseNoteFunction;
|
|
92
76
|
if (!repo) {
|
|
93
|
-
const pkg = await
|
|
77
|
+
const pkg = await _utils.fs.readJSON(_path.default.join(cwd, "package.json"));
|
|
94
78
|
({ repository } = pkg);
|
|
95
79
|
}
|
|
96
80
|
if (custom) {
|
|
97
81
|
let possibleReleaseNoteFunc;
|
|
98
|
-
const releasenotePath = (0,
|
|
82
|
+
const releasenotePath = (0, _resolvefrom.default)(cwd, custom);
|
|
99
83
|
possibleReleaseNoteFunc = require(releasenotePath);
|
|
100
84
|
if (possibleReleaseNoteFunc.default) {
|
|
101
85
|
possibleReleaseNoteFunc = possibleReleaseNoteFunc.default;
|
|
@@ -106,7 +90,7 @@ async function genReleaseNote(options) {
|
|
|
106
90
|
throw new Error("Could not resolve release note generation functions");
|
|
107
91
|
}
|
|
108
92
|
}
|
|
109
|
-
const changesets = await (0,
|
|
93
|
+
const changesets = await (0, _read.default)(cwd);
|
|
110
94
|
if (changesets.length === 0) {
|
|
111
95
|
console.warn("No unreleased changesets found.");
|
|
112
96
|
return "";
|
|
@@ -114,7 +98,7 @@ async function genReleaseNote(options) {
|
|
|
114
98
|
const features = [];
|
|
115
99
|
const bugFix = [];
|
|
116
100
|
for (const changeset of changesets) {
|
|
117
|
-
const { stdout } = await (0,
|
|
101
|
+
const { stdout } = await (0, _utils.execa)("git", [
|
|
118
102
|
"log",
|
|
119
103
|
"--pretty=format:%h--%s--%an",
|
|
120
104
|
`.changeset/${changeset.id}.md`
|
|
@@ -127,11 +111,8 @@ async function genReleaseNote(options) {
|
|
|
127
111
|
message: (message || changeset.summary).trim(),
|
|
128
112
|
summary: changeset.summary
|
|
129
113
|
};
|
|
130
|
-
if (customReleaseNoteFunction
|
|
131
|
-
commitObj = await customReleaseNoteFunction.getReleaseInfo(
|
|
132
|
-
stdout,
|
|
133
|
-
commitObj
|
|
134
|
-
);
|
|
114
|
+
if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseInfo) {
|
|
115
|
+
commitObj = await customReleaseNoteFunction.getReleaseInfo(stdout, commitObj);
|
|
135
116
|
} else {
|
|
136
117
|
commitObj = getReleaseInfo(stdout, commitObj);
|
|
137
118
|
}
|
|
@@ -142,37 +123,23 @@ async function genReleaseNote(options) {
|
|
|
142
123
|
}
|
|
143
124
|
}
|
|
144
125
|
if (!features.length && !bugFix.length) {
|
|
145
|
-
console.warn(
|
|
146
|
-
"no release note found, you can run `pnpm run add` to add changeset"
|
|
147
|
-
);
|
|
126
|
+
console.warn("no release note found, you can run `pnpm run add` to add changeset");
|
|
148
127
|
}
|
|
149
128
|
let result = "";
|
|
150
129
|
if (features.length) {
|
|
151
130
|
result += "## Features:\n";
|
|
152
131
|
for (const commit of features) {
|
|
153
|
-
const releaseNote = await getReleaseNoteLine(
|
|
154
|
-
commit,
|
|
155
|
-
customReleaseNoteFunction
|
|
156
|
-
);
|
|
132
|
+
const releaseNote = await getReleaseNoteLine(commit, customReleaseNoteFunction);
|
|
157
133
|
result += releaseNote;
|
|
158
134
|
}
|
|
159
135
|
}
|
|
160
136
|
if (bugFix.length) {
|
|
161
137
|
result += "## Bug Fix:\n";
|
|
162
138
|
for (const commit of bugFix) {
|
|
163
|
-
const releaseNote = await getReleaseNoteLine(
|
|
164
|
-
commit,
|
|
165
|
-
customReleaseNoteFunction
|
|
166
|
-
);
|
|
139
|
+
const releaseNote = await getReleaseNoteLine(commit, customReleaseNoteFunction);
|
|
167
140
|
result += releaseNote;
|
|
168
141
|
}
|
|
169
142
|
}
|
|
170
143
|
console.info(result);
|
|
171
144
|
return result;
|
|
172
145
|
}
|
|
173
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
174
|
-
0 && (module.exports = {
|
|
175
|
-
genReleaseNote,
|
|
176
|
-
getReleaseInfo,
|
|
177
|
-
getReleaseNoteLine
|
|
178
|
-
});
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var status_exports = {};
|
|
19
|
-
__export(status_exports, {
|
|
20
|
-
status: () => status
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "status", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => status
|
|
21
8
|
});
|
|
22
|
-
|
|
23
|
-
var import_utils = require("../utils");
|
|
9
|
+
const _utils = require("../utils");
|
|
24
10
|
async function status(options) {
|
|
25
|
-
const params = [
|
|
11
|
+
const params = [
|
|
12
|
+
_utils.CHANGESET_PATH,
|
|
13
|
+
"status"
|
|
14
|
+
];
|
|
26
15
|
const { verbose, output, since } = options;
|
|
27
16
|
if (verbose) {
|
|
28
17
|
params.push("--verbose");
|
|
@@ -35,9 +24,5 @@ async function status(options) {
|
|
|
35
24
|
params.push("--since");
|
|
36
25
|
params.push(since);
|
|
37
26
|
}
|
|
38
|
-
await (0,
|
|
27
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, params);
|
|
39
28
|
}
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
status
|
|
43
|
-
});
|