silgi 0.38.0 → 0.38.1
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 +7 -7
- package/dist/cli/index.mjs +1 -1
- package/dist/types/index.d.mts +5 -5
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -429,18 +429,18 @@ async function registerModuleExportScan(silgi) {
|
|
|
429
429
|
});
|
|
430
430
|
options.runtimeHooks.push({ key: configKey, value: importName });
|
|
431
431
|
}
|
|
432
|
-
if (hasTypeExport("
|
|
433
|
-
const importName = hash(`${configKey}
|
|
432
|
+
if (hasTypeExport("SetupModuleOption")) {
|
|
433
|
+
const importName = hash(`${configKey}SetupModuleOption`);
|
|
434
434
|
options.addImportItemType({
|
|
435
435
|
imports: [
|
|
436
436
|
{
|
|
437
437
|
as: importName,
|
|
438
|
-
name: "
|
|
438
|
+
name: "SetupModuleOption"
|
|
439
439
|
}
|
|
440
440
|
],
|
|
441
441
|
specifier
|
|
442
442
|
});
|
|
443
|
-
options.
|
|
443
|
+
options.setupModuleOption.push({ key: configKey, value: importName });
|
|
444
444
|
}
|
|
445
445
|
if (hasTypeExport("ModuleRuntimeMethods")) {
|
|
446
446
|
const importName = hash(`${configKey}ModuleRuntimeMethods`);
|
|
@@ -1862,7 +1862,7 @@ async function prepareSchema(silgi) {
|
|
|
1862
1862
|
addImportItemType,
|
|
1863
1863
|
options: [],
|
|
1864
1864
|
contexts: [],
|
|
1865
|
-
|
|
1865
|
+
setupModuleOption: [],
|
|
1866
1866
|
shareds: [],
|
|
1867
1867
|
events: [],
|
|
1868
1868
|
hooks: [],
|
|
@@ -1900,7 +1900,7 @@ async function prepareSchema(silgi) {
|
|
|
1900
1900
|
}).join(",\n")}
|
|
1901
1901
|
}` : "interface SilgiModuleEventsExtends {}",
|
|
1902
1902
|
"",
|
|
1903
|
-
`type
|
|
1903
|
+
`type SetupModuleOptionExtend = ${data.setupModuleOption?.length ? data.setupModuleOption.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
1904
1904
|
"",
|
|
1905
1905
|
`type RuntimeMethodExtends = ${data.methods?.length ? data.methods.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
1906
1906
|
"",
|
|
@@ -1961,7 +1961,7 @@ async function prepareSchema(silgi) {
|
|
|
1961
1961
|
SilgiRuntimeContext: [{}, { extends: ["SilgiModuleContextExtends"] }],
|
|
1962
1962
|
SilgiEvent: [{}, { extends: ["SilgiModuleEventsExtends"] }],
|
|
1963
1963
|
SilgiRuntimeSharedsExtend: [{}, { extends: ["SilgiModuleSharedExtends"] }],
|
|
1964
|
-
|
|
1964
|
+
SetupModuleOption: [{}, { extends: ["SetupModuleOptionExtend"] }],
|
|
1965
1965
|
SilgiRuntimeOptions: [{}, { extends: ["SilgiRuntimeOptionExtends"] }],
|
|
1966
1966
|
SilgiRuntimeHooks: [{}, { extends: ["SilgiRuntimeHooksExtends"] }],
|
|
1967
1967
|
SilgiRuntimeConfig: [{}, { extends: ["SilgiRuntimeConfigExtends"] }],
|
package/dist/cli/index.mjs
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -357,7 +357,7 @@ type ServiceHandler<Schema extends SilgiSchema, Route extends keyof Schema, Meth
|
|
|
357
357
|
interface ServiceSetup<Schema extends SilgiSchema = SilgiSchema, Route extends keyof Schema = keyof Schema, Method extends keyof Schema[Route] = keyof Schema[Route], Resolved extends boolean = false, HiddenParameters extends boolean = false> {
|
|
358
358
|
handler: ServiceHandler<Schema, Route, Method, Resolved, HiddenParameters>;
|
|
359
359
|
rules?: RouteConfigService;
|
|
360
|
-
modules?: Partial<
|
|
360
|
+
modules?: Partial<SetupModuleOption>;
|
|
361
361
|
storage?: StorageConfig<ServiceHandlerInput<Schema, Route, Method, HiddenParameters>>;
|
|
362
362
|
}
|
|
363
363
|
/**
|
|
@@ -395,7 +395,7 @@ type MiddlewareHandler<Response extends EventHandlerResponse = EventHandlerRespo
|
|
|
395
395
|
interface MiddlewareSetup {
|
|
396
396
|
handler: MiddlewareHandler;
|
|
397
397
|
rules?: RouteRules;
|
|
398
|
-
modules?: Partial<
|
|
398
|
+
modules?: Partial<SetupModuleOption>;
|
|
399
399
|
storage?: StorageConfig;
|
|
400
400
|
}
|
|
401
401
|
type MiddlewareDefinition = MiddlewareSetup;
|
|
@@ -513,7 +513,7 @@ interface ResolvedSilgiTemplate<Options = TemplateDefaultOptions> extends SilgiT
|
|
|
513
513
|
modified?: boolean;
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
interface
|
|
516
|
+
interface SetupModuleOption {
|
|
517
517
|
}
|
|
518
518
|
interface SilgiModuleOptions {
|
|
519
519
|
}
|
|
@@ -873,7 +873,7 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
873
873
|
key: string;
|
|
874
874
|
value: string;
|
|
875
875
|
}[];
|
|
876
|
-
|
|
876
|
+
setupModuleOption: {
|
|
877
877
|
key: string;
|
|
878
878
|
value: string;
|
|
879
879
|
}[];
|
|
@@ -1229,4 +1229,4 @@ interface LoadConfigOptions {
|
|
|
1229
1229
|
consola?: ConsolaInstance;
|
|
1230
1230
|
}
|
|
1231
1231
|
|
|
1232
|
-
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, HTTPMethod, HookResult, HttpMethod, LoadConfigOptions, MergeAll, MergedSilgiSchema, MethodSchemas, MiddlewareDefinition, MiddlewareHandler, MiddlewareRoute, MiddlewareSetup, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, NamespacesForPrefix, NitroBuildInfo, RequiredServiceType, ResolvedMiddlewareDefinition, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedSchema, ResolvedSchemaDefinition, ResolvedServiceDefinition, ResolvedSilgiTemplate, RouteConfig, RouteConfigService, RouteRules, RouterParams, Routers, RoutesForPrefixAndNamespace, ScanFile, Schema, ServiceHandler, ServiceHandlerInput, ServiceHandlerOutput, ServiceHandlerSource, ServiceMethods, ServiceSetup, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvent, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiHooks, SilgiMeta, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRoute, SilgiRouterTypes,
|
|
1232
|
+
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, HTTPMethod, HookResult, HttpMethod, LoadConfigOptions, MergeAll, MergedSilgiSchema, MethodSchemas, MiddlewareDefinition, MiddlewareHandler, MiddlewareRoute, MiddlewareSetup, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, NamespacesForPrefix, NitroBuildInfo, RequiredServiceType, ResolvedMiddlewareDefinition, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedSchema, ResolvedSchemaDefinition, ResolvedServiceDefinition, ResolvedSilgiTemplate, RouteConfig, RouteConfigService, RouteRules, RouterParams, Routers, RoutesForPrefixAndNamespace, ScanFile, Schema, ServiceHandler, ServiceHandlerInput, ServiceHandlerOutput, ServiceHandlerSource, ServiceMethods, ServiceSetup, SetupModuleOption, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvent, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiHooks, SilgiMeta, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRoute, SilgiRouterTypes, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeDefaultConfig, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiStorageBase, SilgiTemplate, SilgiURL, StandardHTTPMethod, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, WithPathParams };
|