@modern-js/utils 2.22.1-alpha.2 → 2.22.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/cli/constants/index.js +0 -4
- package/dist/cjs/cli/prettyInstructions.js +3 -2
- package/dist/cjs/runtime/nestedRoutes.js +3 -1
- package/dist/cjs/runtime-node/index.js +0 -2
- package/dist/cjs/universal/constants.js +0 -4
- package/dist/esm/cli/constants/index.js +0 -1
- package/dist/esm/cli/prettyInstructions.js +3 -2
- package/dist/esm/runtime/nestedRoutes.js +3 -1
- package/dist/esm/runtime-node/index.js +0 -1
- package/dist/esm/universal/constants.js +0 -1
- package/dist/types/cli/constants/index.d.ts +0 -4
- package/dist/types/runtime/nestedRoutes.d.ts +6 -2
- package/dist/types/runtime-node/index.d.ts +1 -2
- package/dist/types/universal/constants.d.ts +1 -5
- package/package.json +4 -13
- package/dist/FileSizeReporter.d.ts +0 -16
- package/dist/FileSizeReporter.js +0 -162
- package/dist/alias.d.ts +0 -25
- package/dist/alias.js +0 -108
- package/dist/analyzeProject.d.ts +0 -2
- package/dist/analyzeProject.js +0 -71
- package/dist/applyOptionsChain.d.ts +0 -3
- package/dist/applyOptionsChain.js +0 -58
- package/dist/babel.d.ts +0 -3
- package/dist/babel.js +0 -136
- package/dist/chainId.d.ts +0 -244
- package/dist/chainId.js +0 -196
- package/dist/cjs/runtime-node/nestedRoutes.js +0 -28
- package/dist/clearConsole.d.ts +0 -1
- package/dist/clearConsole.js +0 -31
- package/dist/commands.d.ts +0 -4
- package/dist/commands.js +0 -48
- package/dist/compatRequire.d.ts +0 -13
- package/dist/compatRequire.js +0 -82
- package/dist/compiled.d.ts +0 -43
- package/dist/compiled.js +0 -142
- package/dist/constants.d.ts +0 -244
- package/dist/constants.js +0 -320
- package/dist/debug.d.ts +0 -6
- package/dist/debug.js +0 -28
- package/dist/emptyDir.d.ts +0 -1
- package/dist/emptyDir.js +0 -52
- package/dist/ensureAbsolutePath.d.ts +0 -7
- package/dist/ensureAbsolutePath.js +0 -38
- package/dist/ensureArray.d.ts +0 -1
- package/dist/ensureArray.js +0 -32
- package/dist/esm/runtime-node/nestedRoutes.js +0 -18
- package/dist/findExists.d.ts +0 -6
- package/dist/findExists.js +0 -45
- package/dist/generateMetaTags.d.ts +0 -16
- package/dist/generateMetaTags.js +0 -61
- package/dist/getBrowserslist.d.ts +0 -2
- package/dist/getBrowserslist.js +0 -31
- package/dist/getCoreJsVersion.d.ts +0 -1
- package/dist/getCoreJsVersion.js +0 -46
- package/dist/getEntryOptions.d.ts +0 -1
- package/dist/getEntryOptions.js +0 -54
- package/dist/getPackageManager.d.ts +0 -1
- package/dist/getPackageManager.js +0 -87
- package/dist/getPort.d.ts +0 -14
- package/dist/getPort.js +0 -112
- package/dist/getServerConfig.d.ts +0 -1
- package/dist/getServerConfig.js +0 -67
- package/dist/getTargetDir.d.ts +0 -1
- package/dist/getTargetDir.js +0 -41
- package/dist/import.d.ts +0 -5
- package/dist/import.js +0 -33
- package/dist/index.d.ts +0 -44
- package/dist/index.js +0 -60
- package/dist/is/index.d.ts +0 -58
- package/dist/is/index.js +0 -114
- package/dist/is/nodeEnv.d.ts +0 -8
- package/dist/is/nodeEnv.js +0 -39
- package/dist/is/platform.d.ts +0 -2
- package/dist/is/platform.js +0 -30
- package/dist/is/type.d.ts +0 -8
- package/dist/is/type.js +0 -64
- package/dist/logger.d.ts +0 -65
- package/dist/logger.js +0 -145
- package/dist/monorepo.d.ts +0 -11
- package/dist/monorepo.js +0 -137
- package/dist/nodeEnv.d.ts +0 -3
- package/dist/nodeEnv.js +0 -81
- package/dist/path.d.ts +0 -18
- package/dist/path.js +0 -92
- package/dist/pathSerializer.d.ts +0 -16
- package/dist/pathSerializer.js +0 -76
- package/dist/plugin.d.ts +0 -2
- package/dist/plugin.js +0 -46
- package/dist/prettyInstructions.d.ts +0 -9
- package/dist/prettyInstructions.js +0 -112
- package/dist/printBuildError.d.ts +0 -8
- package/dist/printBuildError.js +0 -57
- package/dist/react.d.ts +0 -1
- package/dist/react.js +0 -64
- package/dist/readTsConfig.d.ts +0 -2
- package/dist/readTsConfig.js +0 -47
- package/dist/removeSlash.d.ts +0 -3
- package/dist/removeSlash.js +0 -33
- package/dist/resolve.d.ts +0 -13
- package/dist/resolve.js +0 -63
- package/dist/routes.d.ts +0 -2
- package/dist/routes.js +0 -58
- package/dist/runtimeExports.d.ts +0 -4
- package/dist/runtimeExports.js +0 -73
- package/dist/ssr.d.ts +0 -8
- package/dist/ssr.js +0 -30
- package/dist/storage.d.ts +0 -5
- package/dist/storage.js +0 -75
- package/dist/testUtils.d.ts +0 -5
- package/dist/testUtils.js +0 -38
- package/dist/types/runtime-node/nestedRoutes.d.ts +0 -3
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -15
- package/dist/universal/constants.d.ts +0 -9
- package/dist/universal/constants.js +0 -30
- package/dist/universal/formatWebpack.d.ts +0 -13
- package/dist/universal/formatWebpack.js +0 -100
- package/dist/universal/nestedRoutes.d.ts +0 -8
- package/dist/universal/nestedRoutes.js +0 -131
- package/dist/universal/remixRouter.d.ts +0 -1
- package/dist/universal/remixRouter.js +0 -17
- package/dist/universal/serialize.d.ts +0 -1
- package/dist/universal/serialize.js +0 -40
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -92
- package/dist/wait.d.ts +0 -2
- package/dist/wait.js +0 -29
- package/dist/watch.d.ts +0 -8
- package/dist/watch.js +0 -90
package/dist/getBrowserslist.js
DELETED
@@ -1,31 +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 getBrowserslist_exports = {};
|
19
|
-
__export(getBrowserslist_exports, {
|
20
|
-
defaults: () => defaults,
|
21
|
-
getBrowserslist: () => getBrowserslist
|
22
|
-
});
|
23
|
-
module.exports = __toCommonJS(getBrowserslist_exports);
|
24
|
-
var import_compiled = require("./compiled");
|
25
|
-
const defaults = ["> 0.01%", "not dead", "not op_mini all"];
|
26
|
-
const getBrowserslist = (appDirectory) => import_compiled.browserslist.loadConfig({ path: appDirectory }) || defaults;
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
28
|
-
0 && (module.exports = {
|
29
|
-
defaults,
|
30
|
-
getBrowserslist
|
31
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const getCoreJsVersion: (corejsPkgPath: string) => string;
|
package/dist/getCoreJsVersion.js
DELETED
@@ -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;
|
package/dist/getEntryOptions.js
DELETED
@@ -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>;
|
package/dist/getServerConfig.js
DELETED
@@ -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
|
-
});
|
package/dist/getTargetDir.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const getTargetDir: (from: string, baseDir: string, targetBaseDir: string) => string;
|
package/dist/getTargetDir.js
DELETED
@@ -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
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);
|