arkormx 2.0.0-next.12 → 2.0.0-next.13
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/dist/cli.mjs +33 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -2071,6 +2071,16 @@ const resolveAndApplyConfig = (imported) => {
|
|
|
2071
2071
|
runtimeConfigLoaded = true;
|
|
2072
2072
|
return true;
|
|
2073
2073
|
};
|
|
2074
|
+
/**
|
|
2075
|
+
* Dynamically import a configuration file.
|
|
2076
|
+
* A cache-busting query parameter is appended to ensure the latest version is loaded.
|
|
2077
|
+
*
|
|
2078
|
+
* @param configPath
|
|
2079
|
+
* @returns A promise that resolves to the imported configuration module.
|
|
2080
|
+
*/
|
|
2081
|
+
const importConfigFile = (configPath) => {
|
|
2082
|
+
return RuntimeModuleLoader.load(configPath);
|
|
2083
|
+
};
|
|
2074
2084
|
const loadRuntimeConfigSync = () => {
|
|
2075
2085
|
const syncConfigPaths = getRuntimeConfigPaths();
|
|
2076
2086
|
for (const configPath of syncConfigPaths) {
|
|
@@ -2083,6 +2093,28 @@ const loadRuntimeConfigSync = () => {
|
|
|
2083
2093
|
}
|
|
2084
2094
|
return false;
|
|
2085
2095
|
};
|
|
2096
|
+
/**
|
|
2097
|
+
* Load the ArkORM configuration by searching for configuration files in the
|
|
2098
|
+
* current working directory.
|
|
2099
|
+
* @returns
|
|
2100
|
+
*/
|
|
2101
|
+
const loadArkormConfig = async () => {
|
|
2102
|
+
if (runtimeConfigLoaded) return;
|
|
2103
|
+
if (runtimeConfigLoadingPromise) return await runtimeConfigLoadingPromise;
|
|
2104
|
+
runtimeConfigLoadingPromise = (async () => {
|
|
2105
|
+
const configPaths = getRuntimeConfigPaths();
|
|
2106
|
+
for (const configPath of configPaths) {
|
|
2107
|
+
if (!existsSync$1(configPath)) continue;
|
|
2108
|
+
try {
|
|
2109
|
+
if (resolveAndApplyConfig(await importConfigFile(configPath))) return;
|
|
2110
|
+
} catch {
|
|
2111
|
+
continue;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
runtimeConfigLoaded = true;
|
|
2115
|
+
})();
|
|
2116
|
+
await runtimeConfigLoadingPromise;
|
|
2117
|
+
};
|
|
2086
2118
|
const getDefaultStubsPath = () => {
|
|
2087
2119
|
return resolveDefaultStubsPath();
|
|
2088
2120
|
};
|
|
@@ -3645,6 +3677,7 @@ var logo_default = String.raw`
|
|
|
3645
3677
|
|
|
3646
3678
|
//#endregion
|
|
3647
3679
|
//#region src/cli/index.ts
|
|
3680
|
+
await loadArkormConfig();
|
|
3648
3681
|
const app = new CliApp();
|
|
3649
3682
|
await Kernel.init(app, {
|
|
3650
3683
|
logo: logo_default,
|