silgi 0.27.9 → 0.27.11

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.27.9";
4
+ const version = "0.27.11";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -108,6 +108,11 @@ const command$1 = defineCommand({
108
108
  label: "Command Tags",
109
109
  hint: "It executes all commands that are related to the tags you select."
110
110
  }] : [],
111
+ {
112
+ value: "functions",
113
+ label: "Functions",
114
+ hint: "Select and run individual functions"
115
+ },
111
116
  ...Object.keys(cliJson).filter((key) => {
112
117
  const scripts = cliJson[key];
113
118
  const scriptValues = Object.values(scripts);
@@ -141,6 +146,42 @@ const command$1 = defineCommand({
141
146
  })).filter((script) => script.handler.tags?.includes(selectedTags));
142
147
  }
143
148
  ).flat();
149
+ } else if (commandName === "functions") {
150
+ const availableFunctions = [];
151
+ for (const cmd of Object.keys(cliJson)) {
152
+ const scripts = cliJson[cmd];
153
+ for (const scriptName of Object.keys(scripts)) {
154
+ const script = scripts[scriptName];
155
+ if (script.type === "function") {
156
+ availableFunctions.push({
157
+ command: cmd,
158
+ script: scriptName,
159
+ handler: script
160
+ });
161
+ }
162
+ }
163
+ }
164
+ if (availableFunctions.length === 0) {
165
+ consola.warn("No functions found in cli.json");
166
+ return;
167
+ }
168
+ const selectedFunction = await p.select({
169
+ message: "Select a function to run",
170
+ options: availableFunctions.map((fn) => ({
171
+ label: `${fn.command} \u2192 ${fn.script}`,
172
+ value: `${fn.command}:${fn.script}`,
173
+ hint: fn.handler.description || void 0
174
+ }))
175
+ });
176
+ if (!selectedFunction)
177
+ return;
178
+ const [selectedCmd, selectedScript] = selectedFunction.split(":");
179
+ const functionDef = cliJson[selectedCmd][selectedScript];
180
+ selectedCommands = [{
181
+ command: selectedCmd,
182
+ script: selectedScript,
183
+ handler: functionDef
184
+ }];
144
185
  } else {
145
186
  const scripts = cliJson[commandName];
146
187
  const scriptName = await p.select({
@@ -47,6 +47,7 @@ const SilgiCLIDefaults = {
47
47
  },
48
48
  serverDir: "{{ rootDir }}/server",
49
49
  clientDir: "{{ rootDir }}/client",
50
+ migrationDir: "{{ rootDir }}/migration",
50
51
  silgi: {
51
52
  serverDir: "{{ serverDir }}/silgi",
52
53
  clientDir: "{{ clientDir }}/silgi",
@@ -538,6 +538,9 @@ interface DefaultHooks {
538
538
  type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends Record<string, any> ? {
539
539
  [P in keyof T]?: DeepPartial<T[P]>;
540
540
  } : T;
541
+ type DeepRequired<T> = T extends (...args: any[]) => any ? T : T extends Record<string, any> ? {
542
+ [P in keyof T]-?: DeepRequired<T[P]>;
543
+ } : T;
541
544
  type Awaitable<T> = T | Promise<T>;
542
545
  interface CreateScope {
543
546
  execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>) => Promise<ExtractOutputFromURI<TURI>>;
@@ -617,6 +620,7 @@ interface SilgiCLIOptions extends PresetOptions {
617
620
  workspaceDir: string;
618
621
  rootDir: string;
619
622
  srcDir: string;
623
+ migrationDir: string;
620
624
  scanDirs: string[];
621
625
  build: {
622
626
  dir: string;
@@ -1171,4 +1175,4 @@ interface ServiceParseModule {
1171
1175
  (params: ServiceParse): Awaited<void> | void;
1172
1176
  }
1173
1177
 
1174
- export type { AllPaths, AppConfig, Awaitable, BaseNamespaceType, BaseSchemaType, BaseSilgiMethodType, CaptureError, CapturedErrorContext, CommandType, CreateScope, DeepPartial, DefaultHooks, DefaultNamespaces, DefaultRouteConfig, DefaultRouteRules, DotenvOptions, EnvOptions, EventHandlerResponse, ExtendContext, ExtendShared, ExtractInputFromURI, ExtractOutputFromURI, ExtractPathParams, ExtractPathParamsFromURI, ExtractQueryParamsFromURI, ExtractSourceFromURI, FrameworkContext, GenerateAppOptions, GraphQLJSON, HookResult, HttpMethod, ImportItem, LoadConfigOptions, MergedSilgiSchema, MethodHandlerType, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, Namespaces, NitroBuildInfo, PrepareCore, RequiredServiceType, ResolvedMethodHandlerType, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedServiceType, ResolvedSilgiTemplate, RouteRules, RouterParams, ScanFile, ServiceParse, ServiceParseModule, ServiceType, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIDynamicConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvents, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiFunction, SilgiHooks, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiNamespaces, SilgiOperation, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRouteRules, SilgiRouterTypes, SilgiRuntimeActions, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeRouteRules, SilgiRuntimeRouteRulesConfig, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiServiceInterface, SilgiStorageBase, SilgiTemplate, SilgiURIs, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, URIsTypes };
1178
+ export type { AllPaths, AppConfig, Awaitable, BaseNamespaceType, BaseSchemaType, BaseSilgiMethodType, CaptureError, CapturedErrorContext, CommandType, CreateScope, DeepPartial, DeepRequired, DefaultHooks, DefaultNamespaces, DefaultRouteConfig, DefaultRouteRules, DotenvOptions, EnvOptions, EventHandlerResponse, ExtendContext, ExtendShared, ExtractInputFromURI, ExtractOutputFromURI, ExtractPathParams, ExtractPathParamsFromURI, ExtractQueryParamsFromURI, ExtractSourceFromURI, FrameworkContext, GenerateAppOptions, GraphQLJSON, HookResult, HttpMethod, ImportItem, LoadConfigOptions, MergedSilgiSchema, MethodHandlerType, ModuleDefinition, ModuleHookContext, ModuleMeta, ModuleOptionsCustom, ModuleSetupInstallResult, ModuleSetupReturn, Namespaces, NitroBuildInfo, PrepareCore, RequiredServiceType, ResolvedMethodHandlerType, ResolvedModuleMeta, ResolvedModuleOptions, ResolvedServiceType, ResolvedSilgiTemplate, RouteRules, RouterParams, ScanFile, ServiceParse, ServiceParseModule, ServiceType, Silgi, SilgiAppPlugin, SilgiCLI, SilgiCLIConfig, SilgiCLIDynamicConfig, SilgiCLIHooks, SilgiCLIOptions, SilgiCommands, SilgiCompatibility, SilgiCompatibilityIssue, SilgiCompatibilityIssues, SilgiConfig, SilgiEvents, SilgiFetchClient, SilgiFetchOptions, SilgiFrameworkInfo, SilgiFunction, SilgiHooks, SilgiModule, SilgiModuleInput, SilgiModuleOptions, SilgiNamespaces, SilgiOperation, SilgiOptions, SilgiPreset, SilgiPresetMeta, SilgiRouteRules, SilgiRouterTypes, SilgiRuntimeActions, SilgiRuntimeConfig, SilgiRuntimeContext, SilgiRuntimeHooks, SilgiRuntimeMethods, SilgiRuntimeOptions, SilgiRuntimeRouteRules, SilgiRuntimeRouteRulesConfig, SilgiRuntimeShareds, SilgiRuntimeSharedsExtend, SilgiSchema, SilgiServiceInterface, SilgiStorageBase, SilgiTemplate, SilgiURIs, StorageConfig, StorageKeyGenerator, StorageKeyParams, StorageMounts, TSReference, TrimAfterFourSlashes, URIsTypes };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.27.9",
4
+ "version": "0.27.11",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -32,16 +32,16 @@
32
32
  "lib"
33
33
  ],
34
34
  "peerDependencies": {
35
- "@fastify/deepmerge": "^3.0.0",
36
- "@nuxt/kit": "^3.16.1",
37
- "@nuxt/schema": "^3.16.1",
38
- "@silgi/ecosystem": "^0.4.4",
39
- "h3": "^1.15.1",
40
- "nitropack": "^2.11.7",
41
- "nuxt": "^3.16.1",
42
- "typescript": "^5.8.2",
43
- "vue": "^3.5.13",
44
- "zod": "^3.24.2"
35
+ "@fastify/deepmerge": ">=3.0.0",
36
+ "@nuxt/kit": ">=3.16.1",
37
+ "@nuxt/schema": ">=3.16.1",
38
+ "@silgi/ecosystem": ">=0.4.4",
39
+ "h3": ">=1.15.1",
40
+ "nitropack": ">=2.11.7",
41
+ "nuxt": ">=3.16.1",
42
+ "typescript": ">=5.8.2",
43
+ "vue": ">=3.5.13",
44
+ "zod": ">=3.24.2"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "@nuxt/kit": {