silgi 0.9.17 → 0.9.18

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.17";
1
+ const version = "0.9.18";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.3.0",
4
4
  "@nuxt/kit": "^3.15.4",
@@ -627,12 +627,12 @@ async function silgiCoreFile(data, frameworkContext, silgi) {
627
627
  " modulesURIs,",
628
628
  ` plugins: [${plugins.join(", ")}],`,
629
629
  _data._silgiConfigs.length > 0 ? ` ${_data._silgiConfigs.map((config) => typeof config === "string" ? config : typeof config === "object" ? Object.entries(config).map(([key, value]) => `${key}: ${value}`).join(",\n ") : "").join(",\n ")},` : "",
630
+ " runtimeConfig: {},",
630
631
  " ...buildOptions,",
631
632
  " options: mergeDeep(",
632
633
  " moduleOptions || {},",
633
634
  " {",
634
635
  ` present: '${silgi.options.preset}',`,
635
- " runtimeConfig: {},",
636
636
  " ...cliOptions,",
637
637
  " },",
638
638
  " ) as any,",
@@ -503,6 +503,8 @@ async function createSilgi(config) {
503
503
  ready: () => {
504
504
  return hooks.callHook("ready", silgi);
505
505
  },
506
+ envOptions: config.envOptions ?? {},
507
+ runtimeConfig: config.runtimeConfig ?? {},
506
508
  close: () => hooks.callHook("close", silgi),
507
509
  logger: createConsola(defu(config.options?.consolaOptions ?? {}, {
508
510
  tag: "silgi"
@@ -248,12 +248,12 @@ function useSilgiRuntimeConfig() {
248
248
  if (!silgi) {
249
249
  return globalThis.$silgiSharedRuntimeConfig;
250
250
  }
251
- return applyEnv(klona(silgi.options.runtimeConfig), {
251
+ return applyEnv(klona(silgi.runtimeConfig), {
252
252
  prefix: "NITRO_",
253
253
  altPrefix: "NUXT_",
254
254
  silgiPrefix: "SILGI_",
255
255
  envExpansion: silgi.options.experimental?.envExpansion ?? !!process$1.env.NITRO_ENV_EXPANSION,
256
- ...silgi.options.envOptions
256
+ ...silgi.envOptions
257
257
  });
258
258
  }
259
259
  function getEnv(key, opts, env = process$1.env) {
@@ -1,4 +1,4 @@
1
- const version = "0.9.17";
1
+ const version = "0.9.18";
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.17";
1
+ const version = "0.9.18";
2
2
  const devDependencies = {
3
3
  "@antfu/eslint-config": "^4.3.0",
4
4
  "@nuxt/kit": "^3.15.4",
@@ -934,6 +934,10 @@ interface Silgi {
934
934
  close: () => Promise<void>;
935
935
  logger: ConsolaInstance;
936
936
  storage: Storage;
937
+ envOptions: EnvOptions;
938
+ runtimeConfig: SilgiRuntimeOptions & {
939
+ [key: string]: any;
940
+ };
937
941
  options: SilgiOptions & SilgiRuntimeOptions;
938
942
  captureError: CaptureError;
939
943
  }
@@ -957,10 +961,6 @@ type CaptureError = (error: Error, context: CapturedErrorContext) => void;
957
961
  interface SilgiOptions {
958
962
  consolaOptions?: Partial<ConsolaOptions>;
959
963
  present: PresetNameInput;
960
- envOptions: EnvOptions;
961
- runtimeConfig: SilgiRuntimeOptions & {
962
- [key: string]: any;
963
- };
964
964
  /**
965
965
  * Set to `true` to enable debug mode.
966
966
  *
@@ -934,6 +934,10 @@ interface Silgi {
934
934
  close: () => Promise<void>;
935
935
  logger: ConsolaInstance;
936
936
  storage: Storage;
937
+ envOptions: EnvOptions;
938
+ runtimeConfig: SilgiRuntimeOptions & {
939
+ [key: string]: any;
940
+ };
937
941
  options: SilgiOptions & SilgiRuntimeOptions;
938
942
  captureError: CaptureError;
939
943
  }
@@ -957,10 +961,6 @@ type CaptureError = (error: Error, context: CapturedErrorContext) => void;
957
961
  interface SilgiOptions {
958
962
  consolaOptions?: Partial<ConsolaOptions>;
959
963
  present: PresetNameInput;
960
- envOptions: EnvOptions;
961
- runtimeConfig: SilgiRuntimeOptions & {
962
- [key: string]: any;
963
- };
964
964
  /**
965
965
  * Set to `true` to enable debug mode.
966
966
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.9.17",
4
+ "version": "0.9.18",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {