silgi 0.38.15 → 0.38.17
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 +20 -2
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/types.mjs +1 -1
- package/dist/types/index.d.mts +8 -4
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -468,6 +468,19 @@ async function registerModuleExportScan(silgi) {
|
|
|
468
468
|
});
|
|
469
469
|
options.routeRules.push({ key: configKey, value: importName });
|
|
470
470
|
}
|
|
471
|
+
if (hasTypeExport("MetaData")) {
|
|
472
|
+
const importName = hash(`${configKey}MetaData`);
|
|
473
|
+
options.addImportItemType({
|
|
474
|
+
imports: [
|
|
475
|
+
{
|
|
476
|
+
as: importName,
|
|
477
|
+
name: "MetaData"
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
specifier
|
|
481
|
+
});
|
|
482
|
+
options.metaDatas.push({ key: configKey, value: importName });
|
|
483
|
+
}
|
|
471
484
|
}
|
|
472
485
|
});
|
|
473
486
|
}
|
|
@@ -1869,7 +1882,8 @@ async function prepareSchema(silgi) {
|
|
|
1869
1882
|
runtimeHooks: [],
|
|
1870
1883
|
runtimeOptions: [],
|
|
1871
1884
|
methods: [],
|
|
1872
|
-
routeRules: []
|
|
1885
|
+
routeRules: [],
|
|
1886
|
+
metaDatas: []
|
|
1873
1887
|
};
|
|
1874
1888
|
await silgi.callHook("before:schema.ts", data);
|
|
1875
1889
|
const silgiScanTS = relativeWithDot(silgi.options.build.typesDir, `${silgi.options.silgi.serverDir}/scan`);
|
|
@@ -1911,6 +1925,9 @@ async function prepareSchema(silgi) {
|
|
|
1911
1925
|
`type SilgiRuntimeOptionExtends = ${data.runtimeOptions?.length ? data.runtimeOptions.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
1912
1926
|
"",
|
|
1913
1927
|
`type RouteRulesExtend = ${data.routeRules?.length ? data.routeRules.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
1928
|
+
"",
|
|
1929
|
+
`type MetaDataExtend = ${data.metaDatas?.length ? data.metaDatas.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
1930
|
+
"",
|
|
1914
1931
|
silgi.options.typescript.generateRuntimeConfigTypes ? generateTypes(
|
|
1915
1932
|
await resolveSchema(
|
|
1916
1933
|
{
|
|
@@ -1969,7 +1986,8 @@ async function prepareSchema(silgi) {
|
|
|
1969
1986
|
SilgiRuntimeMethods: [{}, { extends: ["RuntimeMethodExtends"] }],
|
|
1970
1987
|
Routers: [{}, { extends: ["RoutersExtend"] }],
|
|
1971
1988
|
SilgiModuleOptions: [{}, { extends: ["SilgiModuleOptionExtend"] }],
|
|
1972
|
-
RouteRules: [{}, { extends: ["RouteRulesExtend"] }]
|
|
1989
|
+
RouteRules: [{}, { extends: ["RouteRulesExtend"] }],
|
|
1990
|
+
MetaData: [{}, { extends: ["MetaDataExtend"] }]
|
|
1973
1991
|
}).replace(/,\s*/g, "\n"),
|
|
1974
1992
|
"",
|
|
1975
1993
|
"export {}"
|
package/dist/cli/index.mjs
CHANGED
package/dist/cli/types.mjs
CHANGED
|
@@ -30,7 +30,7 @@ async function silgiGenerateType(silgi) {
|
|
|
30
30
|
);
|
|
31
31
|
const tsconfigDir = dirname(tsConfigPath);
|
|
32
32
|
const include = /* @__PURE__ */ new Set([
|
|
33
|
-
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi.d.ts")).replace(
|
|
33
|
+
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, ".silgi.d.ts")).replace(
|
|
34
34
|
/^(?=[^.])/,
|
|
35
35
|
"./"
|
|
36
36
|
),
|
package/dist/types/index.d.mts
CHANGED
|
@@ -448,7 +448,7 @@ interface SilgiCLI {
|
|
|
448
448
|
options: SilgiCLIOptions;
|
|
449
449
|
_requiredModules: Record<string, boolean>;
|
|
450
450
|
adapters: Record<string, Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>>>;
|
|
451
|
-
meta:
|
|
451
|
+
meta: MetaData;
|
|
452
452
|
}
|
|
453
453
|
interface SilgiFrameworkInfo {
|
|
454
454
|
name?: 'silgi' | (string & {});
|
|
@@ -694,13 +694,13 @@ interface SilgiOptions {
|
|
|
694
694
|
};
|
|
695
695
|
captureError: CaptureError;
|
|
696
696
|
adapters: Record<string, Adapter<Record<string, any>, TablesSchema, InferModelTypes<TablesSchema>>>;
|
|
697
|
-
meta:
|
|
697
|
+
meta: MetaData;
|
|
698
698
|
[key: string]: any;
|
|
699
699
|
}
|
|
700
700
|
|
|
701
701
|
type StandardHTTPMethod = 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE';
|
|
702
702
|
type HTTPMethod = SilgiRuntimeMethods extends Record<string, any> ? keyof SilgiRuntimeMethods | StandardHTTPMethod : StandardHTTPMethod;
|
|
703
|
-
interface
|
|
703
|
+
interface MetaData extends Record<string, unknown> {
|
|
704
704
|
}
|
|
705
705
|
interface SilgiRoute {
|
|
706
706
|
route: string;
|
|
@@ -884,6 +884,10 @@ interface SilgiCLIHooks extends SilgiHooks {
|
|
|
884
884
|
key: string;
|
|
885
885
|
value: string;
|
|
886
886
|
}[];
|
|
887
|
+
metaDatas: {
|
|
888
|
+
key: string;
|
|
889
|
+
value: string;
|
|
890
|
+
}[];
|
|
887
891
|
events: {
|
|
888
892
|
key: string;
|
|
889
893
|
value: string;
|
|
@@ -1222,4 +1226,4 @@ interface LoadConfigOptions {
|
|
|
1222
1226
|
consola?: ConsolaInstance;
|
|
1223
1227
|
}
|
|
1224
1228
|
|
|
1225
|
-
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,
|
|
1229
|
+
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, MetaData, 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, 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 };
|