@modern-js/bff-generator 3.1.8 → 3.1.10
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 +208 -103
- package/package.json +11 -7
package/dist/index.js
CHANGED
|
@@ -118738,7 +118738,9 @@ var lazy = (moduleName, requireFn) => {
|
|
|
118738
118738
|
const importLazyLocal = require_import_lazy()(requireFn);
|
|
118739
118739
|
return importLazyLocal(moduleName);
|
|
118740
118740
|
};
|
|
118741
|
-
var Import = {
|
|
118741
|
+
var Import = {
|
|
118742
|
+
lazy
|
|
118743
|
+
};
|
|
118742
118744
|
|
|
118743
118745
|
// ../../../toolkit/utils/dist/esm/compiled.js
|
|
118744
118746
|
var import_fs_extra = __toESM(require_fs_extra());
|
|
@@ -118770,21 +118772,25 @@ var import_browserslist = __toESM(require_browserslist());
|
|
|
118770
118772
|
var import_recursive_readdir = __toESM(require_recursive_readdir());
|
|
118771
118773
|
var import_commander = __toESM(require_commander());
|
|
118772
118774
|
var import_signale2 = __toESM(require_signale());
|
|
118773
|
-
var mime = Import.lazy(
|
|
118774
|
-
|
|
118775
|
-
|
|
118776
|
-
);
|
|
118777
|
-
var chokidar = Import.lazy(
|
|
118778
|
-
"../compiled/chokidar",
|
|
118779
|
-
require
|
|
118780
|
-
);
|
|
118781
|
-
var inquirer = Import.lazy(
|
|
118782
|
-
"../compiled/inquirer",
|
|
118783
|
-
require
|
|
118784
|
-
);
|
|
118775
|
+
var mime = Import.lazy("../compiled/mime-types", require);
|
|
118776
|
+
var chokidar = Import.lazy("../compiled/chokidar", require);
|
|
118777
|
+
var inquirer = Import.lazy("../compiled/inquirer", require);
|
|
118785
118778
|
|
|
118786
118779
|
// ../../../toolkit/utils/dist/esm/logger.js
|
|
118787
118780
|
var import_chalk2 = __toESM(require_chalk());
|
|
118781
|
+
function _define_property(obj, key, value) {
|
|
118782
|
+
if (key in obj) {
|
|
118783
|
+
Object.defineProperty(obj, key, {
|
|
118784
|
+
value,
|
|
118785
|
+
enumerable: true,
|
|
118786
|
+
configurable: true,
|
|
118787
|
+
writable: true
|
|
118788
|
+
});
|
|
118789
|
+
} else {
|
|
118790
|
+
obj[key] = value;
|
|
118791
|
+
}
|
|
118792
|
+
return obj;
|
|
118793
|
+
}
|
|
118788
118794
|
var LOG_LEVEL = {
|
|
118789
118795
|
error: 0,
|
|
118790
118796
|
warn: 1,
|
|
@@ -118818,22 +118824,15 @@ var LOG_TYPES = {
|
|
|
118818
118824
|
label: "debug",
|
|
118819
118825
|
level: "debug"
|
|
118820
118826
|
},
|
|
118821
|
-
log: {
|
|
118827
|
+
log: {
|
|
118828
|
+
level: "log"
|
|
118829
|
+
}
|
|
118822
118830
|
};
|
|
118823
118831
|
var DEFAULT_CONFIG = {
|
|
118824
118832
|
displayLabel: true,
|
|
118825
118833
|
uppercaseLabel: false
|
|
118826
118834
|
};
|
|
118827
118835
|
var Logger = class {
|
|
118828
|
-
constructor(options = {}) {
|
|
118829
|
-
this.level = options.level || LOG_TYPES.log.level;
|
|
118830
|
-
this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
|
|
118831
|
-
this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
|
|
118832
|
-
this.longestLabel = this.getLongestLabel();
|
|
118833
|
-
Object.keys(this.types).forEach((type) => {
|
|
118834
|
-
this[type] = this._log.bind(this, type);
|
|
118835
|
-
});
|
|
118836
|
-
}
|
|
118837
118836
|
_log(type, message, ...args) {
|
|
118838
118837
|
if (message === void 0 || message === null) {
|
|
118839
118838
|
console.log();
|
|
@@ -118874,6 +118873,19 @@ ${import_chalk2.default.grey(rest.join("\n"))}`;
|
|
|
118874
118873
|
});
|
|
118875
118874
|
return longestLabel;
|
|
118876
118875
|
}
|
|
118876
|
+
constructor(options = {}) {
|
|
118877
|
+
_define_property(this, "level", void 0);
|
|
118878
|
+
_define_property(this, "config", void 0);
|
|
118879
|
+
_define_property(this, "types", void 0);
|
|
118880
|
+
_define_property(this, "longestLabel", void 0);
|
|
118881
|
+
this.level = options.level || LOG_TYPES.log.level;
|
|
118882
|
+
this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
|
|
118883
|
+
this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
|
|
118884
|
+
this.longestLabel = this.getLongestLabel();
|
|
118885
|
+
Object.keys(this.types).forEach((type) => {
|
|
118886
|
+
this[type] = this._log.bind(this, type);
|
|
118887
|
+
});
|
|
118888
|
+
}
|
|
118877
118889
|
};
|
|
118878
118890
|
var logger = new Logger();
|
|
118879
118891
|
logger.Logger = Logger;
|
|
@@ -118882,7 +118894,11 @@ logger.Logger = Logger;
|
|
|
118882
118894
|
function canUseNpm() {
|
|
118883
118895
|
return __async(this, null, function* () {
|
|
118884
118896
|
try {
|
|
118885
|
-
yield (0, import_execa.default)("npm", [
|
|
118897
|
+
yield (0, import_execa.default)("npm", [
|
|
118898
|
+
"--version"
|
|
118899
|
+
], {
|
|
118900
|
+
env: process.env
|
|
118901
|
+
});
|
|
118886
118902
|
return true;
|
|
118887
118903
|
} catch (e) {
|
|
118888
118904
|
return false;
|
|
@@ -118892,7 +118908,11 @@ function canUseNpm() {
|
|
|
118892
118908
|
function canUsePnpm() {
|
|
118893
118909
|
return __async(this, null, function* () {
|
|
118894
118910
|
try {
|
|
118895
|
-
yield (0, import_execa.default)("pnpm", [
|
|
118911
|
+
yield (0, import_execa.default)("pnpm", [
|
|
118912
|
+
"--version"
|
|
118913
|
+
], {
|
|
118914
|
+
env: process.env
|
|
118915
|
+
});
|
|
118896
118916
|
return true;
|
|
118897
118917
|
} catch (e) {
|
|
118898
118918
|
return false;
|
|
@@ -118918,26 +118938,29 @@ function getObjKeyMap(obj, prefix = "") {
|
|
|
118918
118938
|
if ((0, import_lodash2.isString)(obj[key])) {
|
|
118919
118939
|
result[key] = prefix ? `${prefix}.${key}` : key;
|
|
118920
118940
|
} else if ((0, import_lodash2.isObject)(obj[key])) {
|
|
118921
|
-
result[key] = getObjKeyMap(
|
|
118922
|
-
obj[key],
|
|
118923
|
-
prefix ? `${prefix}.${key}` : key
|
|
118924
|
-
);
|
|
118941
|
+
result[key] = getObjKeyMap(obj[key], prefix ? `${prefix}.${key}` : key);
|
|
118925
118942
|
}
|
|
118926
118943
|
});
|
|
118927
118944
|
return result;
|
|
118928
118945
|
}
|
|
118929
118946
|
|
|
118930
118947
|
// ../../../cli/plugin-i18n/dist/esm-node/index.js
|
|
118931
|
-
|
|
118932
|
-
|
|
118933
|
-
|
|
118934
|
-
|
|
118948
|
+
function _define_property2(obj, key, value) {
|
|
118949
|
+
if (key in obj) {
|
|
118950
|
+
Object.defineProperty(obj, key, {
|
|
118951
|
+
value,
|
|
118952
|
+
enumerable: true,
|
|
118953
|
+
configurable: true,
|
|
118954
|
+
writable: true
|
|
118955
|
+
});
|
|
118956
|
+
} else {
|
|
118957
|
+
obj[key] = value;
|
|
118935
118958
|
}
|
|
118959
|
+
return obj;
|
|
118960
|
+
}
|
|
118961
|
+
var I18n = class {
|
|
118936
118962
|
format(msg, vars) {
|
|
118937
|
-
return msg.replace(
|
|
118938
|
-
/\{(\w+)\}/g,
|
|
118939
|
-
(_match, capture) => Object.prototype.hasOwnProperty.call(vars, capture) ? vars[capture] : capture
|
|
118940
|
-
);
|
|
118963
|
+
return msg.replace(/\{(\w+)\}/g, (_match, capture) => Object.prototype.hasOwnProperty.call(vars, capture) ? vars[capture] : capture);
|
|
118941
118964
|
}
|
|
118942
118965
|
getMessage(lang, key, vars, fallbackText) {
|
|
118943
118966
|
const languages = Object.keys(this.languageMap);
|
|
@@ -118974,6 +118997,10 @@ var I18n = class {
|
|
|
118974
118997
|
t: (key, vars, fallbackText) => this.getMessage(lang, key, vars, fallbackText)
|
|
118975
118998
|
};
|
|
118976
118999
|
}
|
|
119000
|
+
constructor() {
|
|
119001
|
+
_define_property2(this, "language", "en");
|
|
119002
|
+
_define_property2(this, "languageMap", {});
|
|
119003
|
+
}
|
|
118977
119004
|
};
|
|
118978
119005
|
|
|
118979
119006
|
// ../../generator-common/dist/esm-node/locale/zh.js
|
|
@@ -119173,48 +119200,79 @@ var EN_LOCALE = {
|
|
|
119173
119200
|
|
|
119174
119201
|
// ../../generator-common/dist/esm-node/locale/index.js
|
|
119175
119202
|
var i18n = new I18n();
|
|
119176
|
-
var localeKeys = i18n.init("en", {
|
|
119203
|
+
var localeKeys = i18n.init("en", {
|
|
119204
|
+
zh: ZH_LOCALE,
|
|
119205
|
+
en: EN_LOCALE
|
|
119206
|
+
});
|
|
119177
119207
|
|
|
119178
119208
|
// ../../generator-common/dist/esm-node/common/solution.js
|
|
119179
|
-
var Solution
|
|
119209
|
+
var Solution;
|
|
119210
|
+
(function(Solution2) {
|
|
119180
119211
|
Solution2["MWA"] = "mwa";
|
|
119181
119212
|
Solution2["Module"] = "module";
|
|
119182
119213
|
Solution2["Doc"] = "doc";
|
|
119183
119214
|
Solution2["Monorepo"] = "monorepo";
|
|
119184
|
-
|
|
119185
|
-
|
|
119215
|
+
})(Solution || (Solution = {}));
|
|
119216
|
+
var SubSolution;
|
|
119217
|
+
(function(SubSolution2) {
|
|
119218
|
+
SubSolution2["MWA"] = "mwa";
|
|
119219
|
+
SubSolution2["MWATest"] = "mwa_test";
|
|
119220
|
+
SubSolution2["Module"] = "module";
|
|
119221
|
+
SubSolution2["InnerModule"] = "inner_module";
|
|
119222
|
+
})(SubSolution || (SubSolution = {}));
|
|
119223
|
+
var SolutionText = {
|
|
119224
|
+
[Solution.MWA]: () => i18n.t(localeKeys.solution.mwa),
|
|
119225
|
+
[Solution.Module]: () => i18n.t(localeKeys.solution.module),
|
|
119226
|
+
[Solution.Doc]: () => i18n.t(localeKeys.solution.doc),
|
|
119227
|
+
[Solution.Monorepo]: () => i18n.t(localeKeys.solution.monorepo)
|
|
119228
|
+
};
|
|
119229
|
+
var SubSolutionText = {
|
|
119230
|
+
[SubSolution.MWA]: () => i18n.t(localeKeys.sub_solution.mwa),
|
|
119231
|
+
[SubSolution.MWATest]: () => i18n.t(localeKeys.sub_solution.mwa_test),
|
|
119232
|
+
[SubSolution.Module]: () => i18n.t(localeKeys.sub_solution.module),
|
|
119233
|
+
[SubSolution.InnerModule]: () => i18n.t(localeKeys.sub_solution.inner_module)
|
|
119234
|
+
};
|
|
119186
119235
|
var SolutionToolsMap = {
|
|
119187
|
-
[
|
|
119188
|
-
|
|
119189
|
-
|
|
119190
|
-
]: "@modern-js/
|
|
119191
|
-
|
|
119192
|
-
|
|
119193
|
-
|
|
119194
|
-
]: "@modern-js/module-
|
|
119195
|
-
[
|
|
119196
|
-
|
|
119197
|
-
|
|
119198
|
-
|
|
119199
|
-
[
|
|
119200
|
-
|
|
119201
|
-
|
|
119202
|
-
]: "@modern-js/
|
|
119236
|
+
[Solution.MWA]: "@modern-js/app-tools",
|
|
119237
|
+
[Solution.Module]: "@modern-js/module-tools",
|
|
119238
|
+
[Solution.Doc]: "@modern-js/doc-tools",
|
|
119239
|
+
[Solution.Monorepo]: "@modern-js/monorepo-tools"
|
|
119240
|
+
};
|
|
119241
|
+
var SolutionGenerator = {
|
|
119242
|
+
[Solution.MWA]: "@modern-js/mwa-generator",
|
|
119243
|
+
[Solution.Module]: "@modern-js/module-generator",
|
|
119244
|
+
[Solution.Doc]: "@modern-js/doc-generator",
|
|
119245
|
+
[Solution.Monorepo]: "@modern-js/monorepo-generator"
|
|
119246
|
+
};
|
|
119247
|
+
var SubSolutionGenerator = {
|
|
119248
|
+
[SubSolution.MWA]: "@modern-js/mwa-generator",
|
|
119249
|
+
[SubSolution.MWATest]: "@modern-js/mwa-generator",
|
|
119250
|
+
[SubSolution.Module]: "@modern-js/module-generator",
|
|
119251
|
+
[SubSolution.InnerModule]: "@modern-js/module-generator"
|
|
119203
119252
|
};
|
|
119204
119253
|
|
|
119205
119254
|
// ../../generator-common/dist/esm-node/common/language.js
|
|
119206
|
-
var Language
|
|
119255
|
+
var Language;
|
|
119256
|
+
(function(Language2) {
|
|
119207
119257
|
Language2["TS"] = "ts";
|
|
119208
119258
|
Language2["JS"] = "js";
|
|
119209
|
-
|
|
119210
|
-
|
|
119259
|
+
})(Language || (Language = {}));
|
|
119260
|
+
var LanguageName = {
|
|
119261
|
+
[Language.TS]: "TS",
|
|
119262
|
+
[Language.JS]: "ES6+"
|
|
119263
|
+
};
|
|
119211
119264
|
|
|
119212
119265
|
// ../../generator-common/dist/esm-node/mwa/common.js
|
|
119213
|
-
var Framework
|
|
119266
|
+
var Framework;
|
|
119267
|
+
(function(Framework2) {
|
|
119214
119268
|
Framework2["Express"] = "express";
|
|
119215
119269
|
Framework2["Koa"] = "koa";
|
|
119216
|
-
|
|
119217
|
-
|
|
119270
|
+
})(Framework || (Framework = {}));
|
|
119271
|
+
var BuildTools;
|
|
119272
|
+
(function(BuildTools2) {
|
|
119273
|
+
BuildTools2["Webpack"] = "webpack";
|
|
119274
|
+
BuildTools2["Rspack"] = "rspack";
|
|
119275
|
+
})(BuildTools || (BuildTools = {}));
|
|
119218
119276
|
var getFrameworkSchema = (_extra = {}) => {
|
|
119219
119277
|
return {
|
|
119220
119278
|
type: "string",
|
|
@@ -119226,22 +119284,16 @@ var getFrameworkSchema = (_extra = {}) => {
|
|
|
119226
119284
|
};
|
|
119227
119285
|
};
|
|
119228
119286
|
var FrameworkAppendTypeContent = {
|
|
119229
|
-
[
|
|
119230
|
-
|
|
119231
|
-
/* Express */
|
|
119232
|
-
]: `/// <reference types='@modern-js/plugin-express/types' />`,
|
|
119233
|
-
[
|
|
119234
|
-
"koa"
|
|
119235
|
-
/* Koa */
|
|
119236
|
-
]: `/// <reference types='@modern-js/plugin-koa/types' />`
|
|
119287
|
+
[Framework.Express]: `/// <reference types='@modern-js/plugin-express/types' />`,
|
|
119288
|
+
[Framework.Koa]: `/// <reference types='@modern-js/plugin-koa/types' />`
|
|
119237
119289
|
};
|
|
119238
119290
|
|
|
119239
119291
|
// ../../generator-common/dist/esm-node/mwa/bff.js
|
|
119240
|
-
var BFFType
|
|
119292
|
+
var BFFType;
|
|
119293
|
+
(function(BFFType2) {
|
|
119241
119294
|
BFFType2["Func"] = "func";
|
|
119242
119295
|
BFFType2["Framework"] = "framework";
|
|
119243
|
-
|
|
119244
|
-
})(BFFType || {});
|
|
119296
|
+
})(BFFType || (BFFType = {}));
|
|
119245
119297
|
var getBFFTypeSchema = (_extra = {}) => {
|
|
119246
119298
|
return {
|
|
119247
119299
|
type: "string",
|
|
@@ -119265,23 +119317,24 @@ var getBFFSchema = (extra = {}) => {
|
|
|
119265
119317
|
};
|
|
119266
119318
|
};
|
|
119267
119319
|
var MWADefaultBffConfig = {
|
|
119268
|
-
bffType:
|
|
119320
|
+
bffType: BFFType.Func,
|
|
119269
119321
|
frameWork: Framework.Express
|
|
119270
119322
|
};
|
|
119271
119323
|
|
|
119272
119324
|
// ../../generator-common/dist/esm-node/newAction/common/index.js
|
|
119273
|
-
var ActionType
|
|
119325
|
+
var ActionType;
|
|
119326
|
+
(function(ActionType2) {
|
|
119274
119327
|
ActionType2["Function"] = "function";
|
|
119275
119328
|
ActionType2["Element"] = "element";
|
|
119276
119329
|
ActionType2["Refactor"] = "refactor";
|
|
119277
|
-
|
|
119278
|
-
|
|
119279
|
-
|
|
119330
|
+
})(ActionType || (ActionType = {}));
|
|
119331
|
+
var ActionElement;
|
|
119332
|
+
(function(ActionElement2) {
|
|
119280
119333
|
ActionElement2["Entry"] = "entry";
|
|
119281
119334
|
ActionElement2["Server"] = "server";
|
|
119282
|
-
|
|
119283
|
-
|
|
119284
|
-
|
|
119335
|
+
})(ActionElement || (ActionElement = {}));
|
|
119336
|
+
var ActionFunction;
|
|
119337
|
+
(function(ActionFunction2) {
|
|
119285
119338
|
ActionFunction2["TailwindCSS"] = "tailwindcss";
|
|
119286
119339
|
ActionFunction2["BFF"] = "bff";
|
|
119287
119340
|
ActionFunction2["MicroFrontend"] = "micro_frontend";
|
|
@@ -119296,12 +119349,44 @@ var ActionFunction = /* @__PURE__ */ ((ActionFunction2) => {
|
|
|
119296
119349
|
ActionFunction2["Proxy"] = "proxy";
|
|
119297
119350
|
ActionFunction2["SWC"] = "swc";
|
|
119298
119351
|
ActionFunction2["Rspack"] = "rspack";
|
|
119299
|
-
|
|
119300
|
-
|
|
119301
|
-
|
|
119352
|
+
})(ActionFunction || (ActionFunction = {}));
|
|
119353
|
+
var ActionRefactor;
|
|
119354
|
+
(function(ActionRefactor2) {
|
|
119302
119355
|
ActionRefactor2["ReactRouter5"] = "react_router_5";
|
|
119303
|
-
|
|
119304
|
-
|
|
119356
|
+
})(ActionRefactor || (ActionRefactor = {}));
|
|
119357
|
+
var ActionTypeText = {
|
|
119358
|
+
[ActionType.Function]: () => i18n.t(localeKeys.action.function.self),
|
|
119359
|
+
[ActionType.Element]: () => i18n.t(localeKeys.action.element.self),
|
|
119360
|
+
[ActionType.Refactor]: () => i18n.t(localeKeys.action.refactor.self)
|
|
119361
|
+
};
|
|
119362
|
+
var ActionElementText = {
|
|
119363
|
+
[ActionElement.Entry]: () => i18n.t(localeKeys.action.element.entry),
|
|
119364
|
+
[ActionElement.Server]: () => i18n.t(localeKeys.action.element.server)
|
|
119365
|
+
};
|
|
119366
|
+
var ActionFunctionText = {
|
|
119367
|
+
[ActionFunction.TailwindCSS]: () => i18n.t(localeKeys.action.function.tailwindcss),
|
|
119368
|
+
[ActionFunction.BFF]: () => i18n.t(localeKeys.action.function.bff),
|
|
119369
|
+
[ActionFunction.MicroFrontend]: () => i18n.t(localeKeys.action.function.micro_frontend),
|
|
119370
|
+
[ActionFunction.I18n]: () => i18n.t(localeKeys.action.function.i18n),
|
|
119371
|
+
[ActionFunction.Test]: () => i18n.t(localeKeys.action.function.test),
|
|
119372
|
+
[ActionFunction.E2ETest]: () => i18n.t(localeKeys.action.function.e2e_test),
|
|
119373
|
+
[ActionFunction.Doc]: () => i18n.t(localeKeys.action.function.doc),
|
|
119374
|
+
[ActionFunction.Storybook]: () => i18n.t(localeKeys.action.function.storybook),
|
|
119375
|
+
[ActionFunction.RuntimeApi]: () => i18n.t(localeKeys.action.function.runtime_api),
|
|
119376
|
+
[ActionFunction.SSG]: () => i18n.t(localeKeys.action.function.ssg),
|
|
119377
|
+
[ActionFunction.Polyfill]: () => i18n.t(localeKeys.action.function.polyfill),
|
|
119378
|
+
[ActionFunction.Proxy]: () => i18n.t(localeKeys.action.function.proxy),
|
|
119379
|
+
[ActionFunction.SWC]: () => i18n.t(localeKeys.action.function.swc),
|
|
119380
|
+
[ActionFunction.Rspack]: () => i18n.t(localeKeys.action.function.rspack)
|
|
119381
|
+
};
|
|
119382
|
+
var ActionRefactorText = {
|
|
119383
|
+
[ActionRefactor.ReactRouter5]: () => i18n.t(localeKeys.action.refactor.react_router_5)
|
|
119384
|
+
};
|
|
119385
|
+
var ActionTypeTextMap = {
|
|
119386
|
+
[ActionType.Element]: ActionElementText,
|
|
119387
|
+
[ActionType.Function]: ActionFunctionText,
|
|
119388
|
+
[ActionType.Refactor]: ActionRefactorText
|
|
119389
|
+
};
|
|
119305
119390
|
|
|
119306
119391
|
// ../../generator-common/dist/esm-node/newAction/mwa/index.js
|
|
119307
119392
|
var MWAActionTypes = [
|
|
@@ -119321,8 +119406,13 @@ var MWAActionFunctions = [
|
|
|
119321
119406
|
ActionFunction.Proxy,
|
|
119322
119407
|
ActionFunction.Storybook
|
|
119323
119408
|
];
|
|
119324
|
-
var MWAActionElements = [
|
|
119325
|
-
|
|
119409
|
+
var MWAActionElements = [
|
|
119410
|
+
ActionElement.Entry,
|
|
119411
|
+
ActionElement.Server
|
|
119412
|
+
];
|
|
119413
|
+
var MWAActionReactors = [
|
|
119414
|
+
ActionRefactor.ReactRouter5
|
|
119415
|
+
];
|
|
119326
119416
|
var MWAActionTypesMap = {
|
|
119327
119417
|
[ActionType.Element]: MWAActionElements,
|
|
119328
119418
|
[ActionType.Function]: MWAActionFunctions,
|
|
@@ -119440,7 +119530,11 @@ function stripAnsi2(string) {
|
|
|
119440
119530
|
function isPackageExist(packageName, registry2) {
|
|
119441
119531
|
return __async(this, null, function* () {
|
|
119442
119532
|
if (yield canUseNpm()) {
|
|
119443
|
-
const args = [
|
|
119533
|
+
const args = [
|
|
119534
|
+
"view",
|
|
119535
|
+
packageName,
|
|
119536
|
+
"version"
|
|
119537
|
+
];
|
|
119444
119538
|
if (registry2) {
|
|
119445
119539
|
args.push(`--registry=${registry2}`);
|
|
119446
119540
|
}
|
|
@@ -119453,7 +119547,11 @@ function isPackageExist(packageName, registry2) {
|
|
|
119453
119547
|
function isPackageDeprecated(packageName, registry2) {
|
|
119454
119548
|
return __async(this, null, function* () {
|
|
119455
119549
|
if (yield canUseNpm()) {
|
|
119456
|
-
const args = [
|
|
119550
|
+
const args = [
|
|
119551
|
+
"view",
|
|
119552
|
+
packageName,
|
|
119553
|
+
"deprecated"
|
|
119554
|
+
];
|
|
119457
119555
|
if (registry2) {
|
|
119458
119556
|
args.push(`--registry=${registry2}`);
|
|
119459
119557
|
}
|
|
@@ -119464,7 +119562,9 @@ function isPackageDeprecated(packageName, registry2) {
|
|
|
119464
119562
|
});
|
|
119465
119563
|
}
|
|
119466
119564
|
function semverDecrease(version) {
|
|
119467
|
-
const versionObj = import_semver.default.parse(version, {
|
|
119565
|
+
const versionObj = import_semver.default.parse(version, {
|
|
119566
|
+
loose: true
|
|
119567
|
+
});
|
|
119468
119568
|
if (!versionObj) {
|
|
119469
119569
|
throw new Error(`Version ${version} is not valid semver`);
|
|
119470
119570
|
}
|
|
@@ -119526,7 +119626,11 @@ function getPackageVersion(packageName, registry2) {
|
|
|
119526
119626
|
spinner: "runner"
|
|
119527
119627
|
}).start();
|
|
119528
119628
|
if (yield canUsePnpm()) {
|
|
119529
|
-
const args = [
|
|
119629
|
+
const args = [
|
|
119630
|
+
"info",
|
|
119631
|
+
packageName,
|
|
119632
|
+
"version"
|
|
119633
|
+
];
|
|
119530
119634
|
if (registry2) {
|
|
119531
119635
|
args.push(`--registry=${registry2}`);
|
|
119532
119636
|
}
|
|
@@ -119535,7 +119639,11 @@ function getPackageVersion(packageName, registry2) {
|
|
|
119535
119639
|
return stripAnsi2(result.stdout);
|
|
119536
119640
|
}
|
|
119537
119641
|
if (yield canUseNpm()) {
|
|
119538
|
-
const args = [
|
|
119642
|
+
const args = [
|
|
119643
|
+
"view",
|
|
119644
|
+
packageName,
|
|
119645
|
+
"version"
|
|
119646
|
+
];
|
|
119539
119647
|
if (registry2) {
|
|
119540
119648
|
args.push(`--registry=${registry2}`);
|
|
119541
119649
|
}
|
|
@@ -119553,20 +119661,17 @@ function getModernPluginVersion(_0, _1) {
|
|
|
119553
119661
|
}) {
|
|
119554
119662
|
const { cwd = process.cwd(), registry: registry2, distTag } = options;
|
|
119555
119663
|
const getLatetPluginVersion = (tag) => __async(this, null, function* () {
|
|
119556
|
-
const version = yield getPackageVersion(
|
|
119557
|
-
`${packageName}@${tag || distTag || "latest"}`,
|
|
119558
|
-
registry2
|
|
119559
|
-
);
|
|
119664
|
+
const version = yield getPackageVersion(`${packageName}@${tag || distTag || "latest"}`, registry2);
|
|
119560
119665
|
return version;
|
|
119561
119666
|
});
|
|
119562
119667
|
if (!packageName.startsWith("@modern-js") || packageName.includes("electron") || packageName.includes("codesmith") || packageName.includes("easy-form") || packageName.startsWith("@modern-js-reduck")) {
|
|
119563
119668
|
return getLatetPluginVersion("latest");
|
|
119564
119669
|
}
|
|
119565
|
-
const pkgPath = import_path2.default.join(
|
|
119566
|
-
|
|
119567
|
-
|
|
119568
|
-
|
|
119569
|
-
);
|
|
119670
|
+
const pkgPath = import_path2.default.join(require.resolve(SolutionToolsMap[solution], {
|
|
119671
|
+
paths: [
|
|
119672
|
+
cwd
|
|
119673
|
+
]
|
|
119674
|
+
}), "../../../../", "package.json");
|
|
119570
119675
|
if (import_fs_extra.default.existsSync(pkgPath)) {
|
|
119571
119676
|
const pkgInfo = import_fs_extra.default.readJSONSync(pkgPath);
|
|
119572
119677
|
const modernVersion = pkgInfo.version;
|
package/package.json
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
"description": "A Progressive React Framework for modern web development.",
|
|
4
4
|
"homepage": "https://modernjs.dev",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/modern.js/issues",
|
|
6
|
-
"repository":
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/web-infra-dev/modern.js",
|
|
9
|
+
"directory": "packages/generator/generators/bff-generator"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"keywords": [
|
|
9
13
|
"react",
|
|
@@ -11,7 +15,7 @@
|
|
|
11
15
|
"modern",
|
|
12
16
|
"modern.js"
|
|
13
17
|
],
|
|
14
|
-
"version": "3.1.
|
|
18
|
+
"version": "3.1.10",
|
|
15
19
|
"jsnext:source": "./src/index.ts",
|
|
16
20
|
"types": "./src/index.ts",
|
|
17
21
|
"main": "./dist/index.js",
|
|
@@ -28,11 +32,11 @@
|
|
|
28
32
|
"@types/node": "^14",
|
|
29
33
|
"jest": "^29",
|
|
30
34
|
"typescript": "^4",
|
|
31
|
-
"@modern-js/generator-common": "3.1.
|
|
32
|
-
"@modern-js/plugin-i18n": "2.
|
|
33
|
-
"@modern-js/generator-utils": "3.1.
|
|
34
|
-
"@scripts/build": "2.
|
|
35
|
-
"@scripts/jest-config": "2.
|
|
35
|
+
"@modern-js/generator-common": "3.1.10",
|
|
36
|
+
"@modern-js/plugin-i18n": "2.16.0",
|
|
37
|
+
"@modern-js/generator-utils": "3.1.10",
|
|
38
|
+
"@scripts/build": "2.16.0",
|
|
39
|
+
"@scripts/jest-config": "2.16.0"
|
|
36
40
|
},
|
|
37
41
|
"sideEffects": false,
|
|
38
42
|
"publishConfig": {
|