@modern-js/upgrade-generator 3.3.9 → 3.3.11
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 +32 -28
- package/package.json +10 -10
- package/src/index.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -52668,12 +52668,12 @@ function _define_property(obj, key, value) {
|
|
|
52668
52668
|
return obj;
|
|
52669
52669
|
}
|
|
52670
52670
|
|
|
52671
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
52671
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
52672
52672
|
var import_utils13 = require("@modern-js/utils");
|
|
52673
52673
|
var import_lodash5 = require("@modern-js/utils/lodash");
|
|
52674
52674
|
var import_comment_json = __toESM(require_src2());
|
|
52675
52675
|
|
|
52676
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
52676
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/env.js
|
|
52677
52677
|
var import_utils = require("@modern-js/utils");
|
|
52678
52678
|
async function canUseNvm() {
|
|
52679
52679
|
try {
|
|
@@ -52723,7 +52723,7 @@ async function canUsePnpm() {
|
|
|
52723
52723
|
}
|
|
52724
52724
|
}
|
|
52725
52725
|
|
|
52726
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
52726
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/utils/install.js
|
|
52727
52727
|
var import_utils2 = require("@modern-js/utils");
|
|
52728
52728
|
function execaWithStreamLog(command, args, options) {
|
|
52729
52729
|
const promise = (0, import_utils2.execa)(command, args, {
|
|
@@ -52819,7 +52819,7 @@ async function pnpmInstall({ cwd, registryUrl, ignoreScripts, useNvm }) {
|
|
|
52819
52819
|
throw new Error("please install pnpm first");
|
|
52820
52820
|
}
|
|
52821
52821
|
|
|
52822
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.
|
|
52822
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-npm@2.3.5/node_modules/@modern-js/codesmith-api-npm/dist/esm-node/index.js
|
|
52823
52823
|
var NpmAPI = class {
|
|
52824
52824
|
npmInstall({ cwd, registryUrl, ignoreScripts }) {
|
|
52825
52825
|
return npmInstall({
|
|
@@ -52848,7 +52848,7 @@ var NpmAPI = class {
|
|
|
52848
52848
|
}
|
|
52849
52849
|
};
|
|
52850
52850
|
|
|
52851
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
|
52851
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-git/dist/esm-node/utils/index.js
|
|
52852
52852
|
var import_utils4 = require("@modern-js/utils");
|
|
52853
52853
|
async function canUseGit() {
|
|
52854
52854
|
try {
|
|
@@ -52923,7 +52923,7 @@ async function gitCommit(cwd, commitMessage) {
|
|
|
52923
52923
|
});
|
|
52924
52924
|
}
|
|
52925
52925
|
|
|
52926
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.
|
|
52926
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-git@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-git/dist/esm-node/index.js
|
|
52927
52927
|
var GitAPI = class {
|
|
52928
52928
|
async isInGitRepo(cwd = this.generatorCore.outputPath) {
|
|
52929
52929
|
const canUse = await canUseGit();
|
|
@@ -52975,12 +52975,12 @@ var GitAPI = class {
|
|
|
52975
52975
|
}
|
|
52976
52976
|
};
|
|
52977
52977
|
|
|
52978
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
52978
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/materials/FsResource.js
|
|
52979
52979
|
var import_path = __toESM(require("path"));
|
|
52980
52980
|
var import_utils6 = require("@modern-js/utils");
|
|
52981
52981
|
var FS_RESOURCE = "_codesmith_core_fs_resource";
|
|
52982
52982
|
|
|
52983
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.
|
|
52983
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith/dist/esm-node/utils/fsExists.js
|
|
52984
52984
|
var import_utils7 = require("@modern-js/utils");
|
|
52985
52985
|
async function fsExists(path6) {
|
|
52986
52986
|
try {
|
|
@@ -52991,7 +52991,7 @@ async function fsExists(path6) {
|
|
|
52991
52991
|
}
|
|
52992
52992
|
}
|
|
52993
52993
|
|
|
52994
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
|
52994
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/utils/renderString.js
|
|
52995
52995
|
var import_handlebars = __toESM(require_lib());
|
|
52996
52996
|
function renderString(template, fullData, registers) {
|
|
52997
52997
|
const helpers = {
|
|
@@ -53005,7 +53005,7 @@ function renderString(template, fullData, registers) {
|
|
|
53005
53005
|
return import_handlebars.default.compile(template)(fullData) || "";
|
|
53006
53006
|
}
|
|
53007
53007
|
|
|
53008
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.
|
|
53008
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-handlebars@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-handlebars/dist/esm-node/index.js
|
|
53009
53009
|
var HandlebarsAPI = class {
|
|
53010
53010
|
async registerHelp(helpers) {
|
|
53011
53011
|
this.registers.helpers = {
|
|
@@ -53055,13 +53055,13 @@ var HandlebarsAPI = class {
|
|
|
53055
53055
|
}
|
|
53056
53056
|
};
|
|
53057
53057
|
|
|
53058
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
|
53058
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/utils/renderString.js
|
|
53059
53059
|
var import_ejs = __toESM(require_ejs());
|
|
53060
53060
|
function renderString2(template, fullData) {
|
|
53061
53061
|
return import_ejs.default.render(template, fullData) || "";
|
|
53062
53062
|
}
|
|
53063
53063
|
|
|
53064
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.
|
|
53064
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-ejs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-ejs/dist/esm-node/index.js
|
|
53065
53065
|
var EjsAPI = class {
|
|
53066
53066
|
async renderTemplate(templateResource, target, parameters = {}) {
|
|
53067
53067
|
if (templateResource._type !== FS_RESOURCE) {
|
|
@@ -53094,7 +53094,7 @@ var EjsAPI = class {
|
|
|
53094
53094
|
}
|
|
53095
53095
|
};
|
|
53096
53096
|
|
|
53097
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.
|
|
53097
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-fs@2.3.5_@modern-js+codesmith@2.3.5/node_modules/@modern-js/codesmith-api-fs/dist/esm-node/index.js
|
|
53098
53098
|
var import_path2 = __toESM(require("path"));
|
|
53099
53099
|
var import_utils10 = require("@modern-js/utils");
|
|
53100
53100
|
var FsAPI = class {
|
|
@@ -62678,10 +62678,10 @@ var Schema = (
|
|
|
62678
62678
|
}()
|
|
62679
62679
|
);
|
|
62680
62680
|
|
|
62681
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
62681
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
62682
62682
|
var import_inquirer = __toESM(require_inquirer());
|
|
62683
62683
|
|
|
62684
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
62684
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/transform.js
|
|
62685
62685
|
var import_lodash = require("@modern-js/utils/lodash");
|
|
62686
62686
|
function validateSchema(schema) {
|
|
62687
62687
|
const { type, properties } = schema;
|
|
@@ -62773,7 +62773,7 @@ function transformForm(schema, configValue = {}, validateMap, initValue) {
|
|
|
62773
62773
|
return getQuestionFromSchema(schema, configValue, validateMap, initValue);
|
|
62774
62774
|
}
|
|
62775
62775
|
|
|
62776
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
62776
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/prompt.js
|
|
62777
62777
|
var compileRule = (rule, scope) => {
|
|
62778
62778
|
const state = Schema.compile(rule, {
|
|
62779
62779
|
$self: {},
|
|
@@ -62877,7 +62877,7 @@ async function prompt(schema, configValue = {}, validateMap, initValue) {
|
|
|
62877
62877
|
return answers;
|
|
62878
62878
|
}
|
|
62879
62879
|
|
|
62880
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.
|
|
62880
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-formily@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-formily/dist/esm-node/inquirer.js
|
|
62881
62881
|
var CLIReader = class {
|
|
62882
62882
|
getAnswers() {
|
|
62883
62883
|
return this.answers;
|
|
@@ -62908,7 +62908,7 @@ var CLIReader = class {
|
|
|
62908
62908
|
}
|
|
62909
62909
|
};
|
|
62910
62910
|
|
|
62911
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
62911
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
62912
62912
|
var import_inquirer2 = __toESM(require_inquirer2());
|
|
62913
62913
|
|
|
62914
62914
|
// ../../../../node_modules/.pnpm/@modern-js+plugin-i18n@2.37.2/node_modules/@modern-js/plugin-i18n/dist/esm-node/index.js
|
|
@@ -62974,7 +62974,7 @@ var I18n = class {
|
|
|
62974
62974
|
}
|
|
62975
62975
|
};
|
|
62976
62976
|
|
|
62977
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
62977
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/zh.js
|
|
62978
62978
|
var ZH_LOCALE = {
|
|
62979
62979
|
environment: {
|
|
62980
62980
|
node_version: "请升级 Node 版本至 LIS",
|
|
@@ -63001,7 +63001,7 @@ var ZH_LOCALE = {
|
|
|
63001
63001
|
}
|
|
63002
63002
|
};
|
|
63003
63003
|
|
|
63004
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63004
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/en.js
|
|
63005
63005
|
var EN_LOCALE = {
|
|
63006
63006
|
environment: {
|
|
63007
63007
|
node_version: "please upgrade node to lts version",
|
|
@@ -63028,14 +63028,14 @@ var EN_LOCALE = {
|
|
|
63028
63028
|
}
|
|
63029
63029
|
};
|
|
63030
63030
|
|
|
63031
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63031
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/locale/index.js
|
|
63032
63032
|
var i18n = new I18n();
|
|
63033
63033
|
var localeKeys = i18n.init("zh", {
|
|
63034
63034
|
zh: ZH_LOCALE,
|
|
63035
63035
|
en: EN_LOCALE
|
|
63036
63036
|
});
|
|
63037
63037
|
|
|
63038
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63038
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/transform.js
|
|
63039
63039
|
var import_lodash4 = require("@modern-js/utils/lodash");
|
|
63040
63040
|
function transformInquirerSchema(questions, configValue = {}, validateMap = {}, initValue = {}) {
|
|
63041
63041
|
for (const question of questions) {
|
|
@@ -63063,7 +63063,7 @@ function transformInquirerSchema(questions, configValue = {}, validateMap = {},
|
|
|
63063
63063
|
return questions;
|
|
63064
63064
|
}
|
|
63065
63065
|
|
|
63066
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63066
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/utils/checkUseNvm.js
|
|
63067
63067
|
var import_path4 = __toESM(require("path"));
|
|
63068
63068
|
var import_utils12 = require("@modern-js/utils");
|
|
63069
63069
|
var NODE_MAJOR_VERSION_MAP = {
|
|
@@ -63111,7 +63111,7 @@ async function checkUseNvm(cwd, logger2) {
|
|
|
63111
63111
|
}
|
|
63112
63112
|
}
|
|
63113
63113
|
|
|
63114
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.
|
|
63114
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-app@2.3.5_@modern-js+codesmith@2.3.5_typescript@5.3.3/node_modules/@modern-js/codesmith-api-app/dist/esm-node/index.js
|
|
63115
63115
|
var AppAPI = class {
|
|
63116
63116
|
async checkEnvironment(nodeVersion) {
|
|
63117
63117
|
if (import_utils13.semver.lt(process.versions.node, nodeVersion || "12.22.12")) {
|
|
@@ -63351,11 +63351,11 @@ var AppAPI = class {
|
|
|
63351
63351
|
}
|
|
63352
63352
|
};
|
|
63353
63353
|
|
|
63354
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
63354
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
|
63355
63355
|
var import_comment_json2 = __toESM(require_src2());
|
|
63356
63356
|
var declarationUpdate = __toESM(require_dist());
|
|
63357
63357
|
|
|
63358
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
63358
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/utils/index.js
|
|
63359
63359
|
async function editJson(generatorCore, resource, getNewJsonValue) {
|
|
63360
63360
|
const originJsonValue = await resource.value();
|
|
63361
63361
|
const newJsonString = await getNewJsonValue(originJsonValue.content);
|
|
@@ -63368,7 +63368,7 @@ async function editJson(generatorCore, resource, getNewJsonValue) {
|
|
|
63368
63368
|
return newJsonString;
|
|
63369
63369
|
}
|
|
63370
63370
|
|
|
63371
|
-
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.
|
|
63371
|
+
// ../../../../node_modules/.pnpm/@modern-js+codesmith-api-json@2.3.5/node_modules/@modern-js/codesmith-api-json/dist/esm-node/index.js
|
|
63372
63372
|
var JsonAPI = class {
|
|
63373
63373
|
async get(resource) {
|
|
63374
63374
|
const originJsonValue = await resource.value();
|
|
@@ -63893,7 +63893,11 @@ var i18n3 = new I18n2();
|
|
|
63893
63893
|
var localeKeys3 = i18n3.init("en", { zh: ZH_LOCALE3, en: EN_LOCALE3 });
|
|
63894
63894
|
|
|
63895
63895
|
// src/index.ts
|
|
63896
|
-
var SpecialModernDeps = [
|
|
63896
|
+
var SpecialModernDeps = [
|
|
63897
|
+
"@modern-js/plugin-storybook",
|
|
63898
|
+
"@modern-js/builder-rspack-provider"
|
|
63899
|
+
// need be removed after 2.46.1
|
|
63900
|
+
];
|
|
63897
63901
|
var handleSpecialModernDeps = async (dep, modernVersion) => {
|
|
63898
63902
|
const version = await getAvailableVersion(dep, modernVersion);
|
|
63899
63903
|
if (!await isPackageExist(`${dep}@${version}`)) {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.3.
|
|
18
|
+
"version": "3.3.11",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"/dist/index.js"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@modern-js/
|
|
26
|
+
"@modern-js/codesmith": "2.3.5",
|
|
27
|
+
"@modern-js/codesmith-api-app": "2.3.5",
|
|
28
|
+
"@modern-js/codesmith-api-json": "2.3.5",
|
|
29
|
+
"@modern-js/generator-common": "3.3.11",
|
|
30
|
+
"@modern-js/utils": "2.48.0",
|
|
31
|
+
"@modern-js/generator-utils": "3.3.11",
|
|
32
|
+
"@modern-js/plugin-i18n": "2.48.0"
|
|
27
33
|
},
|
|
28
34
|
"devDependencies": {
|
|
29
|
-
"@modern-js/codesmith": "2.3.4",
|
|
30
|
-
"@modern-js/codesmith-api-app": "2.3.4",
|
|
31
|
-
"@modern-js/codesmith-api-json": "2.3.4",
|
|
32
35
|
"@types/jest": "^29",
|
|
33
36
|
"@types/node": "^14",
|
|
34
37
|
"jest": "^29",
|
|
35
38
|
"typescript": "^5",
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@scripts/build": "2.47.0",
|
|
39
|
-
"@scripts/jest-config": "2.47.0",
|
|
40
|
-
"@modern-js/generator-common": "3.3.9"
|
|
39
|
+
"@scripts/build": "2.48.0",
|
|
40
|
+
"@scripts/jest-config": "2.48.0"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"publishConfig": {
|
package/src/index.ts
CHANGED
|
@@ -23,7 +23,10 @@ import {
|
|
|
23
23
|
import { i18n, localeKeys } from './locale';
|
|
24
24
|
|
|
25
25
|
// Special modern.js dependencies, the plugin version maybe not same with other modern.js plugin
|
|
26
|
-
const SpecialModernDeps = [
|
|
26
|
+
const SpecialModernDeps = [
|
|
27
|
+
'@modern-js/plugin-storybook',
|
|
28
|
+
'@modern-js/builder-rspack-provider', // need be removed after 2.46.1
|
|
29
|
+
];
|
|
27
30
|
|
|
28
31
|
const handleSpecialModernDeps = async (dep: string, modernVersion: string) => {
|
|
29
32
|
const version = await getAvailableVersion(dep, modernVersion);
|