@modern-js/dependence-generator 3.1.21 → 3.1.22

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 +17 -271
  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();
@@ -115499,6 +115499,9 @@ var require_constants = __commonJS({
115499
115499
  ROUTE_SPEC_FILE: function() {
115500
115500
  return ROUTE_SPEC_FILE;
115501
115501
  },
115502
+ NESTED_ROUTE_SPEC_FILE: function() {
115503
+ return NESTED_ROUTE_SPEC_FILE;
115504
+ },
115502
115505
  MAIN_ENTRY_NAME: function() {
115503
115506
  return MAIN_ENTRY_NAME;
115504
115507
  },
@@ -115583,9 +115586,6 @@ var require_constants = __commonJS({
115583
115586
  INTERNAL_SERVER_PLUGINS: function() {
115584
115587
  return INTERNAL_SERVER_PLUGINS;
115585
115588
  },
115586
- PLUGIN_SCHEMAS: function() {
115587
- return PLUGIN_SCHEMAS;
115588
- },
115589
115589
  DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: function() {
115590
115590
  return DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS;
115591
115591
  }
@@ -115593,6 +115593,7 @@ var require_constants = __commonJS({
115593
115593
  var _export_star = require_export_star();
115594
115594
  _export_star._(require_chainId(), exports);
115595
115595
  var ROUTE_SPEC_FILE = "route.json";
115596
+ var NESTED_ROUTE_SPEC_FILE = "nestedRoutes.json";
115596
115597
  var MAIN_ENTRY_NAME = "main";
115597
115598
  var SERVER_BUNDLE_DIRECTORY = "bundles";
115598
115599
  var SERVER_WORKER_BUNDLE_DIRECTORY = "worker";
@@ -115639,8 +115640,6 @@ var require_constants = __commonJS({
115639
115640
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
115640
115641
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
115641
115642
  "@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
115643
  // legacy router (inner react-router-dom v5)
115645
115644
  "@modern-js/plugin-router-legacy": "@modern-js/plugin-router-legacy/cli"
115646
115645
  };
@@ -115671,8 +115670,6 @@ var require_constants = __commonJS({
115671
115670
  "@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
115672
115671
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
115673
115672
  "@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
115673
  // legacy router (inner react-router-dom v5)
115677
115674
  "@modern-js/plugin-router-v5": "@modern-js/plugin-router-v5/cli"
115678
115675
  };
@@ -115688,214 +115685,6 @@ var require_constants = __commonJS({
115688
115685
  [SERVER_PLUGIN_SERVER]: "@modern-js/plugin-server/server",
115689
115686
  [SERVER_PLUGIN_POLYFILL]: "@modern-js/plugin-polyfill/server"
115690
115687
  };
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
115688
  var DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
115900
115689
  allowNamespaces: true,
115901
115690
  allExtensions: true,
@@ -116350,11 +116139,14 @@ var require_project = __commonJS({
116350
116139
  return false;
116351
116140
  }
116352
116141
  };
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);
116142
+ var isApiOnly = (appDirectory, entryDir, apiDir) => __async(exports, null, function* () {
116143
+ const existApi = yield _compiled.fs.pathExists(apiDir !== null && apiDir !== void 0 ? apiDir : _path.default.join(appDirectory, "api"));
116144
+ const existSrc = yield _compiled.fs.pathExists(_path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src"));
116356
116145
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
116357
- return !existSrc || Boolean(options["api-only"]);
116146
+ if (options["api-only"]) {
116147
+ return true;
116148
+ }
116149
+ return existApi && !existSrc;
116358
116150
  });
116359
116151
  var isWebOnly = () => __async(exports, null, function* () {
116360
116152
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
@@ -116688,21 +116480,6 @@ var require_get2 = __commonJS({
116688
116480
  }
116689
116481
  });
116690
116482
 
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
116483
  // ../../../toolkit/utils/dist/cjs/cli/logger.js
116707
116484
  var require_logger2 = __commonJS({
116708
116485
  "../../../toolkit/utils/dist/cjs/cli/logger.js"(exports) {
@@ -116725,7 +116502,6 @@ var require_logger2 = __commonJS({
116725
116502
  return logger;
116726
116503
  }
116727
116504
  });
116728
- var _define_property15 = require_define_property();
116729
116505
  var _interop_require_default = require_interop_require_default();
116730
116506
  var _chalk = /* @__PURE__ */ _interop_require_default._(require_chalk2());
116731
116507
  var LOG_LEVEL = {
@@ -116811,10 +116587,6 @@ ${_chalk.default.grey(rest.join("\n"))}`;
116811
116587
  return longestLabel;
116812
116588
  }
116813
116589
  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
116590
  this.level = options.level || LOG_TYPES.log.level;
116819
116591
  this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
116820
116592
  this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
@@ -117744,31 +117516,6 @@ var require_runtimeExports = __commonJS({
117744
117516
  }
117745
117517
  });
117746
117518
 
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
117519
  // ../../../toolkit/utils/dist/cjs/cli/watch.js
117773
117520
  var require_watch = __commonJS({
117774
117521
  "../../../toolkit/utils/dist/cjs/cli/watch.js"(exports) {
@@ -117865,7 +117612,6 @@ var require_cli = __commonJS({
117865
117612
  _export_star._(require_require(), exports);
117866
117613
  _export_star._(require_routes(), exports);
117867
117614
  _export_star._(require_runtimeExports(), exports);
117868
- _export_star._(require_test(), exports);
117869
117615
  _export_star._(require_watch(), exports);
117870
117616
  }
117871
117617
  });
@@ -133264,7 +133010,7 @@ var ZH_LOCALE2 = {
133264
133010
  function: {
133265
133011
  self: "启用可选功能",
133266
133012
  question: "请选择功能名称",
133267
- tailwindcss: "启用 「Tailwind CSS」 支持",
133013
+ tailwindcss: "启用「Tailwind CSS」 支持",
133268
133014
  bff: "启用「BFF」功能",
133269
133015
  micro_frontend: "启用「微前端」模式",
133270
133016
  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.22",
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.0",
34
+ "@modern-js/generator-utils": "3.1.22",
35
+ "@scripts/jest-config": "2.23.0",
36
+ "@modern-js/plugin-i18n": "2.23.0",
37
+ "@modern-js/generator-common": "3.1.22"
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": {