@modern-js/upgrade 2.35.1 → 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.
- package/dist/index.js +43 -25
- package/dist/locale/en.js +24 -7
- package/dist/locale/index.js +31 -21
- package/dist/locale/zh.js +24 -7
- package/dist/upgrade.js +26 -9
- package/package.json +6 -6
package/dist/index.js
CHANGED
@@ -1,38 +1,56 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return defineCommand;
|
15
|
-
},
|
16
|
-
default: function() {
|
17
|
-
return _default;
|
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 src_exports = {};
|
30
|
+
__export(src_exports, {
|
31
|
+
default: () => src_default,
|
32
|
+
defineCommand: () => defineCommand
|
19
33
|
});
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
35
|
+
var import_language_detector = require("@modern-js/plugin-i18n/language-detector");
|
36
|
+
var import_commander = require("@modern-js/utils/commander");
|
37
|
+
var import_locale = require("./locale");
|
24
38
|
function defineCommand(program) {
|
25
|
-
const locale = (0,
|
26
|
-
|
39
|
+
const locale = (0, import_language_detector.getLocaleLanguage)();
|
40
|
+
import_locale.i18n.changeLanguage({
|
27
41
|
locale
|
28
42
|
});
|
29
|
-
program.description(
|
30
|
-
const { upgradeAction } = await Promise.resolve().then(() =>
|
43
|
+
program.description(import_locale.i18n.t(import_locale.localeKeys.command.describe)).option("--dist-tag <distTag>", import_locale.i18n.t(import_locale.localeKeys.command.distTag), "").option("--registry <registry>", import_locale.i18n.t(import_locale.localeKeys.command.registry), "").option("-d,--debug", import_locale.i18n.t(import_locale.localeKeys.command.debug), false).option("--cwd <cwd>", import_locale.i18n.t(import_locale.localeKeys.command.cwd), "").option("--no-need-install", import_locale.i18n.t(import_locale.localeKeys.command.noNeedInstall)).action(async (params) => {
|
44
|
+
const { upgradeAction } = await Promise.resolve().then(() => __toESM(require("./upgrade")));
|
31
45
|
return upgradeAction(params);
|
32
46
|
});
|
33
47
|
}
|
34
|
-
|
35
|
-
const program = new
|
48
|
+
var src_default = () => {
|
49
|
+
const program = new import_commander.Command();
|
36
50
|
defineCommand(program);
|
37
51
|
program.parse(process.argv);
|
38
52
|
};
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
54
|
+
0 && (module.exports = {
|
55
|
+
defineCommand
|
56
|
+
});
|
package/dist/locale/en.js
CHANGED
@@ -1,13 +1,26 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
Object.
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
describe: "upgrade modern package to latest",
|
@@ -18,3 +31,7 @@ const EN_LOCALE = {
|
|
18
31
|
noNeedInstall: "not run install command"
|
19
32
|
}
|
20
33
|
};
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
35
|
+
0 && (module.exports = {
|
36
|
+
EN_LOCALE
|
37
|
+
});
|
package/dist/locale/index.js
CHANGED
@@ -1,27 +1,37 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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:
|
26
|
-
en:
|
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
|
});
|
package/dist/locale/zh.js
CHANGED
@@ -1,13 +1,26 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
Object.
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
describe: "升级 Modern.js 到最新版本",
|
@@ -18,3 +31,7 @@ const ZH_LOCALE = {
|
|
18
31
|
cwd: "项目路径"
|
19
32
|
}
|
20
33
|
};
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
35
|
+
0 && (module.exports = {
|
36
|
+
ZH_LOCALE
|
37
|
+
});
|
package/dist/upgrade.js
CHANGED
@@ -1,19 +1,32 @@
|
|
1
1
|
"use strict";
|
2
|
-
Object.defineProperty
|
3
|
-
|
4
|
-
|
5
|
-
Object.
|
6
|
-
|
7
|
-
|
8
|
-
|
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 upgrade_exports = {};
|
20
|
+
__export(upgrade_exports, {
|
21
|
+
upgradeAction: () => upgradeAction
|
10
22
|
});
|
11
|
-
|
23
|
+
module.exports = __toCommonJS(upgrade_exports);
|
24
|
+
var import_codesmith = require("@modern-js/codesmith");
|
12
25
|
const UPGRADE_GENERATOR = "@modern-js/upgrade-generator";
|
13
26
|
async function upgradeAction(options) {
|
14
27
|
const { cwd = process.cwd(), debug = false, distTag, registry, needInstall } = options;
|
15
28
|
const projectDir = cwd;
|
16
|
-
const smith = new
|
29
|
+
const smith = new import_codesmith.CodeSmith({
|
17
30
|
debug
|
18
31
|
});
|
19
32
|
smith.logger.debug("@modern-js/upgrade", projectDir || "", options);
|
@@ -42,3 +55,7 @@ async function upgradeAction(options) {
|
|
42
55
|
process.exit(1);
|
43
56
|
}
|
44
57
|
}
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
59
|
+
0 && (module.exports = {
|
60
|
+
upgradeAction
|
61
|
+
});
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.36.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/index.d.ts",
|
21
21
|
"main": "./dist/index.js",
|
@@ -35,8 +35,8 @@
|
|
35
35
|
"dependencies": {
|
36
36
|
"@modern-js/codesmith": "2.2.5",
|
37
37
|
"@swc/helpers": "0.5.1",
|
38
|
-
"@modern-js/plugin-i18n": "2.
|
39
|
-
"@modern-js/utils": "2.
|
38
|
+
"@modern-js/plugin-i18n": "2.36.0",
|
39
|
+
"@modern-js/utils": "2.36.0"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
42
|
"@types/jest": "^29",
|
@@ -44,9 +44,9 @@
|
|
44
44
|
"jest": "^29",
|
45
45
|
"ts-node": "^10.9.1",
|
46
46
|
"typescript": "^5",
|
47
|
-
"@
|
48
|
-
"@
|
49
|
-
"@scripts/jest-config": "2.
|
47
|
+
"@scripts/build": "2.36.0",
|
48
|
+
"@modern-js/upgrade-generator": "3.2.3",
|
49
|
+
"@scripts/jest-config": "2.36.0"
|
50
50
|
},
|
51
51
|
"sideEffects": false,
|
52
52
|
"publishConfig": {
|