@modern-js/plugin-changeset 2.35.0 → 2.36.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.
@@ -1,18 +1,31 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "bump", {
6
- enumerable: true,
7
- get: function() {
8
- return bump;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var bump_exports = {};
20
+ __export(bump_exports, {
21
+ bump: () => bump
10
22
  });
11
- const _utils = require("../utils");
23
+ module.exports = __toCommonJS(bump_exports);
24
+ var import_utils = require("../utils");
12
25
  async function bump(options) {
13
26
  const { snapshot, canary, preid, ignore } = options;
14
27
  const params = [
15
- _utils.CHANGESET_PATH,
28
+ import_utils.CHANGESET_PATH,
16
29
  "version"
17
30
  ];
18
31
  if (snapshot) {
@@ -28,27 +41,31 @@ async function bump(options) {
28
41
  });
29
42
  }
30
43
  if (canary) {
31
- await (0, _utils.execaWithStreamLog)(process.execPath, [
32
- _utils.CHANGESET_PATH,
44
+ await (0, import_utils.execaWithStreamLog)(process.execPath, [
45
+ import_utils.CHANGESET_PATH,
33
46
  "pre",
34
47
  "enter",
35
48
  preid || "next"
36
49
  ]);
37
50
  try {
38
- await (0, _utils.execaWithStreamLog)(process.execPath, params);
39
- await (0, _utils.execaWithStreamLog)(process.execPath, [
40
- _utils.CHANGESET_PATH,
51
+ await (0, import_utils.execaWithStreamLog)(process.execPath, params);
52
+ await (0, import_utils.execaWithStreamLog)(process.execPath, [
53
+ import_utils.CHANGESET_PATH,
41
54
  "pre",
42
55
  "exit"
43
56
  ]);
44
57
  } catch (e) {
45
- await (0, _utils.execaWithStreamLog)(process.execPath, [
46
- _utils.CHANGESET_PATH,
58
+ await (0, import_utils.execaWithStreamLog)(process.execPath, [
59
+ import_utils.CHANGESET_PATH,
47
60
  "pre",
48
61
  "exit"
49
62
  ]);
50
63
  }
51
64
  } else {
52
- await (0, _utils.execaWithStreamLog)(process.execPath, params);
65
+ await (0, import_utils.execaWithStreamLog)(process.execPath, params);
53
66
  }
54
67
  }
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ bump
71
+ });
@@ -1,23 +1,36 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "change", {
6
- enumerable: true,
7
- get: function() {
8
- return change;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var change_exports = {};
20
+ __export(change_exports, {
21
+ change: () => change
10
22
  });
11
- const _utils = require("@modern-js/utils");
12
- const _utils1 = require("../utils");
13
- const _locale = require("../locale");
23
+ module.exports = __toCommonJS(change_exports);
24
+ var import_utils = require("@modern-js/utils");
25
+ var import_utils2 = require("../utils");
26
+ var import_locale = require("../locale");
14
27
  async function change(options) {
15
28
  const appDir = process.cwd();
16
- if ((0, _utils.isMonorepo)(appDir)) {
17
- const packages = (0, _utils.getMonorepoPackages)(appDir);
29
+ if ((0, import_utils.isMonorepo)(appDir)) {
30
+ const packages = (0, import_utils.getMonorepoPackages)(appDir);
18
31
  if (packages.length === 0) {
19
- const packageManager = await (0, _utils.getPackageManager)(appDir);
20
- _utils.logger.warn(_locale.i18n.t(_locale.localeKeys.command.change.no_packages, {
32
+ const packageManager = await (0, import_utils.getPackageManager)(appDir);
33
+ import_utils.logger.warn(import_locale.i18n.t(import_locale.localeKeys.command.change.no_packages, {
21
34
  packageManager: packageManager === "yarn" ? "yarn" : `${packageManager} run`
22
35
  }));
23
36
  return;
@@ -25,7 +38,7 @@ async function change(options) {
25
38
  }
26
39
  const { empty, open } = options;
27
40
  const params = [
28
- _utils1.CHANGESET_PATH,
41
+ import_utils2.CHANGESET_PATH,
29
42
  "add"
30
43
  ];
31
44
  if (empty) {
@@ -34,5 +47,9 @@ async function change(options) {
34
47
  if (open) {
35
48
  params.push("--open");
36
49
  }
37
- await (0, _utils1.execaWithStreamLog)(process.execPath, params);
50
+ await (0, import_utils2.execaWithStreamLog)(process.execPath, params);
38
51
  }
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ change
55
+ });
@@ -1,11 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var commands_exports = {};
17
+ module.exports = __toCommonJS(commands_exports);
18
+ __reExport(commands_exports, require("./change"), module.exports);
19
+ __reExport(commands_exports, require("./bump"), module.exports);
20
+ __reExport(commands_exports, require("./pre"), module.exports);
21
+ __reExport(commands_exports, require("./release"), module.exports);
22
+ __reExport(commands_exports, require("./status"), module.exports);
23
+ __reExport(commands_exports, require("./releaseNote"), module.exports);
24
+ // Annotate the CommonJS export names for ESM import in node:
25
+ 0 && (module.exports = {
26
+ ...require("./change"),
27
+ ...require("./bump"),
28
+ ...require("./pre"),
29
+ ...require("./release"),
30
+ ...require("./status"),
31
+ ...require("./releaseNote")
4
32
  });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./change"), exports);
7
- _export_star._(require("./bump"), exports);
8
- _export_star._(require("./pre"), exports);
9
- _export_star._(require("./release"), exports);
10
- _export_star._(require("./status"), exports);
11
- _export_star._(require("./releaseNote"), exports);
@@ -1,22 +1,39 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "pre", {
6
- enumerable: true,
7
- get: function() {
8
- return pre;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var pre_exports = {};
20
+ __export(pre_exports, {
21
+ pre: () => pre
10
22
  });
11
- const _utils = require("../utils");
23
+ module.exports = __toCommonJS(pre_exports);
24
+ var import_utils = require("../utils");
12
25
  async function pre(type, tag = "next") {
13
26
  const params = [
14
- _utils.CHANGESET_PATH,
27
+ import_utils.CHANGESET_PATH,
15
28
  "pre",
16
29
  type
17
30
  ];
18
31
  if (type === "enter") {
19
32
  params.push(tag);
20
33
  }
21
- await (0, _utils.execaWithStreamLog)(process.execPath, params);
34
+ await (0, import_utils.execaWithStreamLog)(process.execPath, params);
22
35
  }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ pre
39
+ });
@@ -1,21 +1,43 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "release", {
6
- enumerable: true,
7
- get: function() {
8
- return release;
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
17
  }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var release_exports = {};
30
+ __export(release_exports, {
31
+ release: () => release
10
32
  });
11
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
12
- const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
13
- const _utils = require("@modern-js/utils");
14
- const _git = require("@changesets/git");
15
- const _utils1 = require("../utils");
33
+ module.exports = __toCommonJS(release_exports);
34
+ var import_path = __toESM(require("path"));
35
+ var import_utils = require("@modern-js/utils");
36
+ var import_git = require("@changesets/git");
37
+ var import_utils2 = require("../utils");
16
38
  async function release(options) {
17
39
  const appDir = process.cwd();
18
- const packageManager = await (0, _utils.getPackageManager)(process.cwd());
40
+ const packageManager = await (0, import_utils.getPackageManager)(process.cwd());
19
41
  const params = [
20
42
  "publish"
21
43
  ];
@@ -28,16 +50,16 @@ async function release(options) {
28
50
  params.push("--otp");
29
51
  params.push(otp);
30
52
  }
31
- if (!(0, _utils.isMonorepo)(appDir) || packageManager === "yarn" || packageManager === "npm") {
32
- await (0, _utils1.execaWithStreamLog)(process.execPath, [
33
- _utils1.CHANGESET_PATH,
53
+ if (!(0, import_utils.isMonorepo)(appDir) || packageManager === "yarn" || packageManager === "npm") {
54
+ await (0, import_utils2.execaWithStreamLog)(process.execPath, [
55
+ import_utils2.CHANGESET_PATH,
34
56
  ...params
35
57
  ]);
36
58
  return;
37
59
  }
38
60
  params.push("-r");
39
61
  params.push("--filter");
40
- const pnpmVersion = await (0, _utils.getPnpmVersion)();
62
+ const pnpmVersion = await (0, import_utils.getPnpmVersion)();
41
63
  if (pnpmVersion.startsWith("6")) {
42
64
  params.push("./packages/");
43
65
  } else {
@@ -51,15 +73,19 @@ async function release(options) {
51
73
  params.push("--no-git-checks");
52
74
  }
53
75
  if (provenance) {
54
- if (_utils.semver.lt(pnpmVersion, "8.4.0")) {
76
+ if (import_utils.semver.lt(pnpmVersion, "8.4.0")) {
55
77
  console.warn("current pnpm version not support --provenance, please upgrade pnpm version first.");
56
78
  } else {
57
79
  params.push("--provenance");
58
80
  }
59
81
  }
60
- await (0, _utils1.execaWithStreamLog)(packageManager, params);
61
- const pnpmPublishSummaryFile = _path.default.join(appDir, "pnpm-publish-summary.json");
62
- const publishInfo = await _utils.fs.readJSON(pnpmPublishSummaryFile, "utf-8");
63
- await Promise.all((publishInfo.publishedPackages || []).map((pkg) => (0, _git.tag)(`${pkg.name}@${pkg.version}`, appDir)));
64
- await _utils.fs.remove(pnpmPublishSummaryFile);
82
+ await (0, import_utils2.execaWithStreamLog)(packageManager, params);
83
+ const pnpmPublishSummaryFile = import_path.default.join(appDir, "pnpm-publish-summary.json");
84
+ const publishInfo = await import_utils.fs.readJSON(pnpmPublishSummaryFile, "utf-8");
85
+ await Promise.all((publishInfo.publishedPackages || []).map((pkg) => (0, import_git.tag)(`${pkg.name}@${pkg.version}`, appDir)));
86
+ await import_utils.fs.remove(pnpmPublishSummaryFile);
65
87
  }
88
+ // Annotate the CommonJS export names for ESM import in node:
89
+ 0 && (module.exports = {
90
+ release
91
+ });
@@ -1,49 +1,49 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
6
9
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- CommitType: function() {
14
- return CommitType;
15
- },
16
- ChangesTitle: function() {
17
- return ChangesTitle;
18
- },
19
- ChangesZhTitle: function() {
20
- return ChangesZhTitle;
21
- },
22
- CommitTypeTitle: function() {
23
- return CommitTypeTitle;
24
- },
25
- CommitTypeZhTitle: function() {
26
- return CommitTypeZhTitle;
27
- },
28
- getCommitType: function() {
29
- return getCommitType;
30
- },
31
- getReleaseInfo: function() {
32
- return getReleaseInfo;
33
- },
34
- getReleaseNoteLine: function() {
35
- return getReleaseNoteLine;
36
- },
37
- genReleaseNote: function() {
38
- return genReleaseNote;
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
39
17
  }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var releaseNote_exports = {};
30
+ __export(releaseNote_exports, {
31
+ ChangesTitle: () => ChangesTitle,
32
+ ChangesZhTitle: () => ChangesZhTitle,
33
+ CommitType: () => CommitType,
34
+ CommitTypeTitle: () => CommitTypeTitle,
35
+ CommitTypeZhTitle: () => CommitTypeZhTitle,
36
+ genReleaseNote: () => genReleaseNote,
37
+ getCommitType: () => getCommitType,
38
+ getReleaseInfo: () => getReleaseInfo,
39
+ getReleaseNoteLine: () => getReleaseNoteLine
40
40
  });
41
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
42
- const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
43
- const _resolvefrom = /* @__PURE__ */ _interop_require_default._(require("resolve-from"));
44
- const _axios = /* @__PURE__ */ _interop_require_default._(require("axios"));
45
- const _utils = require("@modern-js/utils");
46
- const _read = /* @__PURE__ */ _interop_require_default._(require("@changesets/read"));
41
+ module.exports = __toCommonJS(releaseNote_exports);
42
+ var import_path = __toESM(require("path"));
43
+ var import_resolve_from = __toESM(require("resolve-from"));
44
+ var import_axios = __toESM(require("axios"));
45
+ var import_utils = require("@modern-js/utils");
46
+ var import_read = __toESM(require("@changesets/read"));
47
47
  var CommitType;
48
48
  (function(CommitType2) {
49
49
  CommitType2["Performance"] = "performance";
@@ -93,7 +93,7 @@ async function getReleaseInfo(commit, commitObj, repo, authToken) {
93
93
  commitObj.author = author;
94
94
  } else if (repo && token) {
95
95
  try {
96
- const res = await _axios.default.get(`https://api.github.com/repos/${repo}/commits/${commitId}`, {
96
+ const res = await import_axios.default.get(`https://api.github.com/repos/${repo}/commits/${commitId}`, {
97
97
  method: "GET",
98
98
  headers: {
99
99
  "Content-Type": "application/json",
@@ -115,8 +115,7 @@ async function getReleaseInfo(commit, commitObj, repo, authToken) {
115
115
  return commitObj;
116
116
  }
117
117
  function getReleaseNoteLine(commit, customReleaseNoteFunction, lang = "en") {
118
- var _customReleaseNoteFunction;
119
- if ((_customReleaseNoteFunction = customReleaseNoteFunction) === null || _customReleaseNoteFunction === void 0 ? void 0 : _customReleaseNoteFunction.getReleaseNoteLine) {
118
+ if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseNoteLine) {
120
119
  return customReleaseNoteFunction.getReleaseNoteLine(commit, lang);
121
120
  }
122
121
  const { repository, pullRequestId, summary, summary_zh, author } = commit;
@@ -134,12 +133,12 @@ async function genReleaseNote(options) {
134
133
  let repository = repo;
135
134
  let customReleaseNoteFunction;
136
135
  if (!repo) {
137
- const pkg = await _utils.fs.readJSON(_path.default.join(cwd, "package.json"));
136
+ const pkg = await import_utils.fs.readJSON(import_path.default.join(cwd, "package.json"));
138
137
  ({ repository } = pkg);
139
138
  }
140
139
  if (custom) {
141
140
  let possibleReleaseNoteFunc;
142
- const releasenotePath = (0, _resolvefrom.default)(cwd, custom);
141
+ const releasenotePath = (0, import_resolve_from.default)(cwd, custom);
143
142
  possibleReleaseNoteFunc = require(releasenotePath);
144
143
  if (possibleReleaseNoteFunc.default) {
145
144
  possibleReleaseNoteFunc = possibleReleaseNoteFunc.default;
@@ -150,7 +149,7 @@ async function genReleaseNote(options) {
150
149
  throw new Error("Could not resolve release note generation functions");
151
150
  }
152
151
  }
153
- const changesets = await (0, _read.default)(cwd);
152
+ const changesets = await (0, import_read.default)(cwd);
154
153
  if (changesets.length === 0) {
155
154
  console.warn("No unreleased changesets found.");
156
155
  return "";
@@ -178,8 +177,7 @@ async function genReleaseNote(options) {
178
177
  }
179
178
  };
180
179
  for (const changeset of changesets) {
181
- var _customReleaseNoteFunction;
182
- const { stdout } = await (0, _utils.execa)("git", [
180
+ const { stdout } = await (0, import_utils.execa)("git", [
183
181
  "log",
184
182
  "--pretty=format:%h--%s--%ae",
185
183
  `.changeset/${changeset.id}.md`
@@ -194,7 +192,7 @@ async function genReleaseNote(options) {
194
192
  summary: firstLine,
195
193
  summary_zh: futureLines.filter((l) => Boolean(l)).join("\n")
196
194
  };
197
- if ((_customReleaseNoteFunction = customReleaseNoteFunction) === null || _customReleaseNoteFunction === void 0 ? void 0 : _customReleaseNoteFunction.getReleaseInfo) {
195
+ if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseInfo) {
198
196
  commitObj = await customReleaseNoteFunction.getReleaseInfo(stdout, commitObj);
199
197
  } else {
200
198
  commitObj = await getReleaseInfo(stdout, commitObj, repository, options.authToken);
@@ -240,3 +238,15 @@ ${result.zh}` : result.en;
240
238
  console.info(resultStr);
241
239
  return resultStr;
242
240
  }
241
+ // Annotate the CommonJS export names for ESM import in node:
242
+ 0 && (module.exports = {
243
+ ChangesTitle,
244
+ ChangesZhTitle,
245
+ CommitType,
246
+ CommitTypeTitle,
247
+ CommitTypeZhTitle,
248
+ genReleaseNote,
249
+ getCommitType,
250
+ getReleaseInfo,
251
+ getReleaseNoteLine
252
+ });
@@ -1,17 +1,30 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "status", {
6
- enumerable: true,
7
- get: function() {
8
- return status;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var status_exports = {};
20
+ __export(status_exports, {
21
+ status: () => status
10
22
  });
11
- const _utils = require("../utils");
23
+ module.exports = __toCommonJS(status_exports);
24
+ var import_utils = require("../utils");
12
25
  async function status(options) {
13
26
  const params = [
14
- _utils.CHANGESET_PATH,
27
+ import_utils.CHANGESET_PATH,
15
28
  "status"
16
29
  ];
17
30
  const { verbose, output, since } = options;
@@ -26,5 +39,9 @@ async function status(options) {
26
39
  params.push("--since");
27
40
  params.push(since);
28
41
  }
29
- await (0, _utils.execaWithStreamLog)(process.execPath, params);
42
+ await (0, import_utils.execaWithStreamLog)(process.execPath, params);
30
43
  }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ status
47
+ });
package/dist/cjs/index.js CHANGED
@@ -1,47 +1,58 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- changesetPlugin: function() {
14
- return changesetPlugin;
15
- },
16
- default: function() {
17
- return _default;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
16
+ return to;
17
+ };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ changesetPlugin: () => changesetPlugin,
23
+ default: () => src_default
19
24
  });
20
- const _export_star = require("@swc/helpers/_/_export_star");
21
- const _languagedetector = require("@modern-js/plugin-i18n/language-detector");
22
- const _commands = _export_star._(require("./commands"), exports);
23
- const _locale = require("./locale");
25
+ module.exports = __toCommonJS(src_exports);
26
+ var import_language_detector = require("@modern-js/plugin-i18n/language-detector");
27
+ var import_commands = require("./commands");
28
+ var import_locale = require("./locale");
29
+ __reExport(src_exports, require("./commands"), module.exports);
24
30
  const changesetPlugin = () => ({
25
31
  name: "@modern-js/plugin-changeset",
26
32
  setup: () => {
27
- _locale.i18n.changeLanguage({
28
- locale: (0, _languagedetector.getLocaleLanguage)()
33
+ import_locale.i18n.changeLanguage({
34
+ locale: (0, import_language_detector.getLocaleLanguage)()
29
35
  });
30
36
  return {
31
37
  commands({ program }) {
32
- program.command("change").description(_locale.i18n.t(_locale.localeKeys.command.change.describe)).option("--empty", _locale.i18n.t(_locale.localeKeys.command.change.empty), false).option("--open", _locale.i18n.t(_locale.localeKeys.command.change.open), false).action((options) => (0, _commands.change)(options));
33
- program.command("bump").description(_locale.i18n.t(_locale.localeKeys.command.bump.describe)).option("--canary", _locale.i18n.t(_locale.localeKeys.command.bump.canary), false).option("--ignore <package>", _locale.i18n.t(_locale.localeKeys.command.bump.ignore), (val, memo) => {
38
+ program.command("change").description(import_locale.i18n.t(import_locale.localeKeys.command.change.describe)).option("--empty", import_locale.i18n.t(import_locale.localeKeys.command.change.empty), false).option("--open", import_locale.i18n.t(import_locale.localeKeys.command.change.open), false).action((options) => (0, import_commands.change)(options));
39
+ program.command("bump").description(import_locale.i18n.t(import_locale.localeKeys.command.bump.describe)).option("--canary", import_locale.i18n.t(import_locale.localeKeys.command.bump.canary), false).option("--ignore <package>", import_locale.i18n.t(import_locale.localeKeys.command.bump.ignore), (val, memo) => {
34
40
  memo.push(val);
35
41
  return memo;
36
- }, []).option("--preid <tag>", _locale.i18n.t(_locale.localeKeys.command.bump.preid), "next").option("--snapshot [snapshot]", _locale.i18n.t(_locale.localeKeys.command.bump.snapshot), false).action((options) => (0, _commands.bump)(options));
37
- program.command("pre <enter|exit> [tag]").description(_locale.i18n.t(_locale.localeKeys.command.pre.describe)).action((type, tag) => (0, _commands.pre)(type, tag));
38
- program.command("release").description(_locale.i18n.t(_locale.localeKeys.command.release.describe)).option("--tag <tag>", _locale.i18n.t(_locale.localeKeys.command.release.tag), "").option("--otp <token>", _locale.i18n.t(_locale.localeKeys.command.release.otp), "").option("--ignore-scripts", _locale.i18n.t(_locale.localeKeys.command.release.ignore_scripts), "").option("--no-git-checks", _locale.i18n.t(_locale.localeKeys.command.release.no_git_checks), "").option("--provenance", _locale.i18n.t(_locale.localeKeys.command.release.provenance)).action((options) => (0, _commands.release)(options));
39
- program.command("change-status").description(_locale.i18n.t(_locale.localeKeys.command.status.describe)).option("--verbose", _locale.i18n.t(_locale.localeKeys.command.status.verbose)).option("--output <file>", _locale.i18n.t(_locale.localeKeys.command.status.output)).option("--since <ref>", _locale.i18n.t(_locale.localeKeys.command.status.since)).action((options) => (0, _commands.status)(options));
40
- program.command("gen-release-note").description(_locale.i18n.t(_locale.localeKeys.command.gen_release_note.describe)).option("--repo <repo>", _locale.i18n.t(_locale.localeKeys.command.gen_release_note.repo)).option("--custom <custom>", _locale.i18n.t(_locale.localeKeys.command.gen_release_note.custom)).action(async (options) => {
41
- await (0, _commands.genReleaseNote)(options);
42
+ }, []).option("--preid <tag>", import_locale.i18n.t(import_locale.localeKeys.command.bump.preid), "next").option("--snapshot [snapshot]", import_locale.i18n.t(import_locale.localeKeys.command.bump.snapshot), false).action((options) => (0, import_commands.bump)(options));
43
+ program.command("pre <enter|exit> [tag]").description(import_locale.i18n.t(import_locale.localeKeys.command.pre.describe)).action((type, tag) => (0, import_commands.pre)(type, tag));
44
+ program.command("release").description(import_locale.i18n.t(import_locale.localeKeys.command.release.describe)).option("--tag <tag>", import_locale.i18n.t(import_locale.localeKeys.command.release.tag), "").option("--otp <token>", import_locale.i18n.t(import_locale.localeKeys.command.release.otp), "").option("--ignore-scripts", import_locale.i18n.t(import_locale.localeKeys.command.release.ignore_scripts), "").option("--no-git-checks", import_locale.i18n.t(import_locale.localeKeys.command.release.no_git_checks), "").option("--provenance", import_locale.i18n.t(import_locale.localeKeys.command.release.provenance)).action((options) => (0, import_commands.release)(options));
45
+ program.command("change-status").description(import_locale.i18n.t(import_locale.localeKeys.command.status.describe)).option("--verbose", import_locale.i18n.t(import_locale.localeKeys.command.status.verbose)).option("--output <file>", import_locale.i18n.t(import_locale.localeKeys.command.status.output)).option("--since <ref>", import_locale.i18n.t(import_locale.localeKeys.command.status.since)).action((options) => (0, import_commands.status)(options));
46
+ program.command("gen-release-note").description(import_locale.i18n.t(import_locale.localeKeys.command.gen_release_note.describe)).option("--repo <repo>", import_locale.i18n.t(import_locale.localeKeys.command.gen_release_note.repo)).option("--custom <custom>", import_locale.i18n.t(import_locale.localeKeys.command.gen_release_note.custom)).action(async (options) => {
47
+ await (0, import_commands.genReleaseNote)(options);
42
48
  });
43
49
  }
44
50
  };
45
51
  }
46
52
  });
47
- const _default = changesetPlugin;
53
+ var src_default = changesetPlugin;
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ changesetPlugin,
57
+ ...require("./commands")
58
+ });
@@ -1,13 +1,26 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "EN_LOCALE", {
6
- enumerable: true,
7
- get: function() {
8
- return EN_LOCALE;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var en_exports = {};
20
+ __export(en_exports, {
21
+ EN_LOCALE: () => EN_LOCALE
10
22
  });
23
+ module.exports = __toCommonJS(en_exports);
11
24
  const EN_LOCALE = {
12
25
  command: {
13
26
  change: {
@@ -47,3 +60,7 @@ const EN_LOCALE = {
47
60
  }
48
61
  }
49
62
  };
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ EN_LOCALE
66
+ });
@@ -1,27 +1,37 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- i18n: function() {
14
- return i18n;
15
- },
16
- localeKeys: function() {
17
- return localeKeys;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var locale_exports = {};
20
+ __export(locale_exports, {
21
+ i18n: () => i18n,
22
+ localeKeys: () => localeKeys
19
23
  });
20
- const _plugini18n = require("@modern-js/plugin-i18n");
21
- const _zh = require("./zh");
22
- const _en = require("./en");
23
- const i18n = new _plugini18n.I18n();
24
+ module.exports = __toCommonJS(locale_exports);
25
+ var import_plugin_i18n = require("@modern-js/plugin-i18n");
26
+ var import_zh = require("./zh");
27
+ var import_en = require("./en");
28
+ const i18n = new import_plugin_i18n.I18n();
24
29
  const localeKeys = i18n.init("en", {
25
- zh: _zh.ZH_LOCALE,
26
- en: _en.EN_LOCALE
30
+ zh: import_zh.ZH_LOCALE,
31
+ en: import_en.EN_LOCALE
32
+ });
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ i18n,
36
+ localeKeys
27
37
  });
@@ -1,13 +1,26 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "ZH_LOCALE", {
6
- enumerable: true,
7
- get: function() {
8
- return ZH_LOCALE;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var zh_exports = {};
20
+ __export(zh_exports, {
21
+ ZH_LOCALE: () => ZH_LOCALE
10
22
  });
23
+ module.exports = __toCommonJS(zh_exports);
11
24
  const ZH_LOCALE = {
12
25
  command: {
13
26
  change: {
@@ -47,3 +60,7 @@ const ZH_LOCALE = {
47
60
  }
48
61
  }
49
62
  };
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ ZH_LOCALE
66
+ });
@@ -1,29 +1,49 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
6
9
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- CHANGESET_PATH: function() {
14
- return CHANGESET_PATH;
15
- },
16
- execaWithStreamLog: function() {
17
- return execaWithStreamLog;
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
17
  }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var changeset_exports = {};
30
+ __export(changeset_exports, {
31
+ CHANGESET_PATH: () => CHANGESET_PATH,
32
+ execaWithStreamLog: () => execaWithStreamLog
19
33
  });
20
- const _utils = require("@modern-js/utils");
34
+ module.exports = __toCommonJS(changeset_exports);
35
+ var import_utils = require("@modern-js/utils");
21
36
  const CHANGESET_PATH = require.resolve("@changesets/cli");
22
37
  function execaWithStreamLog(command, args) {
23
- const promise = (0, _utils.execa)(command, args, {
38
+ const promise = (0, import_utils.execa)(command, args, {
24
39
  stdin: "inherit",
25
40
  stdout: "inherit",
26
41
  stderr: "inherit"
27
42
  });
28
43
  return promise;
29
44
  }
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ CHANGESET_PATH,
48
+ execaWithStreamLog
49
+ });
@@ -1,6 +1,22 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var utils_exports = {};
17
+ module.exports = __toCommonJS(utils_exports);
18
+ __reExport(utils_exports, require("./changeset"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./changeset")
4
22
  });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./changeset"), exports);
@@ -1,5 +1,5 @@
1
1
  import { CHANGESET_PATH, execaWithStreamLog } from "../utils";
2
- export async function bump(options) {
2
+ async function bump(options) {
3
3
  const { snapshot, canary, preid, ignore } = options;
4
4
  const params = [
5
5
  CHANGESET_PATH,
@@ -42,3 +42,6 @@ export async function bump(options) {
42
42
  await execaWithStreamLog(process.execPath, params);
43
43
  }
44
44
  }
45
+ export {
46
+ bump
47
+ };
@@ -1,7 +1,7 @@
1
1
  import { isMonorepo, getMonorepoPackages, getPackageManager, logger } from "@modern-js/utils";
2
2
  import { CHANGESET_PATH, execaWithStreamLog } from "../utils";
3
3
  import { i18n, localeKeys } from "../locale";
4
- export async function change(options) {
4
+ async function change(options) {
5
5
  const appDir = process.cwd();
6
6
  if (isMonorepo(appDir)) {
7
7
  const packages = getMonorepoPackages(appDir);
@@ -26,3 +26,6 @@ export async function change(options) {
26
26
  }
27
27
  await execaWithStreamLog(process.execPath, params);
28
28
  }
29
+ export {
30
+ change
31
+ };
@@ -1,5 +1,5 @@
1
1
  import { CHANGESET_PATH, execaWithStreamLog } from "../utils";
2
- export async function pre(type, tag = "next") {
2
+ async function pre(type, tag = "next") {
3
3
  const params = [
4
4
  CHANGESET_PATH,
5
5
  "pre",
@@ -10,3 +10,6 @@ export async function pre(type, tag = "next") {
10
10
  }
11
11
  await execaWithStreamLog(process.execPath, params);
12
12
  }
13
+ export {
14
+ pre
15
+ };
@@ -2,7 +2,7 @@ import path from "path";
2
2
  import { getPackageManager, isMonorepo, fs, getPnpmVersion, semver } from "@modern-js/utils";
3
3
  import { tag as gitTag } from "@changesets/git";
4
4
  import { CHANGESET_PATH, execaWithStreamLog } from "../utils";
5
- export async function release(options) {
5
+ async function release(options) {
6
6
  const appDir = process.cwd();
7
7
  const packageManager = await getPackageManager(process.cwd());
8
8
  const params = [
@@ -52,3 +52,6 @@ export async function release(options) {
52
52
  await Promise.all((publishInfo.publishedPackages || []).map((pkg) => gitTag(`${pkg.name}@${pkg.version}`, appDir)));
53
53
  await fs.remove(pnpmPublishSummaryFile);
54
54
  }
55
+ export {
56
+ release
57
+ };
@@ -3,7 +3,7 @@ import resolveFrom from "resolve-from";
3
3
  import axios from "axios";
4
4
  import { fs, execa } from "@modern-js/utils";
5
5
  import readChangesets from "@changesets/read";
6
- export var CommitType;
6
+ var CommitType;
7
7
  (function(CommitType2) {
8
8
  CommitType2["Performance"] = "performance";
9
9
  CommitType2["Features"] = "features";
@@ -11,23 +11,23 @@ export var CommitType;
11
11
  CommitType2["Doc"] = "doc";
12
12
  CommitType2["Other"] = "other";
13
13
  })(CommitType || (CommitType = {}));
14
- export const ChangesTitle = `What's Changed`;
15
- export const ChangesZhTitle = "更新内容";
16
- export const CommitTypeTitle = {
14
+ const ChangesTitle = `What's Changed`;
15
+ const ChangesZhTitle = "更新内容";
16
+ const CommitTypeTitle = {
17
17
  performance: "Performance Improvements ⚡",
18
18
  features: "New Features 🎉",
19
19
  bugFix: "Bug Fixes 🐞",
20
20
  doc: "Docs update 📄",
21
21
  other: "Other Changes"
22
22
  };
23
- export const CommitTypeZhTitle = {
23
+ const CommitTypeZhTitle = {
24
24
  performance: "性能优化 ⚡",
25
25
  features: "新特性 🎉",
26
26
  bugFix: "Bug 修复 🐞",
27
27
  doc: "文档更新 📄",
28
28
  other: "其他变更"
29
29
  };
30
- export function getCommitType(message) {
30
+ function getCommitType(message) {
31
31
  if (message.startsWith("perf")) {
32
32
  return CommitType.Performance;
33
33
  }
@@ -43,7 +43,7 @@ export function getCommitType(message) {
43
43
  return CommitType.Other;
44
44
  }
45
45
  const AuthorMap = /* @__PURE__ */ new Map();
46
- export async function getReleaseInfo(commit, commitObj, repo, authToken) {
46
+ async function getReleaseInfo(commit, commitObj, repo, authToken) {
47
47
  const commitRegex = /(.*)\(#(\d*)\)/;
48
48
  const [commitId, message, email] = commit.split("--");
49
49
  const author = AuthorMap.get(email);
@@ -73,9 +73,8 @@ export async function getReleaseInfo(commit, commitObj, repo, authToken) {
73
73
  }
74
74
  return commitObj;
75
75
  }
76
- export function getReleaseNoteLine(commit, customReleaseNoteFunction, lang = "en") {
77
- var _customReleaseNoteFunction;
78
- if ((_customReleaseNoteFunction = customReleaseNoteFunction) === null || _customReleaseNoteFunction === void 0 ? void 0 : _customReleaseNoteFunction.getReleaseNoteLine) {
76
+ function getReleaseNoteLine(commit, customReleaseNoteFunction, lang = "en") {
77
+ if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseNoteLine) {
79
78
  return customReleaseNoteFunction.getReleaseNoteLine(commit, lang);
80
79
  }
81
80
  const { repository, pullRequestId, summary, summary_zh, author } = commit;
@@ -87,7 +86,7 @@ export function getReleaseNoteLine(commit, customReleaseNoteFunction, lang = "en
87
86
  return `- ${summary_zh}${author ? ` 由 @${author} 实现` : ""}${pullRequest ? `, 详情可查看 ${pullRequest}` : ""}
88
87
  `;
89
88
  }
90
- export async function genReleaseNote(options) {
89
+ async function genReleaseNote(options) {
91
90
  const cwd = process.cwd();
92
91
  const { repo, custom } = options;
93
92
  let repository = repo;
@@ -137,7 +136,6 @@ export async function genReleaseNote(options) {
137
136
  }
138
137
  };
139
138
  for (const changeset of changesets) {
140
- var _customReleaseNoteFunction;
141
139
  const { stdout } = await execa("git", [
142
140
  "log",
143
141
  "--pretty=format:%h--%s--%ae",
@@ -153,7 +151,7 @@ export async function genReleaseNote(options) {
153
151
  summary: firstLine,
154
152
  summary_zh: futureLines.filter((l) => Boolean(l)).join("\n")
155
153
  };
156
- if ((_customReleaseNoteFunction = customReleaseNoteFunction) === null || _customReleaseNoteFunction === void 0 ? void 0 : _customReleaseNoteFunction.getReleaseInfo) {
154
+ if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseInfo) {
157
155
  commitObj = await customReleaseNoteFunction.getReleaseInfo(stdout, commitObj);
158
156
  } else {
159
157
  commitObj = await getReleaseInfo(stdout, commitObj, repository, options.authToken);
@@ -199,3 +197,14 @@ ${result.zh}` : result.en;
199
197
  console.info(resultStr);
200
198
  return resultStr;
201
199
  }
200
+ export {
201
+ ChangesTitle,
202
+ ChangesZhTitle,
203
+ CommitType,
204
+ CommitTypeTitle,
205
+ CommitTypeZhTitle,
206
+ genReleaseNote,
207
+ getCommitType,
208
+ getReleaseInfo,
209
+ getReleaseNoteLine
210
+ };
@@ -1,5 +1,5 @@
1
1
  import { CHANGESET_PATH, execaWithStreamLog } from "../utils";
2
- export async function status(options) {
2
+ async function status(options) {
3
3
  const params = [
4
4
  CHANGESET_PATH,
5
5
  "status"
@@ -18,3 +18,6 @@ export async function status(options) {
18
18
  }
19
19
  await execaWithStreamLog(process.execPath, params);
20
20
  }
21
+ export {
22
+ status
23
+ };
package/dist/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
2
2
  import { change, bump, pre, release, status, genReleaseNote } from "./commands";
3
3
  import { i18n, localeKeys } from "./locale";
4
4
  export * from "./commands";
5
- export const changesetPlugin = () => ({
5
+ const changesetPlugin = () => ({
6
6
  name: "@modern-js/plugin-changeset",
7
7
  setup: () => {
8
8
  i18n.changeLanguage({
@@ -25,4 +25,8 @@ export const changesetPlugin = () => ({
25
25
  };
26
26
  }
27
27
  });
28
- export default changesetPlugin;
28
+ var src_default = changesetPlugin;
29
+ export {
30
+ changesetPlugin,
31
+ src_default as default
32
+ };
@@ -1,4 +1,4 @@
1
- export const EN_LOCALE = {
1
+ const EN_LOCALE = {
2
2
  command: {
3
3
  change: {
4
4
  describe: "create changeset",
@@ -37,3 +37,6 @@ export const EN_LOCALE = {
37
37
  }
38
38
  }
39
39
  };
40
+ export {
41
+ EN_LOCALE
42
+ };
@@ -6,4 +6,7 @@ const localeKeys = i18n.init("en", {
6
6
  zh: ZH_LOCALE,
7
7
  en: EN_LOCALE
8
8
  });
9
- export { i18n, localeKeys };
9
+ export {
10
+ i18n,
11
+ localeKeys
12
+ };
@@ -1,4 +1,4 @@
1
- export const ZH_LOCALE = {
1
+ const ZH_LOCALE = {
2
2
  command: {
3
3
  change: {
4
4
  describe: "创建变更集",
@@ -37,3 +37,6 @@ export const ZH_LOCALE = {
37
37
  }
38
38
  }
39
39
  };
40
+ export {
41
+ ZH_LOCALE
42
+ };
@@ -1,6 +1,6 @@
1
1
  import { execa } from "@modern-js/utils";
2
- export const CHANGESET_PATH = require.resolve("@changesets/cli");
3
- export function execaWithStreamLog(command, args) {
2
+ const CHANGESET_PATH = require.resolve("@changesets/cli");
3
+ function execaWithStreamLog(command, args) {
4
4
  const promise = execa(command, args, {
5
5
  stdin: "inherit",
6
6
  stdout: "inherit",
@@ -8,3 +8,7 @@ export function execaWithStreamLog(command, args) {
8
8
  });
9
9
  return promise;
10
10
  }
11
+ export {
12
+ CHANGESET_PATH,
13
+ execaWithStreamLog
14
+ };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.35.0",
18
+ "version": "2.36.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -52,17 +52,17 @@
52
52
  "resolve-from": "^5.0.0",
53
53
  "axios": "^1.2.1",
54
54
  "@swc/helpers": "0.5.1",
55
- "@modern-js/plugin-i18n": "2.35.0",
56
- "@modern-js/utils": "2.35.0"
55
+ "@modern-js/plugin-i18n": "2.36.0",
56
+ "@modern-js/utils": "2.36.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/jest": "^29",
60
60
  "@types/node": "^14",
61
61
  "typescript": "^5",
62
62
  "jest": "^29",
63
- "@modern-js/core": "2.35.0",
64
- "@scripts/jest-config": "2.35.0",
65
- "@scripts/build": "2.35.0"
63
+ "@modern-js/core": "2.36.0",
64
+ "@scripts/jest-config": "2.36.0",
65
+ "@scripts/build": "2.36.0"
66
66
  },
67
67
  "sideEffects": false,
68
68
  "publishConfig": {