@modern-js/ssg-generator 3.0.10 → 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 +157 -17
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -135164,7 +135164,7 @@ var require_format2 = __commonJS({
135164
135164
  if (typeof stats === "object") {
135165
135165
  const fileName = stats.moduleName ? `File: ${stats.moduleName}
135166
135166
  ` : "";
135167
- const mainMessage = stats.message;
135167
+ const mainMessage = typeof stats.formatted === "string" ? stats.formatted : stats.message;
135168
135168
  const details = stats.details ? `
135169
135169
  Details: ${stats.details}
135170
135170
  ` : "";
@@ -138525,6 +138525,143 @@ var require_getTargetDir = __commonJS({
138525
138525
  }
138526
138526
  });
138527
138527
 
138528
+ // ../../../toolkit/utils/dist/babel.js
138529
+ var require_babel = __commonJS({
138530
+ "../../../toolkit/utils/dist/babel.js"(exports, module2) {
138531
+ var __defProp2 = Object.defineProperty;
138532
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
138533
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
138534
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
138535
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
138536
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
138537
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
138538
+ var __spreadValues2 = (a, b) => {
138539
+ for (var prop in b || (b = {}))
138540
+ if (__hasOwnProp2.call(b, prop))
138541
+ __defNormalProp2(a, prop, b[prop]);
138542
+ if (__getOwnPropSymbols2)
138543
+ for (var prop of __getOwnPropSymbols2(b)) {
138544
+ if (__propIsEnum2.call(b, prop))
138545
+ __defNormalProp2(a, prop, b[prop]);
138546
+ }
138547
+ return a;
138548
+ };
138549
+ var __export2 = (target, all) => {
138550
+ for (var name in all)
138551
+ __defProp2(target, name, { get: all[name], enumerable: true });
138552
+ };
138553
+ var __copyProps2 = (to, from, except, desc) => {
138554
+ if (from && typeof from === "object" || typeof from === "function") {
138555
+ for (let key of __getOwnPropNames2(from))
138556
+ if (!__hasOwnProp2.call(to, key) && key !== except)
138557
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
138558
+ }
138559
+ return to;
138560
+ };
138561
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
138562
+ var babel_exports = {};
138563
+ __export2(babel_exports, {
138564
+ applyUserBabelConfig: () => applyUserBabelConfig,
138565
+ getBabelUtils: () => getBabelUtils
138566
+ });
138567
+ module2.exports = __toCommonJS2(babel_exports);
138568
+ var import_path4 = require("path");
138569
+ var import_applyOptionsChain = require_applyOptionsChain2();
138570
+ var import_ensureArray = require_ensureArray2();
138571
+ var import_path22 = require_path2();
138572
+ var formatPath = (originPath) => {
138573
+ if ((0, import_path4.isAbsolute)(originPath)) {
138574
+ return originPath.split(import_path4.sep).join("/");
138575
+ }
138576
+ return originPath;
138577
+ };
138578
+ var getPluginItemName = (item) => {
138579
+ if (typeof item === "string") {
138580
+ return formatPath(item);
138581
+ }
138582
+ if (Array.isArray(item) && typeof item[0] === "string") {
138583
+ return formatPath(item[0]);
138584
+ }
138585
+ return null;
138586
+ };
138587
+ var addPlugins = (plugins, config) => {
138588
+ if (config.plugins) {
138589
+ config.plugins.push(...plugins);
138590
+ } else {
138591
+ config.plugins = plugins;
138592
+ }
138593
+ };
138594
+ var addPresets = (presets, config) => {
138595
+ if (config.presets) {
138596
+ config.presets.push(...presets);
138597
+ } else {
138598
+ config.presets = presets;
138599
+ }
138600
+ };
138601
+ var removePlugins = (plugins, config) => {
138602
+ if (!config.plugins) {
138603
+ return;
138604
+ }
138605
+ const removeList = (0, import_ensureArray.ensureArray)(plugins);
138606
+ config.plugins = config.plugins.filter((item) => {
138607
+ const name = getPluginItemName(item);
138608
+ if (name) {
138609
+ return !removeList.find((removeItem) => name.includes(removeItem));
138610
+ }
138611
+ return true;
138612
+ });
138613
+ };
138614
+ var removePresets = (presets, config) => {
138615
+ if (!config.presets) {
138616
+ return;
138617
+ }
138618
+ const removeList = (0, import_ensureArray.ensureArray)(presets);
138619
+ config.presets = config.presets.filter((item) => {
138620
+ const name = getPluginItemName(item);
138621
+ if (name) {
138622
+ return !removeList.find((removeItem) => name.includes(removeItem));
138623
+ }
138624
+ return true;
138625
+ });
138626
+ };
138627
+ var modifyPresetOptions = (presetName, options, presets = []) => {
138628
+ presets.forEach((preset, index) => {
138629
+ if (Array.isArray(preset)) {
138630
+ if (typeof preset[0] === "string" && (0, import_path22.normalizeToPosixPath)(preset[0]).includes(presetName)) {
138631
+ preset[1] = __spreadValues2(__spreadValues2({}, preset[1] || {}), options);
138632
+ }
138633
+ } else if (typeof preset === "string" && (0, import_path22.normalizeToPosixPath)(preset).includes(presetName)) {
138634
+ presets[index] = [preset, options];
138635
+ }
138636
+ });
138637
+ };
138638
+ var getBabelUtils = (config) => {
138639
+ const noop = () => {
138640
+ };
138641
+ return {
138642
+ addPlugins: (plugins) => addPlugins(plugins, config),
138643
+ addPresets: (presets) => addPresets(presets, config),
138644
+ removePlugins: (plugins) => removePlugins(plugins, config),
138645
+ removePresets: (presets) => removePresets(presets, config),
138646
+ // `addIncludes` and `addExcludes` are noop functions by default,
138647
+ // It can be overridden by `extraBabelUtils`.
138648
+ addIncludes: noop,
138649
+ addExcludes: noop,
138650
+ // Compat `presetEnvOptions` and `presetReactOptions` in Eden.
138651
+ modifyPresetEnvOptions: (options) => modifyPresetOptions("@babel/preset-env", options, config.presets || []),
138652
+ modifyPresetReactOptions: (options) => modifyPresetOptions("@babel/preset-react", options, config.presets || [])
138653
+ };
138654
+ };
138655
+ var applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
138656
+ if (userBabelConfig) {
138657
+ const babelUtils = __spreadValues2(__spreadValues2({}, getBabelUtils(defaultOptions)), extraBabelUtils);
138658
+ return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
138659
+ }
138660
+ return defaultOptions;
138661
+ };
138662
+ }
138663
+ });
138664
+
138528
138665
  // ../../../toolkit/utils/dist/index.js
138529
138666
  var require_dist2 = __commonJS({
138530
138667
  "../../../toolkit/utils/dist/index.js"(exports, module2) {
@@ -138588,6 +138725,7 @@ var require_dist2 = __commonJS({
138588
138725
  __reExport(src_exports2, require_getCoreJsVersion(), module2.exports);
138589
138726
  __reExport(src_exports2, require_react(), module2.exports);
138590
138727
  __reExport(src_exports2, require_getTargetDir(), module2.exports);
138728
+ __reExport(src_exports2, require_babel(), module2.exports);
138591
138729
  }
138592
138730
  });
138593
138731
 
@@ -138677,8 +138815,9 @@ var I18n = class {
138677
138815
  var ZH_LOCALE = {
138678
138816
  solution: {
138679
138817
  self: "请选择你想创建的工程类型",
138680
- mwa: "应用",
138681
- module: "模块",
138818
+ mwa: "Web 应用",
138819
+ module: "Npm 模块",
138820
+ doc: "文档站",
138682
138821
  monorepo: "Monorepo",
138683
138822
  custom: "自定义",
138684
138823
  default: "默认"
@@ -138688,10 +138827,10 @@ var ZH_LOCALE = {
138688
138827
  },
138689
138828
  sub_solution: {
138690
138829
  self: "请选择你想创建的工程类型",
138691
- mwa: "应用",
138692
- mwa_test: "应用(测试)",
138693
- module: "模块",
138694
- inner_module: "模块(内部)"
138830
+ mwa: "Web 应用",
138831
+ mwa_test: "Web 应用(测试)",
138832
+ module: "Npm 模块",
138833
+ inner_module: "Npm 模块(内部)"
138695
138834
  },
138696
138835
  action: {
138697
138836
  self: "请选择你想要的操作",
@@ -138773,9 +138912,10 @@ var ZH_LOCALE = {
138773
138912
  var EN_LOCALE = {
138774
138913
  solution: {
138775
138914
  self: "Please select the solution you want to create",
138776
- mwa: "Web App Solution",
138777
- module: "Module Solution",
138778
- monorepo: "Monorepo Solution",
138915
+ mwa: "Web App",
138916
+ module: "Npm Module",
138917
+ doc: "Doc Site",
138918
+ monorepo: "Monorepo",
138779
138919
  custom: "Custom Solution",
138780
138920
  default: "Default"
138781
138921
  },
@@ -138784,11 +138924,11 @@ var EN_LOCALE = {
138784
138924
  },
138785
138925
  sub_solution: {
138786
138926
  self: "Please select the solution you want to create",
138787
- mwa: "Web App Solution",
138788
- mwa_test: "Web App Solution (Test)",
138789
- module: "Module Solution",
138790
- inner_module: "Module Solution (Inner)",
138791
- monorepo: "Monorepo Solution"
138927
+ mwa: "Web App",
138928
+ mwa_test: "Web App (Test)",
138929
+ module: "Npm Module",
138930
+ inner_module: "Npm Module (Inner)",
138931
+ monorepo: "Monorepo"
138792
138932
  },
138793
138933
  action: {
138794
138934
  self: "Action",
@@ -138828,7 +138968,7 @@ var EN_LOCALE = {
138828
138968
  self: "Development Language"
138829
138969
  },
138830
138970
  packageManager: {
138831
- self: "Package Management Tool"
138971
+ self: "Package Manager"
138832
138972
  },
138833
138973
  packageName: {
138834
138974
  self: "Package Name",
@@ -138860,7 +139000,7 @@ var EN_LOCALE = {
138860
139000
  }
138861
139001
  },
138862
139002
  buildTools: {
138863
- self: "Build Tools",
139003
+ self: "Bundler",
138864
139004
  webpack: "webpack",
138865
139005
  rspack: "Rspack (experimental)"
138866
139006
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "3.0.10",
14
+ "version": "3.1.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "main": "./dist/index.js",
17
17
  "files": [
@@ -22,16 +22,16 @@
22
22
  "@babel/runtime": "^7.18.0",
23
23
  "@modern-js/codesmith": "2.0.5",
24
24
  "@modern-js/codesmith-api-app": "2.0.5",
25
- "@types/jest": "^27",
25
+ "@types/jest": "^29",
26
26
  "@types/node": "^14",
27
- "jest": "^27",
27
+ "jest": "^29",
28
28
  "typescript": "^4",
29
- "@modern-js/dependence-generator": "3.0.10",
30
- "@modern-js/plugin-i18n": "2.8.0",
31
- "@modern-js/generator-common": "3.0.10",
32
- "@modern-js/generator-utils": "3.0.10",
33
- "@scripts/build": "2.8.0",
34
- "@scripts/jest-config": "2.8.0"
29
+ "@modern-js/dependence-generator": "3.1.0",
30
+ "@modern-js/generator-utils": "3.1.0",
31
+ "@modern-js/plugin-i18n": "2.10.0",
32
+ "@modern-js/generator-common": "3.1.0",
33
+ "@scripts/jest-config": "2.10.0",
34
+ "@scripts/build": "2.10.0"
35
35
  },
36
36
  "sideEffects": false,
37
37
  "publishConfig": {