@modern-js/ssg-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 -273
  2. package/package.json +9 -8
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();
@@ -113878,6 +113878,9 @@ var require_constants = __commonJS({
113878
113878
  ROUTE_SPEC_FILE: function() {
113879
113879
  return ROUTE_SPEC_FILE;
113880
113880
  },
113881
+ NESTED_ROUTE_SPEC_FILE: function() {
113882
+ return NESTED_ROUTE_SPEC_FILE;
113883
+ },
113881
113884
  MAIN_ENTRY_NAME: function() {
113882
113885
  return MAIN_ENTRY_NAME;
113883
113886
  },
@@ -113962,9 +113965,6 @@ var require_constants = __commonJS({
113962
113965
  INTERNAL_SERVER_PLUGINS: function() {
113963
113966
  return INTERNAL_SERVER_PLUGINS;
113964
113967
  },
113965
- PLUGIN_SCHEMAS: function() {
113966
- return PLUGIN_SCHEMAS;
113967
- },
113968
113968
  DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: function() {
113969
113969
  return DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS;
113970
113970
  }
@@ -113972,6 +113972,7 @@ var require_constants = __commonJS({
113972
113972
  var _export_star = require_export_star();
113973
113973
  _export_star._(require_chainId(), exports);
113974
113974
  var ROUTE_SPEC_FILE = "route.json";
113975
+ var NESTED_ROUTE_SPEC_FILE = "nestedRoutes.json";
113975
113976
  var MAIN_ENTRY_NAME = "main";
113976
113977
  var SERVER_BUNDLE_DIRECTORY = "bundles";
113977
113978
  var SERVER_WORKER_BUNDLE_DIRECTORY = "worker";
@@ -114018,8 +114019,6 @@ var require_constants = __commonJS({
114018
114019
  "@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
114019
114020
  "@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
114020
114021
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
114021
- // TODO: Maybe can remove it
114022
- "@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
114023
114022
  // legacy router (inner react-router-dom v5)
114024
114023
  "@modern-js/plugin-router-legacy": "@modern-js/plugin-router-legacy/cli"
114025
114024
  };
@@ -114050,8 +114049,6 @@ var require_constants = __commonJS({
114050
114049
  "@modern-js/plugin-garfish": "@modern-js/plugin-garfish/cli",
114051
114050
  "@modern-js/plugin-tailwindcss": "@modern-js/plugin-tailwindcss/cli",
114052
114051
  "@modern-js/plugin-polyfill": "@modern-js/plugin-polyfill/cli",
114053
- // TODO: Maybe can remove it
114054
- "@modern-js/plugin-nocode": "@modern-js/plugin-nocode/cli",
114055
114052
  // legacy router (inner react-router-dom v5)
114056
114053
  "@modern-js/plugin-router-v5": "@modern-js/plugin-router-v5/cli"
114057
114054
  };
@@ -114067,214 +114064,6 @@ var require_constants = __commonJS({
114067
114064
  [SERVER_PLUGIN_SERVER]: "@modern-js/plugin-server/server",
114068
114065
  [SERVER_PLUGIN_POLYFILL]: "@modern-js/plugin-polyfill/server"
114069
114066
  };
114070
- var PLUGIN_SCHEMAS = {
114071
- "@modern-js/runtime": [
114072
- {
114073
- target: "runtime",
114074
- schema: {
114075
- type: "object",
114076
- additionalProperties: false
114077
- }
114078
- },
114079
- {
114080
- target: "runtimeByEntries",
114081
- schema: {
114082
- type: "object",
114083
- patternProperties: {
114084
- [ENTRY_NAME_PATTERN]: {
114085
- type: "object"
114086
- }
114087
- },
114088
- additionalProperties: false
114089
- }
114090
- }
114091
- ],
114092
- "@modern-js/plugin-swc": [
114093
- {
114094
- target: "tools.swc",
114095
- schema: {
114096
- typeof: [
114097
- "object"
114098
- ]
114099
- }
114100
- }
114101
- ],
114102
- "@modern-js/plugin-bff": [
114103
- {
114104
- target: "bff",
114105
- schema: {
114106
- type: "object",
114107
- properties: {
114108
- prefix: {
114109
- type: [
114110
- "string",
114111
- "array"
114112
- ],
114113
- items: {
114114
- type: "string"
114115
- }
114116
- },
114117
- fetcher: {
114118
- type: "string"
114119
- },
114120
- proxy: {
114121
- type: "object"
114122
- },
114123
- requestCreator: {
114124
- type: "string"
114125
- }
114126
- }
114127
- }
114128
- }
114129
- ],
114130
- "@modern-js/plugin-tailwindcss": [
114131
- {
114132
- target: "tools.tailwindcss",
114133
- schema: {
114134
- typeof: [
114135
- "object",
114136
- "function"
114137
- ]
114138
- }
114139
- }
114140
- ],
114141
- "@modern-js/plugin-proxy": [
114142
- {
114143
- target: "dev.proxy",
114144
- schema: {
114145
- typeof: [
114146
- "string",
114147
- "object"
114148
- ]
114149
- }
114150
- }
114151
- ],
114152
- "@modern-js/plugin-ssg": [
114153
- {
114154
- target: "output.ssg",
114155
- schema: {
114156
- oneOf: [
114157
- {
114158
- type: "boolean"
114159
- },
114160
- {
114161
- type: "object"
114162
- },
114163
- {
114164
- instanceof: "Function"
114165
- }
114166
- ]
114167
- }
114168
- }
114169
- ],
114170
- "@modern-js/plugin-state": [
114171
- {
114172
- target: "runtime.state",
114173
- schema: {
114174
- type: [
114175
- "boolean",
114176
- "object"
114177
- ]
114178
- }
114179
- }
114180
- ],
114181
- "@modern-js/plugin-design-token": [
114182
- // Legacy Features
114183
- {
114184
- target: "source.designSystem",
114185
- schema: {
114186
- typeof: [
114187
- "object"
114188
- ]
114189
- }
114190
- },
114191
- {
114192
- target: "source.designSystem.supportStyledComponents",
114193
- schema: {
114194
- type: [
114195
- "boolean"
114196
- ]
114197
- }
114198
- },
114199
- {
114200
- target: "designSystem",
114201
- schema: {
114202
- typeof: [
114203
- "object"
114204
- ]
114205
- }
114206
- }
114207
- ],
114208
- "@modern-js/plugin-router": [
114209
- {
114210
- target: "runtime.router",
114211
- schema: {
114212
- type: [
114213
- "boolean",
114214
- "object"
114215
- ]
114216
- }
114217
- }
114218
- ],
114219
- "@modern-js/plugin-testing": [
114220
- {
114221
- target: "testing",
114222
- schema: {
114223
- typeof: [
114224
- "object"
114225
- ]
114226
- }
114227
- },
114228
- {
114229
- target: "tools.jest",
114230
- schema: {
114231
- typeof: [
114232
- "object",
114233
- "function"
114234
- ]
114235
- }
114236
- }
114237
- ],
114238
- "@modern-js/plugin-garfish": [
114239
- {
114240
- target: "runtime.masterApp",
114241
- schema: {
114242
- type: [
114243
- "boolean",
114244
- "object"
114245
- ]
114246
- }
114247
- },
114248
- {
114249
- target: "dev.withMasterApp",
114250
- schema: {
114251
- type: [
114252
- "object"
114253
- ]
114254
- }
114255
- },
114256
- {
114257
- target: "deploy.microFrontend",
114258
- schema: {
114259
- type: [
114260
- "boolean",
114261
- "object"
114262
- ]
114263
- }
114264
- }
114265
- ],
114266
- "@modern-js/plugin-nocode": [],
114267
- "@modern-js/plugin-worker": [
114268
- {
114269
- target: "deploy.worker.ssr",
114270
- schema: {
114271
- type: [
114272
- "boolean"
114273
- ]
114274
- }
114275
- }
114276
- ]
114277
- };
114278
114067
  var DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
114279
114068
  allowNamespaces: true,
114280
114069
  allExtensions: true,
@@ -114729,11 +114518,14 @@ var require_project = __commonJS({
114729
114518
  return false;
114730
114519
  }
114731
114520
  };
114732
- var isApiOnly = (appDirectory, entryDir) => __async(exports, null, function* () {
114733
- const srcDir = _path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src");
114734
- const existSrc = yield _compiled.fs.pathExists(srcDir);
114521
+ var isApiOnly = (appDirectory, entryDir, apiDir) => __async(exports, null, function* () {
114522
+ const existApi = yield _compiled.fs.pathExists(apiDir !== null && apiDir !== void 0 ? apiDir : _path.default.join(appDirectory, "api"));
114523
+ const existSrc = yield _compiled.fs.pathExists(_path.default.join(appDirectory, entryDir !== null && entryDir !== void 0 ? entryDir : "src"));
114735
114524
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
114736
- return !existSrc || Boolean(options["api-only"]);
114525
+ if (options["api-only"]) {
114526
+ return true;
114527
+ }
114528
+ return existApi && !existSrc;
114737
114529
  });
114738
114530
  var isWebOnly = () => __async(exports, null, function* () {
114739
114531
  const options = (0, _compiled.minimist)((0, _commands.getArgv)());
@@ -115067,21 +114859,6 @@ var require_get2 = __commonJS({
115067
114859
  }
115068
114860
  });
115069
114861
 
115070
- // ../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/cjs/_define_property.cjs
115071
- var require_define_property = __commonJS({
115072
- "../../../../node_modules/.pnpm/@swc+helpers@0.5.1/node_modules/@swc/helpers/cjs/_define_property.cjs"(exports) {
115073
- "use strict";
115074
- exports._ = exports._define_property = _define_property14;
115075
- function _define_property14(obj, key, value) {
115076
- if (key in obj) {
115077
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
115078
- } else
115079
- obj[key] = value;
115080
- return obj;
115081
- }
115082
- }
115083
- });
115084
-
115085
114862
  // ../../../toolkit/utils/dist/cjs/cli/logger.js
115086
114863
  var require_logger2 = __commonJS({
115087
114864
  "../../../toolkit/utils/dist/cjs/cli/logger.js"(exports) {
@@ -115104,7 +114881,6 @@ var require_logger2 = __commonJS({
115104
114881
  return logger;
115105
114882
  }
115106
114883
  });
115107
- var _define_property14 = require_define_property();
115108
114884
  var _interop_require_default = require_interop_require_default();
115109
114885
  var _chalk = /* @__PURE__ */ _interop_require_default._(require_chalk2());
115110
114886
  var LOG_LEVEL = {
@@ -115190,10 +114966,6 @@ ${_chalk.default.grey(rest.join("\n"))}`;
115190
114966
  return longestLabel;
115191
114967
  }
115192
114968
  constructor(options = {}) {
115193
- _define_property14._(this, "level", void 0);
115194
- _define_property14._(this, "config", void 0);
115195
- _define_property14._(this, "types", void 0);
115196
- _define_property14._(this, "longestLabel", void 0);
115197
114969
  this.level = options.level || LOG_TYPES.log.level;
115198
114970
  this.config = __spreadValues(__spreadValues({}, DEFAULT_CONFIG), options.config || {});
115199
114971
  this.types = __spreadValues(__spreadValues({}, LOG_TYPES), options.types || {});
@@ -116123,31 +115895,6 @@ var require_runtimeExports = __commonJS({
116123
115895
  }
116124
115896
  });
116125
115897
 
116126
- // ../../../toolkit/utils/dist/cjs/cli/test.js
116127
- var require_test = __commonJS({
116128
- "../../../toolkit/utils/dist/cjs/cli/test.js"(exports) {
116129
- "use strict";
116130
- Object.defineProperty(exports, "__esModule", {
116131
- value: true
116132
- });
116133
- Object.defineProperty(exports, "initSnapshotSerializer", {
116134
- enumerable: true,
116135
- get: function() {
116136
- return initSnapshotSerializer;
116137
- }
116138
- });
116139
- var initSnapshotSerializer = (root) => {
116140
- expect.addSnapshotSerializer({
116141
- test: (val) => typeof val === "string" && (val.includes("modern.js") || val.includes("node_modules") || val.includes(root)),
116142
- print: (val) => (
116143
- // eslint-disable-next-line no-nested-ternary
116144
- 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
116145
- )
116146
- });
116147
- };
116148
- }
116149
- });
116150
-
116151
115898
  // ../../../toolkit/utils/dist/cjs/cli/watch.js
116152
115899
  var require_watch = __commonJS({
116153
115900
  "../../../toolkit/utils/dist/cjs/cli/watch.js"(exports) {
@@ -116244,7 +115991,6 @@ var require_cli = __commonJS({
116244
115991
  _export_star._(require_require(), exports);
116245
115992
  _export_star._(require_routes(), exports);
116246
115993
  _export_star._(require_runtimeExports(), exports);
116247
- _export_star._(require_test(), exports);
116248
115994
  _export_star._(require_watch(), exports);
116249
115995
  }
116250
115996
  });
@@ -131181,7 +130927,7 @@ var ZH_LOCALE2 = {
131181
130927
  function: {
131182
130928
  self: "启用可选功能",
131183
130929
  question: "请选择功能名称",
131184
- tailwindcss: "启用 「Tailwind CSS」 支持",
130930
+ tailwindcss: "启用「Tailwind CSS」 支持",
131185
130931
  bff: "启用「BFF」功能",
131186
130932
  micro_frontend: "启用「微前端」模式",
131187
130933
  i18n: "启用「国际化(i18n)」功能",
@@ -131536,8 +131282,6 @@ module.exports = {
131536
131282
  }
131537
131283
  generator.logger.debug(`forge @modern-js/ssg-generator succeed `);
131538
131284
  });
131539
- // Annotate the CommonJS export names for ESM import in node:
131540
- 0 && (module.exports = {});
131541
131285
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
131542
131286
  /*!
131543
131287
  * fill-range <https://github.com/jonschlinkert/fill-range>
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": [
@@ -29,17 +29,18 @@
29
29
  "@types/node": "^14",
30
30
  "jest": "^29",
31
31
  "typescript": "^5",
32
- "@modern-js/dependence-generator": "3.1.21",
33
- "@modern-js/plugin-i18n": "2.22.1",
34
- "@modern-js/generator-common": "3.1.21",
35
- "@modern-js/generator-utils": "3.1.21",
36
- "@scripts/jest-config": "2.22.1",
37
- "@scripts/build": "2.22.1"
32
+ "@modern-js/generator-common": "3.1.22",
33
+ "@modern-js/plugin-i18n": "2.23.0",
34
+ "@modern-js/dependence-generator": "3.1.22",
35
+ "@modern-js/generator-utils": "3.1.22",
36
+ "@scripts/jest-config": "2.23.0",
37
+ "@scripts/build": "2.23.0"
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": {