@modern-js/utils 2.19.1 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/cjs/cli/alias.js +3 -7
  3. package/dist/cjs/cli/constants/chainId.js +2 -0
  4. package/dist/cjs/cli/constants/index.js +2 -14
  5. package/dist/cjs/cli/ensure.js +2 -6
  6. package/dist/cjs/cli/get/data.js +3 -7
  7. package/dist/cjs/cli/get/index.js +5 -21
  8. package/dist/cjs/cli/index.js +24 -37
  9. package/dist/cjs/cli/is/index.js +6 -18
  10. package/dist/cjs/cli/is/project.js +2 -6
  11. package/dist/cjs/cli/logger.js +7 -23
  12. package/dist/cjs/cli/monorepo.js +3 -7
  13. package/dist/cjs/cli/path.js +4 -8
  14. package/dist/cjs/cli/pathSerializer.js +3 -7
  15. package/dist/cjs/cli/port.js +2 -6
  16. package/dist/cjs/cli/prettyInstructions.js +2 -6
  17. package/dist/cjs/cli/routes.js +2 -6
  18. package/dist/cjs/cli/runtimeExports.js +2 -6
  19. package/dist/cjs/cli/watch.js +2 -6
  20. package/dist/cjs/compiled.js +28 -71
  21. package/dist/cjs/index.js +4 -16
  22. package/dist/cjs/runtime/nestedRoutes.js +2 -41
  23. package/dist/cjs/runtime/remixRouter.js +2 -14
  24. package/dist/cjs/runtime/router.js +2 -15
  25. package/dist/cjs/runtime-browser/index.js +2 -14
  26. package/dist/cjs/runtime-node/router.js +6 -0
  27. package/dist/cjs/runtime-node/serialize.js +2 -6
  28. package/dist/cjs/runtime-node/storage.js +2 -41
  29. package/dist/compiled/better-ajv-errors/index.js +1 -1
  30. package/dist/compiled/webpack-dev-middleware/index.js +2 -2
  31. package/dist/esm/cli/constants/chainId.js +2 -0
  32. package/dist/esm/cli/index.js +0 -1
  33. package/dist/esm/cli/logger.js +1 -13
  34. package/dist/esm/runtime/router.js +1 -2
  35. package/dist/esm/runtime-node/router.js +1 -0
  36. package/dist/types/cli/constants/chainId.d.ts +2 -73
  37. package/dist/types/cli/constants/index.d.ts +0 -21
  38. package/dist/types/cli/index.d.ts +0 -1
  39. package/dist/types/cli/is/config.d.ts +0 -2
  40. package/dist/types/cli/is/project.d.ts +0 -2
  41. package/dist/types/cli/is/type.d.ts +0 -1
  42. package/dist/types/cli/logger.d.ts +0 -2
  43. package/dist/types/cli/path.d.ts +0 -2
  44. package/dist/types/cli/require.d.ts +0 -1
  45. package/dist/types/compiled.d.ts +0 -1
  46. package/dist/types/runtime/router.d.ts +1 -2
  47. package/dist/types/runtime-node/index.d.ts +0 -1
  48. package/dist/types/runtime-node/router.d.ts +1 -0
  49. package/dist/types/universal/constants.d.ts +0 -1
  50. package/package.json +38 -12
  51. package/dist/cjs/cli/generateMetaTags.js +0 -42
  52. package/dist/esm/cli/generateMetaTags.js +0 -34
  53. package/dist/types/cli/generateMetaTags.d.ts +0 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 056627f: fix(plugin-sass): pollute the `global.location` object
8
+ fix(plugin-sass): 污染全局对象 `global.location`
9
+
10
+ ### Patch Changes
11
+
12
+ - e81eeaf: refactor: guard react-router version consistency
13
+ refactor: 保证 react-router 相关包的版本一致性
14
+ - 26dcf3a: chore: bump typescript to v5 in devDependencies
15
+
16
+ chore: 升级 devDependencies 中的 typescript 版本到 v5
17
+
18
+ - 0fc15ca: fix: fix `@modern-js/utils` subpath exports
19
+ fix: 修复 `@modern-js/utils` 子路径导出
20
+ - 43b4e83: feat: support security.nonce for add nonce attribute on script tag
21
+ feat: 支持 security.nonce 配置,为 script 标签添加 nonce 属性
22
+ - ad78387: chore(deps): bump babel-related dependencies to latest version
23
+
24
+ chore(deps): 升级 babel 相关依赖到最新版本
25
+
26
+ ## 2.20.0
27
+
28
+ ### Patch Changes
29
+
30
+ - 3c4e0a5: chore(utils): move generateMetaTags method to builder-shared
31
+
32
+ chore(utils): 移动 generateMetaTags 方法到 builder-shared
33
+
34
+ - 6b9d90a: chore: remove @babel/runtime. add @swc/helper and enable `externalHelper` config.
35
+ chore: 移除 @babel/runtime 依赖. 增加 @swc/helpers 依赖并且开启 `externalHelpers` 配置
36
+
3
37
  ## 2.19.1
4
38
 
5
39
  ## 2.19.0
@@ -15,16 +15,12 @@ _export(exports, {
15
15
  getAliasConfig: () => getAliasConfig,
16
16
  getUserAlias: () => getUserAlias
17
17
  });
18
- const _fs = /* @__PURE__ */ _interop_require_default(require("fs"));
19
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
18
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
19
+ const _fs = /* @__PURE__ */ _interop_require_default._(require("fs"));
20
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
20
21
  const _compiled = require("../compiled");
21
22
  const _get = require("./get");
22
23
  const _applyOptionsChain = require("./applyOptionsChain");
23
- function _interop_require_default(obj) {
24
- return obj && obj.__esModule ? obj : {
25
- default: obj
26
- };
27
- }
28
24
  const validAlias = (modernConfig, { tsconfigPath }) => {
29
25
  const { source: { alias } } = modernConfig;
30
26
  if (!alias) {
@@ -138,6 +138,8 @@ const CHAIN_ID = {
138
138
  BOTTOM_TEMPLATE: "bottom-template",
139
139
  /** HtmlCrossOriginPlugin */
140
140
  HTML_CROSS_ORIGIN: "html-cross-origin",
141
+ /** HtmlNoncePlugin */
142
+ HTML_NONCE: "html-nonce",
141
143
  /** MiniCssExtractPlugin */
142
144
  MINI_CSS_EXTRACT: "mini-css-extract",
143
145
  /** ReactFastRefreshPlugin */
@@ -42,20 +42,8 @@ _export(exports, {
42
42
  PLUGIN_SCHEMAS: () => PLUGIN_SCHEMAS,
43
43
  DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: () => DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS
44
44
  });
45
- _export_star(require("./chainId"), exports);
46
- function _export_star(from, to) {
47
- Object.keys(from).forEach(function(k) {
48
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
49
- Object.defineProperty(to, k, {
50
- enumerable: true,
51
- get: function() {
52
- return from[k];
53
- }
54
- });
55
- }
56
- });
57
- return from;
58
- }
45
+ const _export_star = require("@swc/helpers/_/_export_star");
46
+ _export_star._(require("./chainId"), exports);
59
47
  const ROUTE_SPEC_FILE = "route.json";
60
48
  const MAIN_ENTRY_NAME = "main";
61
49
  const SERVER_BUNDLE_DIRECTORY = "bundles";
@@ -13,12 +13,8 @@ _export(exports, {
13
13
  ensureAbsolutePath: () => ensureAbsolutePath,
14
14
  ensureArray: () => ensureArray
15
15
  });
16
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
17
- function _interop_require_default(obj) {
18
- return obj && obj.__esModule ? obj : {
19
- default: obj
20
- };
21
- }
16
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
17
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
22
18
  const ensureAbsolutePath = (base, filePath) => _path.default.isAbsolute(filePath) ? filePath : _path.default.resolve(base, filePath);
23
19
  const ensureArray = (params) => {
24
20
  if (Array.isArray(params)) {
@@ -19,17 +19,13 @@ _export(exports, {
19
19
  readTsConfig: () => readTsConfig,
20
20
  readTsConfigByFile: () => readTsConfigByFile
21
21
  });
22
- const _os = /* @__PURE__ */ _interop_require_default(require("os"));
23
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
22
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
23
+ const _os = /* @__PURE__ */ _interop_require_default._(require("os"));
24
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
24
25
  const _compiled = require("../../compiled");
25
26
  const _constants = require("../constants");
26
27
  const _is = require("../is");
27
28
  const _package = require("../package");
28
- function _interop_require_default(obj) {
29
- return obj && obj.__esModule ? obj : {
30
- default: obj
31
- };
32
- }
33
29
  const MAX_TIMES = 5;
34
30
  async function getPackageManager(cwd = process.cwd()) {
35
31
  let appDirectory = cwd;
@@ -13,29 +13,13 @@ _export(exports, {
13
13
  getServerConfig: () => getServerConfig,
14
14
  getTargetDir: () => getTargetDir
15
15
  });
16
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
16
+ const _export_star = require("@swc/helpers/_/_export_star");
17
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
18
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
17
19
  const _constants = require("../constants");
18
20
  const _fs = require("../fs");
19
- _export_star(require("./data"), exports);
20
- _export_star(require("./config"), exports);
21
- function _export_star(from, to) {
22
- Object.keys(from).forEach(function(k) {
23
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
24
- Object.defineProperty(to, k, {
25
- enumerable: true,
26
- get: function() {
27
- return from[k];
28
- }
29
- });
30
- }
31
- });
32
- return from;
33
- }
34
- function _interop_require_default(obj) {
35
- return obj && obj.__esModule ? obj : {
36
- default: obj
37
- };
38
- }
21
+ _export_star._(require("./data"), exports);
22
+ _export_star._(require("./config"), exports);
39
23
  const getServerConfig = async (appDirectory, configFile) => {
40
24
  const configFilePath = (0, _fs.findExists)(_constants.CONFIG_FILE_EXTENSIONS.map((extension) => _path.default.resolve(appDirectory, `${configFile}${extension}`)));
41
25
  return configFilePath;
@@ -2,40 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./constants"), exports);
6
- _export_star(require("./get"), exports);
7
- _export_star(require("./is"), exports);
8
- _export_star(require("./alias"), exports);
9
- _export_star(require("./applyOptionsChain"), exports);
10
- _export_star(require("./babel"), exports);
11
- _export_star(require("./commands"), exports);
12
- _export_star(require("./common"), exports);
13
- _export_star(require("./ensure"), exports);
14
- _export_star(require("./fs"), exports);
15
- _export_star(require("./generateMetaTags"), exports);
16
- _export_star(require("./logger"), exports);
17
- _export_star(require("./monorepo"), exports);
18
- _export_star(require("./package"), exports);
19
- _export_star(require("./path"), exports);
20
- _export_star(require("./pathSerializer"), exports);
21
- _export_star(require("./port"), exports);
22
- _export_star(require("./prettyInstructions"), exports);
23
- _export_star(require("./print"), exports);
24
- _export_star(require("./require"), exports);
25
- _export_star(require("./routes"), exports);
26
- _export_star(require("./runtimeExports"), exports);
27
- _export_star(require("./test"), exports);
28
- _export_star(require("./watch"), exports);
29
- function _export_star(from, to) {
30
- Object.keys(from).forEach(function(k) {
31
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
32
- Object.defineProperty(to, k, {
33
- enumerable: true,
34
- get: function() {
35
- return from[k];
36
- }
37
- });
38
- }
39
- });
40
- return from;
41
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./constants"), exports);
7
+ _export_star._(require("./get"), exports);
8
+ _export_star._(require("./is"), exports);
9
+ _export_star._(require("./alias"), exports);
10
+ _export_star._(require("./applyOptionsChain"), exports);
11
+ _export_star._(require("./babel"), exports);
12
+ _export_star._(require("./commands"), exports);
13
+ _export_star._(require("./common"), exports);
14
+ _export_star._(require("./ensure"), exports);
15
+ _export_star._(require("./fs"), exports);
16
+ _export_star._(require("./logger"), exports);
17
+ _export_star._(require("./monorepo"), exports);
18
+ _export_star._(require("./package"), exports);
19
+ _export_star._(require("./path"), exports);
20
+ _export_star._(require("./pathSerializer"), exports);
21
+ _export_star._(require("./port"), exports);
22
+ _export_star._(require("./prettyInstructions"), exports);
23
+ _export_star._(require("./print"), exports);
24
+ _export_star._(require("./require"), exports);
25
+ _export_star._(require("./routes"), exports);
26
+ _export_star._(require("./runtimeExports"), exports);
27
+ _export_star._(require("./test"), exports);
28
+ _export_star._(require("./watch"), exports);
@@ -2,21 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./env"), exports);
6
- _export_star(require("./platform"), exports);
7
- _export_star(require("./type"), exports);
8
- _export_star(require("./config"), exports);
9
- _export_star(require("./project"), exports);
10
- function _export_star(from, to) {
11
- Object.keys(from).forEach(function(k) {
12
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
13
- Object.defineProperty(to, k, {
14
- enumerable: true,
15
- get: function() {
16
- return from[k];
17
- }
18
- });
19
- }
20
- });
21
- return from;
22
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./env"), exports);
7
+ _export_star._(require("./platform"), exports);
8
+ _export_star._(require("./type"), exports);
9
+ _export_star._(require("./config"), exports);
10
+ _export_star._(require("./project"), exports);
@@ -18,16 +18,12 @@ _export(exports, {
18
18
  isReact18: () => isReact18,
19
19
  isTypescript: () => isTypescript
20
20
  });
21
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
21
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
22
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
22
23
  const _commands = require("../commands");
23
24
  const _compiled = require("../../compiled");
24
25
  const _common = require("../common");
25
26
  const _ensure = require("../ensure");
26
- function _interop_require_default(obj) {
27
- return obj && obj.__esModule ? obj : {
28
- default: obj
29
- };
30
- }
31
27
  const debug = (0, _common.createDebugger)("judge-depExists");
32
28
  const isDepExists = (appDirectory, name) => {
33
29
  const pkgPath = _path.default.resolve(appDirectory, "./package.json");
@@ -13,25 +13,9 @@ _export(exports, {
13
13
  Logger: () => Logger,
14
14
  logger: () => logger
15
15
  });
16
- const _chalk = /* @__PURE__ */ _interop_require_default(require("../../compiled/chalk"));
17
- function _define_property(obj, key, value) {
18
- if (key in obj) {
19
- Object.defineProperty(obj, key, {
20
- value,
21
- enumerable: true,
22
- configurable: true,
23
- writable: true
24
- });
25
- } else {
26
- obj[key] = value;
27
- }
28
- return obj;
29
- }
30
- function _interop_require_default(obj) {
31
- return obj && obj.__esModule ? obj : {
32
- default: obj
33
- };
34
- }
16
+ const _define_property = require("@swc/helpers/_/_define_property");
17
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
18
+ const _chalk = /* @__PURE__ */ _interop_require_default._(require("../../compiled/chalk"));
35
19
  const LOG_LEVEL = {
36
20
  error: 0,
37
21
  warn: 1,
@@ -115,10 +99,10 @@ ${_chalk.default.grey(rest.join("\n"))}`;
115
99
  return longestLabel;
116
100
  }
117
101
  constructor(options = {}) {
118
- _define_property(this, "level", void 0);
119
- _define_property(this, "config", void 0);
120
- _define_property(this, "types", void 0);
121
- _define_property(this, "longestLabel", void 0);
102
+ _define_property._(this, "level", void 0);
103
+ _define_property._(this, "config", void 0);
104
+ _define_property._(this, "types", void 0);
105
+ _define_property._(this, "longestLabel", void 0);
122
106
  this.level = options.level || LOG_TYPES.log.level;
123
107
  this.config = {
124
108
  ...DEFAULT_CONFIG,
@@ -18,14 +18,10 @@ _export(exports, {
18
18
  findMonorepoRoot: () => findMonorepoRoot,
19
19
  getMonorepoPackages: () => getMonorepoPackages
20
20
  });
21
- const _fs = /* @__PURE__ */ _interop_require_default(require("fs"));
22
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
21
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
22
+ const _fs = /* @__PURE__ */ _interop_require_default._(require("fs"));
23
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
23
24
  const _compiled = require("../compiled");
24
- function _interop_require_default(obj) {
25
- return obj && obj.__esModule ? obj : {
26
- default: obj
27
- };
28
- }
29
25
  const PACKAGE_MAX_DEPTH = 5;
30
26
  const WORKSPACE_FILES = {
31
27
  YARN: "package.json",
@@ -24,15 +24,11 @@ _export(exports, {
24
24
  removeTailSlash: () => removeTailSlash,
25
25
  removeSlash: () => removeSlash
26
26
  });
27
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
28
- const _os = /* @__PURE__ */ _interop_require_default(require("os"));
29
- const _fs = /* @__PURE__ */ _interop_require_default(require("fs"));
27
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
28
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
29
+ const _os = /* @__PURE__ */ _interop_require_default._(require("os"));
30
+ const _fs = /* @__PURE__ */ _interop_require_default._(require("fs"));
30
31
  const _compiled = require("../compiled");
31
- function _interop_require_default(obj) {
32
- return obj && obj.__esModule ? obj : {
33
- default: obj
34
- };
35
- }
36
32
  const isPathString = (test) => _path.default.posix.basename(test) !== test || _path.default.win32.basename(test) !== test;
37
33
  const isRelativePath = (test) => /^\.\.?($|[\\/])/.test(test);
38
34
  const normalizeOutputPath = (s) => s.replace(/\\/g, "\\\\");
@@ -15,14 +15,10 @@ _export(exports, {
15
15
  applyMatcherReplacement: () => applyMatcherReplacement,
16
16
  createDefaultPathMatchers: () => createDefaultPathMatchers
17
17
  });
18
- const _os = /* @__PURE__ */ _interop_require_default(require("os"));
19
- const _lodash = /* @__PURE__ */ _interop_require_default(require("../../compiled/lodash"));
18
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
19
+ const _os = /* @__PURE__ */ _interop_require_default._(require("os"));
20
+ const _lodash = /* @__PURE__ */ _interop_require_default._(require("../../compiled/lodash"));
20
21
  const _path = require("./path");
21
- function _interop_require_default(obj) {
22
- return obj && obj.__esModule ? obj : {
23
- default: obj
24
- };
25
- }
26
22
  const matchUpwardPathsAsUnknown = (p) => (0, _lodash.default)((0, _path.upwardPaths)((0, _path.normalizeToPosixPath)(p))).map((match) => ({
27
23
  match,
28
24
  mark: "unknown"
@@ -6,14 +6,10 @@ Object.defineProperty(exports, "getPort", {
6
6
  enumerable: true,
7
7
  get: () => getPort
8
8
  });
9
- const _net = /* @__PURE__ */ _interop_require_default(require("net"));
9
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
10
+ const _net = /* @__PURE__ */ _interop_require_default._(require("net"));
10
11
  const _compiled = require("../compiled");
11
12
  const _logger = require("./logger");
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
13
  const getPort = async (port, { tryLimits = 20, strictPort = false } = {}) => {
18
14
  if (typeof port === "string") {
19
15
  port = parseInt(port, 10);
@@ -13,15 +13,11 @@ _export(exports, {
13
13
  getAddressUrls: () => getAddressUrls,
14
14
  prettyInstructions: () => prettyInstructions
15
15
  });
16
- const _os = /* @__PURE__ */ _interop_require_default(require("os"));
16
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
17
+ const _os = /* @__PURE__ */ _interop_require_default._(require("os"));
17
18
  const _compiled = require("../compiled");
18
19
  const _is = require("./is");
19
20
  const _constants = require("./constants");
20
- function _interop_require_default(obj) {
21
- return obj && obj.__esModule ? obj : {
22
- default: obj
23
- };
24
- }
25
21
  const normalizeUrl = (url) => url.replace(/([^:]\/)\/+/g, "$1");
26
22
  const getIpv4Interfaces = () => {
27
23
  const interfaces = _os.default.networkInterfaces();
@@ -6,14 +6,10 @@ Object.defineProperty(exports, "getRouteId", {
6
6
  enumerable: true,
7
7
  get: () => getRouteId
8
8
  });
9
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
9
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
10
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
10
11
  const _constants = require("./constants");
11
12
  const _path1 = require("./path");
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
13
  const getPathWithoutExt = (filename) => {
18
14
  const extname = _path.default.extname(filename);
19
15
  return filename.slice(0, -extname.length);
@@ -6,14 +6,10 @@ Object.defineProperty(exports, "createRuntimeExportsUtils", {
6
6
  enumerable: true,
7
7
  get: () => createRuntimeExportsUtils
8
8
  });
9
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
9
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
10
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
10
11
  const _compiled = require("../compiled");
11
12
  const _path1 = require("./path");
12
- function _interop_require_default(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
13
  const memo = (fn) => {
18
14
  const cache = /* @__PURE__ */ new Map();
19
15
  return (...params) => {
@@ -13,13 +13,9 @@ _export(exports, {
13
13
  WatchChangeType: () => WatchChangeType,
14
14
  watch: () => watch
15
15
  });
16
- const _path = /* @__PURE__ */ _interop_require_default(require("path"));
16
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
17
+ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
17
18
  const _compiled = require("../compiled");
18
- function _interop_require_default(obj) {
19
- return obj && obj.__esModule ? obj : {
20
- default: obj
21
- };
22
- }
23
19
  const WatchChangeType = {
24
20
  ADD: "add",
25
21
  UNLINK: "unlink",
@@ -44,80 +44,37 @@ _export(exports, {
44
44
  chokidar: () => chokidar,
45
45
  inquirer: () => inquirer
46
46
  });
47
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
48
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
47
49
  const _import = require("./import");
48
- const _fsextra = /* @__PURE__ */ _interop_require_default(require("../compiled/fs-extra"));
49
- const _ora = /* @__PURE__ */ _interop_require_default(require("../compiled/ora"));
50
- const _glob = /* @__PURE__ */ _interop_require_default(require("../compiled/glob"));
51
- const _jsyaml = /* @__PURE__ */ _interop_require_default(require("../compiled/js-yaml"));
52
- const _chalk = /* @__PURE__ */ _interop_require_default(require("../compiled/chalk"));
53
- const _debug = /* @__PURE__ */ _interop_require_default(require("../compiled/debug"));
54
- const _slash = /* @__PURE__ */ _interop_require_default(require("../compiled/slash"));
55
- const _execa = /* @__PURE__ */ _interop_require_default(require("../compiled/execa"));
56
- const _json5 = /* @__PURE__ */ _interop_require_default(require("../compiled/json5"));
57
- const _upath = /* @__PURE__ */ _interop_require_default(require("../compiled/upath"));
58
- const _pkgup = /* @__PURE__ */ _interop_require_default(require("../compiled/pkg-up"));
50
+ const _fsextra = /* @__PURE__ */ _interop_require_default._(require("../compiled/fs-extra"));
51
+ const _ora = /* @__PURE__ */ _interop_require_default._(require("../compiled/ora"));
52
+ const _glob = /* @__PURE__ */ _interop_require_default._(require("../compiled/glob"));
53
+ const _jsyaml = /* @__PURE__ */ _interop_require_default._(require("../compiled/js-yaml"));
54
+ const _chalk = /* @__PURE__ */ _interop_require_default._(require("../compiled/chalk"));
55
+ const _debug = /* @__PURE__ */ _interop_require_default._(require("../compiled/debug"));
56
+ const _slash = /* @__PURE__ */ _interop_require_default._(require("../compiled/slash"));
57
+ const _execa = /* @__PURE__ */ _interop_require_default._(require("../compiled/execa"));
58
+ const _json5 = /* @__PURE__ */ _interop_require_default._(require("../compiled/json5"));
59
+ const _upath = /* @__PURE__ */ _interop_require_default._(require("../compiled/upath"));
60
+ const _pkgup = /* @__PURE__ */ _interop_require_default._(require("../compiled/pkg-up"));
59
61
  const _nanoid = require("../compiled/nanoid");
60
- const _semver = /* @__PURE__ */ _interop_require_default(require("../compiled/semver"));
61
- const _dotenv = /* @__PURE__ */ _interop_require_default(require("../compiled/dotenv"));
62
- const _lodash = /* @__PURE__ */ _interop_require_default(require("../compiled/lodash"));
63
- const _globby = /* @__PURE__ */ _interop_require_default(require("../compiled/globby"));
64
- const _address = /* @__PURE__ */ _interop_require_default(require("../compiled/address"));
65
- const _signale = /* @__PURE__ */ _interop_require_wildcard(require("../compiled/signale"));
66
- const _urljoin = /* @__PURE__ */ _interop_require_default(require("../compiled/url-join"));
67
- const _minimist = /* @__PURE__ */ _interop_require_default(require("../compiled/minimist"));
68
- const _fastglob = /* @__PURE__ */ _interop_require_default(require("../compiled/fast-glob"));
69
- const _filesize = /* @__PURE__ */ _interop_require_default(require("../compiled/filesize"));
70
- const _gzipsize = /* @__PURE__ */ _interop_require_default(require("../compiled/gzip-size"));
71
- const _stripansi = /* @__PURE__ */ _interop_require_default(require("../compiled/strip-ansi"));
72
- const _dotenvexpand = /* @__PURE__ */ _interop_require_default(require("../compiled/dotenv-expand"));
73
- const _browserslist = /* @__PURE__ */ _interop_require_default(require("../compiled/browserslist"));
74
- const _recursivereaddir = /* @__PURE__ */ _interop_require_default(require("../compiled/recursive-readdir"));
62
+ const _semver = /* @__PURE__ */ _interop_require_default._(require("../compiled/semver"));
63
+ const _dotenv = /* @__PURE__ */ _interop_require_default._(require("../compiled/dotenv"));
64
+ const _lodash = /* @__PURE__ */ _interop_require_default._(require("../compiled/lodash"));
65
+ const _globby = /* @__PURE__ */ _interop_require_default._(require("../compiled/globby"));
66
+ const _address = /* @__PURE__ */ _interop_require_default._(require("../compiled/address"));
67
+ const _signale = /* @__PURE__ */ _interop_require_wildcard._(require("../compiled/signale"));
68
+ const _urljoin = /* @__PURE__ */ _interop_require_default._(require("../compiled/url-join"));
69
+ const _minimist = /* @__PURE__ */ _interop_require_default._(require("../compiled/minimist"));
70
+ const _fastglob = /* @__PURE__ */ _interop_require_default._(require("../compiled/fast-glob"));
71
+ const _filesize = /* @__PURE__ */ _interop_require_default._(require("../compiled/filesize"));
72
+ const _gzipsize = /* @__PURE__ */ _interop_require_default._(require("../compiled/gzip-size"));
73
+ const _stripansi = /* @__PURE__ */ _interop_require_default._(require("../compiled/strip-ansi"));
74
+ const _dotenvexpand = /* @__PURE__ */ _interop_require_default._(require("../compiled/dotenv-expand"));
75
+ const _browserslist = /* @__PURE__ */ _interop_require_default._(require("../compiled/browserslist"));
76
+ const _recursivereaddir = /* @__PURE__ */ _interop_require_default._(require("../compiled/recursive-readdir"));
75
77
  const _commander = require("../compiled/commander");
76
- function _interop_require_default(obj) {
77
- return obj && obj.__esModule ? obj : {
78
- default: obj
79
- };
80
- }
81
- function _getRequireWildcardCache(nodeInterop) {
82
- if (typeof WeakMap !== "function")
83
- return null;
84
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
85
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
86
- return (_getRequireWildcardCache = function(nodeInterop2) {
87
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
88
- })(nodeInterop);
89
- }
90
- function _interop_require_wildcard(obj, nodeInterop) {
91
- if (!nodeInterop && obj && obj.__esModule) {
92
- return obj;
93
- }
94
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
95
- return {
96
- default: obj
97
- };
98
- }
99
- var cache = _getRequireWildcardCache(nodeInterop);
100
- if (cache && cache.has(obj)) {
101
- return cache.get(obj);
102
- }
103
- var newObj = {};
104
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
105
- for (var key in obj) {
106
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
107
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
108
- if (desc && (desc.get || desc.set)) {
109
- Object.defineProperty(newObj, key, desc);
110
- } else {
111
- newObj[key] = obj[key];
112
- }
113
- }
114
- }
115
- newObj.default = obj;
116
- if (cache) {
117
- cache.set(obj, newObj);
118
- }
119
- return newObj;
120
- }
121
78
  const mime = _import.Import.lazy("../compiled/mime-types", require);
122
79
  const chokidar = _import.Import.lazy("../compiled/chokidar", require);
123
80
  const inquirer = _import.Import.lazy("../compiled/inquirer", require);
package/dist/cjs/index.js CHANGED
@@ -2,19 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./compiled"), exports);
6
- _export_star(require("./cli"), exports);
7
- _export_star(require("./import"), exports);
8
- function _export_star(from, to) {
9
- Object.keys(from).forEach(function(k) {
10
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
11
- Object.defineProperty(to, k, {
12
- enumerable: true,
13
- get: function() {
14
- return from[k];
15
- }
16
- });
17
- }
18
- });
19
- return from;
20
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./compiled"), exports);
7
+ _export_star._(require("./cli"), exports);
8
+ _export_star._(require("./import"), exports);