@modern-js/utils 2.15.0 → 2.16.0

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 (118) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/FileSizeReporter.js +69 -92
  3. package/dist/cjs/alias.js +34 -58
  4. package/dist/cjs/analyzeProject.js +58 -41
  5. package/dist/cjs/applyOptionsChain.js +15 -42
  6. package/dist/cjs/babel.js +28 -39
  7. package/dist/cjs/chainId.js +7 -25
  8. package/dist/cjs/clearConsole.js +7 -25
  9. package/dist/cjs/commands.js +14 -29
  10. package/dist/cjs/compatRequire.js +22 -38
  11. package/dist/cjs/compiled.js +120 -139
  12. package/dist/cjs/constants.js +143 -98
  13. package/dist/cjs/debug.js +8 -26
  14. package/dist/cjs/emptyDir.js +10 -28
  15. package/dist/cjs/ensureAbsolutePath.js +13 -36
  16. package/dist/cjs/ensureArray.js +10 -26
  17. package/dist/cjs/findExists.js +14 -37
  18. package/dist/cjs/generateMetaTags.js +12 -31
  19. package/dist/cjs/getBrowserslist.js +20 -27
  20. package/dist/cjs/getCoreJsVersion.js +49 -37
  21. package/dist/cjs/getEntryOptions.js +14 -29
  22. package/dist/cjs/getPackageManager.js +23 -46
  23. package/dist/cjs/getPort.js +26 -61
  24. package/dist/cjs/getServerConfig.js +51 -43
  25. package/dist/cjs/getTargetDir.js +50 -38
  26. package/dist/cjs/import.js +16 -27
  27. package/dist/cjs/index.js +61 -60
  28. package/dist/cjs/is/index.js +53 -68
  29. package/dist/cjs/is/nodeEnv.js +13 -29
  30. package/dist/cjs/is/platform.js +13 -26
  31. package/dist/cjs/is/type.js +14 -33
  32. package/dist/cjs/logger.js +54 -50
  33. package/dist/cjs/monorepo.js +47 -78
  34. package/dist/cjs/nodeEnv.js +29 -31
  35. package/dist/cjs/path.js +42 -63
  36. package/dist/cjs/pathSerializer.js +43 -51
  37. package/dist/cjs/plugin.js +11 -29
  38. package/dist/cjs/prettyInstructions.js +35 -68
  39. package/dist/cjs/printBuildError.js +15 -37
  40. package/dist/cjs/react.js +18 -41
  41. package/dist/cjs/readTsConfig.js +21 -39
  42. package/dist/cjs/removeSlash.js +13 -27
  43. package/dist/cjs/resolve.js +25 -31
  44. package/dist/cjs/routes.js +23 -43
  45. package/dist/cjs/runtime/index.js +18 -17
  46. package/dist/cjs/runtime/parsed.js +8 -26
  47. package/dist/cjs/runtimeExports.js +31 -56
  48. package/dist/cjs/ssr.js +13 -26
  49. package/dist/cjs/storage.js +51 -41
  50. package/dist/cjs/testUtils.js +8 -29
  51. package/dist/cjs/types.js +4 -15
  52. package/dist/cjs/universal/constants.js +13 -26
  53. package/dist/cjs/universal/formatWebpack.js +16 -44
  54. package/dist/cjs/universal/nestedRoutes.js +94 -46
  55. package/dist/cjs/universal/pluginDagSort.js +58 -0
  56. package/dist/cjs/universal/remixRouter.js +18 -17
  57. package/dist/cjs/universal/serialize.js +16 -37
  58. package/dist/cjs/version.js +25 -41
  59. package/dist/cjs/wait.js +7 -25
  60. package/dist/cjs/watch.js +69 -43
  61. package/dist/esm/FileSizeReporter.js +40 -52
  62. package/dist/esm/alias.js +9 -19
  63. package/dist/esm/analyzeProject.js +3 -7
  64. package/dist/esm/applyOptionsChain.js +5 -17
  65. package/dist/esm/babel.js +6 -8
  66. package/dist/esm/chainId.js +1 -4
  67. package/dist/esm/clearConsole.js +1 -4
  68. package/dist/esm/commands.js +6 -12
  69. package/dist/esm/compatRequire.js +10 -17
  70. package/dist/esm/compiled.js +32 -76
  71. package/dist/esm/constants.js +143 -89
  72. package/dist/esm/debug.js +1 -4
  73. package/dist/esm/emptyDir.js +1 -4
  74. package/dist/esm/ensureAbsolutePath.js +1 -4
  75. package/dist/esm/ensureArray.js +4 -5
  76. package/dist/esm/findExists.js +1 -4
  77. package/dist/esm/generateMetaTags.js +6 -10
  78. package/dist/esm/getBrowserslist.js +8 -6
  79. package/dist/esm/getCoreJsVersion.js +1 -4
  80. package/dist/esm/getEntryOptions.js +5 -5
  81. package/dist/esm/getPackageManager.js +1 -4
  82. package/dist/esm/getPort.js +10 -25
  83. package/dist/esm/getServerConfig.js +2 -9
  84. package/dist/esm/getTargetDir.js +1 -4
  85. package/dist/esm/import.js +3 -4
  86. package/dist/esm/is/index.js +18 -30
  87. package/dist/esm/is/nodeEnv.js +5 -12
  88. package/dist/esm/is/platform.js +2 -6
  89. package/dist/esm/is/type.js +8 -18
  90. package/dist/esm/logger.js +37 -17
  91. package/dist/esm/monorepo.js +21 -38
  92. package/dist/esm/nodeEnv.js +18 -11
  93. package/dist/esm/path.js +16 -23
  94. package/dist/esm/pathSerializer.js +21 -21
  95. package/dist/esm/plugin.js +1 -4
  96. package/dist/esm/prettyInstructions.js +13 -32
  97. package/dist/esm/printBuildError.js +4 -11
  98. package/dist/esm/react.js +1 -4
  99. package/dist/esm/readTsConfig.js +2 -6
  100. package/dist/esm/removeSlash.js +3 -8
  101. package/dist/esm/resolve.js +14 -11
  102. package/dist/esm/routes.js +4 -10
  103. package/dist/esm/runtime/parsed.js +2 -5
  104. package/dist/esm/runtimeExports.js +17 -22
  105. package/dist/esm/ssr.js +1 -4
  106. package/dist/esm/storage.js +2 -6
  107. package/dist/esm/testUtils.js +2 -8
  108. package/dist/esm/types.js +1 -0
  109. package/dist/esm/universal/constants.js +2 -6
  110. package/dist/esm/universal/formatWebpack.js +10 -22
  111. package/dist/esm/universal/nestedRoutes.js +41 -27
  112. package/dist/esm/universal/pluginDagSort.js +50 -0
  113. package/dist/esm/universal/serialize.js +4 -5
  114. package/dist/esm/version.js +5 -7
  115. package/dist/esm/wait.js +1 -3
  116. package/dist/esm/watch.js +14 -9
  117. package/dist/types/universal/pluginDagSort.d.ts +1 -0
  118. package/package.json +17 -5
@@ -1,56 +1,48 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
6
  for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var constants_exports = {};
19
- __export(constants_exports, {
7
+ Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
10
+ });
11
+ }
12
+ _export(exports, {
13
+ ROUTE_SPEC_FILE: () => ROUTE_SPEC_FILE,
14
+ MAIN_ENTRY_NAME: () => MAIN_ENTRY_NAME,
15
+ LAUNCH_EDITOR_ENDPOINT: () => LAUNCH_EDITOR_ENDPOINT,
16
+ SERVER_BUNDLE_DIRECTORY: () => SERVER_BUNDLE_DIRECTORY,
17
+ SERVER_WORKER_BUNDLE_DIRECTORY: () => SERVER_WORKER_BUNDLE_DIRECTORY,
18
+ ENTRY_NAME_PATTERN: () => ENTRY_NAME_PATTERN,
19
+ SERVER_RENDER_FUNCTION_NAME: () => SERVER_RENDER_FUNCTION_NAME,
20
+ LOADABLE_STATS_FILE: () => LOADABLE_STATS_FILE,
20
21
  API_DIR: () => API_DIR,
22
+ SERVER_DIR: () => SERVER_DIR,
23
+ SHARED_DIR: () => SHARED_DIR,
21
24
  CONFIG_CACHE_DIR: () => CONFIG_CACHE_DIR,
22
25
  CONFIG_FILE_EXTENSIONS: () => CONFIG_FILE_EXTENSIONS,
23
- DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: () => DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS,
24
- DEFAULT_DEV_HOST: () => DEFAULT_DEV_HOST,
26
+ OUTPUT_CONFIG_FILE: () => OUTPUT_CONFIG_FILE,
25
27
  DEFAULT_SERVER_CONFIG: () => DEFAULT_SERVER_CONFIG,
26
- ENTRY_NAME_PATTERN: () => ENTRY_NAME_PATTERN,
28
+ ROUTE_MANIFEST_FILE: () => ROUTE_MANIFEST_FILE,
29
+ LOADER_ROUTES_DIR: () => LOADER_ROUTES_DIR,
30
+ DEFAULT_DEV_HOST: () => DEFAULT_DEV_HOST,
27
31
  INTERNAL_APP_TOOLS_PLUGINS: () => INTERNAL_APP_TOOLS_PLUGINS,
28
32
  INTERNAL_APP_TOOLS_RUNTIME_PLUGINS: () => INTERNAL_APP_TOOLS_RUNTIME_PLUGINS,
29
- INTERNAL_CLI_PLUGINS: () => INTERNAL_CLI_PLUGINS,
30
- INTERNAL_DOC_TOOLS_PLUGINS: () => INTERNAL_DOC_TOOLS_PLUGINS,
31
33
  INTERNAL_MODULE_TOOLS_PLUGINS: () => INTERNAL_MODULE_TOOLS_PLUGINS,
32
34
  INTERNAL_MONOREPO_TOOLS_PLUGINS: () => INTERNAL_MONOREPO_TOOLS_PLUGINS,
33
- INTERNAL_SERVER_PLUGINS: () => INTERNAL_SERVER_PLUGINS,
34
- LAUNCH_EDITOR_ENDPOINT: () => LAUNCH_EDITOR_ENDPOINT,
35
- LOADABLE_STATS_FILE: () => LOADABLE_STATS_FILE,
36
- LOADER_ROUTES_DIR: () => LOADER_ROUTES_DIR,
37
- MAIN_ENTRY_NAME: () => MAIN_ENTRY_NAME,
38
- OUTPUT_CONFIG_FILE: () => OUTPUT_CONFIG_FILE,
39
- PLUGIN_SCHEMAS: () => PLUGIN_SCHEMAS,
40
- ROUTE_MANIFEST_FILE: () => ROUTE_MANIFEST_FILE,
41
- ROUTE_SPEC_FILE: () => ROUTE_SPEC_FILE,
42
- SERVER_BUNDLE_DIRECTORY: () => SERVER_BUNDLE_DIRECTORY,
43
- SERVER_DIR: () => SERVER_DIR,
35
+ INTERNAL_DOC_TOOLS_PLUGINS: () => INTERNAL_DOC_TOOLS_PLUGINS,
36
+ INTERNAL_CLI_PLUGINS: () => INTERNAL_CLI_PLUGINS,
44
37
  SERVER_PLUGIN_BFF: () => SERVER_PLUGIN_BFF,
45
38
  SERVER_PLUGIN_EXPRESS: () => SERVER_PLUGIN_EXPRESS,
46
39
  SERVER_PLUGIN_KOA: () => SERVER_PLUGIN_KOA,
47
- SERVER_PLUGIN_POLYFILL: () => SERVER_PLUGIN_POLYFILL,
48
40
  SERVER_PLUGIN_SERVER: () => SERVER_PLUGIN_SERVER,
49
- SERVER_RENDER_FUNCTION_NAME: () => SERVER_RENDER_FUNCTION_NAME,
50
- SERVER_WORKER_BUNDLE_DIRECTORY: () => SERVER_WORKER_BUNDLE_DIRECTORY,
51
- SHARED_DIR: () => SHARED_DIR
41
+ SERVER_PLUGIN_POLYFILL: () => SERVER_PLUGIN_POLYFILL,
42
+ INTERNAL_SERVER_PLUGINS: () => INTERNAL_SERVER_PLUGINS,
43
+ PLUGIN_SCHEMAS: () => PLUGIN_SCHEMAS,
44
+ DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: () => DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS
52
45
  });
53
- module.exports = __toCommonJS(constants_exports);
54
46
  const ROUTE_SPEC_FILE = "route.json";
55
47
  const MAIN_ENTRY_NAME = "main";
56
48
  const LAUNCH_EDITOR_ENDPOINT = "/__open-stack-frame-in-editor";
@@ -63,7 +55,11 @@ const API_DIR = "api";
63
55
  const SERVER_DIR = "server";
64
56
  const SHARED_DIR = "shared";
65
57
  const CONFIG_CACHE_DIR = "./node_modules/.cache/node-bundle-require";
66
- const CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".mjs"];
58
+ const CONFIG_FILE_EXTENSIONS = [
59
+ ".js",
60
+ ".ts",
61
+ ".mjs"
62
+ ];
67
63
  const OUTPUT_CONFIG_FILE = "modern.config.json";
68
64
  const DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
69
65
  const ROUTE_MANIFEST_FILE = "routes-manifest.json";
@@ -157,7 +153,11 @@ const PLUGIN_SCHEMAS = {
157
153
  target: "runtimeByEntries",
158
154
  schema: {
159
155
  type: "object",
160
- patternProperties: { [ENTRY_NAME_PATTERN]: { type: "object" } },
156
+ patternProperties: {
157
+ [ENTRY_NAME_PATTERN]: {
158
+ type: "object"
159
+ }
160
+ },
161
161
  additionalProperties: false
162
162
  }
163
163
  }
@@ -165,7 +165,11 @@ const PLUGIN_SCHEMAS = {
165
165
  "@modern-js/plugin-swc": [
166
166
  {
167
167
  target: "tools.swc",
168
- schema: { typeof: ["object"] }
168
+ schema: {
169
+ typeof: [
170
+ "object"
171
+ ]
172
+ }
169
173
  }
170
174
  ],
171
175
  "@modern-js/plugin-bff": [
@@ -175,12 +179,23 @@ const PLUGIN_SCHEMAS = {
175
179
  type: "object",
176
180
  properties: {
177
181
  prefix: {
178
- type: ["string", "array"],
179
- items: { type: "string" }
182
+ type: [
183
+ "string",
184
+ "array"
185
+ ],
186
+ items: {
187
+ type: "string"
188
+ }
189
+ },
190
+ fetcher: {
191
+ type: "string"
180
192
  },
181
- fetcher: { type: "string" },
182
- proxy: { type: "object" },
183
- requestCreator: { type: "string" }
193
+ proxy: {
194
+ type: "object"
195
+ },
196
+ requestCreator: {
197
+ type: "string"
198
+ }
184
199
  }
185
200
  }
186
201
  }
@@ -188,13 +203,23 @@ const PLUGIN_SCHEMAS = {
188
203
  "@modern-js/plugin-tailwindcss": [
189
204
  {
190
205
  target: "tools.tailwindcss",
191
- schema: { typeof: ["object", "function"] }
206
+ schema: {
207
+ typeof: [
208
+ "object",
209
+ "function"
210
+ ]
211
+ }
192
212
  }
193
213
  ],
194
214
  "@modern-js/plugin-proxy": [
195
215
  {
196
216
  target: "dev.proxy",
197
- schema: { typeof: ["string", "object"] }
217
+ schema: {
218
+ typeof: [
219
+ "string",
220
+ "object"
221
+ ]
222
+ }
198
223
  }
199
224
  ],
200
225
  "@modern-js/plugin-ssg": [
@@ -202,9 +227,15 @@ const PLUGIN_SCHEMAS = {
202
227
  target: "output.ssg",
203
228
  schema: {
204
229
  oneOf: [
205
- { type: "boolean" },
206
- { type: "object" },
207
- { instanceof: "Function" }
230
+ {
231
+ type: "boolean"
232
+ },
233
+ {
234
+ type: "object"
235
+ },
236
+ {
237
+ instanceof: "Function"
238
+ }
208
239
  ]
209
240
  }
210
241
  }
@@ -212,59 +243,108 @@ const PLUGIN_SCHEMAS = {
212
243
  "@modern-js/plugin-state": [
213
244
  {
214
245
  target: "runtime.state",
215
- schema: { type: ["boolean", "object"] }
246
+ schema: {
247
+ type: [
248
+ "boolean",
249
+ "object"
250
+ ]
251
+ }
216
252
  }
217
253
  ],
218
254
  "@modern-js/plugin-design-token": [
219
255
  // Legacy Features
220
256
  {
221
257
  target: "source.designSystem",
222
- schema: { typeof: ["object"] }
258
+ schema: {
259
+ typeof: [
260
+ "object"
261
+ ]
262
+ }
223
263
  },
224
264
  {
225
265
  target: "source.designSystem.supportStyledComponents",
226
- schema: { type: ["boolean"] }
266
+ schema: {
267
+ type: [
268
+ "boolean"
269
+ ]
270
+ }
227
271
  },
228
272
  {
229
273
  target: "designSystem",
230
- schema: { typeof: ["object"] }
274
+ schema: {
275
+ typeof: [
276
+ "object"
277
+ ]
278
+ }
231
279
  }
232
280
  ],
233
281
  "@modern-js/plugin-router": [
234
282
  {
235
283
  target: "runtime.router",
236
- schema: { type: ["boolean", "object"] }
284
+ schema: {
285
+ type: [
286
+ "boolean",
287
+ "object"
288
+ ]
289
+ }
237
290
  }
238
291
  ],
239
292
  "@modern-js/plugin-testing": [
240
293
  {
241
294
  target: "testing",
242
- schema: { typeof: ["object"] }
295
+ schema: {
296
+ typeof: [
297
+ "object"
298
+ ]
299
+ }
243
300
  },
244
301
  {
245
302
  target: "tools.jest",
246
- schema: { typeof: ["object", "function"] }
303
+ schema: {
304
+ typeof: [
305
+ "object",
306
+ "function"
307
+ ]
308
+ }
247
309
  }
248
310
  ],
249
311
  "@modern-js/plugin-garfish": [
250
312
  {
251
313
  target: "runtime.masterApp",
252
- schema: { type: ["boolean", "object"] }
314
+ schema: {
315
+ type: [
316
+ "boolean",
317
+ "object"
318
+ ]
319
+ }
253
320
  },
254
321
  {
255
322
  target: "dev.withMasterApp",
256
- schema: { type: ["object"] }
323
+ schema: {
324
+ type: [
325
+ "object"
326
+ ]
327
+ }
257
328
  },
258
329
  {
259
330
  target: "deploy.microFrontend",
260
- schema: { type: ["boolean", "object"] }
331
+ schema: {
332
+ type: [
333
+ "boolean",
334
+ "object"
335
+ ]
336
+ }
261
337
  }
262
338
  ],
263
339
  "@modern-js/plugin-nocode": [],
264
340
  "@modern-js/plugin-worker": [
265
341
  {
266
342
  target: "deploy.worker.ssr",
267
- schema: { type: ["boolean"] }
343
+ schema: {
344
+ type: [
345
+ "boolean"
346
+ ]
347
+ }
268
348
  }
269
349
  ]
270
350
  };
@@ -277,38 +357,3 @@ const DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
277
357
  optimizeConstEnums: true,
278
358
  isTSX: true
279
359
  };
280
- // Annotate the CommonJS export names for ESM import in node:
281
- 0 && (module.exports = {
282
- API_DIR,
283
- CONFIG_CACHE_DIR,
284
- CONFIG_FILE_EXTENSIONS,
285
- DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS,
286
- DEFAULT_DEV_HOST,
287
- DEFAULT_SERVER_CONFIG,
288
- ENTRY_NAME_PATTERN,
289
- INTERNAL_APP_TOOLS_PLUGINS,
290
- INTERNAL_APP_TOOLS_RUNTIME_PLUGINS,
291
- INTERNAL_CLI_PLUGINS,
292
- INTERNAL_DOC_TOOLS_PLUGINS,
293
- INTERNAL_MODULE_TOOLS_PLUGINS,
294
- INTERNAL_MONOREPO_TOOLS_PLUGINS,
295
- INTERNAL_SERVER_PLUGINS,
296
- LAUNCH_EDITOR_ENDPOINT,
297
- LOADABLE_STATS_FILE,
298
- LOADER_ROUTES_DIR,
299
- MAIN_ENTRY_NAME,
300
- OUTPUT_CONFIG_FILE,
301
- PLUGIN_SCHEMAS,
302
- ROUTE_MANIFEST_FILE,
303
- ROUTE_SPEC_FILE,
304
- SERVER_BUNDLE_DIRECTORY,
305
- SERVER_DIR,
306
- SERVER_PLUGIN_BFF,
307
- SERVER_PLUGIN_EXPRESS,
308
- SERVER_PLUGIN_KOA,
309
- SERVER_PLUGIN_POLYFILL,
310
- SERVER_PLUGIN_SERVER,
311
- SERVER_RENDER_FUNCTION_NAME,
312
- SERVER_WORKER_BUNDLE_DIRECTORY,
313
- SHARED_DIR
314
- });
package/dist/cjs/debug.js CHANGED
@@ -1,28 +1,10 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var debug_exports = {};
19
- __export(debug_exports, {
20
- createDebugger: () => createDebugger
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
21
4
  });
22
- module.exports = __toCommonJS(debug_exports);
23
- var import_debug = require("../compiled/debug");
24
- const createDebugger = (scope) => (0, import_debug.debug)(`modern-js:${scope}`);
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- createDebugger
5
+ Object.defineProperty(exports, "createDebugger", {
6
+ enumerable: true,
7
+ get: () => createDebugger
28
8
  });
9
+ const _debug = require("../compiled/debug");
10
+ const createDebugger = (scope) => (0, _debug.debug)(`modern-js:${scope}`);
@@ -1,32 +1,14 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var emptyDir_exports = {};
19
- __export(emptyDir_exports, {
20
- emptyDir: () => emptyDir
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
21
4
  });
22
- module.exports = __toCommonJS(emptyDir_exports);
23
- var import_compiled = require("./compiled");
5
+ Object.defineProperty(exports, "emptyDir", {
6
+ enumerable: true,
7
+ get: () => emptyDir
8
+ });
9
+ const _compiled = require("./compiled");
24
10
  const emptyDir = async (dir) => {
25
- if (await import_compiled.fs.pathExists(dir)) {
26
- await import_compiled.fs.emptyDir(dir);
11
+ if (await _compiled.fs.pathExists(dir)) {
12
+ await _compiled.fs.emptyDir(dir);
27
13
  }
28
14
  };
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- emptyDir
32
- });
@@ -1,38 +1,15 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var ensureAbsolutePath_exports = {};
29
- __export(ensureAbsolutePath_exports, {
30
- ensureAbsolutePath: () => ensureAbsolutePath
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
31
4
  });
32
- module.exports = __toCommonJS(ensureAbsolutePath_exports);
33
- var import_path = __toESM(require("path"));
34
- const ensureAbsolutePath = (base, filePath) => import_path.default.isAbsolute(filePath) ? filePath : import_path.default.resolve(base, filePath);
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- ensureAbsolutePath
5
+ Object.defineProperty(exports, "ensureAbsolutePath", {
6
+ enumerable: true,
7
+ get: () => ensureAbsolutePath
38
8
  });
9
+ const _path = /* @__PURE__ */ _interop_require_default(require("path"));
10
+ function _interop_require_default(obj) {
11
+ return obj && obj.__esModule ? obj : {
12
+ default: obj
13
+ };
14
+ }
15
+ const ensureAbsolutePath = (base, filePath) => _path.default.isAbsolute(filePath) ? filePath : _path.default.resolve(base, filePath);
@@ -1,32 +1,16 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var ensureArray_exports = {};
19
- __export(ensureArray_exports, {
20
- ensureArray: () => ensureArray
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ensureArray", {
6
+ enumerable: true,
7
+ get: () => ensureArray
21
8
  });
22
- module.exports = __toCommonJS(ensureArray_exports);
23
9
  const ensureArray = (params) => {
24
10
  if (Array.isArray(params)) {
25
11
  return params;
26
12
  }
27
- return [params];
13
+ return [
14
+ params
15
+ ];
28
16
  };
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- ensureArray
32
- });
@@ -1,45 +1,22 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var findExists_exports = {};
29
- __export(findExists_exports, {
30
- findExists: () => findExists
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
31
4
  });
32
- module.exports = __toCommonJS(findExists_exports);
33
- var import_fs = __toESM(require("fs"));
5
+ Object.defineProperty(exports, "findExists", {
6
+ enumerable: true,
7
+ get: () => findExists
8
+ });
9
+ const _fs = /* @__PURE__ */ _interop_require_default(require("fs"));
10
+ function _interop_require_default(obj) {
11
+ return obj && obj.__esModule ? obj : {
12
+ default: obj
13
+ };
14
+ }
34
15
  const findExists = (files) => {
35
16
  for (const file of files) {
36
- if (import_fs.default.existsSync(file) && import_fs.default.statSync(file).isFile()) {
17
+ if (_fs.default.existsSync(file) && _fs.default.statSync(file).isFile()) {
37
18
  return file;
38
19
  }
39
20
  }
40
21
  return false;
41
22
  };
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {
44
- findExists
45
- });
@@ -1,25 +1,11 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var generateMetaTags_exports = {};
19
- __export(generateMetaTags_exports, {
20
- generateMetaTags: () => generateMetaTags
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "generateMetaTags", {
6
+ enumerable: true,
7
+ get: () => generateMetaTags
21
8
  });
22
- module.exports = __toCommonJS(generateMetaTags_exports);
23
9
  const tagObjectToString = (tagDefinition) => {
24
10
  const attributes = Object.keys(tagDefinition.attributes || {}).filter((attributeName) => tagDefinition.attributes[attributeName] !== false).map((attributeName) => {
25
11
  if (tagDefinition.attributes[attributeName] === true) {
@@ -27,7 +13,9 @@ const tagObjectToString = (tagDefinition) => {
27
13
  }
28
14
  return `${attributeName}="${tagDefinition.attributes[attributeName]}"`;
29
15
  });
30
- return `<${[tagDefinition.tagName].concat(attributes).join(" ")}>${tagDefinition.innerHTML || ""}${tagDefinition.voidTag ? "" : `</${tagDefinition.tagName}>`}`;
16
+ return `<${[
17
+ tagDefinition.tagName
18
+ ].concat(attributes).join(" ")}>${tagDefinition.innerHTML || ""}${tagDefinition.voidTag ? "" : `</${tagDefinition.tagName}>`}`;
31
19
  };
32
20
  const generateMetaTags = (metaOptions) => {
33
21
  if (!metaOptions) {
@@ -49,13 +37,6 @@ const generateMetaTags = (metaOptions) => {
49
37
  voidTag: true,
50
38
  attributes: metaTagAttributes
51
39
  };
52
- }).reduce(
53
- (memo, tagObject) => `${memo}
54
- ${tagObjectToString(tagObject)}`,
55
- ""
56
- );
40
+ }).reduce((memo, tagObject) => `${memo}
41
+ ${tagObjectToString(tagObject)}`, "");
57
42
  };
58
- // Annotate the CommonJS export names for ESM import in node:
59
- 0 && (module.exports = {
60
- generateMetaTags
61
- });