@modern-js/utils 2.35.1 → 2.37.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/dist/cjs/cli/alias.js +45 -46
  2. package/dist/cjs/cli/applyOptionsChain.js +30 -13
  3. package/dist/cjs/cli/babel.js +36 -26
  4. package/dist/cjs/cli/commands.js +29 -21
  5. package/dist/cjs/cli/common.js +29 -20
  6. package/dist/cjs/cli/config.js +24 -7
  7. package/dist/cjs/cli/constants/chainId.js +24 -7
  8. package/dist/cjs/cli/constants/index.js +84 -113
  9. package/dist/cjs/cli/ensure.js +37 -18
  10. package/dist/cjs/cli/fs.js +29 -19
  11. package/dist/cjs/cli/get/config.js +26 -9
  12. package/dist/cjs/cli/get/data.js +67 -54
  13. package/dist/cjs/cli/get/index.js +46 -25
  14. package/dist/cjs/cli/index.js +58 -23
  15. package/dist/cjs/cli/is/config.js +37 -31
  16. package/dist/cjs/cli/is/env.js +32 -29
  17. package/dist/cjs/cli/is/index.js +26 -8
  18. package/dist/cjs/cli/is/project.js +67 -53
  19. package/dist/cjs/cli/is/type.js +39 -36
  20. package/dist/cjs/cli/logger.js +25 -130
  21. package/dist/cjs/cli/monorepo.js +58 -58
  22. package/dist/cjs/cli/package.js +34 -26
  23. package/dist/cjs/cli/path.js +64 -54
  24. package/dist/cjs/cli/port.js +39 -13
  25. package/dist/cjs/cli/prettyInstructions.js +48 -29
  26. package/dist/cjs/cli/require.js +35 -29
  27. package/dist/cjs/cli/runtimeExports.js +42 -16
  28. package/dist/cjs/cli/watch.js +41 -22
  29. package/dist/cjs/compiled.js +127 -138
  30. package/dist/cjs/import.js +25 -15
  31. package/dist/cjs/index.js +24 -6
  32. package/dist/cjs/universal/constants.js +32 -21
  33. package/dist/cjs/universal/formatWebpack.js +25 -15
  34. package/dist/cjs/universal/pluginDagSort.js +25 -8
  35. package/dist/esm/cli/alias.js +10 -22
  36. package/dist/esm/cli/applyOptionsChain.js +4 -1
  37. package/dist/esm/cli/babel.js +6 -2
  38. package/dist/esm/cli/commands.js +10 -4
  39. package/dist/esm/cli/common.js +8 -3
  40. package/dist/esm/cli/config.js +4 -1
  41. package/dist/esm/cli/constants/chainId.js +4 -1
  42. package/dist/esm/cli/constants/index.js +62 -39
  43. package/dist/esm/cli/ensure.js +6 -2
  44. package/dist/esm/cli/fs.js +6 -2
  45. package/dist/esm/cli/get/config.js +4 -1
  46. package/dist/esm/cli/get/data.js +18 -8
  47. package/dist/esm/cli/get/index.js +6 -2
  48. package/dist/esm/cli/is/config.js +14 -6
  49. package/dist/esm/cli/is/env.js +12 -8
  50. package/dist/esm/cli/is/index.js +0 -1
  51. package/dist/esm/cli/is/project.js +17 -8
  52. package/dist/esm/cli/is/type.js +20 -9
  53. package/dist/esm/cli/logger.js +4 -128
  54. package/dist/esm/cli/monorepo.js +14 -16
  55. package/dist/esm/cli/package.js +10 -4
  56. package/dist/esm/cli/path.js +24 -11
  57. package/dist/esm/cli/port.js +5 -2
  58. package/dist/esm/cli/prettyInstructions.js +6 -2
  59. package/dist/esm/cli/require.js +14 -6
  60. package/dist/esm/cli/runtimeExports.js +6 -3
  61. package/dist/esm/cli/watch.js +10 -6
  62. package/dist/esm/compiled.js +65 -31
  63. package/dist/esm/import.js +6 -3
  64. package/dist/esm/universal/constants.js +12 -4
  65. package/dist/esm/universal/formatWebpack.js +5 -2
  66. package/dist/esm/universal/pluginDagSort.js +5 -2
  67. package/dist/esm-node/cli/alias.js +8 -19
  68. package/dist/esm-node/cli/applyOptionsChain.js +4 -1
  69. package/dist/esm-node/cli/babel.js +6 -2
  70. package/dist/esm-node/cli/commands.js +10 -4
  71. package/dist/esm-node/cli/common.js +8 -3
  72. package/dist/esm-node/cli/config.js +4 -1
  73. package/dist/esm-node/cli/constants/chainId.js +4 -1
  74. package/dist/esm-node/cli/constants/index.js +62 -39
  75. package/dist/esm-node/cli/ensure.js +6 -2
  76. package/dist/esm-node/cli/fs.js +6 -2
  77. package/dist/esm-node/cli/get/config.js +4 -1
  78. package/dist/esm-node/cli/get/data.js +18 -8
  79. package/dist/esm-node/cli/get/index.js +6 -2
  80. package/dist/esm-node/cli/is/config.js +14 -6
  81. package/dist/esm-node/cli/is/env.js +12 -6
  82. package/dist/esm-node/cli/is/index.js +0 -1
  83. package/dist/esm-node/cli/is/project.js +16 -7
  84. package/dist/esm-node/cli/is/type.js +20 -9
  85. package/dist/esm-node/cli/logger.js +4 -113
  86. package/dist/esm-node/cli/monorepo.js +14 -18
  87. package/dist/esm-node/cli/package.js +10 -4
  88. package/dist/esm-node/cli/path.js +24 -11
  89. package/dist/esm-node/cli/port.js +4 -1
  90. package/dist/esm-node/cli/prettyInstructions.js +6 -2
  91. package/dist/esm-node/cli/require.js +14 -6
  92. package/dist/esm-node/cli/runtimeExports.js +4 -1
  93. package/dist/esm-node/cli/watch.js +6 -2
  94. package/dist/esm-node/compiled.js +65 -31
  95. package/dist/esm-node/import.js +5 -2
  96. package/dist/esm-node/universal/constants.js +12 -4
  97. package/dist/esm-node/universal/formatWebpack.js +5 -2
  98. package/dist/esm-node/universal/pluginDagSort.js +5 -2
  99. package/dist/types/cli/alias.d.ts +0 -5
  100. package/dist/types/cli/constants/index.d.ts +0 -14
  101. package/dist/types/cli/is/env.d.ts +1 -2
  102. package/dist/types/cli/is/index.d.ts +0 -1
  103. package/dist/types/cli/logger.d.ts +1 -69
  104. package/dist/types/cli/monorepo.d.ts +0 -1
  105. package/dist/types/universal/constants.d.ts +4 -0
  106. package/package.json +6 -13
  107. package/dist/cjs/cli/is/platform.js +0 -21
  108. package/dist/compiled/gradient-string/index.d.ts +0 -1
  109. package/dist/compiled/gradient-string/index.js +0 -1
  110. package/dist/compiled/gradient-string/license +0 -21
  111. package/dist/compiled/gradient-string/package.json +0 -1
  112. package/dist/compiled/webpack-dev-middleware/index.js +0 -7
  113. package/dist/compiled/webpack-dev-middleware/license +0 -20
  114. package/dist/compiled/webpack-dev-middleware/package.json +0 -1
  115. package/dist/compiled/webpack-dev-middleware/types/index.d.ts +0 -262
  116. package/dist/esm/cli/is/platform.js +0 -6
  117. package/dist/esm-node/cli/is/platform.js +0 -2
  118. package/dist/types/cli/is/platform.d.ts +0 -2
@@ -1,53 +1,46 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
6
9
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- validAlias: function() {
14
- return validAlias;
15
- },
16
- mergeAlias: function() {
17
- return mergeAlias;
18
- },
19
- getAliasConfig: function() {
20
- return getAliasConfig;
21
- },
22
- getUserAlias: function() {
23
- return getUserAlias;
24
- }
25
- });
26
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
27
- const _fs = /* @__PURE__ */ _interop_require_default._(require("fs"));
28
- const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
29
- const _compiled = require("../compiled");
30
- const _get = require("./get");
31
- const _applyOptionsChain = require("./applyOptionsChain");
32
- const validAlias = (modernConfig, { tsconfigPath }) => {
33
- const { source: { alias } } = modernConfig;
34
- if (!alias) {
35
- return null;
36
- }
37
- const isTsProject = _fs.default.existsSync(tsconfigPath);
38
- if (!isTsProject) {
39
- return null;
40
- }
41
- const userAlias = getUserAlias(alias);
42
- if (Object.keys(userAlias).length > 0) {
43
- return _compiled.chalk.red('Note: Please use `compilerOptions.paths` in "tsconfig.json" file replace `source.alias` config in "modern.config.js/ts" when project is typescript');
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
17
  }
45
- return null;
18
+ return to;
46
19
  };
47
- const mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var alias_exports = {};
30
+ __export(alias_exports, {
31
+ getAliasConfig: () => getAliasConfig,
32
+ getUserAlias: () => getUserAlias,
33
+ mergeAlias: () => mergeAlias
34
+ });
35
+ module.exports = __toCommonJS(alias_exports);
36
+ var import_fs = __toESM(require("fs"));
37
+ var import_path = __toESM(require("path"));
38
+ var import_get = require("./get");
39
+ var import_applyOptionsChain = require("./applyOptionsChain");
40
+ const mergeAlias = (alias) => (0, import_applyOptionsChain.applyOptionsChain)({}, alias);
48
41
  const getAliasConfig = (aliasOption, option) => {
49
42
  var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
50
- const isTsProject = _fs.default.existsSync(option.tsconfigPath);
43
+ const isTsProject = import_fs.default.existsSync(option.tsconfigPath);
51
44
  const alias = mergeAlias(aliasOption);
52
45
  if (!isTsProject) {
53
46
  return {
@@ -57,10 +50,10 @@ const getAliasConfig = (aliasOption, option) => {
57
50
  isTsProject
58
51
  };
59
52
  }
60
- const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
53
+ const tsconfig = (0, import_get.readTsConfigByFile)(option.tsconfigPath);
61
54
  const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
62
55
  return {
63
- absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
56
+ absoluteBaseUrl: baseUrl ? import_path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
64
57
  paths: {
65
58
  ...alias,
66
59
  ...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
@@ -75,3 +68,9 @@ const getUserAlias = (alias = {}) => Object.keys(alias).reduce((o, k) => {
75
68
  }
76
69
  return o;
77
70
  }, {});
71
+ // Annotate the CommonJS export names for ESM import in node:
72
+ 0 && (module.exports = {
73
+ getAliasConfig,
74
+ getUserAlias,
75
+ mergeAlias
76
+ });
@@ -1,26 +1,39 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "applyOptionsChain", {
6
- enumerable: true,
7
- get: function() {
8
- return applyOptionsChain;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var applyOptionsChain_exports = {};
20
+ __export(applyOptionsChain_exports, {
21
+ applyOptionsChain: () => applyOptionsChain
10
22
  });
11
- const _is = require("./is");
12
- const _logger = require("./logger");
23
+ module.exports = __toCommonJS(applyOptionsChain_exports);
24
+ var import_is = require("./is");
25
+ var import_logger = require("./logger");
13
26
  function applyOptionsChain(defaults, options, utils, mergeFn = Object.assign) {
14
27
  if (!options) {
15
28
  return defaults;
16
29
  }
17
- if ((0, _is.isPlainObject)(options)) {
30
+ if ((0, import_is.isPlainObject)(options)) {
18
31
  return mergeFn(defaults, options);
19
- } else if ((0, _is.isFunction)(options)) {
32
+ } else if ((0, import_is.isFunction)(options)) {
20
33
  const ret = options(defaults, utils);
21
34
  if (ret) {
22
- if (!(0, _is.isPlainObject)(ret)) {
23
- _logger.logger.warn(`${options.name}: Function should mutate the config and return nothing, Or return a cloned or merged version of config object.`);
35
+ if (!(0, import_is.isPlainObject)(ret)) {
36
+ import_logger.logger.warn(`${options.name}: Function should mutate the config and return nothing, Or return a cloned or merged version of config object.`);
24
37
  }
25
38
  return ret;
26
39
  }
@@ -32,3 +45,7 @@ default options is: ${JSON.stringify(defaults)}`);
32
45
  }
33
46
  return defaults;
34
47
  }
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ applyOptionsChain
51
+ });
@@ -1,29 +1,34 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- getBabelUtils: function() {
14
- return getBabelUtils;
15
- },
16
- applyUserBabelConfig: function() {
17
- return applyUserBabelConfig;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var babel_exports = {};
20
+ __export(babel_exports, {
21
+ applyUserBabelConfig: () => applyUserBabelConfig,
22
+ getBabelUtils: () => getBabelUtils
19
23
  });
20
- const _path = require("path");
21
- const _applyOptionsChain = require("./applyOptionsChain");
22
- const _ensure = require("./ensure");
23
- const _path1 = require("./path");
24
+ module.exports = __toCommonJS(babel_exports);
25
+ var import_path = require("path");
26
+ var import_applyOptionsChain = require("./applyOptionsChain");
27
+ var import_ensure = require("./ensure");
28
+ var import_path2 = require("./path");
24
29
  const formatPath = (originPath) => {
25
- if ((0, _path.isAbsolute)(originPath)) {
26
- return originPath.split(_path.sep).join("/");
30
+ if ((0, import_path.isAbsolute)(originPath)) {
31
+ return originPath.split(import_path.sep).join("/");
27
32
  }
28
33
  return originPath;
29
34
  };
@@ -54,7 +59,7 @@ const removePlugins = (plugins, config) => {
54
59
  if (!config.plugins) {
55
60
  return;
56
61
  }
57
- const removeList = (0, _ensure.ensureArray)(plugins);
62
+ const removeList = (0, import_ensure.ensureArray)(plugins);
58
63
  config.plugins = config.plugins.filter((item) => {
59
64
  const name = getPluginItemName(item);
60
65
  if (name) {
@@ -67,7 +72,7 @@ const removePresets = (presets, config) => {
67
72
  if (!config.presets) {
68
73
  return;
69
74
  }
70
- const removeList = (0, _ensure.ensureArray)(presets);
75
+ const removeList = (0, import_ensure.ensureArray)(presets);
71
76
  config.presets = config.presets.filter((item) => {
72
77
  const name = getPluginItemName(item);
73
78
  if (name) {
@@ -79,13 +84,13 @@ const removePresets = (presets, config) => {
79
84
  const modifyPresetOptions = (presetName, options, presets = []) => {
80
85
  presets.forEach((preset, index) => {
81
86
  if (Array.isArray(preset)) {
82
- if (typeof preset[0] === "string" && (0, _path1.normalizeToPosixPath)(preset[0]).includes(presetName)) {
87
+ if (typeof preset[0] === "string" && (0, import_path2.normalizeToPosixPath)(preset[0]).includes(presetName)) {
83
88
  preset[1] = {
84
89
  ...preset[1] || {},
85
90
  ...options
86
91
  };
87
92
  }
88
- } else if (typeof preset === "string" && (0, _path1.normalizeToPosixPath)(preset).includes(presetName)) {
93
+ } else if (typeof preset === "string" && (0, import_path2.normalizeToPosixPath)(preset).includes(presetName)) {
89
94
  presets[index] = [
90
95
  preset,
91
96
  options
@@ -116,7 +121,12 @@ const applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils)
116
121
  ...getBabelUtils(defaultOptions),
117
122
  ...extraBabelUtils
118
123
  };
119
- return (0, _applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
124
+ return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
120
125
  }
121
126
  return defaultOptions;
122
127
  };
128
+ // Annotate the CommonJS export names for ESM import in node:
129
+ 0 && (module.exports = {
130
+ applyUserBabelConfig,
131
+ getBabelUtils
132
+ });
@@ -1,28 +1,29 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- getFullArgv: function() {
14
- return getFullArgv;
15
- },
16
- getArgv: function() {
17
- return getArgv;
18
- },
19
- getCommand: function() {
20
- return getCommand;
21
- },
22
- isDevCommand: function() {
23
- return isDevCommand;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var commands_exports = {};
20
+ __export(commands_exports, {
21
+ getArgv: () => getArgv,
22
+ getCommand: () => getCommand,
23
+ getFullArgv: () => getFullArgv,
24
+ isDevCommand: () => isDevCommand
25
25
  });
26
+ module.exports = __toCommonJS(commands_exports);
26
27
  const getFullArgv = () => {
27
28
  var _process_env_MODERN_ARGV;
28
29
  return ((_process_env_MODERN_ARGV = process.env.MODERN_ARGV) === null || _process_env_MODERN_ARGV === void 0 ? void 0 : _process_env_MODERN_ARGV.split(" ")) || process.argv;
@@ -39,3 +40,10 @@ const isDevCommand = () => {
39
40
  const command = getCommand();
40
41
  return command === "dev" || command === "start";
41
42
  };
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ getArgv,
46
+ getCommand,
47
+ getFullArgv,
48
+ isDevCommand
49
+ });
@@ -1,27 +1,30 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- createDebugger: function() {
14
- return createDebugger;
15
- },
16
- clearConsole: function() {
17
- return clearConsole;
18
- },
19
- wait: function() {
20
- return wait;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var common_exports = {};
20
+ __export(common_exports, {
21
+ clearConsole: () => clearConsole,
22
+ createDebugger: () => createDebugger,
23
+ wait: () => wait
22
24
  });
23
- const _debug = require("../../compiled/debug");
24
- const createDebugger = (scope) => (0, _debug.debug)(`modern-js:${scope}`);
25
+ module.exports = __toCommonJS(common_exports);
26
+ var import_debug = require("../../compiled/debug");
27
+ const createDebugger = (scope) => (0, import_debug.debug)(`modern-js:${scope}`);
25
28
  const clearConsole = () => {
26
29
  if (process.stdout.isTTY && !process.env.DEBUG) {
27
30
  process.stdout.write("\x1B[H\x1B[2J");
@@ -30,3 +33,9 @@ const clearConsole = () => {
30
33
  const wait = (time = 0) => new Promise((resolve) => {
31
34
  setTimeout(resolve, time);
32
35
  });
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ clearConsole,
39
+ createDebugger,
40
+ wait
41
+ });
@@ -1,15 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "isOverriddenConfigKey", {
6
- enumerable: true,
7
- get: function() {
8
- return isOverriddenConfigKey;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var config_exports = {};
20
+ __export(config_exports, {
21
+ isOverriddenConfigKey: () => isOverriddenConfigKey
10
22
  });
23
+ module.exports = __toCommonJS(config_exports);
11
24
  const isOverriddenConfigKey = (key) => [
12
25
  "removeConsole",
13
26
  "enableInlineScripts",
14
27
  "enableInlineStyles"
15
28
  ].includes(key);
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ isOverriddenConfigKey
32
+ });
@@ -1,13 +1,26 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "CHAIN_ID", {
6
- enumerable: true,
7
- get: function() {
8
- return CHAIN_ID;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chainId_exports = {};
20
+ __export(chainId_exports, {
21
+ CHAIN_ID: () => CHAIN_ID
10
22
  });
23
+ module.exports = __toCommonJS(chainId_exports);
11
24
  const CHAIN_ID = {
12
25
  /** Predefined rules */
13
26
  RULE: {
@@ -202,3 +215,7 @@ const CHAIN_ID = {
202
215
  TS_CONFIG_PATHS: "ts-config-paths"
203
216
  }
204
217
  };
218
+ // Annotate the CommonJS export names for ESM import in node:
219
+ 0 && (module.exports = {
220
+ CHAIN_ID
221
+ });