@modern-js/utils 2.11.0 → 2.12.1-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +12 -0
- package/dist/{alias.js → cjs/alias.js} +4 -15
- package/dist/{analyzeProject.js → cjs/analyzeProject.js} +5 -25
- package/dist/{babel.js → cjs/babel.js} +9 -16
- package/dist/{commands.js → cjs/commands.js} +7 -2
- package/dist/{compatRequire.js → cjs/compatRequire.js} +4 -17
- package/dist/cjs/emptyDir.js +32 -0
- package/dist/{getEntryOptions.js → cjs/getEntryOptions.js} +1 -15
- package/dist/{getPackageManager.js → cjs/getPackageManager.js} +19 -41
- package/dist/{getPort.js → cjs/getPort.js} +4 -24
- package/dist/{getServerConfig.js → cjs/getServerConfig.js} +2 -22
- package/dist/{logger.js → cjs/logger.js} +5 -16
- package/dist/{monorepo.js → cjs/monorepo.js} +4 -15
- package/dist/cjs/nodeEnv.js +55 -0
- package/dist/{path.js → cjs/path.js} +1 -1
- package/dist/{pathSerializer.js → cjs/pathSerializer.js} +1 -1
- package/dist/{prettyInstructions.js → cjs/prettyInstructions.js} +13 -16
- package/dist/{react.js → cjs/react.js} +4 -15
- package/dist/{runtimeExports.js → cjs/runtimeExports.js} +1 -1
- package/dist/{universal → cjs/universal}/nestedRoutes.js +2 -19
- package/dist/cjs/version.js +59 -0
- package/dist/{watch.js → cjs/watch.js} +9 -29
- package/dist/esm/FileSizeReporter.js +180 -0
- package/dist/esm/alias.js +83 -0
- package/dist/esm/analyzeProject.js +168 -0
- package/dist/esm/applyOptionsChain.js +26 -0
- package/dist/esm/babel.js +169 -0
- package/dist/esm/chainId.js +92 -0
- package/dist/esm/clearConsole.js +6 -0
- package/dist/esm/commands.js +17 -0
- package/dist/esm/compatRequire.js +68 -0
- package/dist/esm/compiled.js +34 -0
- package/dist/esm/constants.js +317 -0
- package/dist/esm/debug.js +5 -0
- package/dist/esm/emptyDir.js +158 -0
- package/dist/esm/ensureAbsolutePath.js +5 -0
- package/dist/esm/ensureArray.js +9 -0
- package/dist/esm/findExists.js +27 -0
- package/dist/esm/generateMetaTags.js +40 -0
- package/dist/esm/getBrowserslist.js +12 -0
- package/dist/esm/getCoreJsVersion.js +57 -0
- package/dist/esm/getEntryOptions.js +45 -0
- package/dist/esm/getPackageManager.js +187 -0
- package/dist/esm/getPort.js +215 -0
- package/dist/esm/getServerConfig.js +145 -0
- package/dist/esm/getTargetDir.js +6 -0
- package/dist/esm/import.js +8 -0
- package/dist/esm/index.js +44 -0
- package/dist/esm/is/index.js +85 -0
- package/dist/esm/is/nodeEnv.js +16 -0
- package/dist/esm/is/platform.js +7 -0
- package/dist/esm/is/type.js +25 -0
- package/dist/esm/logger.js +207 -0
- package/dist/esm/monorepo.js +109 -0
- package/dist/esm/nodeEnv.js +258 -0
- package/dist/esm/path.js +85 -0
- package/dist/esm/pathSerializer.js +85 -0
- package/dist/esm/plugin.js +45 -0
- package/dist/esm/prettyInstructions.js +96 -0
- package/dist/esm/printBuildError.js +24 -0
- package/dist/esm/react.js +43 -0
- package/dist/esm/readTsConfig.js +10 -0
- package/dist/esm/removeSlash.js +10 -0
- package/dist/esm/resolve.js +42 -0
- package/dist/esm/routes.js +19 -0
- package/dist/esm/runtimeExports.js +65 -0
- package/dist/esm/ssr.js +3 -0
- package/dist/esm/storage.js +36 -0
- package/dist/esm/testUtils.js +13 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/universal/constants.js +3 -0
- package/dist/esm/universal/formatWebpack.js +108 -0
- package/dist/esm/universal/nestedRoutes.js +174 -0
- package/dist/esm/universal/remixRouter.js +1 -0
- package/dist/esm/universal/serialize.js +7 -0
- package/dist/esm/version.js +193 -0
- package/dist/esm/wait.js +7 -0
- package/dist/esm/watch.js +230 -0
- package/dist/esm-node/FileSizeReporter.js +133 -0
- package/dist/esm-node/alias.js +61 -0
- package/dist/esm-node/analyzeProject.js +17 -0
- package/dist/esm-node/applyOptionsChain.js +35 -0
- package/dist/esm-node/babel.js +105 -0
- package/dist/esm-node/chainId.js +173 -0
- package/dist/esm-node/clearConsole.js +8 -0
- package/dist/esm-node/commands.js +22 -0
- package/dist/esm-node/compatRequire.js +42 -0
- package/dist/esm-node/compiled.js +77 -0
- package/dist/esm-node/constants.js +264 -0
- package/dist/esm-node/debug.js +5 -0
- package/dist/esm-node/emptyDir.js +9 -0
- package/dist/esm-node/ensureAbsolutePath.js +5 -0
- package/dist/esm-node/ensureArray.js +9 -0
- package/dist/esm-node/findExists.js +12 -0
- package/dist/esm-node/generateMetaTags.js +38 -0
- package/dist/esm-node/getBrowserslist.js +7 -0
- package/dist/esm-node/getCoreJsVersion.js +13 -0
- package/dist/esm-node/getEntryOptions.js +17 -0
- package/dist/esm-node/getPackageManager.js +32 -0
- package/dist/esm-node/getPort.js +59 -0
- package/dist/esm-node/getServerConfig.js +14 -0
- package/dist/esm-node/getTargetDir.js +8 -0
- package/dist/esm-node/import.js +9 -0
- package/dist/esm-node/index.js +44 -0
- package/dist/esm-node/is/index.js +71 -0
- package/dist/esm-node/is/nodeEnv.js +12 -0
- package/dist/esm-node/is/platform.js +6 -0
- package/dist/esm-node/is/type.js +34 -0
- package/dist/esm-node/logger.js +100 -0
- package/dist/esm-node/monorepo.js +87 -0
- package/dist/esm-node/nodeEnv.js +30 -0
- package/dist/esm-node/path.js +50 -0
- package/dist/esm-node/pathSerializer.js +46 -0
- package/dist/esm-node/plugin.js +23 -0
- package/dist/esm-node/prettyInstructions.js +77 -0
- package/dist/esm-node/printBuildError.js +34 -0
- package/dist/esm-node/react.js +20 -0
- package/dist/esm-node/readTsConfig.js +13 -0
- package/dist/esm-node/removeSlash.js +8 -0
- package/dist/esm-node/resolve.js +38 -0
- package/dist/esm-node/routes.js +24 -0
- package/dist/esm-node/runtimeExports.js +40 -0
- package/dist/esm-node/ssr.js +6 -0
- package/dist/esm-node/storage.js +42 -0
- package/dist/esm-node/testUtils.js +15 -0
- package/dist/esm-node/types.js +0 -0
- package/dist/esm-node/universal/constants.js +6 -0
- package/dist/esm-node/universal/formatWebpack.js +77 -0
- package/dist/esm-node/universal/nestedRoutes.js +93 -0
- package/dist/esm-node/universal/remixRouter.js +1 -0
- package/dist/esm-node/universal/serialize.js +7 -0
- package/dist/esm-node/version.js +25 -0
- package/dist/esm-node/wait.js +6 -0
- package/dist/esm-node/watch.js +36 -0
- package/dist/types/commands.d.ts +4 -0
- package/dist/{prettyInstructions.d.ts → types/prettyInstructions.d.ts} +4 -3
- package/package.json +4 -4
- package/dist/commands.d.ts +0 -3
- package/dist/emptyDir.js +0 -52
- package/dist/nodeEnv.js +0 -81
- package/dist/version.js +0 -92
- /package/dist/{FileSizeReporter.js → cjs/FileSizeReporter.js} +0 -0
- /package/dist/{applyOptionsChain.js → cjs/applyOptionsChain.js} +0 -0
- /package/dist/{chainId.js → cjs/chainId.js} +0 -0
- /package/dist/{clearConsole.js → cjs/clearConsole.js} +0 -0
- /package/dist/{compiled.js → cjs/compiled.js} +0 -0
- /package/dist/{constants.js → cjs/constants.js} +0 -0
- /package/dist/{debug.js → cjs/debug.js} +0 -0
- /package/dist/{ensureAbsolutePath.js → cjs/ensureAbsolutePath.js} +0 -0
- /package/dist/{ensureArray.js → cjs/ensureArray.js} +0 -0
- /package/dist/{findExists.js → cjs/findExists.js} +0 -0
- /package/dist/{generateMetaTags.js → cjs/generateMetaTags.js} +0 -0
- /package/dist/{getBrowserslist.js → cjs/getBrowserslist.js} +0 -0
- /package/dist/{getCoreJsVersion.js → cjs/getCoreJsVersion.js} +0 -0
- /package/dist/{getTargetDir.js → cjs/getTargetDir.js} +0 -0
- /package/dist/{import.js → cjs/import.js} +0 -0
- /package/dist/{index.js → cjs/index.js} +0 -0
- /package/dist/{is → cjs/is}/index.js +0 -0
- /package/dist/{is → cjs/is}/nodeEnv.js +0 -0
- /package/dist/{is → cjs/is}/platform.js +0 -0
- /package/dist/{is → cjs/is}/type.js +0 -0
- /package/dist/{plugin.js → cjs/plugin.js} +0 -0
- /package/dist/{printBuildError.js → cjs/printBuildError.js} +0 -0
- /package/dist/{readTsConfig.js → cjs/readTsConfig.js} +0 -0
- /package/dist/{removeSlash.js → cjs/removeSlash.js} +0 -0
- /package/dist/{resolve.js → cjs/resolve.js} +0 -0
- /package/dist/{routes.js → cjs/routes.js} +0 -0
- /package/dist/{ssr.js → cjs/ssr.js} +0 -0
- /package/dist/{storage.js → cjs/storage.js} +0 -0
- /package/dist/{testUtils.js → cjs/testUtils.js} +0 -0
- /package/dist/{types.js → cjs/types.js} +0 -0
- /package/dist/{universal → cjs/universal}/constants.js +0 -0
- /package/dist/{universal → cjs/universal}/formatWebpack.js +0 -0
- /package/dist/{universal → cjs/universal}/remixRouter.js +0 -0
- /package/dist/{universal → cjs/universal}/serialize.js +0 -0
- /package/dist/{wait.js → cjs/wait.js} +0 -0
- /package/dist/{FileSizeReporter.d.ts → types/FileSizeReporter.d.ts} +0 -0
- /package/dist/{alias.d.ts → types/alias.d.ts} +0 -0
- /package/dist/{analyzeProject.d.ts → types/analyzeProject.d.ts} +0 -0
- /package/dist/{applyOptionsChain.d.ts → types/applyOptionsChain.d.ts} +0 -0
- /package/dist/{babel.d.ts → types/babel.d.ts} +0 -0
- /package/dist/{chainId.d.ts → types/chainId.d.ts} +0 -0
- /package/dist/{clearConsole.d.ts → types/clearConsole.d.ts} +0 -0
- /package/dist/{compatRequire.d.ts → types/compatRequire.d.ts} +0 -0
- /package/dist/{compiled.d.ts → types/compiled.d.ts} +0 -0
- /package/dist/{constants.d.ts → types/constants.d.ts} +0 -0
- /package/dist/{debug.d.ts → types/debug.d.ts} +0 -0
- /package/dist/{emptyDir.d.ts → types/emptyDir.d.ts} +0 -0
- /package/dist/{ensureAbsolutePath.d.ts → types/ensureAbsolutePath.d.ts} +0 -0
- /package/dist/{ensureArray.d.ts → types/ensureArray.d.ts} +0 -0
- /package/dist/{findExists.d.ts → types/findExists.d.ts} +0 -0
- /package/dist/{generateMetaTags.d.ts → types/generateMetaTags.d.ts} +0 -0
- /package/dist/{getBrowserslist.d.ts → types/getBrowserslist.d.ts} +0 -0
- /package/dist/{getCoreJsVersion.d.ts → types/getCoreJsVersion.d.ts} +0 -0
- /package/dist/{getEntryOptions.d.ts → types/getEntryOptions.d.ts} +0 -0
- /package/dist/{getPackageManager.d.ts → types/getPackageManager.d.ts} +0 -0
- /package/dist/{getPort.d.ts → types/getPort.d.ts} +0 -0
- /package/dist/{getServerConfig.d.ts → types/getServerConfig.d.ts} +0 -0
- /package/dist/{getTargetDir.d.ts → types/getTargetDir.d.ts} +0 -0
- /package/dist/{import.d.ts → types/import.d.ts} +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{is → types/is}/index.d.ts +0 -0
- /package/dist/{is → types/is}/nodeEnv.d.ts +0 -0
- /package/dist/{is → types/is}/platform.d.ts +0 -0
- /package/dist/{is → types/is}/type.d.ts +0 -0
- /package/dist/{logger.d.ts → types/logger.d.ts} +0 -0
- /package/dist/{monorepo.d.ts → types/monorepo.d.ts} +0 -0
- /package/dist/{nodeEnv.d.ts → types/nodeEnv.d.ts} +0 -0
- /package/dist/{path.d.ts → types/path.d.ts} +0 -0
- /package/dist/{pathSerializer.d.ts → types/pathSerializer.d.ts} +0 -0
- /package/dist/{plugin.d.ts → types/plugin.d.ts} +0 -0
- /package/dist/{printBuildError.d.ts → types/printBuildError.d.ts} +0 -0
- /package/dist/{react.d.ts → types/react.d.ts} +0 -0
- /package/dist/{readTsConfig.d.ts → types/readTsConfig.d.ts} +0 -0
- /package/dist/{removeSlash.d.ts → types/removeSlash.d.ts} +0 -0
- /package/dist/{resolve.d.ts → types/resolve.d.ts} +0 -0
- /package/dist/{routes.d.ts → types/routes.d.ts} +0 -0
- /package/dist/{runtimeExports.d.ts → types/runtimeExports.d.ts} +0 -0
- /package/dist/{ssr.d.ts → types/ssr.d.ts} +0 -0
- /package/dist/{storage.d.ts → types/storage.d.ts} +0 -0
- /package/dist/{testUtils.d.ts → types/testUtils.d.ts} +0 -0
- /package/dist/{types.d.ts → types/types.d.ts} +0 -0
- /package/dist/{universal → types/universal}/constants.d.ts +0 -0
- /package/dist/{universal → types/universal}/formatWebpack.d.ts +0 -0
- /package/dist/{universal → types/universal}/nestedRoutes.d.ts +0 -0
- /package/dist/{universal → types/universal}/remixRouter.d.ts +0 -0
- /package/dist/{universal → types/universal}/serialize.d.ts +0 -0
- /package/dist/{version.d.ts → types/version.d.ts} +0 -0
- /package/dist/{wait.d.ts → types/wait.d.ts} +0 -0
- /package/dist/{watch.d.ts → types/watch.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
+
## 2.12.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- c2ca6c8: fix(app-tools): failed to restart CLI
|
8
|
+
|
9
|
+
fix(app-tools): 修复 CLI 重启失败的问题
|
10
|
+
|
11
|
+
- 6d86e34: feat(doc-tools): print dev server URLs with base
|
12
|
+
|
13
|
+
feat(doc-tools): 输出 dev server 的 URLs 时补全 base 信息
|
14
|
+
|
3
15
|
## 2.11.0
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -2,22 +2,8 @@ var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
6
5
|
var __getProtoOf = Object.getPrototypeOf;
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
10
|
-
var __spreadValues = (a, b) => {
|
11
|
-
for (var prop in b || (b = {}))
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
14
|
-
if (__getOwnPropSymbols)
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
16
|
-
if (__propIsEnum.call(b, prop))
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
18
|
-
}
|
19
|
-
return a;
|
20
|
-
};
|
21
7
|
var __export = (target, all) => {
|
22
8
|
for (var name in all)
|
23
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -88,7 +74,10 @@ const getAliasConfig = (aliasOption, option) => {
|
|
88
74
|
const baseUrl = (_a = tsconfig == null ? void 0 : tsconfig.compilerOptions) == null ? void 0 : _a.baseUrl;
|
89
75
|
return {
|
90
76
|
absoluteBaseUrl: baseUrl ? import_path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
91
|
-
paths:
|
77
|
+
paths: {
|
78
|
+
...alias,
|
79
|
+
...(_b = tsconfig == null ? void 0 : tsconfig.compilerOptions) == null ? void 0 : _b.paths
|
80
|
+
},
|
92
81
|
isTsPath: true,
|
93
82
|
isTsProject
|
94
83
|
};
|
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
25
25
|
mod
|
26
26
|
));
|
27
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
28
|
var analyzeProject_exports = {};
|
49
29
|
__export(analyzeProject_exports, {
|
50
30
|
isApiOnly: () => isApiOnly,
|
@@ -54,16 +34,16 @@ module.exports = __toCommonJS(analyzeProject_exports);
|
|
54
34
|
var path = __toESM(require("path"));
|
55
35
|
var import_commands = require("./commands");
|
56
36
|
var import_compiled = require("./compiled");
|
57
|
-
const isApiOnly = (appDirectory, entryDir) =>
|
37
|
+
const isApiOnly = async (appDirectory, entryDir) => {
|
58
38
|
const srcDir = path.join(appDirectory, entryDir != null ? entryDir : "src");
|
59
|
-
const existSrc =
|
39
|
+
const existSrc = await import_compiled.fs.pathExists(srcDir);
|
60
40
|
const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
|
61
41
|
return !existSrc || Boolean(options["api-only"]);
|
62
|
-
}
|
63
|
-
const isWebOnly = () =>
|
42
|
+
};
|
43
|
+
const isWebOnly = async () => {
|
64
44
|
const options = (0, import_compiled.minimist)((0, import_commands.getArgv)());
|
65
45
|
return Boolean(options["web-only"]);
|
66
|
-
}
|
46
|
+
};
|
67
47
|
// Annotate the CommonJS export names for ESM import in node:
|
68
48
|
0 && (module.exports = {
|
69
49
|
isApiOnly,
|
@@ -1,21 +1,7 @@
|
|
1
1
|
var __defProp = Object.defineProperty;
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
5
4
|
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
5
|
var __export = (target, all) => {
|
20
6
|
for (var name in all)
|
21
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -98,7 +84,11 @@ const modifyPresetOptions = (presetName, options, presets = []) => {
|
|
98
84
|
presets.forEach((preset, index) => {
|
99
85
|
if (Array.isArray(preset)) {
|
100
86
|
if (typeof preset[0] === "string" && (0, import_path2.normalizeToPosixPath)(preset[0]).includes(presetName)) {
|
101
|
-
preset[1] =
|
87
|
+
preset[1] = {
|
88
|
+
...preset[1] || {},
|
89
|
+
...options
|
90
|
+
// `options` is specific to different presets
|
91
|
+
};
|
102
92
|
}
|
103
93
|
} else if (typeof preset === "string" && (0, import_path2.normalizeToPosixPath)(preset).includes(presetName)) {
|
104
94
|
presets[index] = [preset, options];
|
@@ -124,7 +114,10 @@ const getBabelUtils = (config) => {
|
|
124
114
|
};
|
125
115
|
const applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils) => {
|
126
116
|
if (userBabelConfig) {
|
127
|
-
const babelUtils =
|
117
|
+
const babelUtils = {
|
118
|
+
...getBabelUtils(defaultOptions),
|
119
|
+
...extraBabelUtils
|
120
|
+
};
|
128
121
|
return (0, import_applyOptionsChain.applyOptionsChain)(defaultOptions, userBabelConfig || {}, babelUtils);
|
129
122
|
}
|
130
123
|
return defaultOptions;
|
@@ -19,12 +19,16 @@ var commands_exports = {};
|
|
19
19
|
__export(commands_exports, {
|
20
20
|
getArgv: () => getArgv,
|
21
21
|
getCommand: () => getCommand,
|
22
|
+
getFullArgv: () => getFullArgv,
|
22
23
|
isDevCommand: () => isDevCommand
|
23
24
|
});
|
24
25
|
module.exports = __toCommonJS(commands_exports);
|
25
|
-
const
|
26
|
+
const getFullArgv = () => {
|
26
27
|
var _a;
|
27
|
-
return ((
|
28
|
+
return ((_a = process.env.MODERN_ARGV) == null ? void 0 : _a.split(" ")) || process.argv;
|
29
|
+
};
|
30
|
+
const getArgv = () => {
|
31
|
+
return getFullArgv().slice(2);
|
28
32
|
};
|
29
33
|
const getCommand = () => {
|
30
34
|
const args = getArgv();
|
@@ -39,5 +43,6 @@ const isDevCommand = () => {
|
|
39
43
|
0 && (module.exports = {
|
40
44
|
getArgv,
|
41
45
|
getCommand,
|
46
|
+
getFullArgv,
|
42
47
|
isDevCommand
|
43
48
|
});
|
@@ -1,21 +1,7 @@
|
|
1
1
|
var __defProp = Object.defineProperty;
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
5
4
|
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
5
|
var __export = (target, all) => {
|
20
6
|
for (var name in all)
|
21
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -49,10 +35,11 @@ const dynamicImport = new Function(
|
|
49
35
|
"return import(modulePath)"
|
50
36
|
);
|
51
37
|
const requireExistModule = (filename, opt) => {
|
52
|
-
const final =
|
38
|
+
const final = {
|
53
39
|
extensions: [".ts", ".js"],
|
54
|
-
interop: true
|
55
|
-
|
40
|
+
interop: true,
|
41
|
+
...opt
|
42
|
+
};
|
56
43
|
const exist = (0, import_findExists.findExists)(final.extensions.map((ext) => `${filename}${ext}`));
|
57
44
|
if (!exist) {
|
58
45
|
return null;
|
@@ -0,0 +1,32 @@
|
|
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 emptyDir_exports = {};
|
19
|
+
__export(emptyDir_exports, {
|
20
|
+
emptyDir: () => emptyDir
|
21
|
+
});
|
22
|
+
module.exports = __toCommonJS(emptyDir_exports);
|
23
|
+
var import_compiled = require("./compiled");
|
24
|
+
const emptyDir = async (dir) => {
|
25
|
+
if (await import_compiled.fs.pathExists(dir)) {
|
26
|
+
await import_compiled.fs.emptyDir(dir);
|
27
|
+
}
|
28
|
+
};
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
30
|
+
0 && (module.exports = {
|
31
|
+
emptyDir
|
32
|
+
});
|
@@ -1,21 +1,7 @@
|
|
1
1
|
var __defProp = Object.defineProperty;
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
5
4
|
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
5
|
var __export = (target, all) => {
|
20
6
|
for (var name in all)
|
21
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -42,7 +28,7 @@ const getEntryOptions = (name, baseOptions, optionsByEntries, packageName) => {
|
|
42
28
|
if (optionsByEntry === void 0 && name === import_constants.MAIN_ENTRY_NAME && packageName) {
|
43
29
|
optionsByEntry = getOptionsByEntryName(packageName, optionsByEntries);
|
44
30
|
}
|
45
|
-
return optionsByEntry !== void 0 ? (0, import_is.isPlainObject)(optionsByEntry) && (0, import_is.isPlainObject)(baseOptions) ?
|
31
|
+
return optionsByEntry !== void 0 ? (0, import_is.isPlainObject)(optionsByEntry) && (0, import_is.isPlainObject)(baseOptions) ? { ...baseOptions, ...optionsByEntry } : optionsByEntry : baseOptions;
|
46
32
|
} else {
|
47
33
|
return baseOptions;
|
48
34
|
}
|
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
25
25
|
mod
|
26
26
|
));
|
27
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
28
|
var getPackageManager_exports = {};
|
49
29
|
__export(getPackageManager_exports, {
|
50
30
|
getPackageManager: () => getPackageManager
|
@@ -55,31 +35,29 @@ var import_path = __toESM(require("path"));
|
|
55
35
|
var import_compiled = require("./compiled");
|
56
36
|
var import_nodeEnv = require("./nodeEnv");
|
57
37
|
const MAX_TIMES = 5;
|
58
|
-
function getPackageManager() {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
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)()) {
|
38
|
+
async function getPackageManager(cwd = process.cwd()) {
|
39
|
+
let appDirectory = cwd;
|
40
|
+
let times = 0;
|
41
|
+
while (import_os.default.homedir() !== appDirectory && times < MAX_TIMES) {
|
42
|
+
times++;
|
43
|
+
if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "pnpm-lock.yaml"))) {
|
76
44
|
return "pnpm";
|
77
45
|
}
|
78
|
-
if (
|
46
|
+
if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "yarn.lock"))) {
|
79
47
|
return "yarn";
|
80
48
|
}
|
81
|
-
|
82
|
-
|
49
|
+
if (import_compiled.fs.existsSync(import_path.default.resolve(appDirectory, "package-lock.json"))) {
|
50
|
+
return "npm";
|
51
|
+
}
|
52
|
+
appDirectory = import_path.default.join(appDirectory, "..");
|
53
|
+
}
|
54
|
+
if (await (0, import_nodeEnv.canUsePnpm)()) {
|
55
|
+
return "pnpm";
|
56
|
+
}
|
57
|
+
if (await (0, import_nodeEnv.canUseYarn)()) {
|
58
|
+
return "yarn";
|
59
|
+
}
|
60
|
+
return "npm";
|
83
61
|
}
|
84
62
|
// Annotate the CommonJS export names for ESM import in node:
|
85
63
|
0 && (module.exports = {
|
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
25
25
|
mod
|
26
26
|
));
|
27
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
28
|
var getPort_exports = {};
|
49
29
|
__export(getPort_exports, {
|
50
30
|
getPort: () => getPort
|
@@ -53,10 +33,10 @@ module.exports = __toCommonJS(getPort_exports);
|
|
53
33
|
var import_net = __toESM(require("net"));
|
54
34
|
var import_compiled = require("./compiled");
|
55
35
|
var import_logger = require("./logger");
|
56
|
-
const getPort =
|
36
|
+
const getPort = async (port, {
|
57
37
|
tryLimits = 20,
|
58
38
|
strictPort = false
|
59
|
-
} = {}) {
|
39
|
+
} = {}) => {
|
60
40
|
if (typeof port === "string") {
|
61
41
|
port = parseInt(port, 10);
|
62
42
|
}
|
@@ -68,7 +48,7 @@ const getPort = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (port, {
|
|
68
48
|
let attempts = 0;
|
69
49
|
while (!found && attempts <= tryLimits) {
|
70
50
|
try {
|
71
|
-
|
51
|
+
await new Promise((resolve, reject) => {
|
72
52
|
const server = import_net.default.createServer();
|
73
53
|
server.unref();
|
74
54
|
server.on("error", reject);
|
@@ -105,7 +85,7 @@ const getPort = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (port, {
|
|
105
85
|
}
|
106
86
|
}
|
107
87
|
return port;
|
108
|
-
}
|
88
|
+
};
|
109
89
|
// Annotate the CommonJS export names for ESM import in node:
|
110
90
|
0 && (module.exports = {
|
111
91
|
getPort
|
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
25
25
|
mod
|
26
26
|
));
|
27
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
28
|
var getServerConfig_exports = {};
|
49
29
|
__export(getServerConfig_exports, {
|
50
30
|
getServerConfig: () => getServerConfig
|
@@ -53,14 +33,14 @@ module.exports = __toCommonJS(getServerConfig_exports);
|
|
53
33
|
var path = __toESM(require("path"));
|
54
34
|
var import_constants = require("./constants");
|
55
35
|
var import_findExists = require("./findExists");
|
56
|
-
const getServerConfig = (appDirectory, configFile) =>
|
36
|
+
const getServerConfig = async (appDirectory, configFile) => {
|
57
37
|
const configFilePath = (0, import_findExists.findExists)(
|
58
38
|
import_constants.CONFIG_FILE_EXTENSIONS.map(
|
59
39
|
(extension) => path.resolve(appDirectory, `${configFile}${extension}`)
|
60
40
|
)
|
61
41
|
);
|
62
42
|
return configFilePath;
|
63
|
-
}
|
43
|
+
};
|
64
44
|
// Annotate the CommonJS export names for ESM import in node:
|
65
45
|
0 && (module.exports = {
|
66
46
|
getServerConfig
|
@@ -2,22 +2,8 @@ var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
6
5
|
var __getProtoOf = Object.getPrototypeOf;
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
10
|
-
var __spreadValues = (a, b) => {
|
11
|
-
for (var prop in b || (b = {}))
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
14
|
-
if (__getOwnPropSymbols)
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
16
|
-
if (__propIsEnum.call(b, prop))
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
18
|
-
}
|
19
|
-
return a;
|
20
|
-
};
|
21
7
|
var __export = (target, all) => {
|
22
8
|
for (var name in all)
|
23
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -88,8 +74,11 @@ const DEFAULT_CONFIG = {
|
|
88
74
|
class Logger {
|
89
75
|
constructor(options = {}) {
|
90
76
|
this.level = options.level || LOG_TYPES.log.level;
|
91
|
-
this.config =
|
92
|
-
this.types =
|
77
|
+
this.config = { ...DEFAULT_CONFIG, ...options.config || {} };
|
78
|
+
this.types = {
|
79
|
+
...LOG_TYPES,
|
80
|
+
...options.types || {}
|
81
|
+
};
|
93
82
|
this.longestLabel = this.getLongestLabel();
|
94
83
|
Object.keys(this.types).forEach((type) => {
|
95
84
|
this[type] = this._log.bind(this, type);
|
@@ -2,22 +2,8 @@ var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
6
5
|
var __getProtoOf = Object.getPrototypeOf;
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
10
|
-
var __spreadValues = (a, b) => {
|
11
|
-
for (var prop in b || (b = {}))
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
14
|
-
if (__getOwnPropSymbols)
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
16
|
-
if (__propIsEnum.call(b, prop))
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
18
|
-
}
|
19
|
-
return a;
|
20
|
-
};
|
21
7
|
var __export = (target, all) => {
|
22
8
|
for (var name in all)
|
23
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -77,7 +63,10 @@ const isModernjsMonorepo = (root) => {
|
|
77
63
|
return false;
|
78
64
|
}
|
79
65
|
const json = JSON.parse(import_fs.default.readFileSync(pkgJsonPath, "utf8"));
|
80
|
-
const deps =
|
66
|
+
const deps = {
|
67
|
+
...json.dependencies || {},
|
68
|
+
...json.devDependencies || {}
|
69
|
+
};
|
81
70
|
return Boolean(deps["@modern-js/monorepo-tools"]);
|
82
71
|
};
|
83
72
|
const findMonorepoRoot = (appDirectory, maxDepth = PACKAGE_MAX_DEPTH) => {
|
@@ -0,0 +1,55 @@
|
|
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 nodeEnv_exports = {};
|
19
|
+
__export(nodeEnv_exports, {
|
20
|
+
canUseNpm: () => canUseNpm,
|
21
|
+
canUsePnpm: () => canUsePnpm,
|
22
|
+
canUseYarn: () => canUseYarn
|
23
|
+
});
|
24
|
+
module.exports = __toCommonJS(nodeEnv_exports);
|
25
|
+
var import_compiled = require("./compiled");
|
26
|
+
async function canUseNpm() {
|
27
|
+
try {
|
28
|
+
await (0, import_compiled.execa)("npm", ["--version"], { env: process.env });
|
29
|
+
return true;
|
30
|
+
} catch (e) {
|
31
|
+
return false;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
async function canUseYarn() {
|
35
|
+
try {
|
36
|
+
await (0, import_compiled.execa)("yarn", ["--version"], { env: process.env });
|
37
|
+
return true;
|
38
|
+
} catch (e) {
|
39
|
+
return false;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
async function canUsePnpm() {
|
43
|
+
try {
|
44
|
+
await (0, import_compiled.execa)("pnpm", ["--version"], { env: process.env });
|
45
|
+
return true;
|
46
|
+
} catch (e) {
|
47
|
+
return false;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
51
|
+
0 && (module.exports = {
|
52
|
+
canUseNpm,
|
53
|
+
canUsePnpm,
|
54
|
+
canUseYarn
|
55
|
+
});
|
@@ -56,7 +56,7 @@ function applyMatcherReplacement(matchers, str, options = {}) {
|
|
56
56
|
const createDefaultPathMatchers = (root) => {
|
57
57
|
const ret = [
|
58
58
|
{
|
59
|
-
match:
|
59
|
+
match: /(?<=\/)(\.pnpm\/.+?\/node_modules)(?=\/)/,
|
60
60
|
mark: "pnpmInner"
|
61
61
|
}
|
62
62
|
];
|
@@ -51,19 +51,16 @@ const getIpv4Interfaces = () => {
|
|
51
51
|
};
|
52
52
|
const getAddressUrls = (protocol = "http", port) => {
|
53
53
|
const ipv4Interfaces = getIpv4Interfaces();
|
54
|
-
return ipv4Interfaces.reduce(
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
},
|
65
|
-
[]
|
66
|
-
);
|
54
|
+
return ipv4Interfaces.reduce((memo, detail) => {
|
55
|
+
let label = "Network: ";
|
56
|
+
let url = `${protocol}://${detail.address}:${port}`;
|
57
|
+
if (detail.address.includes(`localhost`) || detail.internal) {
|
58
|
+
label = "Local: ";
|
59
|
+
url = `${protocol}://localhost:${port}`;
|
60
|
+
}
|
61
|
+
memo.push({ label, url });
|
62
|
+
return memo;
|
63
|
+
}, []);
|
67
64
|
};
|
68
65
|
const prettyInstructions = (appContext, config) => {
|
69
66
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
@@ -75,15 +72,15 @@ const prettyInstructions = (appContext, config) => {
|
|
75
72
|
let message = "App running at:\n\n";
|
76
73
|
if ((0, import_is.isSingleEntry)(entrypoints) || apiOnly) {
|
77
74
|
message += urls.map(
|
78
|
-
({
|
75
|
+
({ label, url }) => ` ${import_compiled.chalk.bold(`> ${label.padEnd(10)}`)}${import_compiled.chalk.cyanBright(
|
79
76
|
normalizeUrl(`${url}/${routes[0].urlPath}`)
|
80
77
|
)}
|
81
78
|
`
|
82
79
|
).join("");
|
83
80
|
} else {
|
84
81
|
const maxNameLength = Math.max(...routes.map((r) => r.entryName.length));
|
85
|
-
urls.forEach(({
|
86
|
-
message += ` ${import_compiled.chalk.bold(`> ${
|
82
|
+
urls.forEach(({ label, url }) => {
|
83
|
+
message += ` ${import_compiled.chalk.bold(`> ${label}`)}
|
87
84
|
`;
|
88
85
|
routes.forEach(({ entryName, urlPath, isSSR }) => {
|
89
86
|
if (!checkedEntries.includes(entryName)) {
|