@modern-js/entry-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 +9 -8
package/dist/index.js CHANGED
@@ -35283,6 +35283,9 @@ var require_constants = __commonJS({
35283
35283
  ROUTE_SPEC_FILE: function() {
35284
35284
  return ROUTE_SPEC_FILE;
35285
35285
  },
35286
+ NESTED_ROUTE_SPEC_FILE: function() {
35287
+ return NESTED_ROUTE_SPEC_FILE;
35288
+ },
35286
35289
  MAIN_ENTRY_NAME: function() {
35287
35290
  return MAIN_ENTRY_NAME;
35288
35291
  },
@@ -35367,9 +35370,6 @@ var require_constants = __commonJS({
35367
35370
  INTERNAL_SERVER_PLUGINS: function() {
35368
35371
  return INTERNAL_SERVER_PLUGINS;
35369
35372
  },
35370
- PLUGIN_SCHEMAS: function() {
35371
- return PLUGIN_SCHEMAS;
35372
- },
35373
35373
  DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: function() {
35374
35374
  return DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS;
35375
35375
  }
@@ -35377,6 +35377,7 @@ var require_constants = __commonJS({
35377
35377
  var _export_star = require_export_star();
35378
35378
  _export_star._(require_chainId(), exports);
35379
35379
  var ROUTE_SPEC_FILE = "route.json";
35380
+ var NESTED_ROUTE_SPEC_FILE = "nestedRoutes.json";
35380
35381
  var MAIN_ENTRY_NAME = "main";
35381
35382
  var SERVER_BUNDLE_DIRECTORY = "bundles";
35382
35383
  var SERVER_WORKER_BUNDLE_DIRECTORY = "worker";
@@ -35423,8 +35424,6 @@ var require_constants = __commonJS({
35423
35424
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
35424
35425
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
35425
35426
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
35426
- // TODO: Maybe can remove it
35427
- "@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
35428
35427
  // legacy router (inner react-router-dom v5)
35429
35428
  "@modern-js/plugin-router-legacy": "@modern-js/plugin-router-legacy/cli"
35430
35429
  };
@@ -35455,8 +35454,6 @@ var require_constants = __commonJS({
35455
35454
  "@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
35456
35455
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
35457
35456
  "@modern-js/plugin-polyfill": "@modern-js/plugin-polyfill/cli",
35458
- // TODO: Maybe can remove it
35459
- "@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
35460
35457
  // legacy router (inner react-router-dom v5)
35461
35458
  "@modern-js/plugin-router-v5": "@modern-js/plugin-router-v5/cli"
35462
35459
  };
@@ -35472,214 +35469,6 @@ var require_constants = __commonJS({
35472
35469
  [SERVER_PLUGIN_SERVER]: "@modern-js/plugin-server/server",
35473
35470
  [SERVER_PLUGIN_POLYFILL]: "@modern-js/plugin-polyfill/server"
35474
35471
  };
35475
- var PLUGIN_SCHEMAS = {
35476
- "@modern-js/runtime": [
35477
- {
35478
- target: "runtime",
35479
- schema: {
35480
- type: "object",
35481
- additionalProperties: false
35482
- }
35483
- },
35484
- {
35485
- target: "runtimeByEntries",
35486
- schema: {
35487
- type: "object",
35488
- patternProperties: {
35489
- [ENTRY_NAME_PATTERN]: {
35490
- type: "object"
35491
- }
35492
- },
35493
- additionalProperties: false
35494
- }
35495
- }
35496
- ],
35497
- "@modern-js/plugin-swc": [
35498
- {
35499
- target: "tools.swc",
35500
- schema: {
35501
- typeof: [
35502
- "object"
35503
- ]
35504
- }
35505
- }
35506
- ],
35507
- "@modern-js/plugin-bff": [
35508
- {
35509
- target: "bff",
35510
- schema: {
35511
- type: "object",
35512
- properties: {
35513
- prefix: {
35514
- type: [
35515
- "string",
35516
- "array"
35517
- ],
35518
- items: {
35519
- type: "string"
35520
- }
35521
- },
35522
- fetcher: {
35523
- type: "string"
35524
- },
35525
- proxy: {
35526
- type: "object"
35527
- },
35528
- requestCreator: {
35529
- type: "string"
35530
- }
35531
- }
35532
- }
35533
- }
35534
- ],
35535
- "@modern-js/plugin-tailwindcss": [
35536
- {
35537
- target: "tools.tailwindcss",
35538
- schema: {
35539
- typeof: [
35540
- "object",
35541
- "function"
35542
- ]
35543
- }
35544
- }
35545
- ],
35546
- "@modern-js/plugin-proxy": [
35547
- {
35548
- target: "dev.proxy",
35549
- schema: {
35550
- typeof: [
35551
- "string",
35552
- "object"
35553
- ]
35554
- }
35555
- }
35556
- ],
35557
- "@modern-js/plugin-ssg": [
35558
- {
35559
- target: "output.ssg",
35560
- schema: {
35561
- oneOf: [
35562
- {
35563
- type: "boolean"
35564
- },
35565
- {
35566
- type: "object"
35567
- },
35568
- {
35569
- instanceof: "Function"
35570
- }
35571
- ]
35572
- }
35573
- }
35574
- ],
35575
- "@modern-js/plugin-state": [
35576
- {
35577
- target: "runtime.state",
35578
- schema: {
35579
- type: [
35580
- "boolean",
35581
- "object"
35582
- ]
35583
- }
35584
- }
35585
- ],
35586
- "@modern-js/plugin-design-token": [
35587
- // Legacy Features
35588
- {
35589
- target: "source.designSystem",
35590
- schema: {
35591
- typeof: [
35592
- "object"
35593
- ]
35594
- }
35595
- },
35596
- {
35597
- target: "source.designSystem.supportStyledComponents",
35598
- schema: {
35599
- type: [
35600
- "boolean"
35601
- ]
35602
- }
35603
- },
35604
- {
35605
- target: "designSystem",
35606
- schema: {
35607
- typeof: [
35608
- "object"
35609
- ]
35610
- }
35611
- }
35612
- ],
35613
- "@modern-js/plugin-router": [
35614
- {
35615
- target: "runtime.router",
35616
- schema: {
35617
- type: [
35618
- "boolean",
35619
- "object"
35620
- ]
35621
- }
35622
- }
35623
- ],
35624
- "@modern-js/plugin-testing": [
35625
- {
35626
- target: "testing",
35627
- schema: {
35628
- typeof: [
35629
- "object"
35630
- ]
35631
- }
35632
- },
35633
- {
35634
- target: "tools.jest",
35635
- schema: {
35636
- typeof: [
35637
- "object",
35638
- "function"
35639
- ]
35640
- }
35641
- }
35642
- ],
35643
- "@modern-js/plugin-garfish": [
35644
- {
35645
- target: "runtime.masterApp",
35646
- schema: {
35647
- type: [
35648
- "boolean",
35649
- "object"
35650
- ]
35651
- }
35652
- },
35653
- {
35654
- target: "dev.withMasterApp",
35655
- schema: {
35656
- type: [
35657
- "object"
35658
- ]
35659
- }
35660
- },
35661
- {
35662
- target: "deploy.microFrontend",
35663
- schema: {
35664
- type: [
35665
- "boolean",
35666
- "object"
35667
- ]
35668
- }
35669
- }
35670
- ],
35671
- "@modern-js/plugin-nocode": [],
35672
- "@modern-js/plugin-worker": [
35673
- {
35674
- target: "deploy.worker.ssr",
35675
- schema: {
35676
- type: [
35677
- "boolean"
35678
- ]
35679
- }
35680
- }
35681
- ]
35682
- };
35683
35472
  var DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
35684
35473
  allowNamespaces: true,
35685
35474
  allExtensions: true,
@@ -36134,11 +35923,14 @@ var require_project = __commonJS({
36134
35923
  return false;
36135
35924
  }
36136
35925
  };
36137
- var isApiOnly = (appDirectory, entryDir) => __async(exports, null, function* () {
36138
- const srcDir = _path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src");
36139
- const existSrc = yield _compiled.fs.pathExists(srcDir);
35926
+ var isApiOnly = (appDirectory, entryDir, apiDir) => __async(exports, null, function* () {
35927
+ const existApi = yield _compiled.fs.pathExists(apiDir !== null && apiDir !== void 0 ? apiDir : _path.default.join(appDirectory, "api"));
35928
+ const existSrc = yield _compiled.fs.pathExists(_path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src"));
36140
35929
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
36141
- return !existSrc || Boolean(options["api-only"]);
35930
+ if (options["api-only"]) {
35931
+ return true;
35932
+ }
35933
+ return existApi && !existSrc;
36142
35934
  });
36143
35935
  var isWebOnly = () => __async(exports, null, function* () {
36144
35936
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
@@ -36472,21 +36264,6 @@ var require_get = __commonJS({
36472
36264
  }
36473
36265
  });
36474
36266
 
36475
- // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/cjs/_define_property.cjs
36476
- var require_define_property = __commonJS({
36477
- "../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/cjs/_define_property.cjs"(exports) {
36478
- "use strict";
36479
- exports._ = exports._define_property = _define_property14;
36480
- function _define_property14(obj, key, value) {
36481
- if (key in obj) {
36482
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
36483
- } else
36484
- obj[key] = value;
36485
- return obj;
36486
- }
36487
- }
36488
- });
36489
-
36490
36267
  // ../../../toolkit/utils/dist/cjs/cli/logger.js
36491
36268
  var require_logger = __commonJS({
36492
36269
  "../../../toolkit/utils/dist/cjs/cli/logger.js"(exports) {
@@ -36509,7 +36286,6 @@ var require_logger = __commonJS({
36509
36286
  return logger;
36510
36287
  }
36511
36288
  });
36512
- var _define_property14 = require_define_property();
36513
36289
  var _interop_require_default = require_interop_require_default();
36514
36290
  var _chalk = /* @__PURE__ */ _interop_require_default._(require_chalk());
36515
36291
  var LOG_LEVEL = {
@@ -36595,10 +36371,6 @@ ${_chalk.default.grey(rest.join("\n"))}`;
36595
36371
  return longestLabel;
36596
36372
  }
36597
36373
  constructor(options = {}) {
36598
- _define_property14._(this, "level", void 0);
36599
- _define_property14._(this, "config", void 0);
36600
- _define_property14._(this, "types", void 0);
36601
- _define_property14._(this, "longestLabel", void 0);
36602
36374
  this.level = options.level || LOG_TYPES.log.level;
36603
36375
  this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
36604
36376
  this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
@@ -37528,31 +37300,6 @@ var require_runtimeExports = __commonJS({
37528
37300
  }
37529
37301
  });
37530
37302
 
37531
- // ../../../toolkit/utils/dist/cjs/cli/test.js
37532
- var require_test = __commonJS({
37533
- "../../../toolkit/utils/dist/cjs/cli/test.js"(exports) {
37534
- "use strict";
37535
- Object.defineProperty(exports, "__esModule", {
37536
- value: true
37537
- });
37538
- Object.defineProperty(exports, "initSnapshotSerializer", {
37539
- enumerable: true,
37540
- get: function() {
37541
- return initSnapshotSerializer;
37542
- }
37543
- });
37544
- var initSnapshotSerializer = (root) => {
37545
- expect.addSnapshotSerializer({
37546
- test: (val) => typeof val === "string" && (val.includes("modern.js") || val.includes("node_modules") || val.includes(root)),
37547
- print: (val) => (
37548
- // eslint-disable-next-line no-nested-ternary
37549
- 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
37550
- )
37551
- });
37552
- };
37553
- }
37554
- });
37555
-
37556
37303
  // ../../../toolkit/utils/dist/cjs/cli/watch.js
37557
37304
  var require_watch = __commonJS({
37558
37305
  "../../../toolkit/utils/dist/cjs/cli/watch.js"(exports) {
@@ -37649,7 +37396,6 @@ var require_cli = __commonJS({
37649
37396
  _export_star._(require_require(), exports);
37650
37397
  _export_star._(require_routes(), exports);
37651
37398
  _export_star._(require_runtimeExports(), exports);
37652
- _export_star._(require_test(), exports);
37653
37399
  _export_star._(require_watch(), exports);
37654
37400
  }
37655
37401
  });
@@ -74169,7 +73915,7 @@ var require_parse = __commonJS({
74169
73915
  return current.type === "Punctuator" ? current.value : current.type;
74170
73916
  };
74171
73917
  var is = (t) => type() === t;
74172
- var expect2 = (a) => {
73918
+ var expect = (a) => {
74173
73919
  if (!is(a)) {
74174
73920
  unexpected();
74175
73921
  }
@@ -74251,7 +73997,7 @@ var require_parse = __commonJS({
74251
73997
  while (!is(CURLY_BRACKET_CLOSE)) {
74252
73998
  if (started) {
74253
73999
  assign_comments(PREFIX_AFTER_VALUE);
74254
- expect2(COMMA);
74000
+ expect(COMMA);
74255
74001
  next();
74256
74002
  parse_comments();
74257
74003
  assign_after_comments();
@@ -74260,13 +74006,13 @@ var require_parse = __commonJS({
74260
74006
  }
74261
74007
  }
74262
74008
  started = true;
74263
- expect2("String");
74009
+ expect("String");
74264
74010
  name = JSON.parse(current.value);
74265
74011
  set_prop(name);
74266
74012
  assign_comments(PREFIX_BEFORE);
74267
74013
  next();
74268
74014
  parse_comments(PREFIX_AFTER_PROP);
74269
- expect2(COLON);
74015
+ expect(COLON);
74270
74016
  next();
74271
74017
  parse_comments(PREFIX_AFTER_COLON);
74272
74018
  obj[name] = transform(name, walk());
@@ -74294,7 +74040,7 @@ var require_parse = __commonJS({
74294
74040
  while (!is(BRACKET_CLOSE)) {
74295
74041
  if (started) {
74296
74042
  assign_comments(PREFIX_AFTER_VALUE);
74297
- expect2(COMMA);
74043
+ expect(COMMA);
74298
74044
  next();
74299
74045
  parse_comments();
74300
74046
  assign_after_comments();
@@ -116382,7 +116128,7 @@ var ZH_LOCALE = {
116382
116128
  function: {
116383
116129
  self: "启用可选功能",
116384
116130
  question: "请选择功能名称",
116385
- tailwindcss: "启用 「Tailwind CSS」 支持",
116131
+ tailwindcss: "启用「Tailwind CSS」 支持",
116386
116132
  bff: "启用「BFF」功能",
116387
116133
  micro_frontend: "启用「微前端」模式",
116388
116134
  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,17 +30,18 @@
30
30
  "@types/node": "^14",
31
31
  "jest": "^29",
32
32
  "typescript": "^5",
33
- "@modern-js/generator-utils": "3.1.21",
34
- "@modern-js/utils": "2.22.1",
35
- "@modern-js/plugin-i18n": "2.22.1",
36
- "@modern-js/generator-common": "3.1.21",
37
- "@scripts/build": "2.22.1",
38
- "@scripts/jest-config": "2.22.1"
33
+ "@modern-js/generator-common": "3.1.22",
34
+ "@modern-js/utils": "2.23.0",
35
+ "@modern-js/plugin-i18n": "2.23.0",
36
+ "@modern-js/generator-utils": "3.1.22",
37
+ "@scripts/build": "2.23.0",
38
+ "@scripts/jest-config": "2.23.0"
39
39
  },
40
40
  "sideEffects": false,
41
41
  "publishConfig": {
42
42
  "registry": "https://registry.npmjs.org/",
43
- "access": "public"
43
+ "access": "public",
44
+ "provenance": true
44
45
  },
45
46
  "types": "./src/index.ts",
46
47
  "scripts": {