silgi 0.35.5 → 0.35.6
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/build.mjs +1 -22
- package/dist/cli/index.mjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/types/index.d.mts +8 -5
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -137,21 +137,12 @@ async function prepareEnv(silgiConfig) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
async function emptyFramework(silgi) {
|
|
140
|
-
if (silgi.options.preset === "npm-package" || !silgi.options.preset)
|
|
141
|
-
silgi.hook("after:schema.ts", (data) => {
|
|
142
|
-
data.unshift("type FrameworkContextExtends = {}");
|
|
143
|
-
});
|
|
144
|
-
}
|
|
140
|
+
if (silgi.options.preset === "npm-package" || !silgi.options.preset) ;
|
|
145
141
|
}
|
|
146
142
|
|
|
147
143
|
async function h3Framework(silgi, skip = false) {
|
|
148
144
|
if (!isPresents(["h3"]) && skip === false)
|
|
149
145
|
return;
|
|
150
|
-
if (isPresents(["h3"])) {
|
|
151
|
-
silgi.hook("after:schema.ts", (data) => {
|
|
152
|
-
data.unshift("type FrameworkContextExtends = NitroApp");
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
146
|
silgi.hook("before:schema.ts", (data) => {
|
|
156
147
|
data.addImportItemType([
|
|
157
148
|
{
|
|
@@ -226,11 +217,6 @@ async function h3Framework(silgi, skip = false) {
|
|
|
226
217
|
async function nextJS(silgi, skip = false) {
|
|
227
218
|
if (!isPresents(["next"]) && skip === false)
|
|
228
219
|
return;
|
|
229
|
-
if (isPresents(["next"])) {
|
|
230
|
-
silgi.hook("after:schema.ts", (data) => {
|
|
231
|
-
data.unshift("type FrameworkContextExtends = {}");
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
220
|
const defaultConfig = {
|
|
235
221
|
serverExternalPackages: [
|
|
236
222
|
"mlly",
|
|
@@ -282,9 +268,6 @@ async function nitroFramework(silgi, skip = false) {
|
|
|
282
268
|
specifier: "nitropack/types"
|
|
283
269
|
});
|
|
284
270
|
});
|
|
285
|
-
silgi.hook("after:schema.ts", (data) => {
|
|
286
|
-
data.unshift("type FrameworkContextExtends = NitroApp");
|
|
287
|
-
});
|
|
288
271
|
silgi.options.plugins.push({
|
|
289
272
|
packageImport: "silgi/runtime/internal/nitro",
|
|
290
273
|
path: join(runtimeDir, "internal/nitro")
|
|
@@ -1080,9 +1063,6 @@ async function prepareScanFile(silgi) {
|
|
|
1080
1063
|
imports: [
|
|
1081
1064
|
{
|
|
1082
1065
|
name: "SilgiRuntimeOptions"
|
|
1083
|
-
},
|
|
1084
|
-
{
|
|
1085
|
-
name: "FrameworkContext"
|
|
1086
1066
|
}
|
|
1087
1067
|
]
|
|
1088
1068
|
}
|
|
@@ -1895,7 +1875,6 @@ async function prepareSchema(silgi) {
|
|
|
1895
1875
|
`type SilgiRuntimeHooksExtends = ${data.runtimeHooks?.length ? data.runtimeHooks.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
1896
1876
|
"",
|
|
1897
1877
|
genAugmentation("silgi/types", {
|
|
1898
|
-
FrameworkContext: [{}, { extends: ["FrameworkContextExtends"] }],
|
|
1899
1878
|
SilgiSchema: [{}, { extends: ["SchemaExtends"] }],
|
|
1900
1879
|
ServicesObject: [{}, { extends: ["BaseServices"] }],
|
|
1901
1880
|
SilgiStorageBase: [{}, { extends: ["SilgiStorageBaseExtends"] }],
|
package/dist/cli/index.mjs
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -265,7 +265,7 @@ async function createSilgi(config) {
|
|
|
265
265
|
services: config.services ?? {},
|
|
266
266
|
shared: config.shared ?? {},
|
|
267
267
|
plugins: config.plugins ?? [],
|
|
268
|
-
framework: config.framework ??
|
|
268
|
+
framework: config.framework ?? {},
|
|
269
269
|
storage: config.options.putStorage ?? void 0,
|
|
270
270
|
options: config.options ?? {},
|
|
271
271
|
hooks,
|
package/dist/types/index.d.mts
CHANGED
|
@@ -24,6 +24,7 @@ import { Storage, TransactionOptions, BuiltinDriverName, StorageValue } from 'un
|
|
|
24
24
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
25
25
|
import { ProviderName } from 'std-env';
|
|
26
26
|
import { ServerRequest } from 'srvx';
|
|
27
|
+
import { NitroApp } from 'nitropack';
|
|
27
28
|
import { RouterContext } from 'rou3';
|
|
28
29
|
import { silgiFetch } from 'silgi';
|
|
29
30
|
import { FetchOptions, FetchResponse } from 'ofetch';
|
|
@@ -999,8 +1000,6 @@ interface SilgiRuntimeSharedsExtend {
|
|
|
999
1000
|
interface ExtendShared {
|
|
1000
1001
|
}
|
|
1001
1002
|
|
|
1002
|
-
interface FrameworkContext {
|
|
1003
|
-
}
|
|
1004
1003
|
type StandardHTTPMethod = 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE';
|
|
1005
1004
|
type HTTPMethod = SilgiRuntimeMethods extends Record<string, any> ? keyof SilgiRuntimeMethods | StandardHTTPMethod : StandardHTTPMethod;
|
|
1006
1005
|
interface SilgiRoute {
|
|
@@ -1016,7 +1015,9 @@ interface Silgi {
|
|
|
1016
1015
|
services: ResolvedServiceDefinition;
|
|
1017
1016
|
shared: SilgiRuntimeShareds;
|
|
1018
1017
|
plugins: SilgiAppPlugin[];
|
|
1019
|
-
framework
|
|
1018
|
+
framework?: {
|
|
1019
|
+
nitro?: NitroApp;
|
|
1020
|
+
};
|
|
1020
1021
|
_ignore?: Ignore;
|
|
1021
1022
|
hooks: Hookable<SilgiRuntimeHooks & DefaultHooks>;
|
|
1022
1023
|
hook: Silgi['hooks']['hook'];
|
|
@@ -1034,7 +1035,9 @@ interface SilgiConfig extends Partial<Omit<Silgi, 'options'>>, Partial<SilgiRunt
|
|
|
1034
1035
|
options: DeepPartial<SilgiOptions>;
|
|
1035
1036
|
}
|
|
1036
1037
|
interface BuildSilgi {
|
|
1037
|
-
framework:
|
|
1038
|
+
framework: {
|
|
1039
|
+
nitro?: NitroApp;
|
|
1040
|
+
};
|
|
1038
1041
|
modules?: Partial<SilgiRuntimeOptions>;
|
|
1039
1042
|
options?: Partial<SilgiOptions>;
|
|
1040
1043
|
}
|
|
@@ -1188,4 +1191,4 @@ interface GraphQLJSON {
|
|
|
1188
1191
|
references: any;
|
|
1189
1192
|
}
|
|
1190
1193
|
|
|
1191
|
-
export type { AllPaths, AllPrefixes, AppConfig, Awaitable, BuildSilgi, CaptureError, CapturedErrorContext, CommandType, Commands, CustomRequestInit, DeepPartial, DeepRequired, DefaultHooks, DefineFrameworkOptions, DotenvOptions, EnvOptions, EventHandlerResponse, ExtendContext, ExtendShared, ExtractNamespace, ExtractPathParamKeys, ExtractPathParams, ExtractPrefix, ExtractRoute,
|
|
1194
|
+
export type { AllPaths, AllPrefixes, AppConfig, Awaitable, BuildSilgi, CaptureError, CapturedErrorContext, CommandType, Commands, CustomRequestInit, DeepPartial, DeepRequired, DefaultHooks, DefineFrameworkOptions, DotenvOptions, EnvOptions, EventHandlerResponse, ExtendContext, ExtendShared, ExtractNamespace, ExtractPathParamKeys, ExtractPathParams, ExtractPrefix, ExtractRoute, GenImport, GenerateAppOptions, GraphQLJSON, HTTPMethod, HookResult, HttpMethod, LoadConfigOptions, MergeAll, MergedSilgiSchema, MethodSchemas, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, NamespacesForPrefix, NitroBuildInfo, RequiredServiceType, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedSchema, ResolvedSchemaDefinition, ResolvedServiceDefinition, ResolvedSilgiTemplate, RouteConfig, RouterParams, Routers, RoutesForPrefixAndNamespace, ScanFile, Schema, ServiceHandler, ServiceHandlerInput, ServiceHandlerOutput, ServiceHandlerSource, ServiceMethods, ServiceSetup, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIDynamicConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvent, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiHooks, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRoute, SilgiRouterTypes, SilgiRuntimeActions, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiStorageBase, SilgiTemplate, SilgiURL, StandardHTTPMethod, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, WithPathParams };
|