@modern-js/utils 2.22.1-alpha.3 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/cli/constants/index.js +0 -215
  3. package/dist/cjs/cli/index.js +0 -1
  4. package/dist/cjs/cli/is/project.js +7 -4
  5. package/dist/cjs/cli/logger.js +0 -5
  6. package/dist/cjs/cli/prettyInstructions.js +3 -2
  7. package/dist/cjs/runtime/nestedRoutes.js +3 -1
  8. package/dist/esm/cli/constants/index.js +0 -212
  9. package/dist/esm/cli/index.js +0 -1
  10. package/dist/esm/cli/is/project.js +7 -4
  11. package/dist/esm/cli/logger.js +0 -5
  12. package/dist/esm/cli/prettyInstructions.js +3 -2
  13. package/dist/esm/runtime/nestedRoutes.js +3 -1
  14. package/dist/types/cli/constants/index.d.ts +0 -121
  15. package/dist/types/cli/index.d.ts +0 -1
  16. package/dist/types/cli/is/project.d.ts +11 -1
  17. package/dist/types/runtime/nestedRoutes.d.ts +6 -2
  18. package/package.json +6 -11
  19. package/dist/FileSizeReporter.d.ts +0 -16
  20. package/dist/FileSizeReporter.js +0 -162
  21. package/dist/alias.d.ts +0 -25
  22. package/dist/alias.js +0 -108
  23. package/dist/analyzeProject.d.ts +0 -2
  24. package/dist/analyzeProject.js +0 -71
  25. package/dist/applyOptionsChain.d.ts +0 -3
  26. package/dist/applyOptionsChain.js +0 -58
  27. package/dist/babel.d.ts +0 -3
  28. package/dist/babel.js +0 -136
  29. package/dist/chainId.d.ts +0 -244
  30. package/dist/chainId.js +0 -196
  31. package/dist/cjs/cli/test.js +0 -19
  32. package/dist/clearConsole.d.ts +0 -1
  33. package/dist/clearConsole.js +0 -31
  34. package/dist/commands.d.ts +0 -4
  35. package/dist/commands.js +0 -48
  36. package/dist/compatRequire.d.ts +0 -13
  37. package/dist/compatRequire.js +0 -82
  38. package/dist/compiled.d.ts +0 -43
  39. package/dist/compiled.js +0 -142
  40. package/dist/constants.d.ts +0 -244
  41. package/dist/constants.js +0 -320
  42. package/dist/debug.d.ts +0 -6
  43. package/dist/debug.js +0 -28
  44. package/dist/emptyDir.d.ts +0 -1
  45. package/dist/emptyDir.js +0 -52
  46. package/dist/ensureAbsolutePath.d.ts +0 -7
  47. package/dist/ensureAbsolutePath.js +0 -38
  48. package/dist/ensureArray.d.ts +0 -1
  49. package/dist/ensureArray.js +0 -32
  50. package/dist/esm/cli/test.js +0 -9
  51. package/dist/findExists.d.ts +0 -6
  52. package/dist/findExists.js +0 -45
  53. package/dist/generateMetaTags.d.ts +0 -16
  54. package/dist/generateMetaTags.js +0 -61
  55. package/dist/getBrowserslist.d.ts +0 -2
  56. package/dist/getBrowserslist.js +0 -31
  57. package/dist/getCoreJsVersion.d.ts +0 -1
  58. package/dist/getCoreJsVersion.js +0 -46
  59. package/dist/getEntryOptions.d.ts +0 -1
  60. package/dist/getEntryOptions.js +0 -54
  61. package/dist/getPackageManager.d.ts +0 -1
  62. package/dist/getPackageManager.js +0 -87
  63. package/dist/getPort.d.ts +0 -14
  64. package/dist/getPort.js +0 -112
  65. package/dist/getServerConfig.d.ts +0 -1
  66. package/dist/getServerConfig.js +0 -67
  67. package/dist/getTargetDir.d.ts +0 -1
  68. package/dist/getTargetDir.js +0 -41
  69. package/dist/import.d.ts +0 -5
  70. package/dist/import.js +0 -33
  71. package/dist/index.d.ts +0 -44
  72. package/dist/index.js +0 -60
  73. package/dist/is/index.d.ts +0 -58
  74. package/dist/is/index.js +0 -114
  75. package/dist/is/nodeEnv.d.ts +0 -8
  76. package/dist/is/nodeEnv.js +0 -39
  77. package/dist/is/platform.d.ts +0 -2
  78. package/dist/is/platform.js +0 -30
  79. package/dist/is/type.d.ts +0 -8
  80. package/dist/is/type.js +0 -64
  81. package/dist/logger.d.ts +0 -65
  82. package/dist/logger.js +0 -145
  83. package/dist/monorepo.d.ts +0 -11
  84. package/dist/monorepo.js +0 -137
  85. package/dist/nodeEnv.d.ts +0 -3
  86. package/dist/nodeEnv.js +0 -81
  87. package/dist/path.d.ts +0 -18
  88. package/dist/path.js +0 -92
  89. package/dist/pathSerializer.d.ts +0 -16
  90. package/dist/pathSerializer.js +0 -76
  91. package/dist/plugin.d.ts +0 -2
  92. package/dist/plugin.js +0 -46
  93. package/dist/prettyInstructions.d.ts +0 -9
  94. package/dist/prettyInstructions.js +0 -112
  95. package/dist/printBuildError.d.ts +0 -8
  96. package/dist/printBuildError.js +0 -57
  97. package/dist/react.d.ts +0 -1
  98. package/dist/react.js +0 -64
  99. package/dist/readTsConfig.d.ts +0 -2
  100. package/dist/readTsConfig.js +0 -47
  101. package/dist/removeSlash.d.ts +0 -3
  102. package/dist/removeSlash.js +0 -33
  103. package/dist/resolve.d.ts +0 -13
  104. package/dist/resolve.js +0 -63
  105. package/dist/routes.d.ts +0 -2
  106. package/dist/routes.js +0 -58
  107. package/dist/runtimeExports.d.ts +0 -4
  108. package/dist/runtimeExports.js +0 -73
  109. package/dist/ssr.d.ts +0 -8
  110. package/dist/ssr.js +0 -30
  111. package/dist/storage.d.ts +0 -5
  112. package/dist/storage.js +0 -75
  113. package/dist/testUtils.d.ts +0 -5
  114. package/dist/testUtils.js +0 -38
  115. package/dist/types/cli/test.d.ts +0 -5
  116. package/dist/types.d.ts +0 -1
  117. package/dist/types.js +0 -15
  118. package/dist/universal/constants.d.ts +0 -9
  119. package/dist/universal/constants.js +0 -30
  120. package/dist/universal/formatWebpack.d.ts +0 -13
  121. package/dist/universal/formatWebpack.js +0 -100
  122. package/dist/universal/nestedRoutes.d.ts +0 -8
  123. package/dist/universal/nestedRoutes.js +0 -131
  124. package/dist/universal/remixRouter.d.ts +0 -1
  125. package/dist/universal/remixRouter.js +0 -17
  126. package/dist/universal/serialize.d.ts +0 -1
  127. package/dist/universal/serialize.js +0 -40
  128. package/dist/version.d.ts +0 -2
  129. package/dist/version.js +0 -92
  130. package/dist/wait.d.ts +0 -2
  131. package/dist/wait.js +0 -29
  132. package/dist/watch.d.ts +0 -8
  133. package/dist/watch.js +0 -90
@@ -1 +0,0 @@
1
- export declare const getCoreJsVersion: (corejsPkgPath: string) => string;
@@ -1,46 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var getCoreJsVersion_exports = {};
29
- __export(getCoreJsVersion_exports, {
30
- getCoreJsVersion: () => getCoreJsVersion
31
- });
32
- module.exports = __toCommonJS(getCoreJsVersion_exports);
33
- var fs = __toESM(require("../compiled/fs-extra"));
34
- const getCoreJsVersion = (corejsPkgPath) => {
35
- try {
36
- const { version } = fs.readJSONSync(corejsPkgPath);
37
- const [major, minor] = version.split(".");
38
- return `${major}.${minor}`;
39
- } catch (err) {
40
- return "3";
41
- }
42
- };
43
- // Annotate the CommonJS export names for ESM import in node:
44
- 0 && (module.exports = {
45
- getCoreJsVersion
46
- });
@@ -1 +0,0 @@
1
- export declare const getEntryOptions: <T>(name: string, baseOptions?: T | undefined, optionsByEntries?: Record<string, T> | undefined, packageName?: string) => T | undefined;
@@ -1,54 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __export = (target, all) => {
20
- for (var name in all)
21
- __defProp(target, name, { get: all[name], enumerable: true });
22
- };
23
- var __copyProps = (to, from, except, desc) => {
24
- if (from && typeof from === "object" || typeof from === "function") {
25
- for (let key of __getOwnPropNames(from))
26
- if (!__hasOwnProp.call(to, key) && key !== except)
27
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
- }
29
- return to;
30
- };
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
- var getEntryOptions_exports = {};
33
- __export(getEntryOptions_exports, {
34
- getEntryOptions: () => getEntryOptions
35
- });
36
- module.exports = __toCommonJS(getEntryOptions_exports);
37
- var import_is = require("./is");
38
- var import_constants = require("./constants");
39
- const getEntryOptions = (name, baseOptions, optionsByEntries, packageName) => {
40
- if (optionsByEntries) {
41
- let optionsByEntry = getOptionsByEntryName(name, optionsByEntries);
42
- if (optionsByEntry === void 0 && name === import_constants.MAIN_ENTRY_NAME && packageName) {
43
- optionsByEntry = getOptionsByEntryName(packageName, optionsByEntries);
44
- }
45
- return optionsByEntry !== void 0 ? (0, import_is.isPlainObject)(optionsByEntry) && (0, import_is.isPlainObject)(baseOptions) ? __spreadValues(__spreadValues({}, baseOptions), optionsByEntry) : optionsByEntry : baseOptions;
46
- } else {
47
- return baseOptions;
48
- }
49
- };
50
- const getOptionsByEntryName = (name, optionsByEntries) => optionsByEntries.hasOwnProperty(name) ? optionsByEntries[name] : void 0;
51
- // Annotate the CommonJS export names for ESM import in node:
52
- 0 && (module.exports = {
53
- getEntryOptions
54
- });
@@ -1 +0,0 @@
1
- export declare function getPackageManager(cwd?: string): Promise<"npm" | "yarn" | "pnpm">;
@@ -1,87 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
- var getPackageManager_exports = {};
49
- __export(getPackageManager_exports, {
50
- getPackageManager: () => getPackageManager
51
- });
52
- module.exports = __toCommonJS(getPackageManager_exports);
53
- var import_os = __toESM(require("os"));
54
- var import_path = __toESM(require("path"));
55
- var import_compiled = require("./compiled");
56
- var import_nodeEnv = require("./nodeEnv");
57
- const MAX_TIMES = 5;
58
- function getPackageManager() {
59
- return __async(this, arguments, function* (cwd = process.cwd()) {
60
- let appDirectory = cwd;
61
- let times = 0;
62
- while (import_os.default.homedir() !== appDirectory && times < MAX_TIMES) {
63
- times++;
64
- if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "pnpm-lock.yaml"))) {
65
- return "pnpm";
66
- }
67
- if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "yarn.lock"))) {
68
- return "yarn";
69
- }
70
- if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "package-lock.json"))) {
71
- return "npm";
72
- }
73
- appDirectory = import_path.default.join(appDirectory, "..");
74
- }
75
- if (yield (0, import_nodeEnv.canUsePnpm)()) {
76
- return "pnpm";
77
- }
78
- if (yield (0, import_nodeEnv.canUseYarn)()) {
79
- return "yarn";
80
- }
81
- return "npm";
82
- });
83
- }
84
- // Annotate the CommonJS export names for ESM import in node:
85
- 0 && (module.exports = {
86
- getPackageManager
87
- });
package/dist/getPort.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * Get available free port.
3
- * @param port - Current port want to use.
4
- * @param tryLimits - Maximum number of retries.
5
- * @param strictPort - Whether to throw an error when the port is occupied.
6
- * @returns Available port number.
7
- */
8
- export declare const getPort: (port: string | number, {
9
- tryLimits,
10
- strictPort
11
- }?: {
12
- tryLimits?: number | undefined;
13
- strictPort?: boolean | undefined;
14
- }) => Promise<number>;
package/dist/getPort.js DELETED
@@ -1,112 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
- var getPort_exports = {};
49
- __export(getPort_exports, {
50
- getPort: () => getPort
51
- });
52
- module.exports = __toCommonJS(getPort_exports);
53
- var import_net = __toESM(require("net"));
54
- var import_compiled = require("./compiled");
55
- var import_logger = require("./logger");
56
- const getPort = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (port, {
57
- tryLimits = 20,
58
- strictPort = false
59
- } = {}) {
60
- if (typeof port === "string") {
61
- port = parseInt(port, 10);
62
- }
63
- if (strictPort) {
64
- tryLimits = 1;
65
- }
66
- const original = port;
67
- let found = false;
68
- let attempts = 0;
69
- while (!found && attempts <= tryLimits) {
70
- try {
71
- yield new Promise((resolve, reject) => {
72
- const server = import_net.default.createServer();
73
- server.unref();
74
- server.on("error", reject);
75
- server.listen(
76
- {
77
- port,
78
- host: "0.0.0.0"
79
- },
80
- () => {
81
- found = true;
82
- server.close(resolve);
83
- }
84
- );
85
- });
86
- } catch (e) {
87
- if (e.code !== "EADDRINUSE") {
88
- throw e;
89
- }
90
- port++;
91
- attempts++;
92
- }
93
- }
94
- if (port !== original) {
95
- if (strictPort) {
96
- throw new Error(
97
- `Port "${original}" is occupied, please choose another one.`
98
- );
99
- } else {
100
- import_logger.logger.info(
101
- `Something is already running on port ${original}. ${import_compiled.chalk.yellow(
102
- `Use port ${port} instead.`
103
- )}`
104
- );
105
- }
106
- }
107
- return port;
108
- });
109
- // Annotate the CommonJS export names for ESM import in node:
110
- 0 && (module.exports = {
111
- getPort
112
- });
@@ -1 +0,0 @@
1
- export declare const getServerConfig: (appDirectory: string, configFile: string) => Promise<string | false>;
@@ -1,67 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
- var getServerConfig_exports = {};
49
- __export(getServerConfig_exports, {
50
- getServerConfig: () => getServerConfig
51
- });
52
- module.exports = __toCommonJS(getServerConfig_exports);
53
- var path = __toESM(require("path"));
54
- var import_constants = require("./constants");
55
- var import_findExists = require("./findExists");
56
- const getServerConfig = (appDirectory, configFile) => __async(void 0, null, function* () {
57
- const configFilePath = (0, import_findExists.findExists)(
58
- import_constants.CONFIG_FILE_EXTENSIONS.map(
59
- (extension) => path.resolve(appDirectory, `${configFile}${extension}`)
60
- )
61
- );
62
- return configFilePath;
63
- });
64
- // Annotate the CommonJS export names for ESM import in node:
65
- 0 && (module.exports = {
66
- getServerConfig
67
- });
@@ -1 +0,0 @@
1
- export declare const getTargetDir: (from: string, baseDir: string, targetBaseDir: string) => string;
@@ -1,41 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var getTargetDir_exports = {};
29
- __export(getTargetDir_exports, {
30
- getTargetDir: () => getTargetDir
31
- });
32
- module.exports = __toCommonJS(getTargetDir_exports);
33
- var path = __toESM(require("path"));
34
- const getTargetDir = (from, baseDir, targetBaseDir) => {
35
- const relativePath = path.relative(baseDir, from);
36
- return path.resolve(targetBaseDir, relativePath);
37
- };
38
- // Annotate the CommonJS export names for ESM import in node:
39
- 0 && (module.exports = {
40
- getTargetDir
41
- });
package/dist/import.d.ts DELETED
@@ -1,5 +0,0 @@
1
- declare const lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
2
- export { lazy as lazyImport };
3
- export declare const Import: {
4
- lazy: (moduleName: string, requireFn: (id: string) => unknown) => any;
5
- };
package/dist/import.js DELETED
@@ -1,33 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var import_exports = {};
19
- __export(import_exports, {
20
- Import: () => Import,
21
- lazyImport: () => lazy
22
- });
23
- module.exports = __toCommonJS(import_exports);
24
- const lazy = (moduleName, requireFn) => {
25
- const importLazyLocal = require("../compiled/import-lazy")(requireFn);
26
- return importLazyLocal(moduleName);
27
- };
28
- const Import = { lazy };
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- Import,
32
- lazyImport
33
- });
package/dist/index.d.ts DELETED
@@ -1,44 +0,0 @@
1
- export * from './compiled';
2
- export * from './commands';
3
- export * from './FileSizeReporter';
4
- export * from './printBuildError';
5
- export * from './debug';
6
- export * from './findExists';
7
- export * from './is';
8
- export * from './compatRequire';
9
- export * from './logger';
10
- export * from './constants';
11
- export * from './ensureArray';
12
- export * from './ensureAbsolutePath';
13
- export * from './clearConsole';
14
- export * from './applyOptionsChain';
15
- export * from './getBrowserslist';
16
- export * from './removeSlash';
17
- export * from './getEntryOptions';
18
- export * from './getPort';
19
- export * from './monorepo';
20
- export * from './getPackageManager';
21
- export * from './runtimeExports';
22
- export * from './readTsConfig';
23
- export * from './path';
24
- export * from './pathSerializer';
25
- export * from './generateMetaTags';
26
- export * from './prettyInstructions';
27
- export * from './alias';
28
- export * from './import';
29
- export * from './watch';
30
- export * from './nodeEnv';
31
- export * from './wait';
32
- export * from './emptyDir';
33
- export * from './getServerConfig';
34
- export * from './resolve';
35
- export * from './analyzeProject';
36
- export * from './chainId';
37
- export * from './version';
38
- export * from './plugin';
39
- export * from './routes';
40
- export * from './testUtils';
41
- export * from './getCoreJsVersion';
42
- export * from './react';
43
- export * from './getTargetDir';
44
- export * from './babel';
package/dist/index.js DELETED
@@ -1,60 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var src_exports = {};
16
- module.exports = __toCommonJS(src_exports);
17
- __reExport(src_exports, require("./compiled"), module.exports);
18
- __reExport(src_exports, require("./commands"), module.exports);
19
- __reExport(src_exports, require("./FileSizeReporter"), module.exports);
20
- __reExport(src_exports, require("./printBuildError"), module.exports);
21
- __reExport(src_exports, require("./debug"), module.exports);
22
- __reExport(src_exports, require("./findExists"), module.exports);
23
- __reExport(src_exports, require("./is"), module.exports);
24
- __reExport(src_exports, require("./compatRequire"), module.exports);
25
- __reExport(src_exports, require("./logger"), module.exports);
26
- __reExport(src_exports, require("./constants"), module.exports);
27
- __reExport(src_exports, require("./ensureArray"), module.exports);
28
- __reExport(src_exports, require("./ensureAbsolutePath"), module.exports);
29
- __reExport(src_exports, require("./clearConsole"), module.exports);
30
- __reExport(src_exports, require("./applyOptionsChain"), module.exports);
31
- __reExport(src_exports, require("./getBrowserslist"), module.exports);
32
- __reExport(src_exports, require("./removeSlash"), module.exports);
33
- __reExport(src_exports, require("./getEntryOptions"), module.exports);
34
- __reExport(src_exports, require("./getPort"), module.exports);
35
- __reExport(src_exports, require("./monorepo"), module.exports);
36
- __reExport(src_exports, require("./getPackageManager"), module.exports);
37
- __reExport(src_exports, require("./runtimeExports"), module.exports);
38
- __reExport(src_exports, require("./readTsConfig"), module.exports);
39
- __reExport(src_exports, require("./path"), module.exports);
40
- __reExport(src_exports, require("./pathSerializer"), module.exports);
41
- __reExport(src_exports, require("./generateMetaTags"), module.exports);
42
- __reExport(src_exports, require("./prettyInstructions"), module.exports);
43
- __reExport(src_exports, require("./alias"), module.exports);
44
- __reExport(src_exports, require("./import"), module.exports);
45
- __reExport(src_exports, require("./watch"), module.exports);
46
- __reExport(src_exports, require("./nodeEnv"), module.exports);
47
- __reExport(src_exports, require("./wait"), module.exports);
48
- __reExport(src_exports, require("./emptyDir"), module.exports);
49
- __reExport(src_exports, require("./getServerConfig"), module.exports);
50
- __reExport(src_exports, require("./resolve"), module.exports);
51
- __reExport(src_exports, require("./analyzeProject"), module.exports);
52
- __reExport(src_exports, require("./chainId"), module.exports);
53
- __reExport(src_exports, require("./version"), module.exports);
54
- __reExport(src_exports, require("./plugin"), module.exports);
55
- __reExport(src_exports, require("./routes"), module.exports);
56
- __reExport(src_exports, require("./testUtils"), module.exports);
57
- __reExport(src_exports, require("./getCoreJsVersion"), module.exports);
58
- __reExport(src_exports, require("./react"), module.exports);
59
- __reExport(src_exports, require("./getTargetDir"), module.exports);
60
- __reExport(src_exports, require("./babel"), module.exports);
@@ -1,58 +0,0 @@
1
- interface EntryPoint {
2
- entryName: string;
3
- }
4
- /**
5
- * Check if the package name is in dependencies or devDependencies.
6
- *
7
- * @param appDirectory - Project root directory.
8
- * @param name - Package name.
9
- * @returns True if the name is in dependencies or devDependencies, false otherwise.
10
- */
11
-
12
- export declare const isDepExists: (appDirectory: string, name: string) => boolean;
13
- /**
14
- * Is typescript project.
15
- *
16
- * @param root - App directory.
17
- * @returns Whether to use typescript.
18
- */
19
-
20
- export declare const isTypescript: (root: string) => boolean;
21
- /**
22
- * Is Empty object
23
- *
24
- * @param o - Any object.
25
- * @returns Whether it is empty object.
26
- */
27
-
28
- export declare const isEmpty: (o: Record<string, unknown>) => boolean;
29
- /**
30
- * Is SSR project
31
- *
32
- * @param config - User config.
33
- * @returns Whether to use server side render.
34
- */
35
-
36
- export declare const isSSR: (config: any) => boolean;
37
- export declare const isUseSSRBundle: (config: any) => boolean;
38
- /**
39
- * Is Worker project
40
- *
41
- * @param config - User config.
42
- * @returns Whether to use worker deploy.
43
- */
44
-
45
- export declare const isServiceWorker: (config: any) => boolean;
46
- export declare const isFastRefresh: () => boolean;
47
- export declare const isRouterV5: (config: {
48
- runtime?: {
49
- router?: {
50
- mode?: string;
51
- } | boolean;
52
- };
53
- }) => boolean;
54
- export declare const isSSGEntry: (config: any, entryName: string, entrypoints: EntryPoint[]) => boolean;
55
- export declare const isSingleEntry: (entrypoints: EntryPoint[]) => boolean;
56
- export * from './nodeEnv';
57
- export * from './platform';
58
- export * from './type';