silgi 0.27.2 → 0.27.4

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.27.2";
4
+ const version = "0.27.4";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -1205,8 +1205,8 @@ async function readScanFile(silgi) {
1205
1205
  });
1206
1206
  try {
1207
1207
  if (silgi.options.commandType === "prepare") {
1208
- globalThis.$silgiSharedRuntimeConfig = silgi.options.runtimeConfig;
1209
- injectedResult.code = `globalThis.$silgiSharedRuntimeConfig = ${JSON.stringify(silgi.options.runtimeConfig)};
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,18 +28,15 @@ export function useSilgiRuntimeConfig(event, inlineRuntimeConfig = {}) {
28
28
  }
29
29
  const silgi = tryUseSilgi();
30
30
  if (!silgi) {
31
- if (globalThis.$silgiSharedRuntimeConfig) {
32
- inlineRuntimeConfig = globalThis.$silgiSharedRuntimeConfig;
33
- if (inlineRuntimeConfig && !event) {
34
- return inlineRuntimeConfig;
35
- }
31
+ if (!event) {
32
+ return _sharedRuntimeConfig;
33
+ }
34
+ if (globalThis._silgi_runtime) {
35
+ inlineRuntimeConfig = globalThis._silgi_runtime;
36
36
  }
37
37
  if (!_inlineSilgiRuntimeConfig) {
38
38
  _sharedRuntimeConfig = initRuntimeConfig(envOptions, inlineRuntimeConfig);
39
39
  }
40
- if (!event) {
41
- return _sharedRuntimeConfig;
42
- }
43
40
  const runtimeConfig2 = klona(_inlineSilgiRuntimeConfig);
44
41
  applyEnv(runtimeConfig2, envOptions);
45
42
  return runtimeConfig2;
@@ -544,11 +544,11 @@ interface CreateScope {
544
544
  }
545
545
  declare global {
546
546
  var $silgiStatus: CommandType;
547
- var $silgiSharedRuntimeConfig: SilgiRuntimeOptions;
547
+ var _silgi_runtime: SilgiRuntimeOptions;
548
548
  namespace NodeJS {
549
549
  interface Global {
550
550
  $silgiStatus: CommandType;
551
- $silgiSharedRuntimeConfig: SilgiRuntimeOptions;
551
+ _silgi_runtime: SilgiRuntimeOptions;
552
552
  }
553
553
  }
554
554
  var __nitro__: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.27.2",
4
+ "version": "0.27.4",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {