silgi 0.24.12 → 0.24.14
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 +1 -1
- package/dist/cli/init.mjs +7 -2
- package/dist/types/index.d.mts +8 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/cli/init.mjs
CHANGED
|
@@ -39,14 +39,19 @@ const init = defineCommand({
|
|
|
39
39
|
];
|
|
40
40
|
if (framework === "nitro" || framework === "nuxt") {
|
|
41
41
|
const plugin = [
|
|
42
|
-
`import { buildSilgi } from '../silgi'`,
|
|
42
|
+
`import { buildSilgi } from '../silgi/core'`,
|
|
43
43
|
"",
|
|
44
44
|
"export default defineNitroPlugin(async (nitro) => {",
|
|
45
|
+
"if (!globalThis.__nitro__) {",
|
|
46
|
+
" globalThis.__nitro__ = {}",
|
|
47
|
+
"}",
|
|
48
|
+
"globalThis.__nitro__.useRuntimeConfig = useRuntimeConfig",
|
|
49
|
+
"",
|
|
45
50
|
" const _silgi = buildSilgi(",
|
|
46
51
|
" nitro,",
|
|
47
52
|
" {},",
|
|
48
53
|
" {",
|
|
49
|
-
"
|
|
54
|
+
" putStorage: useStorage(),",
|
|
50
55
|
" runtimeConfig: useRuntimeConfig(),",
|
|
51
56
|
" },",
|
|
52
57
|
" )",
|
package/dist/types/index.d.mts
CHANGED
|
@@ -8,6 +8,8 @@ import { TSConfig } from 'pkg-types';
|
|
|
8
8
|
import { PresetName, PresetOptions, PresetNameInput } from 'silgi/presets';
|
|
9
9
|
import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as SilgiRuntimeShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, RouteRules as RouteRules$1, ModuleMeta as ModuleMeta$1, SilgiModule as SilgiModule$1, SilgiRouteRules as SilgiRouteRules$1, DotenvOptions as DotenvOptions$1, EnvOptions as EnvOptions$1, SilgiRuntimeConfig as SilgiRuntimeConfig$1, ServiceParseModule as ServiceParseModule$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
|
|
10
10
|
import { UnimportPluginOptions } from 'unimport/unplugin';
|
|
11
|
+
import { H3Event } from 'h3';
|
|
12
|
+
import { NitroRuntimeConfig } from 'nitropack/types';
|
|
11
13
|
import { Defu } from 'defu';
|
|
12
14
|
import { Stats } from 'node:fs';
|
|
13
15
|
import { Unimport } from 'unimport';
|
|
@@ -548,6 +550,10 @@ declare global {
|
|
|
548
550
|
$silgiSharedRuntimeConfig: SilgiRuntimeOptions;
|
|
549
551
|
}
|
|
550
552
|
}
|
|
553
|
+
var __nitro__: {
|
|
554
|
+
useRuntimeConfig?: <T extends NitroRuntimeConfig = NitroRuntimeConfig>(event?: H3Event) => T;
|
|
555
|
+
[key: string]: any;
|
|
556
|
+
};
|
|
551
557
|
}
|
|
552
558
|
|
|
553
559
|
type SilgiPreset = SilgiCLIConfig | (() => SilgiCLIConfig);
|
|
@@ -585,6 +591,7 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
585
591
|
path: string;
|
|
586
592
|
packageImport: string;
|
|
587
593
|
}[];
|
|
594
|
+
baseURL: string;
|
|
588
595
|
compatibilityDate: CompatibilityDates;
|
|
589
596
|
modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
590
597
|
_modules: (SilgiModule<any> | string | [SilgiModule | string, Record<string, any>] | undefined | null | false)[];
|
|
@@ -815,7 +822,7 @@ type ExtractPathParams<T extends string> = T extends `${infer _Start}:${infer Pa
|
|
|
815
822
|
[K in Param]: string;
|
|
816
823
|
} & ExtractPathParams<Rest> : T extends `${infer _Start}:${infer Param}` ? {
|
|
817
824
|
[K in Param]: string;
|
|
818
|
-
} :
|
|
825
|
+
} : unknown;
|
|
819
826
|
|
|
820
827
|
type HttpMethod = 'get' | 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'head' | 'patch' | 'post' | 'put' | 'delete' | 'connect' | 'options' | 'trace';
|
|
821
828
|
type RouterParams<R extends AllPaths | (string & {})> = ExtractPathParams<R>;
|