@modern-js/bff-generator 3.0.11 → 3.1.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.
Files changed (2) hide show
  1. package/dist/index.js +146 -1
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -34836,7 +34836,7 @@ var require_format = __commonJS({
34836
34836
  if (typeof stats === "object") {
34837
34837
  const fileName = stats.moduleName ? `File: ${stats.moduleName}
34838
34838
  ` : "";
34839
- const mainMessage = stats.message;
34839
+ const mainMessage = typeof stats.formatted === "string" ? stats.formatted : stats.message;
34840
34840
  const details = stats.details ? `
34841
34841
  Details: ${stats.details}
34842
34842
  ` : "";
@@ -38197,6 +38197,143 @@ var require_getTargetDir = __commonJS({
38197
38197
  }
38198
38198
  });
38199
38199
 
38200
+ // ../../../toolkit/utils/dist/babel.js
38201
+ var require_babel = __commonJS({
38202
+ "../../../toolkit/utils/dist/babel.js"(exports, module2) {
38203
+ var __defProp2 = Object.defineProperty;
38204
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
38205
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
38206
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
38207
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
38208
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
38209
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
38210
+ var __spreadValues2 = (a, b) => {
38211
+ for (var prop in b || (b = {}))
38212
+ if (__hasOwnProp2.call(b, prop))
38213
+ __defNormalProp2(a, prop, b[prop]);
38214
+ if (__getOwnPropSymbols2)
38215
+ for (var prop of __getOwnPropSymbols2(b)) {
38216
+ if (__propIsEnum2.call(b, prop))
38217
+ __defNormalProp2(a, prop, b[prop]);
38218
+ }
38219
+ return a;
38220
+ };
38221
+ var __export2 = (target, all) => {
38222
+ for (var name in all)
38223
+ __defProp2(target, name, { get: all[name], enumerable: true });
38224
+ };
38225
+ var __copyProps2 = (to, from, except, desc) => {
38226
+ if (from && typeof from === "object" || typeof from === "function") {
38227
+ for (let key of __getOwnPropNames2(from))
38228
+ if (!__hasOwnProp2.call(to, key) && key !== except)
38229
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
38230
+ }
38231
+ return to;
38232
+ };
38233
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
38234
+ var babel_exports = {};
38235
+ __export2(babel_exports, {
38236
+ applyUserBabelConfig: () => applyUserBabelConfig,
38237
+ getBabelUtils: () => getBabelUtils
38238
+ });
38239
+ module2.exports = __toCommonJS2(babel_exports);
38240
+ var import_path4 = require("path");
38241
+ var import_applyOptionsChain = require_applyOptionsChain();
38242
+ var import_ensureArray = require_ensureArray();
38243
+ var import_path22 = require_path();
38244
+ var formatPath = (originPath) => {
38245
+ if ((0, import_path4.isAbsolute)(originPath)) {
38246
+ return originPath.split(import_path4.sep).join("/");
38247
+ }
38248
+ return originPath;
38249
+ };
38250
+ var getPluginItemName = (item) => {
38251
+ if (typeof item === "string") {
38252
+ return formatPath(item);
38253
+ }
38254
+ if (Array.isArray(item) && typeof item[0] === "string") {
38255
+ return formatPath(item[0]);
38256
+ }
38257
+ return null;
38258
+ };
38259
+ var addPlugins = (plugins, config) => {
38260
+ if (config.plugins) {
38261
+ config.plugins.push(...plugins);
38262
+ } else {
38263
+ config.plugins = plugins;
38264
+ }
38265
+ };
38266
+ var addPresets = (presets, config) => {
38267
+ if (config.presets) {
38268
+ config.presets.push(...presets);
38269
+ } else {
38270
+ config.presets = presets;
38271
+ }
38272
+ };
38273
+ var removePlugins = (plugins, config) => {
38274
+ if (!config.plugins) {
38275
+ return;
38276
+ }
38277
+ const removeList = (0, import_ensureArray.ensureArray)(plugins);
38278
+ config.plugins = config.plugins.filter((item) => {
38279
+ const name = getPluginItemName(item);
38280
+ if (name) {
38281
+ return !removeList.find((removeItem) => name.includes(removeItem));
38282
+ }
38283
+ return true;
38284
+ });
38285
+ };
38286
+ var removePresets = (presets, config) => {
38287
+ if (!config.presets) {
38288
+ return;
38289
+ }
38290
+ const removeList = (0, import_ensureArray.ensureArray)(presets);
38291
+ config.presets = config.presets.filter((item) => {
38292
+ const name = getPluginItemName(item);
38293
+ if (name) {
38294
+ return !removeList.find((removeItem) => name.includes(removeItem));
38295
+ }
38296
+ return true;
38297
+ });
38298
+ };
38299
+ var modifyPresetOptions = (presetName, options, presets = []) => {
38300
+ presets.forEach((preset, index) => {
38301
+ if (Array.isArray(preset)) {
38302
+ if (typeof preset[0] === "string" && (0, import_path22.normalizeToPosixPath)(preset[0]).includes(presetName)) {
38303
+ preset[1] = __spreadValues2(__spreadValues2({}, preset[1] || {}), options);
38304
+ }
38305
+ } else if (typeof preset === "string" && (0, import_path22.normalizeToPosixPath)(preset).includes(presetName)) {
38306
+ presets[index] = [preset, options];
38307
+ }
38308
+ });
38309
+ };
38310
+ var getBabelUtils = (config) => {
38311
+ const noop = () => {
38312
+ };
38313
+ return {
38314
+ addPlugins: (plugins) => addPlugins(plugins, config),
38315
+ addPresets: (presets) => addPresets(presets, config),
38316
+ removePlugins: (plugins) => removePlugins(plugins, config),
38317
+ removePresets: (presets) => removePresets(presets, config),
38318
+ // `addIncludes` and `addExcludes` are noop functions by default,
38319
+ // It can be overridden by `extraBabelUtils`.
38320
+ addIncludes: noop,
38321
+ addExcludes: noop,
38322
+ // Compat `presetEnvOptions` and `presetReactOptions` in Eden.
38323
+ modifyPresetEnvOptions: (options) => modifyPresetOptions("@babel/preset-env", options, config.presets || []),
38324
+ modifyPresetReactOptions: (options) => modifyPresetOptions("@babel/preset-react", options, config.presets || [])
38325
+ };
38326
+ };
38327
+ var applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
38328
+ if (userBabelConfig) {
38329
+ const babelUtils = __spreadValues2(__spreadValues2({}, getBabelUtils(defaultOptions)), extraBabelUtils);
38330
+ return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
38331
+ }
38332
+ return defaultOptions;
38333
+ };
38334
+ }
38335
+ });
38336
+
38200
38337
  // ../../../toolkit/utils/dist/index.js
38201
38338
  var require_dist = __commonJS({
38202
38339
  "../../../toolkit/utils/dist/index.js"(exports, module2) {
@@ -38260,6 +38397,7 @@ var require_dist = __commonJS({
38260
38397
  __reExport(src_exports2, require_getCoreJsVersion(), module2.exports);
38261
38398
  __reExport(src_exports2, require_react(), module2.exports);
38262
38399
  __reExport(src_exports2, require_getTargetDir(), module2.exports);
38400
+ __reExport(src_exports2, require_babel(), module2.exports);
38263
38401
  }
38264
38402
  });
38265
38403
 
@@ -139671,6 +139809,7 @@ var ZH_LOCALE = {
139671
139809
  self: "请选择你想创建的工程类型",
139672
139810
  mwa: "Web 应用",
139673
139811
  module: "Npm 模块",
139812
+ doc: "文档站",
139674
139813
  monorepo: "Monorepo",
139675
139814
  custom: "自定义",
139676
139815
  default: "默认"
@@ -139767,6 +139906,7 @@ var EN_LOCALE = {
139767
139906
  self: "Please select the solution you want to create",
139768
139907
  mwa: "Web App",
139769
139908
  module: "Npm Module",
139909
+ doc: "Doc Site",
139770
139910
  monorepo: "Monorepo",
139771
139911
  custom: "Custom Solution",
139772
139912
  default: "Default"
@@ -139866,6 +140006,7 @@ var localeKeys = i18n.init("zh", { zh: ZH_LOCALE, en: EN_LOCALE });
139866
140006
  var Solution = /* @__PURE__ */ ((Solution2) => {
139867
140007
  Solution2["MWA"] = "mwa";
139868
140008
  Solution2["Module"] = "module";
140009
+ Solution2["Doc"] = "doc";
139869
140010
  Solution2["Monorepo"] = "monorepo";
139870
140011
  return Solution2;
139871
140012
  })(Solution || {});
@@ -139878,6 +140019,10 @@ var SolutionToolsMap = {
139878
140019
  "module"
139879
140020
  /* Module */
139880
140021
  ]: "@modern-js/module-tools",
140022
+ [
140023
+ "doc"
140024
+ /* Doc */
140025
+ ]: "@modern-js/doc-tools",
139881
140026
  [
139882
140027
  "monorepo"
139883
140028
  /* Monorepo */
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "3.0.11",
14
+ "version": "3.1.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./src/index.ts",
17
17
  "main": "./dist/index.js",
@@ -24,15 +24,15 @@
24
24
  "@modern-js/codesmith": "2.0.5",
25
25
  "@modern-js/codesmith-api-app": "2.0.5",
26
26
  "@modern-js/codesmith-api-json": "2.0.5",
27
- "@types/jest": "^27",
27
+ "@types/jest": "^29",
28
28
  "@types/node": "^14",
29
- "jest": "^27",
29
+ "jest": "^29",
30
30
  "typescript": "^4",
31
- "@modern-js/generator-common": "3.0.11",
32
- "@scripts/jest-config": "2.9.0",
33
- "@modern-js/plugin-i18n": "2.9.0",
34
- "@scripts/build": "2.9.0",
35
- "@modern-js/generator-utils": "3.0.11"
31
+ "@modern-js/generator-utils": "3.1.0",
32
+ "@modern-js/plugin-i18n": "2.10.0",
33
+ "@modern-js/generator-common": "3.1.0",
34
+ "@scripts/build": "2.10.0",
35
+ "@scripts/jest-config": "2.10.0"
36
36
  },
37
37
  "sideEffects": false,
38
38
  "publishConfig": {