@modern-js/utils 2.19.1 → 2.20.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.20.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 3c4e0a5: chore(utils): move generateMetaTags method to builder-shared
8
+
9
+ chore(utils): 移动 generateMetaTags 方法到 builder-shared
10
+
11
+ - 6b9d90a: chore: remove @babel/runtime. add @swc/helper and enable `externalHelper` config.
12
+ chore: 移除 @babel/runtime 依赖. 增加 @swc/helpers 依赖并且开启 `externalHelpers` 配置
13
+
3
14
  ## 2.19.1
4
15
 
5
16
  ## 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) {
@@ -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);
@@ -13,49 +13,10 @@ _export(exports, {
13
13
  transformNestedRoutes: () => transformNestedRoutes,
14
14
  renderNestedRoute: () => renderNestedRoute
15
15
  });
16
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
16
17
  const _jsxruntime = require("react/jsx-runtime");
17
- const _react = /* @__PURE__ */ _interop_require_wildcard(require("react"));
18
+ const _react = /* @__PURE__ */ _interop_require_wildcard._(require("react"));
18
19
  const _reactrouterdom = require("react-router-dom");
19
- function _getRequireWildcardCache(nodeInterop) {
20
- if (typeof WeakMap !== "function")
21
- return null;
22
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
23
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
24
- return (_getRequireWildcardCache = function(nodeInterop2) {
25
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
26
- })(nodeInterop);
27
- }
28
- function _interop_require_wildcard(obj, nodeInterop) {
29
- if (!nodeInterop && obj && obj.__esModule) {
30
- return obj;
31
- }
32
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
33
- return {
34
- default: obj
35
- };
36
- }
37
- var cache = _getRequireWildcardCache(nodeInterop);
38
- if (cache && cache.has(obj)) {
39
- return cache.get(obj);
40
- }
41
- var newObj = {};
42
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
43
- for (var key in obj) {
44
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
45
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
46
- if (desc && (desc.get || desc.set)) {
47
- Object.defineProperty(newObj, key, desc);
48
- } else {
49
- newObj[key] = obj[key];
50
- }
51
- }
52
- }
53
- newObj.default = obj;
54
- if (cache) {
55
- cache.set(obj, newObj);
56
- }
57
- return newObj;
58
- }
59
20
  const transformNestedRoutes = (routes) => {
60
21
  const routeElements = [];
61
22
  for (const route of routes) {
@@ -2,17 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("@remix-run/router"), exports);
6
- function _export_star(from, to) {
7
- Object.keys(from).forEach(function(k) {
8
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
- Object.defineProperty(to, k, {
10
- enumerable: true,
11
- get: function() {
12
- return from[k];
13
- }
14
- });
15
- }
16
- });
17
- return from;
18
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("@remix-run/router"), exports);
@@ -2,18 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./nestedRoutes"), exports);
6
- _export_star(require("./remixRouter"), exports);
7
- function _export_star(from, to) {
8
- Object.keys(from).forEach(function(k) {
9
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
10
- Object.defineProperty(to, k, {
11
- enumerable: true,
12
- get: function() {
13
- return from[k];
14
- }
15
- });
16
- }
17
- });
18
- return from;
19
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./nestedRoutes"), exports);
7
+ _export_star._(require("./remixRouter"), exports);
@@ -2,17 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./parsed"), exports);
6
- function _export_star(from, to) {
7
- Object.keys(from).forEach(function(k) {
8
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
- Object.defineProperty(to, k, {
10
- enumerable: true,
11
- get: function() {
12
- return from[k];
13
- }
14
- });
15
- }
16
- });
17
- return from;
18
- }
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./parsed"), exports);
@@ -6,12 +6,8 @@ Object.defineProperty(exports, "serializeJson", {
6
6
  enumerable: true,
7
7
  get: () => serializeJson
8
8
  });
9
- const _serializejavascript = /* @__PURE__ */ _interop_require_default(require("serialize-javascript"));
10
- function _interop_require_default(obj) {
11
- return obj && obj.__esModule ? obj : {
12
- default: obj
13
- };
14
- }
9
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
10
+ const _serializejavascript = /* @__PURE__ */ _interop_require_default._(require("serialize-javascript"));
15
11
  const serializeJson = (data) => {
16
12
  return (0, _serializejavascript.default)(data, {
17
13
  isJSON: true
@@ -6,47 +6,8 @@ Object.defineProperty(exports, "createStorage", {
6
6
  enumerable: true,
7
7
  get: () => createStorage
8
8
  });
9
- const _async_hooks = /* @__PURE__ */ _interop_require_wildcard(require("async_hooks"));
10
- function _getRequireWildcardCache(nodeInterop) {
11
- if (typeof WeakMap !== "function")
12
- return null;
13
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
14
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
15
- return (_getRequireWildcardCache = function(nodeInterop2) {
16
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
17
- })(nodeInterop);
18
- }
19
- function _interop_require_wildcard(obj, nodeInterop) {
20
- if (!nodeInterop && obj && obj.__esModule) {
21
- return obj;
22
- }
23
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
24
- return {
25
- default: obj
26
- };
27
- }
28
- var cache = _getRequireWildcardCache(nodeInterop);
29
- if (cache && cache.has(obj)) {
30
- return cache.get(obj);
31
- }
32
- var newObj = {};
33
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
34
- for (var key in obj) {
35
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
36
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
37
- if (desc && (desc.get || desc.set)) {
38
- Object.defineProperty(newObj, key, desc);
39
- } else {
40
- newObj[key] = obj[key];
41
- }
42
- }
43
- }
44
- newObj.default = obj;
45
- if (cache) {
46
- cache.set(obj, newObj);
47
- }
48
- return newObj;
49
- }
9
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
10
+ const _async_hooks = /* @__PURE__ */ _interop_require_wildcard._(require("async_hooks"));
50
11
  const createStorage = () => {
51
12
  let storage;
52
13
  if (typeof _async_hooks.AsyncLocalStorage !== "undefined") {
@@ -8,7 +8,6 @@ export * from "./commands";
8
8
  export * from "./common";
9
9
  export * from "./ensure";
10
10
  export * from "./fs";
11
- export * from "./generateMetaTags";
12
11
  export * from "./logger";
13
12
  export * from "./monorepo";
14
13
  export * from "./package";
@@ -1,16 +1,4 @@
1
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
13
- }
1
+ import { _ as _define_property } from "@swc/helpers/_/_define_property";
14
2
  import chalk from "../../compiled/chalk";
15
3
  const LOG_LEVEL = {
16
4
  error: 0,
@@ -8,7 +8,6 @@ export * from './commands';
8
8
  export * from './common';
9
9
  export * from './ensure';
10
10
  export * from './fs';
11
- export * from './generateMetaTags';
12
11
  export * from './logger';
13
12
  export * from './monorepo';
14
13
  export * from './package';
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.19.1",
18
+ "version": "2.20.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -62,6 +62,8 @@
62
62
  "default": "./dist/cjs/universal/pluginDagSort.js"
63
63
  },
64
64
  "./ajv": "./dist/compiled/ajv/index.js",
65
+ "./commander": "./compiled/commander/index.js",
66
+ "./ora": "./compiled/ora/index.js",
65
67
  "./glob": "./dist/compiled/glob/index.js",
66
68
  "./chalk": "./dist/compiled/chalk/index.js",
67
69
  "./execa": "./dist/compiled/execa/index.js",
@@ -170,6 +172,12 @@
170
172
  ],
171
173
  "webpack-dev-middleware": [
172
174
  "./dist/compiled/webpack-dev-middleware/types/index.d.ts"
175
+ ],
176
+ "commander": [
177
+ "./dist/compiled/commander/typings/index.d.ts"
178
+ ],
179
+ "ora": [
180
+ "./dist/compiled/ora/index.d.ts"
173
181
  ]
174
182
  }
175
183
  },
@@ -177,7 +185,8 @@
177
185
  "caniuse-lite": "^1.0.30001451",
178
186
  "lodash": "^4.17.21",
179
187
  "serialize-javascript": "^6.0.0",
180
- "@remix-run/router": "^1.3.2"
188
+ "@remix-run/router": "^1.3.2",
189
+ "@swc/helpers": "0.5.1"
181
190
  },
182
191
  "peerDependencies": {
183
192
  "react": ">=17.0.0",
@@ -205,9 +214,9 @@
205
214
  "typescript": "^4",
206
215
  "webpack": "^5.82.1",
207
216
  "@types/serialize-javascript": "^5.0.1",
208
- "@modern-js/types": "2.19.1",
209
- "@scripts/build": "2.19.1",
210
- "@scripts/jest-config": "2.19.1"
217
+ "@modern-js/types": "2.20.0",
218
+ "@scripts/build": "2.20.0",
219
+ "@scripts/jest-config": "2.20.0"
211
220
  },
212
221
  "sideEffects": false,
213
222
  "scripts": {
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "generateMetaTags", {
6
- enumerable: true,
7
- get: () => generateMetaTags
8
- });
9
- const tagObjectToString = (tagDefinition) => {
10
- const attributes = Object.keys(tagDefinition.attributes || {}).filter((attributeName) => tagDefinition.attributes[attributeName] !== false).map((attributeName) => {
11
- if (tagDefinition.attributes[attributeName] === true) {
12
- return attributeName;
13
- }
14
- return `${attributeName}="${tagDefinition.attributes[attributeName]}"`;
15
- });
16
- return `<${[
17
- tagDefinition.tagName
18
- ].concat(attributes).join(" ")}>${tagDefinition.innerHTML || ""}${tagDefinition.voidTag ? "" : `</${tagDefinition.tagName}>`}`;
19
- };
20
- const generateMetaTags = (metaOptions) => {
21
- if (!metaOptions) {
22
- return "";
23
- }
24
- const metaTagAttributeObjects = Object.keys(metaOptions).map((metaName) => {
25
- const metaTagContent = metaOptions[metaName];
26
- return typeof metaTagContent === "string" ? {
27
- name: metaName,
28
- content: metaTagContent
29
- } : metaTagContent;
30
- }).filter((attribute) => attribute !== false);
31
- return metaTagAttributeObjects.map((metaTagAttributes) => {
32
- if (metaTagAttributes === false) {
33
- throw new Error("Invalid meta tag");
34
- }
35
- return {
36
- tagName: "meta",
37
- voidTag: true,
38
- attributes: metaTagAttributes
39
- };
40
- }).reduce((memo, tagObject) => `${memo}
41
- ${tagObjectToString(tagObject)}`, "");
42
- };
@@ -1,34 +0,0 @@
1
- const tagObjectToString = (tagDefinition) => {
2
- const attributes = Object.keys(tagDefinition.attributes || {}).filter((attributeName) => tagDefinition.attributes[attributeName] !== false).map((attributeName) => {
3
- if (tagDefinition.attributes[attributeName] === true) {
4
- return attributeName;
5
- }
6
- return `${attributeName}="${tagDefinition.attributes[attributeName]}"`;
7
- });
8
- return `<${[
9
- tagDefinition.tagName
10
- ].concat(attributes).join(" ")}>${tagDefinition.innerHTML || ""}${tagDefinition.voidTag ? "" : `</${tagDefinition.tagName}>`}`;
11
- };
12
- export const generateMetaTags = (metaOptions) => {
13
- if (!metaOptions) {
14
- return "";
15
- }
16
- const metaTagAttributeObjects = Object.keys(metaOptions).map((metaName) => {
17
- const metaTagContent = metaOptions[metaName];
18
- return typeof metaTagContent === "string" ? {
19
- name: metaName,
20
- content: metaTagContent
21
- } : metaTagContent;
22
- }).filter((attribute) => attribute !== false);
23
- return metaTagAttributeObjects.map((metaTagAttributes) => {
24
- if (metaTagAttributes === false) {
25
- throw new Error("Invalid meta tag");
26
- }
27
- return {
28
- tagName: "meta",
29
- voidTag: true,
30
- attributes: metaTagAttributes
31
- };
32
- }).reduce((memo, tagObject) => `${memo}
33
- ${tagObjectToString(tagObject)}`, "");
34
- };
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright JS Foundation and other contributors.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file at
6
- * https://github.com/jantimon/html-webpack-plugin/blob/main/LICENSE
7
- *
8
- * Modified from https://github.com/jantimon/html-webpack-plugin/blob/2f5de7ab9e8bca60e9e200f2e4b4cfab90db28d4/index.js#L800
9
- */
10
- export type MetaAttributes = {
11
- [attributeName: string]: string | boolean;
12
- };
13
- export interface MetaOptions {
14
- [name: string]: string | false | MetaAttributes;
15
- }
16
- export declare const generateMetaTags: (metaOptions?: MetaOptions) => string;