silgi 0.37.24 → 0.37.25
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/build.mjs
CHANGED
|
@@ -1641,17 +1641,13 @@ async function prepareConfigs(silgi) {
|
|
|
1641
1641
|
""
|
|
1642
1642
|
)}`,
|
|
1643
1643
|
"",
|
|
1644
|
-
"const
|
|
1644
|
+
"export const localRuntimeConfig = useSilgiRuntimeConfig(undefined, runtimeConfig)",
|
|
1645
1645
|
""
|
|
1646
1646
|
];
|
|
1647
1647
|
delete _data.runtimeConfig;
|
|
1648
1648
|
importData.push(`export const cliConfigs: Partial<SilgiRuntimeOptions & SilgiOptions> = ${genObjectFromRawEntries(
|
|
1649
1649
|
Object.entries(_data).map(
|
|
1650
1650
|
([key, value]) => [key, genEnsureSafeVar(value)]
|
|
1651
|
-
).concat(
|
|
1652
|
-
[
|
|
1653
|
-
["runtimeConfig", "runtime"]
|
|
1654
|
-
]
|
|
1655
1651
|
)
|
|
1656
1652
|
)}`);
|
|
1657
1653
|
importData.unshift(...baseHeaderBannerComment);
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EnvOptions, SilgiEvent, SilgiRuntimeConfig } from 'silgi/types';
|
|
2
2
|
export declare function updateEnvOptions(runtime: SilgiRuntimeConfig): EnvOptions;
|
|
3
|
-
export declare function useSilgiRuntimeConfig<T extends SilgiRuntimeConfig>(event?: SilgiEvent): SilgiRuntimeConfig;
|
|
3
|
+
export declare function useSilgiRuntimeConfig<T extends SilgiRuntimeConfig>(event?: SilgiEvent, localRuntimeConfig?: SilgiRuntimeConfig): SilgiRuntimeConfig;
|
|
4
4
|
export declare function initRuntimeConfig(envOptions?: EnvOptions, inlineRuntimeConfig?: Record<string, any>): Readonly<Record<string, any>>;
|
|
5
5
|
export declare function updateRuntimeConfig(runtimeConfig: Record<string, unknown>): void;
|
|
6
6
|
export declare function applyEnv(obj: Record<string, any>, opts: EnvOptions, parentKey?: string): Record<string, any>;
|
|
@@ -28,7 +28,10 @@ function sharedRuntimeConfig(runtime) {
|
|
|
28
28
|
}
|
|
29
29
|
return inlineRuntimeConfig;
|
|
30
30
|
}
|
|
31
|
-
export function useSilgiRuntimeConfig(event) {
|
|
31
|
+
export function useSilgiRuntimeConfig(event, localRuntimeConfig) {
|
|
32
|
+
if (localRuntimeConfig) {
|
|
33
|
+
return sharedRuntimeConfig(localRuntimeConfig);
|
|
34
|
+
}
|
|
32
35
|
const runtime = useRuntime();
|
|
33
36
|
if (!event) {
|
|
34
37
|
return sharedRuntimeConfig(runtime);
|