silgi 0.9.26 → 0.9.28

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,51 @@
1
- const version = "0.9.26";
1
+ const version = "0.9.28";
2
+ const peerDependencies = {
3
+ "@fastify/deepmerge": "^2.0.2",
4
+ "@nuxt/kit": "^3.15.3",
5
+ "@nuxt/schema": "^3.15.4",
6
+ h3: "^1.14.0",
7
+ nitropack: "^2.10.4",
8
+ nuxt: "^3.15.3",
9
+ typescript: "^5.7.3",
10
+ vue: "^3.5.13",
11
+ zod: "^3.24.1"
12
+ };
13
+ const dependencies = {
14
+ "@clack/prompts": "^0.10.0",
15
+ "@fastify/deepmerge": "^2.0.2",
16
+ "@oxc-parser/wasm": "^0.49.0",
17
+ "@standard-schema/spec": "^1.0.0",
18
+ c12: "^2.0.4",
19
+ chokidar: "^4.0.3",
20
+ citty: "^0.1.6",
21
+ compatx: "^0.1.8",
22
+ consola: "^3.4.0",
23
+ defu: "^6.1.4",
24
+ destr: "^2.0.3",
25
+ "dev-jiti": "^2.4.2",
26
+ "dot-prop": "^9.0.0",
27
+ dotenv: "^16.4.7",
28
+ "escape-string-regexp": "^5.0.0",
29
+ globby: "^14.1.0",
30
+ hookable: "^5.5.3",
31
+ ignore: "^7.0.3",
32
+ klona: "^2.0.6",
33
+ knitwork: "^1.2.0",
34
+ mlly: "^1.7.4",
35
+ ofetch: "^1.4.1",
36
+ ohash: "^1.1.4",
37
+ pathe: "^2.0.3",
38
+ picocolors: "^1.1.1",
39
+ "pkg-types": "^1.3.1",
40
+ scule: "^1.3.0",
41
+ semver: "^7.7.1",
42
+ "std-env": "^3.8.0",
43
+ ufo: "^1.5.4",
44
+ unctx: "^2.4.1",
45
+ unimport: "^4.1.2",
46
+ unstorage: "^1.15.0",
47
+ untyped: "^1.5.2"
48
+ };
2
49
  const devDependencies = {
3
50
  "@antfu/eslint-config": "^4.3.0",
4
51
  "@nuxt/kit": "^3.15.4",
@@ -19,4 +66,4 @@ const devDependencies = {
19
66
  const packageJson = {
20
67
  version: version};
21
68
 
22
- export { devDependencies as d, packageJson as p, version as v };
69
+ export { devDependencies as a, peerDependencies as b, dependencies as d, packageJson as p, version as v };
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import consola, { consola as consola$1 } from 'consola';
3
3
  import { resolve, isAbsolute, relative, join, dirname, basename, extname } from 'pathe';
4
- import { devDependencies, version } from 'silgi/meta';
4
+ import { peerDependencies, version } from 'silgi/meta';
5
5
  import { promises, existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
6
6
  import { readdir } from 'node:fs/promises';
7
7
  import { resolvePath, parseNodeModulePath, lookupNodeModuleSubpath, resolveModuleExportNames, resolve as resolve$1 } from 'mlly';
@@ -1750,7 +1750,7 @@ async function commands(silgi) {
1750
1750
  async function installPackages(silgi) {
1751
1751
  const packages = {
1752
1752
  dependencies: {
1753
- "@fastify/deepmerge": devDependencies["@fastify/deepmerge"],
1753
+ "@fastify/deepmerge": peerDependencies["@fastify/deepmerge"],
1754
1754
  ...silgi.options.installPackages?.dependencies
1755
1755
  },
1756
1756
  devDependencies: {
@@ -2,7 +2,7 @@ import { Buffer } from 'node:buffer';
2
2
  import * as consola from 'consola';
3
3
  import { ConsolaOptions } from 'consola';
4
4
  import * as silgi_types from 'silgi/types';
5
- import { ModuleOptionsCustom, ModuleDefinition, SilgiModule, SilgiCLI, SilgiPreset, SilgiPresetMeta, EnvOptions, SilgiTemplate, ResolvedSilgiTemplate } from 'silgi/types';
5
+ import { ModuleOptionsCustom, ModuleDefinition, SilgiModule, SilgiCLI, SilgiPreset, SilgiPresetMeta, EnvOptions, SilgiEvents, SilgiTemplate, ResolvedSilgiTemplate } from 'silgi/types';
6
6
 
7
7
  /**
8
8
  * Resolve a module from a given root path using an algorithm patterned on
@@ -83,7 +83,7 @@ declare function resolveSilgiModule(base: string, paths: string[]): Promise<stri
83
83
  *
84
84
  * This mirrors the runtime behavior of Nitro.
85
85
  */
86
- declare function useSilgiRuntimeConfig(): silgi_types.SilgiRuntimeOptions;
86
+ declare function useSilgiRuntimeConfig(event?: SilgiEvents): silgi_types.SilgiRuntimeOptions | undefined;
87
87
  declare function applyEnv(obj: Record<string, any>, opts: EnvOptions, parentKey?: string): Record<string, any>;
88
88
 
89
89
  /**
@@ -2,7 +2,7 @@ import { Buffer } from 'node:buffer';
2
2
  import * as consola from 'consola';
3
3
  import { ConsolaOptions } from 'consola';
4
4
  import * as silgi_types from 'silgi/types';
5
- import { ModuleOptionsCustom, ModuleDefinition, SilgiModule, SilgiCLI, SilgiPreset, SilgiPresetMeta, EnvOptions, SilgiTemplate, ResolvedSilgiTemplate } from 'silgi/types';
5
+ import { ModuleOptionsCustom, ModuleDefinition, SilgiModule, SilgiCLI, SilgiPreset, SilgiPresetMeta, EnvOptions, SilgiEvents, SilgiTemplate, ResolvedSilgiTemplate } from 'silgi/types';
6
6
 
7
7
  /**
8
8
  * Resolve a module from a given root path using an algorithm patterned on
@@ -83,7 +83,7 @@ declare function resolveSilgiModule(base: string, paths: string[]): Promise<stri
83
83
  *
84
84
  * This mirrors the runtime behavior of Nitro.
85
85
  */
86
- declare function useSilgiRuntimeConfig(): silgi_types.SilgiRuntimeOptions;
86
+ declare function useSilgiRuntimeConfig(event?: SilgiEvents): silgi_types.SilgiRuntimeOptions | undefined;
87
87
  declare function applyEnv(obj: Record<string, any>, opts: EnvOptions, parentKey?: string): Record<string, any>;
88
88
 
89
89
  /**
@@ -256,10 +256,26 @@ async function resolveSilgiModule(base, paths) {
256
256
  return resolved;
257
257
  }
258
258
 
259
- function useSilgiRuntimeConfig() {
259
+ const _inlineRuntimeConfig = process$1.env.RUNTIME_CONFIG;
260
+ const envOptions = {
261
+ prefix: "NITRO_",
262
+ altPrefix: _inlineRuntimeConfig?.nitro.envPrefix ?? process$1.env.NITRO_ENV_PREFIX ?? "_",
263
+ envExpansion: _inlineRuntimeConfig?.nitro.envExpansion ?? process$1.env.NITRO_ENV_EXPANSION ?? false
264
+ };
265
+ const _sharedRuntimeConfig = _deepFreeze(
266
+ applyEnv(klona(_inlineRuntimeConfig ?? {}), envOptions)
267
+ );
268
+ function useSilgiRuntimeConfig(event) {
260
269
  const silgi = tryUseSilgi();
261
270
  if (!silgi) {
262
- return globalThis.$silgiSharedRuntimeConfig;
271
+ const data = globalThis.$silgiSharedRuntimeConfig;
272
+ if (data) {
273
+ return data;
274
+ }
275
+ if (!event) {
276
+ return _sharedRuntimeConfig;
277
+ }
278
+ return;
263
279
  }
264
280
  return applyEnv(klona(silgi.runtimeConfig), {
265
281
  prefix: "NITRO_",
@@ -306,6 +322,16 @@ function _expandFromEnv(value, env = process$1.env) {
306
322
  return env[key] || match;
307
323
  });
308
324
  }
325
+ function _deepFreeze(object) {
326
+ const propNames = Object.getOwnPropertyNames(object);
327
+ for (const name of propNames) {
328
+ const value = object[name];
329
+ if (value && typeof value === "object") {
330
+ _deepFreeze(value);
331
+ }
332
+ }
333
+ return Object.freeze(object);
334
+ }
309
335
 
310
336
  const RELATIVE_RE = /^([^.])/;
311
337
  function relativeWithDot(from, to) {
@@ -1,4 +1,51 @@
1
- const version = "0.9.26";
1
+ const version = "0.9.28";
2
+ const peerDependencies = {
3
+ "@fastify/deepmerge": "^2.0.2",
4
+ "@nuxt/kit": "^3.15.3",
5
+ "@nuxt/schema": "^3.15.4",
6
+ h3: "^1.14.0",
7
+ nitropack: "^2.10.4",
8
+ nuxt: "^3.15.3",
9
+ typescript: "^5.7.3",
10
+ vue: "^3.5.13",
11
+ zod: "^3.24.1"
12
+ };
13
+ const dependencies = {
14
+ "@clack/prompts": "^0.10.0",
15
+ "@fastify/deepmerge": "^2.0.2",
16
+ "@oxc-parser/wasm": "^0.49.0",
17
+ "@standard-schema/spec": "^1.0.0",
18
+ c12: "^2.0.4",
19
+ chokidar: "^4.0.3",
20
+ citty: "^0.1.6",
21
+ compatx: "^0.1.8",
22
+ consola: "^3.4.0",
23
+ defu: "^6.1.4",
24
+ destr: "^2.0.3",
25
+ "dev-jiti": "^2.4.2",
26
+ "dot-prop": "^9.0.0",
27
+ dotenv: "^16.4.7",
28
+ "escape-string-regexp": "^5.0.0",
29
+ globby: "^14.1.0",
30
+ hookable: "^5.5.3",
31
+ ignore: "^7.0.3",
32
+ klona: "^2.0.6",
33
+ knitwork: "^1.2.0",
34
+ mlly: "^1.7.4",
35
+ ofetch: "^1.4.1",
36
+ ohash: "^1.1.4",
37
+ pathe: "^2.0.3",
38
+ picocolors: "^1.1.1",
39
+ "pkg-types": "^1.3.1",
40
+ scule: "^1.3.0",
41
+ semver: "^7.7.1",
42
+ "std-env": "^3.8.0",
43
+ ufo: "^1.5.4",
44
+ unctx: "^2.4.1",
45
+ unimport: "^4.1.2",
46
+ unstorage: "^1.15.0",
47
+ untyped: "^1.5.2"
48
+ };
2
49
  const devDependencies = {
3
50
  "@antfu/eslint-config": "^4.3.0",
4
51
  "@nuxt/kit": "^3.15.4",
@@ -17,4 +64,4 @@ const devDependencies = {
17
64
  zod: "^3.24.2"
18
65
  };
19
66
 
20
- export { devDependencies, version };
67
+ export { dependencies, devDependencies, peerDependencies, version };
@@ -1,4 +1,51 @@
1
- const version = "0.9.26";
1
+ const version = "0.9.28";
2
+ const peerDependencies = {
3
+ "@fastify/deepmerge": "^2.0.2",
4
+ "@nuxt/kit": "^3.15.3",
5
+ "@nuxt/schema": "^3.15.4",
6
+ h3: "^1.14.0",
7
+ nitropack: "^2.10.4",
8
+ nuxt: "^3.15.3",
9
+ typescript: "^5.7.3",
10
+ vue: "^3.5.13",
11
+ zod: "^3.24.1"
12
+ };
13
+ const dependencies = {
14
+ "@clack/prompts": "^0.10.0",
15
+ "@fastify/deepmerge": "^2.0.2",
16
+ "@oxc-parser/wasm": "^0.49.0",
17
+ "@standard-schema/spec": "^1.0.0",
18
+ c12: "^2.0.4",
19
+ chokidar: "^4.0.3",
20
+ citty: "^0.1.6",
21
+ compatx: "^0.1.8",
22
+ consola: "^3.4.0",
23
+ defu: "^6.1.4",
24
+ destr: "^2.0.3",
25
+ "dev-jiti": "^2.4.2",
26
+ "dot-prop": "^9.0.0",
27
+ dotenv: "^16.4.7",
28
+ "escape-string-regexp": "^5.0.0",
29
+ globby: "^14.1.0",
30
+ hookable: "^5.5.3",
31
+ ignore: "^7.0.3",
32
+ klona: "^2.0.6",
33
+ knitwork: "^1.2.0",
34
+ mlly: "^1.7.4",
35
+ ofetch: "^1.4.1",
36
+ ohash: "^1.1.4",
37
+ pathe: "^2.0.3",
38
+ picocolors: "^1.1.1",
39
+ "pkg-types": "^1.3.1",
40
+ scule: "^1.3.0",
41
+ semver: "^7.7.1",
42
+ "std-env": "^3.8.0",
43
+ ufo: "^1.5.4",
44
+ unctx: "^2.4.1",
45
+ unimport: "^4.1.2",
46
+ unstorage: "^1.15.0",
47
+ untyped: "^1.5.2"
48
+ };
2
49
  const devDependencies = {
3
50
  "@antfu/eslint-config": "^4.3.0",
4
51
  "@nuxt/kit": "^3.15.4",
@@ -17,4 +64,4 @@ const devDependencies = {
17
64
  zod: "^3.24.2"
18
65
  };
19
66
 
20
- export { devDependencies, version };
67
+ export { dependencies, devDependencies, peerDependencies, version };
@@ -1 +1 @@
1
- export { d as devDependencies, v as version } from '../_chunks/index.mjs';
1
+ export { d as dependencies, a as devDependencies, b as peerDependencies, v as version } from '../_chunks/index.mjs';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.9.26",
4
+ "version": "0.9.28",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {