silgi 0.9.7 → 0.9.9

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,4 +1,4 @@
1
- const version = "0.9.7";
1
+ const version = "0.9.9";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.3.0",
4
4
  "@nuxt/kit": "^3.15.4",
@@ -76,7 +76,7 @@ declare function resolveSilgiModule(base: string, paths: string[]): Promise<stri
76
76
  *
77
77
  * This mirrors the runtime behavior of Nitro.
78
78
  */
79
- declare function useSilgiRuntimeConfig(): Record<string, any>;
79
+ declare function useSilgiRuntimeConfig(): Record<string, any> | undefined;
80
80
 
81
81
  /**
82
82
  * Renders given template during build into the virtual file system (and optionally to disk in the project `buildDir`)
@@ -76,7 +76,7 @@ declare function resolveSilgiModule(base: string, paths: string[]): Promise<stri
76
76
  *
77
77
  * This mirrors the runtime behavior of Nitro.
78
78
  */
79
- declare function useSilgiRuntimeConfig(): Record<string, any>;
79
+ declare function useSilgiRuntimeConfig(): Record<string, any> | undefined;
80
80
 
81
81
  /**
82
82
  * Renders given template during build into the virtual file system (and optionally to disk in the project `buildDir`)
@@ -4,7 +4,7 @@ import consola, { consola as consola$1 } from 'consola';
4
4
  import { relative, resolve, dirname, normalize, isAbsolute, join, parse, basename } from 'pathe';
5
5
  import { colors } from 'consola/utils';
6
6
  import { getProperty } from 'dot-prop';
7
- import { useSilgi, tryUseSilgiCLI, useSilgiCLI } from 'silgi/core';
7
+ import { useSilgi, tryUseSilgiCLI, useSilgiCLI, tryUseSilgi } from 'silgi/core';
8
8
  import { defu } from 'defu';
9
9
  import { c as checkSilgiCompatibility } from '../cli/compatibility.mjs';
10
10
  import { existsSync, promises } from 'node:fs';
@@ -244,7 +244,10 @@ async function resolveSilgiModule(base, paths) {
244
244
  }
245
245
 
246
246
  function useSilgiRuntimeConfig() {
247
- const silgi = useSilgi();
247
+ const silgi = tryUseSilgi();
248
+ if (!silgi) {
249
+ return void 0;
250
+ }
248
251
  return applyEnv(klona(silgi.options.runtimeConfig), {
249
252
  prefix: "NITRO_",
250
253
  altPrefix: "NUXT_",
@@ -1,4 +1,4 @@
1
- const version = "0.9.7";
1
+ const version = "0.9.9";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.3.0",
4
4
  "@nuxt/kit": "^3.15.4",
@@ -1,4 +1,4 @@
1
- const version = "0.9.7";
1
+ const version = "0.9.9";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.3.0",
4
4
  "@nuxt/kit": "^3.15.4",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.9.7",
4
+ "version": "0.9.9",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {