@modern-js/entry-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 +9 -8
package/dist/index.js CHANGED
@@ -35121,10 +35121,14 @@ var require_chainId = __commonJS({
35121
35121
  SVG: "svg",
35122
35122
  /** Rule for pug */
35123
35123
  PUG: "pug",
35124
+ /** Rule for Vue */
35125
+ VUE: "vue",
35124
35126
  /** Rule for toml */
35125
35127
  TOML: "toml",
35126
35128
  /** Rule for yaml */
35127
35129
  YAML: "yaml",
35130
+ /** Rule for wasm */
35131
+ WASM: "wasm",
35128
35132
  /** Rule for bff */
35129
35133
  JS_BFF_API: "js-bff-api"
35130
35134
  },
@@ -35151,6 +35155,8 @@ var require_chainId = __commonJS({
35151
35155
  URL: "url",
35152
35156
  /** pug-loader */
35153
35157
  PUG: "pug",
35158
+ /** vue-loader */
35159
+ VUE: "vue",
35154
35160
  /** file-loader */
35155
35161
  FILE: "file",
35156
35162
  /** @svgr/webpack */
@@ -35220,12 +35226,16 @@ var require_chainId = __commonJS({
35220
35226
  BUNDLE_ANALYZER: "bundle-analyze",
35221
35227
  /** BottomTemplatePlugin */
35222
35228
  BOTTOM_TEMPLATE: "bottom-template",
35223
- /** HtmlCrossOriginPlugin */
35224
- HTML_CROSS_ORIGIN: "html-cross-origin",
35229
+ /** HtmlTagsPlugin */
35230
+ HTML_TAGS: "html-tags",
35225
35231
  /** HtmlNoncePlugin */
35226
35232
  HTML_NONCE: "html-nonce",
35233
+ /** HtmlCrossOriginPlugin */
35234
+ HTML_CROSS_ORIGIN: "html-cross-origin",
35227
35235
  /** MiniCssExtractPlugin */
35228
35236
  MINI_CSS_EXTRACT: "mini-css-extract",
35237
+ /** VueLoaderPlugin */
35238
+ VUE_LOADER_PLUGIN: "vue-loader-plugin",
35229
35239
  /** ReactFastRefreshPlugin */
35230
35240
  REACT_FAST_REFRESH: "react-fast-refresh",
35231
35241
  /** ProvidePlugin for node polyfill */
@@ -35239,9 +35249,7 @@ var require_chainId = __commonJS({
35239
35249
  /** HtmlAsyncChunkPlugin */
35240
35250
  HTML_ASYNC_CHUNK: "html-async-chunk",
35241
35251
  /** SWC_POLYFILL_CHECKER */
35242
- SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin",
35243
- /** HtmlTagsPlugin */
35244
- HTML_TAGS: "html-tags"
35252
+ SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin"
35245
35253
  },
35246
35254
  /** Predefined minimizers */
35247
35255
  MINIMIZER: {
@@ -35283,6 +35291,9 @@ var require_constants = __commonJS({
35283
35291
  ROUTE_SPEC_FILE: function() {
35284
35292
  return ROUTE_SPEC_FILE;
35285
35293
  },
35294
+ NESTED_ROUTE_SPEC_FILE: function() {
35295
+ return NESTED_ROUTE_SPEC_FILE;
35296
+ },
35286
35297
  MAIN_ENTRY_NAME: function() {
35287
35298
  return MAIN_ENTRY_NAME;
35288
35299
  },
@@ -35367,9 +35378,6 @@ var require_constants = __commonJS({
35367
35378
  INTERNAL_SERVER_PLUGINS: function() {
35368
35379
  return INTERNAL_SERVER_PLUGINS;
35369
35380
  },
35370
- PLUGIN_SCHEMAS: function() {
35371
- return PLUGIN_SCHEMAS;
35372
- },
35373
35381
  DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: function() {
35374
35382
  return DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS;
35375
35383
  }
@@ -35377,6 +35385,7 @@ var require_constants = __commonJS({
35377
35385
  var _export_star = require_export_star();
35378
35386
  _export_star._(require_chainId(), exports);
35379
35387
  var ROUTE_SPEC_FILE = "route.json";
35388
+ var NESTED_ROUTE_SPEC_FILE = "nestedRoutes.json";
35380
35389
  var MAIN_ENTRY_NAME = "main";
35381
35390
  var SERVER_BUNDLE_DIRECTORY = "bundles";
35382
35391
  var SERVER_WORKER_BUNDLE_DIRECTORY = "worker";
@@ -35423,8 +35432,6 @@ var require_constants = __commonJS({
35423
35432
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
35424
35433
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
35425
35434
  "@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
35435
  // legacy router (inner react-router-dom v5)
35429
35436
  "@modern-js/plugin-router-legacy": "@modern-js/plugin-router-legacy/cli"
35430
35437
  };
@@ -35455,8 +35462,6 @@ var require_constants = __commonJS({
35455
35462
  "@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
35456
35463
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
35457
35464
  "@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
35465
  // legacy router (inner react-router-dom v5)
35461
35466
  "@modern-js/plugin-router-v5": "@modern-js/plugin-router-v5/cli"
35462
35467
  };
@@ -35472,214 +35477,6 @@ var require_constants = __commonJS({
35472
35477
  [SERVER_PLUGIN_SERVER]: "@modern-js/plugin-server/server",
35473
35478
  [SERVER_PLUGIN_POLYFILL]: "@modern-js/plugin-polyfill/server"
35474
35479
  };
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
35480
  var DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
35684
35481
  allowNamespaces: true,
35685
35482
  allExtensions: true,
@@ -36109,6 +35906,7 @@ var require_project = __commonJS({
36109
35906
  });
36110
35907
  var _interop_require_default = require_interop_require_default();
36111
35908
  var _path = /* @__PURE__ */ _interop_require_default._(require("path"));
35909
+ var _pkgup = /* @__PURE__ */ _interop_require_default._(require_pkg_up());
36112
35910
  var _commands = require_commands();
36113
35911
  var _compiled = require_compiled();
36114
35912
  var _common = require_common();
@@ -36134,19 +35932,24 @@ var require_project = __commonJS({
36134
35932
  return false;
36135
35933
  }
36136
35934
  };
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);
35935
+ var isApiOnly = (appDirectory, entryDir, apiDir) => __async(exports, null, function* () {
35936
+ const existApi = yield _compiled.fs.pathExists(apiDir !== null && apiDir !== void 0 ? apiDir : _path.default.join(appDirectory, "api"));
35937
+ const existSrc = yield _compiled.fs.pathExists(_path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src"));
36140
35938
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
36141
- return !existSrc || Boolean(options["api-only"]);
35939
+ if (options["api-only"]) {
35940
+ return true;
35941
+ }
35942
+ return existApi && !existSrc;
36142
35943
  });
36143
35944
  var isWebOnly = () => __async(exports, null, function* () {
36144
35945
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
36145
35946
  return Boolean(options["web-only"]);
36146
35947
  });
36147
35948
  var isBeyondReact17 = (cwd) => {
36148
- const pkgPath = _path.default.join(cwd, "package.json");
36149
- if (!_compiled.fs.existsSync(pkgPath)) {
35949
+ const pkgPath = _pkgup.default.sync({
35950
+ cwd
35951
+ });
35952
+ if (!pkgPath) {
36150
35953
  return false;
36151
35954
  }
36152
35955
  const pkgInfo = JSON.parse(_compiled.fs.readFileSync(pkgPath, "utf8"));
@@ -36472,21 +36275,6 @@ var require_get = __commonJS({
36472
36275
  }
36473
36276
  });
36474
36277
 
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
36278
  // ../../../toolkit/utils/dist/cjs/cli/logger.js
36491
36279
  var require_logger = __commonJS({
36492
36280
  "../../../toolkit/utils/dist/cjs/cli/logger.js"(exports) {
@@ -36509,7 +36297,6 @@ var require_logger = __commonJS({
36509
36297
  return logger;
36510
36298
  }
36511
36299
  });
36512
- var _define_property14 = require_define_property();
36513
36300
  var _interop_require_default = require_interop_require_default();
36514
36301
  var _chalk = /* @__PURE__ */ _interop_require_default._(require_chalk());
36515
36302
  var LOG_LEVEL = {
@@ -36595,10 +36382,6 @@ ${_chalk.default.grey(rest.join("\n"))}`;
36595
36382
  return longestLabel;
36596
36383
  }
36597
36384
  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
36385
  this.level = options.level || LOG_TYPES.log.level;
36603
36386
  this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
36604
36387
  this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
@@ -37528,31 +37311,6 @@ var require_runtimeExports = __commonJS({
37528
37311
  }
37529
37312
  });
37530
37313
 
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
37314
  // ../../../toolkit/utils/dist/cjs/cli/watch.js
37557
37315
  var require_watch = __commonJS({
37558
37316
  "../../../toolkit/utils/dist/cjs/cli/watch.js"(exports) {
@@ -37649,7 +37407,6 @@ var require_cli = __commonJS({
37649
37407
  _export_star._(require_require(), exports);
37650
37408
  _export_star._(require_routes(), exports);
37651
37409
  _export_star._(require_runtimeExports(), exports);
37652
- _export_star._(require_test(), exports);
37653
37410
  _export_star._(require_watch(), exports);
37654
37411
  }
37655
37412
  });
@@ -74169,7 +73926,7 @@ var require_parse = __commonJS({
74169
73926
  return current.type === "Punctuator" ? current.value : current.type;
74170
73927
  };
74171
73928
  var is = (t) => type() === t;
74172
- var expect2 = (a) => {
73929
+ var expect = (a) => {
74173
73930
  if (!is(a)) {
74174
73931
  unexpected();
74175
73932
  }
@@ -74251,7 +74008,7 @@ var require_parse = __commonJS({
74251
74008
  while (!is(CURLY_BRACKET_CLOSE)) {
74252
74009
  if (started) {
74253
74010
  assign_comments(PREFIX_AFTER_VALUE);
74254
- expect2(COMMA);
74011
+ expect(COMMA);
74255
74012
  next();
74256
74013
  parse_comments();
74257
74014
  assign_after_comments();
@@ -74260,13 +74017,13 @@ var require_parse = __commonJS({
74260
74017
  }
74261
74018
  }
74262
74019
  started = true;
74263
- expect2("String");
74020
+ expect("String");
74264
74021
  name = JSON.parse(current.value);
74265
74022
  set_prop(name);
74266
74023
  assign_comments(PREFIX_BEFORE);
74267
74024
  next();
74268
74025
  parse_comments(PREFIX_AFTER_PROP);
74269
- expect2(COLON);
74026
+ expect(COLON);
74270
74027
  next();
74271
74028
  parse_comments(PREFIX_AFTER_COLON);
74272
74029
  obj[name] = transform(name, walk());
@@ -74294,7 +74051,7 @@ var require_parse = __commonJS({
74294
74051
  while (!is(BRACKET_CLOSE)) {
74295
74052
  if (started) {
74296
74053
  assign_comments(PREFIX_AFTER_VALUE);
74297
- expect2(COMMA);
74054
+ expect(COMMA);
74298
74055
  next();
74299
74056
  parse_comments();
74300
74057
  assign_after_comments();
@@ -116382,7 +116139,7 @@ var ZH_LOCALE = {
116382
116139
  function: {
116383
116140
  self: "启用可选功能",
116384
116141
  question: "请选择功能名称",
116385
- tailwindcss: "启用 「Tailwind CSS」 支持",
116142
+ tailwindcss: "启用「Tailwind CSS」 支持",
116386
116143
  bff: "启用「BFF」功能",
116387
116144
  micro_frontend: "启用「微前端」模式",
116388
116145
  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,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.23",
34
+ "@modern-js/utils": "2.23.1",
35
+ "@modern-js/plugin-i18n": "2.23.1",
36
+ "@modern-js/generator-utils": "3.1.23",
37
+ "@scripts/build": "2.23.1",
38
+ "@scripts/jest-config": "2.23.1"
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": {