silgi 0.7.11 → 0.7.13
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/_chunks/index.mjs +1 -1
- package/dist/cli/prepare.mjs +21 -1
- package/dist/cli/types.mjs +1 -7
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/types/index.d.mts +7 -3
- package/dist/types/index.d.ts +7 -3
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -476,7 +476,8 @@ async function schemaTemplate(silgi) {
|
|
|
476
476
|
storeBase: [],
|
|
477
477
|
hooks: [],
|
|
478
478
|
runtimeHooks: [],
|
|
479
|
-
runtimeOptions: []
|
|
479
|
+
runtimeOptions: [],
|
|
480
|
+
methods: []
|
|
480
481
|
};
|
|
481
482
|
const storeBase = [];
|
|
482
483
|
await silgi.callHook("prepare:schema.ts", data);
|
|
@@ -513,6 +514,8 @@ async function schemaTemplate(silgi) {
|
|
|
513
514
|
"",
|
|
514
515
|
`type RuntimeActionExtends = ${data.actions?.length ? data.actions.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
515
516
|
"",
|
|
517
|
+
`type RuntimeMethodExtends = ${data.methods?.length ? data.methods.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
518
|
+
"",
|
|
516
519
|
`type SilgiModuleSharedExtends = ${data.shareds.length ? data.shareds.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
517
520
|
"",
|
|
518
521
|
`type SilgiModuleOptionExtend = ${data.options?.length ? data.options.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
|
|
@@ -541,6 +544,7 @@ async function schemaTemplate(silgi) {
|
|
|
541
544
|
" interface SilgiRuntimeOptions extends SilgiRuntimeOptionExtends {}",
|
|
542
545
|
" interface SilgiRuntimeHooks extends SilgiRuntimeHooksExtends {}",
|
|
543
546
|
" interface SilgiHooks extends ModuleHooksExtend {}",
|
|
547
|
+
" interface SilgiRuntimeMethods extends RuntimeMethodExtends {}",
|
|
544
548
|
"}",
|
|
545
549
|
"",
|
|
546
550
|
"export {}"
|
|
@@ -888,6 +892,22 @@ async function registerModuleExportScan(silgi) {
|
|
|
888
892
|
});
|
|
889
893
|
options.runtimeHooks.push({ key: configKey, value: importName });
|
|
890
894
|
}
|
|
895
|
+
if (exportedTypes.includes("ModuleRuntimeOptions")) {
|
|
896
|
+
const importName = pascalCase(`${configKey}RuntimeOptions`);
|
|
897
|
+
options.importItems[configKey].import.push({
|
|
898
|
+
name: `ModuleRuntimeOptions as ${importName}`,
|
|
899
|
+
type: true
|
|
900
|
+
});
|
|
901
|
+
options.runtimeOptions.push({ key: configKey, value: importName });
|
|
902
|
+
}
|
|
903
|
+
if (exportedTypes.includes("SilgiRuntimeMethods")) {
|
|
904
|
+
const importName = pascalCase(`${configKey}RuntimeMethods`);
|
|
905
|
+
options.importItems[configKey].import.push({
|
|
906
|
+
name: `SilgiRuntimeMethods as ${importName}`,
|
|
907
|
+
type: true
|
|
908
|
+
});
|
|
909
|
+
options.methods.push({ key: configKey, value: importName });
|
|
910
|
+
}
|
|
891
911
|
}
|
|
892
912
|
}
|
|
893
913
|
});
|
package/dist/cli/types.mjs
CHANGED
|
@@ -314,12 +314,6 @@ async function resolvePathOptions(options) {
|
|
|
314
314
|
"silgi/runtime/*": join(runtimeDir, "*"),
|
|
315
315
|
"#internal/silgi/*": join(runtimeDir, "*")
|
|
316
316
|
};
|
|
317
|
-
options.typescript.customConditions = [
|
|
318
|
-
...options.typescript.customConditions,
|
|
319
|
-
"silgiTypes"
|
|
320
|
-
];
|
|
321
|
-
options.conditions ||= [];
|
|
322
|
-
options.conditions.push("silgi");
|
|
323
317
|
}
|
|
324
318
|
options.alias = {
|
|
325
319
|
...options.alias,
|
|
@@ -625,7 +619,7 @@ async function silgiGenerateType(silgi) {
|
|
|
625
619
|
jsxFactory: "h",
|
|
626
620
|
jsxFragmentFactory: "Fragment",
|
|
627
621
|
allowImportingTsExtensions: true,
|
|
628
|
-
|
|
622
|
+
customConditions: silgi.options.typescript.customConditions,
|
|
629
623
|
paths: {
|
|
630
624
|
"#silgiImports": [
|
|
631
625
|
relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi-imports"))
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -68,7 +68,7 @@ type ExtractInputFromURI<TURI extends keyof SilgiURIs> = GetInput<ExtractPath<TU
|
|
|
68
68
|
type ExtractOutputFromURI<TURI extends keyof SilgiURIs> = GetOutput<ExtractPath<TURI>>;
|
|
69
69
|
type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<ExtractPath<TURI>>;
|
|
70
70
|
|
|
71
|
-
interface
|
|
71
|
+
interface SilgiRuntimeMethods {
|
|
72
72
|
}
|
|
73
73
|
interface SilgiNamespaces {
|
|
74
74
|
}
|
|
@@ -76,7 +76,7 @@ interface DefaultNamespaces extends SilgiNamespaces {
|
|
|
76
76
|
}
|
|
77
77
|
interface SilgiRouterTypes {
|
|
78
78
|
}
|
|
79
|
-
type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof
|
|
79
|
+
type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof SilgiRuntimeMethods | (string & {});
|
|
80
80
|
interface DefaultHooks {
|
|
81
81
|
}
|
|
82
82
|
type DeepPartial<T> = T extends void ? T : T extends Record<string, any> ? {
|
|
@@ -221,6 +221,10 @@ interface SchemaPreparationOptions extends ImportItem {
|
|
|
221
221
|
key: string;
|
|
222
222
|
value: string;
|
|
223
223
|
}[];
|
|
224
|
+
methods: {
|
|
225
|
+
key: string;
|
|
226
|
+
value: string;
|
|
227
|
+
}[];
|
|
224
228
|
contexts: {
|
|
225
229
|
key: string;
|
|
226
230
|
value: string;
|
|
@@ -934,4 +938,4 @@ type Namespaces<T extends BaseNamespaceType> = {
|
|
|
934
938
|
|
|
935
939
|
declare const autoImportTypes: string[];
|
|
936
940
|
|
|
937
|
-
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleRuntimeShared, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type
|
|
941
|
+
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleRuntimeShared, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiSchema, type SilgiServiceInterface, type SilgiShareds, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ type ExtractInputFromURI<TURI extends keyof SilgiURIs> = GetInput<ExtractPath<TU
|
|
|
68
68
|
type ExtractOutputFromURI<TURI extends keyof SilgiURIs> = GetOutput<ExtractPath<TURI>>;
|
|
69
69
|
type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<ExtractPath<TURI>>;
|
|
70
70
|
|
|
71
|
-
interface
|
|
71
|
+
interface SilgiRuntimeMethods {
|
|
72
72
|
}
|
|
73
73
|
interface SilgiNamespaces {
|
|
74
74
|
}
|
|
@@ -76,7 +76,7 @@ interface DefaultNamespaces extends SilgiNamespaces {
|
|
|
76
76
|
}
|
|
77
77
|
interface SilgiRouterTypes {
|
|
78
78
|
}
|
|
79
|
-
type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof
|
|
79
|
+
type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof SilgiRuntimeMethods | (string & {});
|
|
80
80
|
interface DefaultHooks {
|
|
81
81
|
}
|
|
82
82
|
type DeepPartial<T> = T extends void ? T : T extends Record<string, any> ? {
|
|
@@ -221,6 +221,10 @@ interface SchemaPreparationOptions extends ImportItem {
|
|
|
221
221
|
key: string;
|
|
222
222
|
value: string;
|
|
223
223
|
}[];
|
|
224
|
+
methods: {
|
|
225
|
+
key: string;
|
|
226
|
+
value: string;
|
|
227
|
+
}[];
|
|
224
228
|
contexts: {
|
|
225
229
|
key: string;
|
|
226
230
|
value: string;
|
|
@@ -934,4 +938,4 @@ type Namespaces<T extends BaseNamespaceType> = {
|
|
|
934
938
|
|
|
935
939
|
declare const autoImportTypes: string[];
|
|
936
940
|
|
|
937
|
-
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleRuntimeShared, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type
|
|
941
|
+
export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleRuntimeShared, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiSchema, type SilgiServiceInterface, type SilgiShareds, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
|