@modern-js/core 2.26.0 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +5 -3
- package/dist/config/createDefaultConfig.d.ts +1 -1
- package/dist/config/createDefaultConfig.js +12 -6
- package/dist/config/createLoadedConfig.d.ts +1 -1
- package/dist/config/createLoadedConfig.js +80 -73
- package/dist/config/createResolvedConfig.d.ts +1 -1
- package/dist/config/createResolvedConfig.js +59 -72
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +7 -18
- package/dist/config/loadConfig.d.ts +5 -5
- package/dist/config/loadConfig.js +115 -112
- package/dist/context.d.ts +21 -14
- package/dist/context.js +74 -60
- package/dist/createCli.d.ts +13 -13
- package/dist/createCli.js +134 -113
- package/dist/index.d.ts +16 -16
- package/dist/index.js +59 -35
- package/dist/loadEnv.d.ts +1 -1
- package/dist/loadEnv.js +23 -17
- package/dist/loadPlugins.d.ts +4 -4
- package/dist/loadPlugins.js +54 -54
- package/dist/manager.d.ts +62 -62
- package/dist/manager.js +40 -23
- package/dist/nodeApi.d.ts +1 -1
- package/dist/nodeApi.js +25 -9
- package/dist/runBin.d.ts +2 -2
- package/dist/runBin.js +56 -53
- package/dist/schema/patchSchema.d.ts +15 -15
- package/dist/schema/patchSchema.js +56 -53
- package/dist/schema/testing.d.ts +11 -11
- package/dist/schema/testing.js +26 -8
- package/dist/schema/traverseSchema.d.ts +1 -1
- package/dist/schema/traverseSchema.js +25 -17
- package/dist/types/config/index.d.ts +37 -37
- package/dist/types/config/index.js +3 -1
- package/dist/types/config/testing.d.ts +11 -11
- package/dist/types/config/testing.js +3 -1
- package/dist/types/context.d.ts +27 -27
- package/dist/types/context.js +3 -1
- package/dist/types/coreOptions.d.ts +22 -22
- package/dist/types/coreOptions.js +3 -1
- package/dist/types/hooks.d.ts +41 -41
- package/dist/types/hooks.js +3 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +10 -21
- package/dist/types/plugin.d.ts +10 -10
- package/dist/types/plugin.js +3 -1
- package/dist/types/pluginAPI.d.ts +10 -10
- package/dist/types/pluginAPI.js +3 -1
- package/dist/utils/checkIsDuplicationPlugin.d.ts +1 -1
- package/dist/utils/checkIsDuplicationPlugin.js +24 -21
- package/dist/utils/commander.d.ts +1 -1
- package/dist/utils/commander.js +31 -17
- package/dist/utils/createFileWatcher.d.ts +1 -1
- package/dist/utils/createFileWatcher.js +85 -106
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +10 -21
- package/dist/utils/initAppDir.d.ts +1 -1
- package/dist/utils/initAppDir.js +22 -17
- package/dist/utils/mergeConfig.d.ts +1 -1
- package/dist/utils/mergeConfig.js +37 -27
- package/dist/utils/repeatKeyWarning.d.ts +1 -1
- package/dist/utils/repeatKeyWarning.js +29 -16
- package/package.json +11 -10
|
@@ -1,130 +1,133 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
CONFIG_FILE_NAME: function() {
|
|
14
|
+
return CONFIG_FILE_NAME;
|
|
15
|
+
},
|
|
16
|
+
LOCAL_CONFIG_FILE_NAME: function() {
|
|
17
|
+
return LOCAL_CONFIG_FILE_NAME;
|
|
18
|
+
},
|
|
19
|
+
PACKAGE_JSON_CONFIG_NAME: function() {
|
|
20
|
+
return PACKAGE_JSON_CONFIG_NAME;
|
|
21
|
+
},
|
|
22
|
+
getPackageConfig: function() {
|
|
23
|
+
return getPackageConfig;
|
|
24
|
+
},
|
|
25
|
+
getDependencies: function() {
|
|
26
|
+
return getDependencies;
|
|
27
|
+
},
|
|
28
|
+
clearFilesOverTime: function() {
|
|
29
|
+
return clearFilesOverTime;
|
|
30
|
+
},
|
|
31
|
+
getConfigFilePath: function() {
|
|
32
|
+
return getConfigFilePath;
|
|
33
|
+
},
|
|
34
|
+
loadConfig: function() {
|
|
35
|
+
return loadConfig;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
39
|
+
const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
|
|
40
|
+
const _utils = require("@modern-js/utils");
|
|
41
|
+
const _nodebundlerequire = require("@modern-js/node-bundle-require");
|
|
42
|
+
const debug = (0, _utils.createDebugger)("load-config");
|
|
43
|
+
const CONFIG_FILE_NAME = "modern.config";
|
|
44
|
+
const LOCAL_CONFIG_FILE_NAME = "modern.config.local";
|
|
45
|
+
const PACKAGE_JSON_CONFIG_NAME = "modernConfig";
|
|
19
46
|
const getPackageConfig = (appDirectory, packageJsonConfig) => {
|
|
20
|
-
|
|
21
|
-
|
|
47
|
+
const json = JSON.parse(_utils.fs.readFileSync(_path.default.resolve(appDirectory, "./package.json"), "utf8"));
|
|
48
|
+
return json[packageJsonConfig !== null && packageJsonConfig !== void 0 ? packageJsonConfig : PACKAGE_JSON_CONFIG_NAME];
|
|
22
49
|
};
|
|
23
|
-
exports.getPackageConfig = getPackageConfig;
|
|
24
|
-
/**
|
|
25
|
-
* Get the file dependencies by module.children, ignore file path in node_modules and this monorepo packages default.
|
|
26
|
-
* @param filePath - Absolute file path.
|
|
27
|
-
* @returns File dependencies array.
|
|
28
|
-
*/
|
|
29
50
|
const getDependencies = (filePath) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
51
|
+
const mod = require.cache[filePath];
|
|
52
|
+
if (!mod) {
|
|
53
|
+
debug(`${filePath} has not been required yet`);
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
const deps = [];
|
|
57
|
+
if (!/\/node_modules\/|\/modern-js\/packages\//.test(mod.id)) {
|
|
58
|
+
deps.push(mod.id);
|
|
59
|
+
for (const child of mod.children) {
|
|
60
|
+
deps.push(...getDependencies(child.id));
|
|
41
61
|
}
|
|
42
|
-
|
|
62
|
+
}
|
|
63
|
+
return deps;
|
|
43
64
|
};
|
|
44
|
-
exports.getDependencies = getDependencies;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @param targetDir target dir
|
|
48
|
-
* @param overtime Unit of second
|
|
49
|
-
*/
|
|
50
65
|
const clearFilesOverTime = async (targetDir, overtime) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
utils_1.fs.unlinkSync(file.path);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
66
|
+
try {
|
|
67
|
+
const files = await (0, _utils.globby)(`${targetDir}/**/*`, {
|
|
68
|
+
stats: true,
|
|
69
|
+
absolute: true
|
|
70
|
+
});
|
|
71
|
+
const currentTime = Date.now();
|
|
72
|
+
if (files.length > 0) {
|
|
73
|
+
for (const file of files) {
|
|
74
|
+
if (currentTime - file.stats.birthtimeMs >= overtime * 1e3) {
|
|
75
|
+
_utils.fs.unlinkSync(file.path);
|
|
64
76
|
}
|
|
77
|
+
}
|
|
65
78
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
79
|
+
} catch (err) {
|
|
80
|
+
}
|
|
69
81
|
};
|
|
70
|
-
exports.clearFilesOverTime = clearFilesOverTime;
|
|
71
82
|
const bundleRequireWithCatch = async (configFile, { appDirectory }) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
e.message = `Get Error while loading config file: ${configFile}, please check it and retry.\n${e.message || ''}`;
|
|
89
|
-
}
|
|
90
|
-
throw e;
|
|
83
|
+
try {
|
|
84
|
+
const mod = await (0, _nodebundlerequire.bundleRequire)(configFile, {
|
|
85
|
+
autoClear: false,
|
|
86
|
+
getOutputFile: async (filePath) => {
|
|
87
|
+
const defaultOutputFileName = _path.default.basename(await (0, _nodebundlerequire.defaultGetOutputFile)(filePath));
|
|
88
|
+
const outputPath = _path.default.join(appDirectory, _utils.CONFIG_CACHE_DIR);
|
|
89
|
+
const timeLimit = 10 * 60;
|
|
90
|
+
await clearFilesOverTime(outputPath, timeLimit);
|
|
91
|
+
return _path.default.join(outputPath, defaultOutputFileName);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return mod;
|
|
95
|
+
} catch (e) {
|
|
96
|
+
if (e instanceof Error) {
|
|
97
|
+
e.message = `Get Error while loading config file: ${configFile}, please check it and retry.
|
|
98
|
+
${e.message || ""}`;
|
|
91
99
|
}
|
|
100
|
+
throw e;
|
|
101
|
+
}
|
|
92
102
|
};
|
|
93
103
|
const getConfigFilePath = (appDirectory, filePath) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
return path_1.default.resolve(appDirectory, filePath);
|
|
104
|
+
if (filePath) {
|
|
105
|
+
if (_path.default.isAbsolute(filePath)) {
|
|
106
|
+
return filePath;
|
|
99
107
|
}
|
|
100
|
-
return
|
|
108
|
+
return _path.default.resolve(appDirectory, filePath);
|
|
109
|
+
}
|
|
110
|
+
return (0, _utils.findExists)(_utils.CONFIG_FILE_EXTENSIONS.map((extension) => _path.default.resolve(appDirectory, `${CONFIG_FILE_NAME}${extension}`)));
|
|
101
111
|
};
|
|
102
|
-
exports.getConfigFilePath = getConfigFilePath;
|
|
103
|
-
/**
|
|
104
|
-
* Parse and load user config file, support extensions like .ts, mjs, js, ejs.
|
|
105
|
-
* @param appDirectory - App root directory, from which start search user config file.
|
|
106
|
-
* @param configFile - Specific absolute config file path.
|
|
107
|
-
* @returns Object contain config file path, user config object and dependency files used by config file.
|
|
108
|
-
*/
|
|
109
112
|
const loadConfig = async (appDirectory, configFile, packageJsonConfig, loadedConfig) => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
113
|
+
const pkgConfig = getPackageConfig(appDirectory, packageJsonConfig);
|
|
114
|
+
let config;
|
|
115
|
+
const dependencies = pkgConfig ? [
|
|
116
|
+
_path.default.resolve(appDirectory, "./package.json")
|
|
117
|
+
] : [];
|
|
118
|
+
if (loadedConfig) {
|
|
119
|
+
config = loadedConfig;
|
|
120
|
+
} else if (configFile) {
|
|
121
|
+
delete require.cache[configFile];
|
|
122
|
+
const mod = await bundleRequireWithCatch(configFile, {
|
|
123
|
+
appDirectory
|
|
124
|
+
});
|
|
125
|
+
config = mod.default || mod;
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
path: configFile,
|
|
129
|
+
config,
|
|
130
|
+
pkgConfig,
|
|
131
|
+
dependencies
|
|
132
|
+
};
|
|
129
133
|
};
|
|
130
|
-
exports.loadConfig = loadConfig;
|
package/dist/context.d.ts
CHANGED
|
@@ -19,17 +19,24 @@ export declare const useConfigContext: <Extends extends Record<string, any>>() =
|
|
|
19
19
|
* Get normalized content of user config.
|
|
20
20
|
*/
|
|
21
21
|
export declare const useResolvedConfigContext: <Extends extends Record<string, any>>() => NormalizedConfig<Extends>;
|
|
22
|
-
export declare const initAppContext: ({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
export declare const initAppContext: ({
|
|
23
|
+
appDirectory,
|
|
24
|
+
plugins,
|
|
25
|
+
configFile,
|
|
26
|
+
options,
|
|
27
|
+
serverConfigFile,
|
|
28
|
+
serverInternalPlugins
|
|
29
|
+
}: {
|
|
30
|
+
appDirectory: string;
|
|
31
|
+
plugins: CliPlugin[];
|
|
32
|
+
configFile: string | false;
|
|
33
|
+
options?: {
|
|
34
|
+
metaName?: string | undefined;
|
|
35
|
+
srcDir?: string | undefined;
|
|
36
|
+
apiDir?: string | undefined;
|
|
37
|
+
distDir?: string | undefined;
|
|
38
|
+
sharedDir?: string | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
serverConfigFile: string;
|
|
41
|
+
serverInternalPlugins: InternalPlugins;
|
|
42
|
+
}) => IAppContext;
|
package/dist/context.js
CHANGED
|
@@ -1,62 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
AppContext: function() {
|
|
14
|
+
return AppContext;
|
|
15
|
+
},
|
|
16
|
+
ConfigContext: function() {
|
|
17
|
+
return ConfigContext;
|
|
18
|
+
},
|
|
19
|
+
ResolvedConfigContext: function() {
|
|
20
|
+
return ResolvedConfigContext;
|
|
21
|
+
},
|
|
22
|
+
setAppContext: function() {
|
|
23
|
+
return setAppContext;
|
|
24
|
+
},
|
|
25
|
+
useAppContext: function() {
|
|
26
|
+
return useAppContext;
|
|
27
|
+
},
|
|
28
|
+
useConfigContext: function() {
|
|
29
|
+
return useConfigContext;
|
|
30
|
+
},
|
|
31
|
+
useResolvedConfigContext: function() {
|
|
32
|
+
return useResolvedConfigContext;
|
|
33
|
+
},
|
|
34
|
+
initAppContext: function() {
|
|
35
|
+
return initAppContext;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
39
|
+
const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
|
|
40
|
+
const _utils = require("@modern-js/utils");
|
|
41
|
+
const _plugin = require("@modern-js/plugin");
|
|
42
|
+
const AppContext = (0, _plugin.createContext)({});
|
|
43
|
+
const ConfigContext = (0, _plugin.createContext)({});
|
|
44
|
+
const ResolvedConfigContext = (0, _plugin.createContext)({});
|
|
45
|
+
const setAppContext = (value) => AppContext.set(value);
|
|
46
|
+
const useAppContext = () => AppContext.use().value;
|
|
47
|
+
const useConfigContext = () => ConfigContext.use().value;
|
|
48
|
+
const useResolvedConfigContext = () => ResolvedConfigContext.use().value;
|
|
49
|
+
const initAppContext = ({ appDirectory, plugins, configFile, options, serverConfigFile, serverInternalPlugins }) => {
|
|
50
|
+
const { metaName = "modern-js", srcDir = "src", distDir = "", apiDir = "api", sharedDir = "shared" } = options || {};
|
|
51
|
+
return {
|
|
52
|
+
metaName,
|
|
53
|
+
appDirectory,
|
|
54
|
+
configFile,
|
|
55
|
+
serverConfigFile,
|
|
56
|
+
serverInternalPlugins,
|
|
57
|
+
ip: _utils.address.ip(),
|
|
58
|
+
port: 0,
|
|
59
|
+
packageName: require(_path.default.resolve(appDirectory, "./package.json")).name,
|
|
60
|
+
srcDirectory: _path.default.resolve(appDirectory, srcDir),
|
|
61
|
+
apiDirectory: _path.default.resolve(appDirectory, apiDir),
|
|
62
|
+
lambdaDirectory: _path.default.resolve(appDirectory, apiDir, "lambda"),
|
|
63
|
+
distDirectory: distDir,
|
|
64
|
+
sharedDirectory: _path.default.resolve(appDirectory, sharedDir),
|
|
65
|
+
nodeModulesDirectory: _path.default.resolve(appDirectory, "./node_modules"),
|
|
66
|
+
internalDirectory: _path.default.resolve(appDirectory, `./node_modules/.${metaName}`),
|
|
67
|
+
plugins,
|
|
68
|
+
htmlTemplates: {},
|
|
69
|
+
serverRoutes: [],
|
|
70
|
+
entrypoints: [],
|
|
71
|
+
checkedEntries: [],
|
|
72
|
+
apiOnly: false,
|
|
73
|
+
internalDirAlias: `@_${metaName.replace(/-/g, "_")}_internal`,
|
|
74
|
+
internalSrcAlias: `@_${metaName.replace(/-/g, "_")}_src`
|
|
75
|
+
};
|
|
4
76
|
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.initAppContext = exports.useResolvedConfigContext = exports.useConfigContext = exports.useAppContext = exports.setAppContext = exports.ResolvedConfigContext = exports.ConfigContext = exports.AppContext = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const utils_1 = require("@modern-js/utils");
|
|
9
|
-
const plugin_1 = require("@modern-js/plugin");
|
|
10
|
-
exports.AppContext = (0, plugin_1.createContext)({});
|
|
11
|
-
exports.ConfigContext = (0, plugin_1.createContext)({});
|
|
12
|
-
exports.ResolvedConfigContext = (0, plugin_1.createContext)({});
|
|
13
|
-
/**
|
|
14
|
-
* Set app context.
|
|
15
|
-
* @param value new app context. It will override previous app context.
|
|
16
|
-
*/
|
|
17
|
-
const setAppContext = (value) => exports.AppContext.set(value);
|
|
18
|
-
exports.setAppContext = setAppContext;
|
|
19
|
-
/**
|
|
20
|
-
* Get app context, including directories, plugins and some static infos.
|
|
21
|
-
*/
|
|
22
|
-
const useAppContext = () => exports.AppContext.use().value;
|
|
23
|
-
exports.useAppContext = useAppContext;
|
|
24
|
-
/**
|
|
25
|
-
* Get original content of user config.
|
|
26
|
-
*/
|
|
27
|
-
const useConfigContext = () => exports.ConfigContext.use().value;
|
|
28
|
-
exports.useConfigContext = useConfigContext;
|
|
29
|
-
/**
|
|
30
|
-
* Get normalized content of user config.
|
|
31
|
-
*/
|
|
32
|
-
const useResolvedConfigContext = () => exports.ResolvedConfigContext.use().value;
|
|
33
|
-
exports.useResolvedConfigContext = useResolvedConfigContext;
|
|
34
|
-
const initAppContext = ({ appDirectory, plugins, configFile, options, serverConfigFile, serverInternalPlugins, }) => {
|
|
35
|
-
const { metaName = 'modern-js', srcDir = 'src', distDir = '', apiDir = 'api', sharedDir = 'shared', } = options || {};
|
|
36
|
-
return {
|
|
37
|
-
metaName,
|
|
38
|
-
appDirectory,
|
|
39
|
-
configFile,
|
|
40
|
-
serverConfigFile,
|
|
41
|
-
serverInternalPlugins,
|
|
42
|
-
ip: utils_1.address.ip(),
|
|
43
|
-
port: 0,
|
|
44
|
-
packageName: require(path_1.default.resolve(appDirectory, './package.json')).name,
|
|
45
|
-
srcDirectory: path_1.default.resolve(appDirectory, srcDir),
|
|
46
|
-
apiDirectory: path_1.default.resolve(appDirectory, apiDir),
|
|
47
|
-
lambdaDirectory: path_1.default.resolve(appDirectory, apiDir, 'lambda'),
|
|
48
|
-
distDirectory: distDir,
|
|
49
|
-
sharedDirectory: path_1.default.resolve(appDirectory, sharedDir),
|
|
50
|
-
nodeModulesDirectory: path_1.default.resolve(appDirectory, './node_modules'),
|
|
51
|
-
internalDirectory: path_1.default.resolve(appDirectory, `./node_modules/.${metaName}`),
|
|
52
|
-
plugins,
|
|
53
|
-
htmlTemplates: {},
|
|
54
|
-
serverRoutes: [],
|
|
55
|
-
entrypoints: [],
|
|
56
|
-
checkedEntries: [],
|
|
57
|
-
apiOnly: false,
|
|
58
|
-
internalDirAlias: `@_${metaName.replace(/-/g, '_')}_internal`,
|
|
59
|
-
internalSrcAlias: `@_${metaName.replace(/-/g, '_')}_src`,
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
exports.initAppContext = initAppContext;
|
package/dist/createCli.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { CoreOptions } from './types';
|
|
2
2
|
export declare const mergeOptions: (options?: CoreOptions) => CoreOptions & {
|
|
3
|
-
|
|
3
|
+
serverConfigFile: string;
|
|
4
4
|
};
|
|
5
5
|
export declare const createCli: () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
6
|
+
init: (options?: CoreOptions) => Promise<{
|
|
7
|
+
resolved: import("./types").NormalizedConfig<{}>;
|
|
8
|
+
appContext: import("./types").IAppContext;
|
|
9
|
+
}>;
|
|
10
|
+
run: (options?: CoreOptions) => Promise<void>;
|
|
11
|
+
test: (argv: string[], options?: {
|
|
12
|
+
coreOptions?: CoreOptions;
|
|
13
|
+
disableWatcher?: boolean;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
runCommand: (command: string, commandOptions?: string[], options?: CoreOptions) => Promise<void>;
|
|
16
|
+
getPrevInitOptions: () => CoreOptions | undefined;
|
|
17
|
+
};
|