silgi 0.27.2 → 0.27.3
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/index.mjs
CHANGED
|
@@ -1205,8 +1205,8 @@ async function readScanFile(silgi) {
|
|
|
1205
1205
|
});
|
|
1206
1206
|
try {
|
|
1207
1207
|
if (silgi.options.commandType === "prepare") {
|
|
1208
|
-
globalThis
|
|
1209
|
-
injectedResult.code = `globalThis
|
|
1208
|
+
globalThis._silgi_runtime = silgi.options.runtimeConfig;
|
|
1209
|
+
injectedResult.code = `globalThis._silgi_runtime = ${JSON.stringify(silgi.options.runtimeConfig)};
|
|
1210
1210
|
${injectedResult.code}`;
|
|
1211
1211
|
injectedResult.code = injectedResult.code.replace(/runtimeConfig: \{\}/, `runtimeConfig: ${JSON.stringify(silgi.options.runtimeConfig)}`);
|
|
1212
1212
|
}
|
|
@@ -3,7 +3,7 @@ import destr from "destr";
|
|
|
3
3
|
import { klona } from "klona";
|
|
4
4
|
import { snakeCase } from "scule";
|
|
5
5
|
import { tryUseSilgi, useSilgi } from "silgi";
|
|
6
|
-
let _inlineSilgiRuntimeConfig = globalThis.__nitro__?.useRuntimeConfig?.() || process.env.RUNTIME_CONFIG;
|
|
6
|
+
let _inlineSilgiRuntimeConfig = globalThis.__nitro__?.useRuntimeConfig?.() || globalThis._silgi_runtime || process.env.RUNTIME_CONFIG;
|
|
7
7
|
let envOptions = {
|
|
8
8
|
prefix: "NITRO_",
|
|
9
9
|
altPrefix: _inlineSilgiRuntimeConfig?.nitro?.envPrefix ?? process.env.NITRO_ENV_PREFIX ?? "_",
|
|
@@ -28,8 +28,8 @@ export function useSilgiRuntimeConfig(event, inlineRuntimeConfig = {}) {
|
|
|
28
28
|
}
|
|
29
29
|
const silgi = tryUseSilgi();
|
|
30
30
|
if (!silgi) {
|
|
31
|
-
if (globalThis
|
|
32
|
-
inlineRuntimeConfig = globalThis
|
|
31
|
+
if (globalThis._silgi_runtime) {
|
|
32
|
+
inlineRuntimeConfig = globalThis._silgi_runtime;
|
|
33
33
|
if (inlineRuntimeConfig && !event) {
|
|
34
34
|
return inlineRuntimeConfig;
|
|
35
35
|
}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -544,11 +544,11 @@ interface CreateScope {
|
|
|
544
544
|
}
|
|
545
545
|
declare global {
|
|
546
546
|
var $silgiStatus: CommandType;
|
|
547
|
-
var
|
|
547
|
+
var _silgi_runtime: SilgiRuntimeOptions;
|
|
548
548
|
namespace NodeJS {
|
|
549
549
|
interface Global {
|
|
550
550
|
$silgiStatus: CommandType;
|
|
551
|
-
|
|
551
|
+
_silgi_runtime: SilgiRuntimeOptions;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
var __nitro__: {
|