@modern-js/plugin-changeset 2.12.0 → 2.13.1
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 +24 -0
- package/dist/cjs/commands/releaseNote.js +3 -3
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/locale/index.js +1 -1
- package/dist/cjs/utils/index.js +0 -1
- package/dist/esm/commands/releaseNote.js +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/locale/index.js +1 -1
- package/dist/esm/utils/index.js +0 -1
- package/dist/types/utils/index.d.ts +1 -2
- package/package.json +6 -6
- package/dist/cjs/utils/language.js +0 -31
- package/dist/esm/utils/language.js +0 -8
- package/dist/types/utils/language.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @modern-js/plugin-changeset
|
|
2
2
|
|
|
3
|
+
## 2.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @modern-js/plugin-i18n@2.13.1
|
|
8
|
+
- @modern-js/utils@2.13.1
|
|
9
|
+
|
|
10
|
+
## 2.13.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 034f36b: feat: set the default language of CLI to English
|
|
15
|
+
|
|
16
|
+
feat: 将命令行的默认语言设置为英文
|
|
17
|
+
|
|
18
|
+
- 034f36b: fix(upgrade): i18n of upgrade command not work
|
|
19
|
+
|
|
20
|
+
fix(upgrade): 修复 upgrade 命令的 i18n 配置不生效的问题
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [034f36b]
|
|
23
|
+
- Updated dependencies [034f36b]
|
|
24
|
+
- @modern-js/plugin-i18n@2.13.0
|
|
25
|
+
- @modern-js/utils@2.13.0
|
|
26
|
+
|
|
3
27
|
## 2.12.0
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -103,7 +103,7 @@ async function genReleaseNote(options) {
|
|
|
103
103
|
if (typeof possibleReleaseNoteFunc.getReleaseInfo === "function" && typeof possibleReleaseNoteFunc.getReleaseNoteLine === "function") {
|
|
104
104
|
customReleaseNoteFunction = possibleReleaseNoteFunc;
|
|
105
105
|
} else {
|
|
106
|
-
throw new Error("Could not resolve
|
|
106
|
+
throw new Error("Could not resolve release note generation functions");
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
const changesets = await (0, import_read.default)(cwd);
|
|
@@ -160,11 +160,11 @@ async function genReleaseNote(options) {
|
|
|
160
160
|
if (bugFix.length) {
|
|
161
161
|
result += "## Bug Fix:\n";
|
|
162
162
|
for (const commit of bugFix) {
|
|
163
|
-
const
|
|
163
|
+
const releaseNote = await getReleaseNoteLine(
|
|
164
164
|
commit,
|
|
165
165
|
customReleaseNoteFunction
|
|
166
166
|
);
|
|
167
|
-
result +=
|
|
167
|
+
result += releaseNote;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
console.info(result);
|
package/dist/cjs/index.js
CHANGED
|
@@ -21,14 +21,14 @@ __export(src_exports, {
|
|
|
21
21
|
default: () => src_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(src_exports);
|
|
24
|
+
var import_language_detector = require("@modern-js/plugin-i18n/language-detector");
|
|
24
25
|
var import_commands = require("./commands");
|
|
25
26
|
var import_locale = require("./locale");
|
|
26
|
-
var import_utils = require("./utils");
|
|
27
27
|
__reExport(src_exports, require("./commands"), module.exports);
|
|
28
28
|
var src_default = () => ({
|
|
29
29
|
name: "@modern-js/plugin-changeset",
|
|
30
30
|
setup: () => {
|
|
31
|
-
import_locale.i18n.changeLanguage({ locale: (0,
|
|
31
|
+
import_locale.i18n.changeLanguage({ locale: (0, import_language_detector.getLocaleLanguage)() });
|
|
32
32
|
return {
|
|
33
33
|
commands({ program }) {
|
|
34
34
|
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));
|
package/dist/cjs/locale/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var import_plugin_i18n = require("@modern-js/plugin-i18n");
|
|
|
25
25
|
var import_zh = require("./zh");
|
|
26
26
|
var import_en = require("./en");
|
|
27
27
|
const i18n = new import_plugin_i18n.I18n();
|
|
28
|
-
const localeKeys = i18n.init("
|
|
28
|
+
const localeKeys = i18n.init("en", { zh: import_zh.ZH_LOCALE, en: import_en.EN_LOCALE });
|
|
29
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
30
|
0 && (module.exports = {
|
|
31
31
|
i18n,
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -15,4 +15,3 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
15
15
|
var utils_exports = {};
|
|
16
16
|
module.exports = __toCommonJS(utils_exports);
|
|
17
17
|
__reExport(utils_exports, require("./changeset"), module.exports);
|
|
18
|
-
__reExport(utils_exports, require("./language"), module.exports);
|
|
@@ -69,7 +69,7 @@ async function genReleaseNote(options) {
|
|
|
69
69
|
if (typeof possibleReleaseNoteFunc.getReleaseInfo === "function" && typeof possibleReleaseNoteFunc.getReleaseNoteLine === "function") {
|
|
70
70
|
customReleaseNoteFunction = possibleReleaseNoteFunc;
|
|
71
71
|
} else {
|
|
72
|
-
throw new Error("Could not resolve
|
|
72
|
+
throw new Error("Could not resolve release note generation functions");
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
const changesets = await readChangesets(cwd);
|
|
@@ -126,11 +126,11 @@ async function genReleaseNote(options) {
|
|
|
126
126
|
if (bugFix.length) {
|
|
127
127
|
result += "## Bug Fix:\n";
|
|
128
128
|
for (const commit of bugFix) {
|
|
129
|
-
const
|
|
129
|
+
const releaseNote = await getReleaseNoteLine(
|
|
130
130
|
commit,
|
|
131
131
|
customReleaseNoteFunction
|
|
132
132
|
);
|
|
133
|
-
result +=
|
|
133
|
+
result += releaseNote;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
console.info(result);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
|
1
2
|
import { change, bump, pre, release, status, genReleaseNote } from "./commands";
|
|
2
3
|
import { i18n, localeKeys } from "./locale";
|
|
3
|
-
import { getLocaleLanguage } from "./utils";
|
|
4
4
|
export * from "./commands";
|
|
5
5
|
var src_default = () => ({
|
|
6
6
|
name: "@modern-js/plugin-changeset",
|
package/dist/esm/locale/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { I18n } from "@modern-js/plugin-i18n";
|
|
|
2
2
|
import { ZH_LOCALE } from "./zh";
|
|
3
3
|
import { EN_LOCALE } from "./en";
|
|
4
4
|
const i18n = new I18n();
|
|
5
|
-
const localeKeys = i18n.init("
|
|
5
|
+
const localeKeys = i18n.init("en", { zh: ZH_LOCALE, en: EN_LOCALE });
|
|
6
6
|
export {
|
|
7
7
|
i18n,
|
|
8
8
|
localeKeys
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from './changeset';
|
|
2
|
-
export * from './language';
|
|
1
|
+
export * from './changeset';
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.13.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/cjs/index.js",
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
"@changesets/git": "^1.3.2",
|
|
48
48
|
"@changesets/read": "^0.5.5",
|
|
49
49
|
"resolve-from": "^5.0.0",
|
|
50
|
-
"@modern-js/plugin-i18n": "2.
|
|
51
|
-
"@modern-js/utils": "2.
|
|
50
|
+
"@modern-js/plugin-i18n": "2.13.1",
|
|
51
|
+
"@modern-js/utils": "2.13.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/jest": "^29",
|
|
55
55
|
"@types/node": "^14",
|
|
56
56
|
"typescript": "^4",
|
|
57
57
|
"jest": "^29",
|
|
58
|
-
"@modern-js/core": "2.
|
|
59
|
-
"@scripts/build": "2.
|
|
60
|
-
"@scripts/jest-config": "2.
|
|
58
|
+
"@modern-js/core": "2.13.1",
|
|
59
|
+
"@scripts/build": "2.13.1",
|
|
60
|
+
"@scripts/jest-config": "2.13.1"
|
|
61
61
|
},
|
|
62
62
|
"sideEffects": false,
|
|
63
63
|
"publishConfig": {
|
|
@@ -1,31 +0,0 @@
|
|
|
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 });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var language_exports = {};
|
|
19
|
-
__export(language_exports, {
|
|
20
|
-
getLocaleLanguage: () => getLocaleLanguage
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(language_exports);
|
|
23
|
-
var import_language_detector = require("@modern-js/plugin-i18n/language-detector");
|
|
24
|
-
function getLocaleLanguage() {
|
|
25
|
-
const detector = new import_language_detector.I18CLILanguageDetector();
|
|
26
|
-
return detector.detect();
|
|
27
|
-
}
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
getLocaleLanguage
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getLocaleLanguage(): string;
|