@modern-js/dependence-generator 3.1.21 → 3.1.23

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 +35 -278
  2. package/package.json +8 -7
package/dist/index.js CHANGED
@@ -42240,7 +42240,7 @@ var require_parse = __commonJS({
42240
42240
  return current.type === "Punctuator" ? current.value : current.type;
42241
42241
  };
42242
42242
  var is = (t) => type() === t;
42243
- var expect2 = (a) => {
42243
+ var expect = (a) => {
42244
42244
  if (!is(a)) {
42245
42245
  unexpected();
42246
42246
  }
@@ -42322,7 +42322,7 @@ var require_parse = __commonJS({
42322
42322
  while (!is(CURLY_BRACKET_CLOSE)) {
42323
42323
  if (started) {
42324
42324
  assign_comments(PREFIX_AFTER_VALUE);
42325
- expect2(COMMA);
42325
+ expect(COMMA);
42326
42326
  next();
42327
42327
  parse_comments();
42328
42328
  assign_after_comments();
@@ -42331,13 +42331,13 @@ var require_parse = __commonJS({
42331
42331
  }
42332
42332
  }
42333
42333
  started = true;
42334
- expect2("String");
42334
+ expect("String");
42335
42335
  name = JSON.parse(current.value);
42336
42336
  set_prop(name);
42337
42337
  assign_comments(PREFIX_BEFORE);
42338
42338
  next();
42339
42339
  parse_comments(PREFIX_AFTER_PROP);
42340
- expect2(COLON);
42340
+ expect(COLON);
42341
42341
  next();
42342
42342
  parse_comments(PREFIX_AFTER_COLON);
42343
42343
  obj[name] = transform(name, walk());
@@ -42365,7 +42365,7 @@ var require_parse = __commonJS({
42365
42365
  while (!is(BRACKET_CLOSE)) {
42366
42366
  if (started) {
42367
42367
  assign_comments(PREFIX_AFTER_VALUE);
42368
- expect2(COMMA);
42368
+ expect(COMMA);
42369
42369
  next();
42370
42370
  parse_comments();
42371
42371
  assign_after_comments();
@@ -115337,10 +115337,14 @@ var require_chainId = __commonJS({
115337
115337
  SVG: "svg",
115338
115338
  /** Rule for pug */
115339
115339
  PUG: "pug",
115340
+ /** Rule for Vue */
115341
+ VUE: "vue",
115340
115342
  /** Rule for toml */
115341
115343
  TOML: "toml",
115342
115344
  /** Rule for yaml */
115343
115345
  YAML: "yaml",
115346
+ /** Rule for wasm */
115347
+ WASM: "wasm",
115344
115348
  /** Rule for bff */
115345
115349
  JS_BFF_API: "js-bff-api"
115346
115350
  },
@@ -115367,6 +115371,8 @@ var require_chainId = __commonJS({
115367
115371
  URL: "url",
115368
115372
  /** pug-loader */
115369
115373
  PUG: "pug",
115374
+ /** vue-loader */
115375
+ VUE: "vue",
115370
115376
  /** file-loader */
115371
115377
  FILE: "file",
115372
115378
  /** @svgr/webpack */
@@ -115436,12 +115442,16 @@ var require_chainId = __commonJS({
115436
115442
  BUNDLE_ANALYZER: "bundle-analyze",
115437
115443
  /** BottomTemplatePlugin */
115438
115444
  BOTTOM_TEMPLATE: "bottom-template",
115439
- /** HtmlCrossOriginPlugin */
115440
- HTML_CROSS_ORIGIN: "html-cross-origin",
115445
+ /** HtmlTagsPlugin */
115446
+ HTML_TAGS: "html-tags",
115441
115447
  /** HtmlNoncePlugin */
115442
115448
  HTML_NONCE: "html-nonce",
115449
+ /** HtmlCrossOriginPlugin */
115450
+ HTML_CROSS_ORIGIN: "html-cross-origin",
115443
115451
  /** MiniCssExtractPlugin */
115444
115452
  MINI_CSS_EXTRACT: "mini-css-extract",
115453
+ /** VueLoaderPlugin */
115454
+ VUE_LOADER_PLUGIN: "vue-loader-plugin",
115445
115455
  /** ReactFastRefreshPlugin */
115446
115456
  REACT_FAST_REFRESH: "react-fast-refresh",
115447
115457
  /** ProvidePlugin for node polyfill */
@@ -115455,9 +115465,7 @@ var require_chainId = __commonJS({
115455
115465
  /** HtmlAsyncChunkPlugin */
115456
115466
  HTML_ASYNC_CHUNK: "html-async-chunk",
115457
115467
  /** SWC_POLYFILL_CHECKER */
115458
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
115459
- /** HtmlTagsPlugin */
115460
- HTML_TAGS: "html-tags"
115468
+ SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
115461
115469
  },
115462
115470
  /** Predefined minimizers */
115463
115471
  MINIMIZER: {
@@ -115499,6 +115507,9 @@ var require_constants = __commonJS({
115499
115507
  ROUTE_SPEC_FILE: function() {
115500
115508
  return ROUTE_SPEC_FILE;
115501
115509
  },
115510
+ NESTED_ROUTE_SPEC_FILE: function() {
115511
+ return NESTED_ROUTE_SPEC_FILE;
115512
+ },
115502
115513
  MAIN_ENTRY_NAME: function() {
115503
115514
  return MAIN_ENTRY_NAME;
115504
115515
  },
@@ -115583,9 +115594,6 @@ var require_constants = __commonJS({
115583
115594
  INTERNAL_SERVER_PLUGINS: function() {
115584
115595
  return INTERNAL_SERVER_PLUGINS;
115585
115596
  },
115586
- PLUGIN_SCHEMAS: function() {
115587
- return PLUGIN_SCHEMAS;
115588
- },
115589
115597
  DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: function() {
115590
115598
  return DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS;
115591
115599
  }
@@ -115593,6 +115601,7 @@ var require_constants = __commonJS({
115593
115601
  var _export_star = require_export_star();
115594
115602
  _export_star._(require_chainId(), exports);
115595
115603
  var ROUTE_SPEC_FILE = "route.json";
115604
+ var NESTED_ROUTE_SPEC_FILE = "nestedRoutes.json";
115596
115605
  var MAIN_ENTRY_NAME = "main";
115597
115606
  var SERVER_BUNDLE_DIRECTORY = "bundles";
115598
115607
  var SERVER_WORKER_BUNDLE_DIRECTORY = "worker";
@@ -115639,8 +115648,6 @@ var require_constants = __commonJS({
115639
115648
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
115640
115649
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
115641
115650
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
115642
- // TODO: Maybe can remove it
115643
- "@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
115644
115651
  // legacy router (inner react-router-dom v5)
115645
115652
  "@modern-js/plugin-router-legacy": "@modern-js/plugin-router-legacy/cli"
115646
115653
  };
@@ -115671,8 +115678,6 @@ var require_constants = __commonJS({
115671
115678
  "@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
115672
115679
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
115673
115680
  "@modern-js/plugin-polyfill": "@modern-js/plugin-polyfill/cli",
115674
- // TODO: Maybe can remove it
115675
- "@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
115676
115681
  // legacy router (inner react-router-dom v5)
115677
115682
  "@modern-js/plugin-router-v5": "@modern-js/plugin-router-v5/cli"
115678
115683
  };
@@ -115688,214 +115693,6 @@ var require_constants = __commonJS({
115688
115693
  [SERVER_PLUGIN_SERVER]: "@modern-js/plugin-server/server",
115689
115694
  [SERVER_PLUGIN_POLYFILL]: "@modern-js/plugin-polyfill/server"
115690
115695
  };
115691
- var PLUGIN_SCHEMAS = {
115692
- "@modern-js/runtime": [
115693
- {
115694
- target: "runtime",
115695
- schema: {
115696
- type: "object",
115697
- additionalProperties: false
115698
- }
115699
- },
115700
- {
115701
- target: "runtimeByEntries",
115702
- schema: {
115703
- type: "object",
115704
- patternProperties: {
115705
- [ENTRY_NAME_PATTERN]: {
115706
- type: "object"
115707
- }
115708
- },
115709
- additionalProperties: false
115710
- }
115711
- }
115712
- ],
115713
- "@modern-js/plugin-swc": [
115714
- {
115715
- target: "tools.swc",
115716
- schema: {
115717
- typeof: [
115718
- "object"
115719
- ]
115720
- }
115721
- }
115722
- ],
115723
- "@modern-js/plugin-bff": [
115724
- {
115725
- target: "bff",
115726
- schema: {
115727
- type: "object",
115728
- properties: {
115729
- prefix: {
115730
- type: [
115731
- "string",
115732
- "array"
115733
- ],
115734
- items: {
115735
- type: "string"
115736
- }
115737
- },
115738
- fetcher: {
115739
- type: "string"
115740
- },
115741
- proxy: {
115742
- type: "object"
115743
- },
115744
- requestCreator: {
115745
- type: "string"
115746
- }
115747
- }
115748
- }
115749
- }
115750
- ],
115751
- "@modern-js/plugin-tailwindcss": [
115752
- {
115753
- target: "tools.tailwindcss",
115754
- schema: {
115755
- typeof: [
115756
- "object",
115757
- "function"
115758
- ]
115759
- }
115760
- }
115761
- ],
115762
- "@modern-js/plugin-proxy": [
115763
- {
115764
- target: "dev.proxy",
115765
- schema: {
115766
- typeof: [
115767
- "string",
115768
- "object"
115769
- ]
115770
- }
115771
- }
115772
- ],
115773
- "@modern-js/plugin-ssg": [
115774
- {
115775
- target: "output.ssg",
115776
- schema: {
115777
- oneOf: [
115778
- {
115779
- type: "boolean"
115780
- },
115781
- {
115782
- type: "object"
115783
- },
115784
- {
115785
- instanceof: "Function"
115786
- }
115787
- ]
115788
- }
115789
- }
115790
- ],
115791
- "@modern-js/plugin-state": [
115792
- {
115793
- target: "runtime.state",
115794
- schema: {
115795
- type: [
115796
- "boolean",
115797
- "object"
115798
- ]
115799
- }
115800
- }
115801
- ],
115802
- "@modern-js/plugin-design-token": [
115803
- // Legacy Features
115804
- {
115805
- target: "source.designSystem",
115806
- schema: {
115807
- typeof: [
115808
- "object"
115809
- ]
115810
- }
115811
- },
115812
- {
115813
- target: "source.designSystem.supportStyledComponents",
115814
- schema: {
115815
- type: [
115816
- "boolean"
115817
- ]
115818
- }
115819
- },
115820
- {
115821
- target: "designSystem",
115822
- schema: {
115823
- typeof: [
115824
- "object"
115825
- ]
115826
- }
115827
- }
115828
- ],
115829
- "@modern-js/plugin-router": [
115830
- {
115831
- target: "runtime.router",
115832
- schema: {
115833
- type: [
115834
- "boolean",
115835
- "object"
115836
- ]
115837
- }
115838
- }
115839
- ],
115840
- "@modern-js/plugin-testing": [
115841
- {
115842
- target: "testing",
115843
- schema: {
115844
- typeof: [
115845
- "object"
115846
- ]
115847
- }
115848
- },
115849
- {
115850
- target: "tools.jest",
115851
- schema: {
115852
- typeof: [
115853
- "object",
115854
- "function"
115855
- ]
115856
- }
115857
- }
115858
- ],
115859
- "@modern-js/plugin-garfish": [
115860
- {
115861
- target: "runtime.masterApp",
115862
- schema: {
115863
- type: [
115864
- "boolean",
115865
- "object"
115866
- ]
115867
- }
115868
- },
115869
- {
115870
- target: "dev.withMasterApp",
115871
- schema: {
115872
- type: [
115873
- "object"
115874
- ]
115875
- }
115876
- },
115877
- {
115878
- target: "deploy.microFrontend",
115879
- schema: {
115880
- type: [
115881
- "boolean",
115882
- "object"
115883
- ]
115884
- }
115885
- }
115886
- ],
115887
- "@modern-js/plugin-nocode": [],
115888
- "@modern-js/plugin-worker": [
115889
- {
115890
- target: "deploy.worker.ssr",
115891
- schema: {
115892
- type: [
115893
- "boolean"
115894
- ]
115895
- }
115896
- }
115897
- ]
115898
- };
115899
115696
  var DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
115900
115697
  allowNamespaces: true,
115901
115698
  allExtensions: true,
@@ -116325,6 +116122,7 @@ var require_project = __commonJS({
116325
116122
  });
116326
116123
  var _interop_require_default = require_interop_require_default();
116327
116124
  var _path = /* @__PURE__ */ _interop_require_default._(require("path"));
116125
+ var _pkgup = /* @__PURE__ */ _interop_require_default._(require_pkg_up2());
116328
116126
  var _commands = require_commands();
116329
116127
  var _compiled = require_compiled();
116330
116128
  var _common = require_common3();
@@ -116350,19 +116148,24 @@ var require_project = __commonJS({
116350
116148
  return false;
116351
116149
  }
116352
116150
  };
116353
- var isApiOnly = (appDirectory, entryDir) => __async(exports, null, function* () {
116354
- const srcDir = _path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src");
116355
- const existSrc = yield _compiled.fs.pathExists(srcDir);
116151
+ var isApiOnly = (appDirectory, entryDir, apiDir) => __async(exports, null, function* () {
116152
+ const existApi = yield _compiled.fs.pathExists(apiDir !== null && apiDir !== void 0 ? apiDir : _path.default.join(appDirectory, "api"));
116153
+ const existSrc = yield _compiled.fs.pathExists(_path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src"));
116356
116154
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
116357
- return !existSrc || Boolean(options["api-only"]);
116155
+ if (options["api-only"]) {
116156
+ return true;
116157
+ }
116158
+ return existApi && !existSrc;
116358
116159
  });
116359
116160
  var isWebOnly = () => __async(exports, null, function* () {
116360
116161
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
116361
116162
  return Boolean(options["web-only"]);
116362
116163
  });
116363
116164
  var isBeyondReact17 = (cwd) => {
116364
- const pkgPath = _path.default.join(cwd, "package.json");
116365
- if (!_compiled.fs.existsSync(pkgPath)) {
116165
+ const pkgPath = _pkgup.default.sync({
116166
+ cwd
116167
+ });
116168
+ if (!pkgPath) {
116366
116169
  return false;
116367
116170
  }
116368
116171
  const pkgInfo = JSON.parse(_compiled.fs.readFileSync(pkgPath, "utf8"));
@@ -116688,21 +116491,6 @@ var require_get2 = __commonJS({
116688
116491
  }
116689
116492
  });
116690
116493
 
116691
- // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/cjs/_define_property.cjs
116692
- var require_define_property = __commonJS({
116693
- "../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/cjs/_define_property.cjs"(exports) {
116694
- "use strict";
116695
- exports._ = exports._define_property = _define_property15;
116696
- function _define_property15(obj, key, value) {
116697
- if (key in obj) {
116698
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
116699
- } else
116700
- obj[key] = value;
116701
- return obj;
116702
- }
116703
- }
116704
- });
116705
-
116706
116494
  // ../../../toolkit/utils/dist/cjs/cli/logger.js
116707
116495
  var require_logger2 = __commonJS({
116708
116496
  "../../../toolkit/utils/dist/cjs/cli/logger.js"(exports) {
@@ -116725,7 +116513,6 @@ var require_logger2 = __commonJS({
116725
116513
  return logger;
116726
116514
  }
116727
116515
  });
116728
- var _define_property15 = require_define_property();
116729
116516
  var _interop_require_default = require_interop_require_default();
116730
116517
  var _chalk = /* @__PURE__ */ _interop_require_default._(require_chalk2());
116731
116518
  var LOG_LEVEL = {
@@ -116811,10 +116598,6 @@ ${_chalk.default.grey(rest.join("\n"))}`;
116811
116598
  return longestLabel;
116812
116599
  }
116813
116600
  constructor(options = {}) {
116814
- _define_property15._(this, "level", void 0);
116815
- _define_property15._(this, "config", void 0);
116816
- _define_property15._(this, "types", void 0);
116817
- _define_property15._(this, "longestLabel", void 0);
116818
116601
  this.level = options.level || LOG_TYPES.log.level;
116819
116602
  this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
116820
116603
  this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
@@ -117744,31 +117527,6 @@ var require_runtimeExports = __commonJS({
117744
117527
  }
117745
117528
  });
117746
117529
 
117747
- // ../../../toolkit/utils/dist/cjs/cli/test.js
117748
- var require_test = __commonJS({
117749
- "../../../toolkit/utils/dist/cjs/cli/test.js"(exports) {
117750
- "use strict";
117751
- Object.defineProperty(exports, "__esModule", {
117752
- value: true
117753
- });
117754
- Object.defineProperty(exports, "initSnapshotSerializer", {
117755
- enumerable: true,
117756
- get: function() {
117757
- return initSnapshotSerializer;
117758
- }
117759
- });
117760
- var initSnapshotSerializer = (root) => {
117761
- expect.addSnapshotSerializer({
117762
- test: (val) => typeof val === "string" && (val.includes("modern.js") || val.includes("node_modules") || val.includes(root)),
117763
- print: (val) => (
117764
- // eslint-disable-next-line no-nested-ternary
117765
- typeof val === "string" ? val.includes("node_modules") ? `"${val.replace(/.+node_modules/, ``).replace(/\\/g, "/")}"` : val.includes("modern.js") ? `"${val.replace(/.+modern\.js/, ``).replace(/\\/g, "/")}"` : `"${val.replace(root, "").replace(/\\/g, "/")}"` : val
117766
- )
117767
- });
117768
- };
117769
- }
117770
- });
117771
-
117772
117530
  // ../../../toolkit/utils/dist/cjs/cli/watch.js
117773
117531
  var require_watch = __commonJS({
117774
117532
  "../../../toolkit/utils/dist/cjs/cli/watch.js"(exports) {
@@ -117865,7 +117623,6 @@ var require_cli = __commonJS({
117865
117623
  _export_star._(require_require(), exports);
117866
117624
  _export_star._(require_routes(), exports);
117867
117625
  _export_star._(require_runtimeExports(), exports);
117868
- _export_star._(require_test(), exports);
117869
117626
  _export_star._(require_watch(), exports);
117870
117627
  }
117871
117628
  });
@@ -133264,7 +133021,7 @@ var ZH_LOCALE2 = {
133264
133021
  function: {
133265
133022
  self: "启用可选功能",
133266
133023
  question: "请选择功能名称",
133267
- tailwindcss: "启用 「Tailwind CSS」 支持",
133024
+ tailwindcss: "启用「Tailwind CSS」 支持",
133268
133025
  bff: "启用「BFF」功能",
133269
133026
  micro_frontend: "启用「微前端」模式",
133270
133027
  i18n: "启用「国际化(i18n)」功能",
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.21",
18
+ "version": "3.1.23",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -30,16 +30,17 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@scripts/build": "2.22.1",
34
- "@modern-js/generator-utils": "3.1.21",
35
- "@scripts/jest-config": "2.22.1",
36
- "@modern-js/plugin-i18n": "2.22.1",
37
- "@modern-js/generator-common": "3.1.21"
33
+ "@scripts/build": "2.23.1",
34
+ "@scripts/jest-config": "2.23.1",
35
+ "@modern-js/generator-utils": "3.1.23",
36
+ "@modern-js/plugin-i18n": "2.23.1",
37
+ "@modern-js/generator-common": "3.1.23"
38
38
  },
39
39
  "sideEffects": false,
40
40
  "publishConfig": {
41
41
  "registry": "https://registry.npmjs.org/",
42
- "access": "public"
42
+ "access": "public",
43
+ "provenance": true
43
44
  },
44
45
  "types": "./src/index.ts",
45
46
  "scripts": {