@modern-js/upgrade 0.0.0-nightly-20241015170644 → 0.0.0-nightly-20241017170647

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/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-nightly-20241015170644",
18
+ "version": "0.0.0-nightly-20241017170647",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/index.d.ts",
21
21
  "main": "./dist/index.js",
@@ -36,21 +36,19 @@
36
36
  "default": "./dist/index.js"
37
37
  }
38
38
  },
39
- "dependencies": {
40
- "@modern-js/codesmith": "2.5.2",
41
- "@swc/helpers": "0.5.13",
42
- "@modern-js/plugin-i18n": "0.0.0-nightly-20241015170644",
43
- "@modern-js/utils": "0.0.0-nightly-20241015170644"
44
- },
45
39
  "devDependencies": {
40
+ "commander": "10.0.1",
41
+ "@modern-js/codesmith": "2.6.5",
42
+ "@modern-js/codesmith-utils": "2.6.5",
46
43
  "@types/jest": "^29",
47
44
  "@types/node": "^14",
48
45
  "jest": "^29",
49
46
  "ts-node": "^10.9.1",
50
47
  "typescript": "^5",
51
- "@modern-js/upgrade-generator": "0.0.0-nightly-20241015170644",
52
- "@scripts/build": "0.0.0-nightly-20241015170644",
53
- "@scripts/jest-config": "0.0.0-nightly-20241015170644"
48
+ "@modern-js/plugin-i18n": "0.0.0-nightly-20241017170647",
49
+ "@modern-js/upgrade-generator": "0.0.0-nightly-20241017170647",
50
+ "@scripts/jest-config": "0.0.0-nightly-20241017170647",
51
+ "@scripts/build": "0.0.0-nightly-20241017170647"
54
52
  },
55
53
  "sideEffects": false,
56
54
  "publishConfig": {
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Command } from '@modern-js/utils/commander';
2
- import type { Options } from './upgrade';
3
- export type { Options };
4
- export declare function defineCommand(program: Command): void;
5
- declare const _default: () => void;
6
- export default _default;
@@ -1,11 +0,0 @@
1
- export declare const EN_LOCALE: {
2
- command: {
3
- describe: string;
4
- distTag: string;
5
- registry: string;
6
- debug: string;
7
- cwd: string;
8
- noNeedInstall: string;
9
- config: string;
10
- };
11
- };
package/dist/locale/en.js DELETED
@@ -1,38 +0,0 @@
1
- "use strict";
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 });
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
22
- });
23
- module.exports = __toCommonJS(en_exports);
24
- const EN_LOCALE = {
25
- command: {
26
- describe: "upgrade modern package to latest",
27
- distTag: `use specified tag version for it's generator`,
28
- registry: "set npm registry url to run npm command",
29
- debug: "using debug mode to log something",
30
- cwd: "project path",
31
- noNeedInstall: "not run install command",
32
- config: "specify the configuration file, which can be a relative or absolute path"
33
- }
34
- };
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- EN_LOCALE
38
- });
@@ -1,24 +0,0 @@
1
- import { I18n } from '@modern-js/plugin-i18n';
2
- declare const i18n: I18n;
3
- declare const localeKeys: {
4
- command: {
5
- describe: string;
6
- distTag: string;
7
- registry: string;
8
- debug: string;
9
- cwd: string;
10
- noNeedInstall: string;
11
- config: string;
12
- };
13
- } | {
14
- command: {
15
- describe: string;
16
- distTag: string;
17
- registry: string;
18
- debug: string;
19
- noNeedInstall: string;
20
- cwd: string;
21
- config: string;
22
- };
23
- };
24
- export { i18n, localeKeys };
@@ -1,37 +0,0 @@
1
- "use strict";
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 });
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
23
- });
24
- module.exports = __toCommonJS(locale_exports);
25
- var import_plugin_i18n = require("@modern-js/plugin-i18n");
26
- var import_en = require("./en");
27
- var import_zh = require("./zh");
28
- const i18n = new import_plugin_i18n.I18n();
29
- const localeKeys = i18n.init("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
37
- });
@@ -1,11 +0,0 @@
1
- export declare const ZH_LOCALE: {
2
- command: {
3
- describe: string;
4
- distTag: string;
5
- registry: string;
6
- debug: string;
7
- noNeedInstall: string;
8
- cwd: string;
9
- config: string;
10
- };
11
- };
package/dist/locale/zh.js DELETED
@@ -1,38 +0,0 @@
1
- "use strict";
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 });
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
22
- });
23
- module.exports = __toCommonJS(zh_exports);
24
- const ZH_LOCALE = {
25
- command: {
26
- describe: "升级 Modern.js 到最新版本",
27
- distTag: "升级时底层生成器使用特殊的 npm Tag",
28
- registry: "定制 npm registry",
29
- debug: "开启 Debug 模式,打印调试日志信息",
30
- noNeedInstall: "无需安装依赖",
31
- cwd: "项目路径",
32
- config: "指定配置文件路径,可以为相对路径或绝对路径"
33
- }
34
- };
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- ZH_LOCALE
38
- });
package/dist/upgrade.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export interface Options {
2
- cwd?: string;
3
- debug?: boolean;
4
- distTag?: string;
5
- registry?: string;
6
- needInstall?: boolean;
7
- }
8
- export declare function upgradeAction(options: Options): Promise<void>;
package/dist/upgrade.js DELETED
@@ -1,61 +0,0 @@
1
- "use strict";
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 });
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
22
- });
23
- module.exports = __toCommonJS(upgrade_exports);
24
- var import_codesmith = require("@modern-js/codesmith");
25
- const UPGRADE_GENERATOR = "@modern-js/upgrade-generator";
26
- async function upgradeAction(options) {
27
- const { cwd = process.cwd(), debug = false, distTag, registry, needInstall } = options;
28
- const projectDir = cwd;
29
- const smith = new import_codesmith.CodeSmith({
30
- debug
31
- });
32
- smith.logger.debug("@modern-js/upgrade", projectDir || "", options);
33
- let generator = UPGRADE_GENERATOR;
34
- if (process.env.CODESMITH_ENV === "development") {
35
- generator = require.resolve(UPGRADE_GENERATOR);
36
- } else if (distTag) {
37
- generator = `${UPGRADE_GENERATOR}@${distTag}`;
38
- }
39
- try {
40
- await smith.forge({
41
- tasks: [
42
- {
43
- generator,
44
- config: {
45
- debug,
46
- distTag,
47
- registry,
48
- noNeedInstall: !needInstall
49
- }
50
- }
51
- ],
52
- pwd: cwd
53
- });
54
- } catch (e) {
55
- process.exit(1);
56
- }
57
- }
58
- // Annotate the CommonJS export names for ESM import in node:
59
- 0 && (module.exports = {
60
- upgradeAction
61
- });