silgi 0.4.3 → 0.4.4

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,6 +1,6 @@
1
1
  const name = "silgi";
2
2
  const type = "module";
3
- const version = "0.4.3";
3
+ const version = "0.4.4";
4
4
  const packageManager = "pnpm@9.15.1";
5
5
  const sideEffects = false;
6
6
  const exports = {
@@ -92,7 +92,7 @@ const files = [
92
92
  ];
93
93
  const scripts = {
94
94
  build: "pnpm gen-presets && pnpm build:package && pnpm --filter './modules/*' generate && pnpm build:module",
95
- "build:prepare": "pnpm gen-presets && pnpm build:package && pnpm --filter './modules/*' generate && pnpm build:prepare",
95
+ "build:prepare": "pnpm build:stub && pnpm --filter './modules/*' silgi:prepare",
96
96
  "build:package": "unbuild",
97
97
  "build:module": "pnpm --filter '@silgi/*' build",
98
98
  "build:stub": "pnpm gen-presets && unbuild --stub && pnpm --filter './modules/*' build:stub && pnpm --filter './module-builder' build:stub",
@@ -33,6 +33,11 @@ import 'unctx';
33
33
  async function h3Framework(silgi, skip = false) {
34
34
  if (silgi.options.preset !== "h3" && skip === false)
35
35
  return;
36
+ if (silgi.options.preset === "h3") {
37
+ silgi.hook("after:prepare:schema.ts", (data) => {
38
+ data.unshift("type FrameworkContextExtends = NitroApp");
39
+ });
40
+ }
36
41
  silgi.hook("prepare:schema.ts", (data) => {
37
42
  data.importItems.nitropack = {
38
43
  import: [
@@ -53,9 +58,6 @@ async function h3Framework(silgi, skip = false) {
53
58
  isSilgiContext: false
54
59
  });
55
60
  });
56
- silgi.hook("after:prepare:schema.ts", (data) => {
57
- data.unshift("type FrameworkContextExtends = NitroApp");
58
- });
59
61
  silgi.hook("prepare:createDTSFramework", (data) => {
60
62
  data.importItems["silgi/types"] = {
61
63
  import: [
@@ -104,9 +106,6 @@ const frameworkSetup = [h3Framework, nitroFramework, nuxtFramework];
104
106
 
105
107
  async function prepare$1(silgi) {
106
108
  await prepareDir(silgi.options.output.dir);
107
- if (!silgi.options.static) {
108
- await prepareDir(silgi.options.output.serverDir);
109
- }
110
109
  }
111
110
  async function prepareDir(dir) {
112
111
  await fsp.rm(dir, { recursive: true, force: true });
@@ -254,7 +253,7 @@ async function generateRouterDTS(silgi) {
254
253
  const tag = "srn";
255
254
  const groupedRoutes = Object.entries(uris || {}).reduce((acc, [key, _value]) => {
256
255
  const [service, resource, method, action] = key.split("/");
257
- const routePath = `${tag}/${service}/${resource}/${action}`;
256
+ const routePath = `${tag}/${service}/${resource}/${action}/${_value}`;
258
257
  if (!acc[routePath]) {
259
258
  acc[routePath] = {};
260
259
  }
@@ -309,12 +308,6 @@ async function createCoreFramework(silgi) {
309
308
  if (silgi.options.preset !== "nitro" && silgi.options.preset !== "h3")
310
309
  return;
311
310
  const importItems = {
312
- "silgi": {
313
- import: [
314
- { name: "useSilgi" }
315
- ],
316
- from: "silgi"
317
- },
318
311
  "silgi/types": {
319
312
  import: [
320
313
  { name: "SilgiModuleContext", type: true }
@@ -342,11 +335,12 @@ async function createCoreFramework(silgi) {
342
335
  functions
343
336
  });
344
337
  const content = [
345
- ...functions.map((f) => ` ${f}(framework)`)
338
+ ...functions.map((f) => ` await ${f}(framework)`)
346
339
  ];
347
340
  return {
348
341
  content,
349
- importItems
342
+ importItems,
343
+ customImports
350
344
  };
351
345
  }
352
346
  async function createDTSFramework(silgi) {
@@ -503,9 +497,9 @@ async function schemaTemplate(silgi) {
503
497
  return importData;
504
498
  }
505
499
 
506
- async function silgiCoreFile(_importItems, frameworkContext, silgi) {
500
+ async function silgiCoreFile(data, frameworkContext, silgi) {
507
501
  const relativeRootDir = relativeWithDot(silgi.options.rootDir, silgi.options.serverDir);
508
- const importItems = {
502
+ let importItems = {
509
503
  "silgi/core": {
510
504
  import: [
511
505
  { name: "createSilgi" }
@@ -521,7 +515,7 @@ async function silgiCoreFile(_importItems, frameworkContext, silgi) {
521
515
  from: "silgi/types"
522
516
  }
523
517
  };
524
- _importItems = { ..._importItems, ...importItems };
518
+ importItems = { ...data._importItems, ...importItems };
525
519
  await Promise.all([...silgi.options.modules, ...silgi.options._modules].map(async (id) => {
526
520
  if (typeof id !== "string") {
527
521
  return;
@@ -534,7 +528,7 @@ async function silgiCoreFile(_importItems, frameworkContext, silgi) {
534
528
  importItems[pkg.name].from = isAbsolute(id) ? relativeWithDot(relativeRootDir, id) : id;
535
529
  }
536
530
  }));
537
- const customImports = [];
531
+ const customImports = data._customImports || [];
538
532
  const uris = [];
539
533
  const services = [];
540
534
  const shareds = [];
@@ -594,7 +588,6 @@ async function silgiCoreFile(_importItems, frameworkContext, silgi) {
594
588
  }),
595
589
  shareds.length > 0 ? "])" : "}",
596
590
  "",
597
- "export const silgiOptions: Partial<SilgiOptions> = {}",
598
591
  "",
599
592
  "export async function buildSilgi(framework: FrameworkContext, options?: Partial<SilgiModuleOptions>) {",
600
593
  " const silgi = await createSilgi({",
@@ -607,7 +600,6 @@ async function silgiCoreFile(_importItems, frameworkContext, silgi) {
607
600
  ` plugins: [${plugins.join(", ")}],`,
608
601
  "",
609
602
  " options: {",
610
- " ...silgiOptions,",
611
603
  " ...options,",
612
604
  " },",
613
605
  " })",
@@ -635,7 +627,10 @@ async function writeTypesAndFiles(silgi) {
635
627
  opts.references.push({ path: "./framework.d.ts" });
636
628
  });
637
629
  const schemaContent = await schemaTemplate(silgi);
638
- const coreContent = await silgiCoreFile(data?.importItems ?? {}, data?.content ?? [], silgi);
630
+ const coreContent = await silgiCoreFile({
631
+ _importItems: data?.importItems ?? {},
632
+ _customImports: data?.customImports ?? []
633
+ }, data?.content ?? [], silgi);
639
634
  const frameworkDTS = await createDTSFramework(silgi);
640
635
  const { declarations, tsConfig } = await silgiGenerateType(silgi);
641
636
  const tsConfigPath = resolve(
@@ -814,7 +809,7 @@ function moduleScanHooks(silgi) {
814
809
  let importName;
815
810
  options.importItems[module.meta.configKey] = {
816
811
  import: [],
817
- from: module.meta._packageName
812
+ from: module.meta.name || module.meta._packageName
818
813
  };
819
814
  if (exports.interface.config) {
820
815
  importName = pascalCase(`${module.meta.configKey}Config`);
@@ -1,4 +1,4 @@
1
- import { SilgiCLIConfig, LoadConfigOptions, SilgiCLIOptions, SilgiCLI, SilgiConfig, Silgi, SilgiRouterTypes, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, SilgiModuleShared, DefaultNamespaces, BaseSchemaType } from 'silgi/types';
1
+ import { SilgiCLIConfig, LoadConfigOptions, SilgiCLIOptions, SilgiCLI, SilgiConfig, Silgi, SilgiRouterTypes, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, SilgiModuleShared, SilgiEvent, DefaultNamespaces, BaseSchemaType } from 'silgi/types';
2
2
  import { TSConfig } from 'pkg-types';
3
3
  import { FetchOptions } from 'ofetch';
4
4
  export { c as createStorage, s as silgi } from '../shared/silgi.40ZJYm8F.mjs';
@@ -14,28 +14,49 @@ declare function silgiGenerateType(silgi: SilgiCLI): Promise<{
14
14
 
15
15
  declare function createSilgi(config: SilgiConfig): Promise<Silgi>;
16
16
 
17
- type FetchResponseData<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
18
- output: any;
19
- } ? SilgiRouterTypes[Route][Method]['output'] : never;
20
- type RequestBodyOption<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
21
- input: any;
17
+ type StaticRoutes = keyof SilgiRouterTypes;
18
+ type ExtractStaticPath<T extends string> = T extends `${infer Start}/:${string}` ? Start : T;
19
+ type RouteWithParams<T extends string> = T | `${T}/${string}`;
20
+ type ValidRoute = StaticRoutes | RouteWithParams<ExtractStaticPath<StaticRoutes & string>>;
21
+ type FindMatchingRoute<T extends string> = {
22
+ [K in StaticRoutes]: ExtractStaticPath<K & string> extends never ? never : T extends `${ExtractStaticPath<K & string>}${string}` ? K : never;
23
+ }[StaticRoutes];
24
+ type Method<R extends ValidRoute> = R extends StaticRoutes ? keyof SilgiRouterTypes[R] : keyof SilgiRouterTypes[FindMatchingRoute<R & string>];
25
+ type DefaultMethodType = 'get' | 'post' | 'put' | 'delete';
26
+ type FetchResponseData<R extends ValidRoute, M extends Method<R>> = R extends StaticRoutes ? SilgiRouterTypes[R][M & keyof SilgiRouterTypes[R]]['output'] : SilgiRouterTypes[FindMatchingRoute<R & string>][M & keyof SilgiRouterTypes[FindMatchingRoute<R & string>]]['output'];
27
+ type RequestBodyOption<R extends ValidRoute, M extends Method<R>> = R extends StaticRoutes ? SilgiRouterTypes[R][M & keyof SilgiRouterTypes[R]] extends {
28
+ input: infer I;
22
29
  } ? {
23
- body: SilgiRouterTypes[Route][Method]['input'];
30
+ body: I;
31
+ } : {
32
+ body?: never;
33
+ } : SilgiRouterTypes[FindMatchingRoute<R & string>][M & keyof SilgiRouterTypes[FindMatchingRoute<R & string>]] extends {
34
+ input: infer I;
35
+ } ? {
36
+ body: I;
24
37
  } : {
25
38
  body?: never;
26
39
  };
27
- type RouterParams<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
28
- params: any;
40
+ type ExtractParams<T extends string> = T extends `${string}:${infer Param}/${infer Rest}` ? {
41
+ [K in Param]: string;
42
+ } & ExtractParams<Rest> : T extends `${string}:${infer Param}` ? {
43
+ [K in Param]: string;
44
+ } : object;
45
+ type RouterParams<R extends ValidRoute, M extends Method<R>> = R extends StaticRoutes ? SilgiRouterTypes[R][M & keyof SilgiRouterTypes[R]] extends {
46
+ params: infer P;
29
47
  } ? {
30
- params?: SilgiRouterTypes[Route][Method]['params'];
48
+ params: P;
49
+ } : R extends `${string}:${string}` ? {
50
+ params: ExtractParams<R>;
31
51
  } : {
32
52
  params?: never;
53
+ } : {
54
+ params: ExtractParams<FindMatchingRoute<R & string>>;
33
55
  };
34
- type DefaultMethod<Route extends keyof SilgiRouterTypes> = keyof SilgiRouterTypes[Route];
35
- type SilgiFetchOptions<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>> = {
36
- method?: Method;
37
- } & RequestBodyOption<Route, Method> & RouterParams<Route, Method> & Omit<FetchOptions, 'query' | 'body' | 'method'>;
38
- type SilgiFetchClient = <Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>, ResT = FetchResponseData<Route, Method>>(url: Route, options?: SilgiFetchOptions<Route, Method>) => Promise<ResT>;
56
+ type SilgiFetchOptions<R extends ValidRoute, M extends Method<R>> = {
57
+ method: M;
58
+ } & RequestBodyOption<R, M> & RouterParams<R, M> & Omit<FetchOptions, 'query' | 'body' | 'method'>;
59
+ type SilgiFetchClient = <R extends ValidRoute, M extends Method<R> | DefaultMethodType = 'get'>(url: R, options: SilgiFetchOptions<R, M extends Method<R> ? M : Extract<Method<R>, DefaultMethodType>>) => Promise<FetchResponseData<R, M extends Method<R> ? M : Extract<Method<R>, DefaultMethodType>>>;
39
60
  declare function createSilgiFetch(options: FetchOptions | ((options: FetchOptions) => FetchOptions), localFetch?: typeof globalThis.$fetch): SilgiFetchClient;
40
61
 
41
62
  interface Options {
@@ -80,6 +101,8 @@ declare function mergeSchemas<T extends MergedSilgiSchema[]>(typesOrArray: [...T
80
101
  declare function mergeServices<T extends ServiceType<SilgiSchema>[]>(servicesOrArray: [...T] | T): RequiredServiceType<SilgiSchema>;
81
102
  declare function mergeShared<T extends SilgiModuleShared[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
82
103
 
104
+ declare function getEvent<T>(event?: SilgiEvent): T;
105
+
83
106
  declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces, Record<string, BaseSchemaType<StandardSchemaV1>>>>>(silgiType: T): {
84
107
  [K in keyof T]: {
85
108
  [P in keyof T[K]]: T[K][P];
@@ -133,4 +156,4 @@ declare class SilgiError extends Error {
133
156
 
134
157
  declare function useSilgi(): Silgi;
135
158
 
136
- export { SchemaParser, SilgiError, createSchema, createService, createShared, createSilgi, createSilgiFetch, loadOptions, mergeSchemas, mergeServices, mergeShared, parseURI, silgiGenerateType, useSilgi };
159
+ export { SchemaParser, SilgiError, createSchema, createService, createShared, createSilgi, createSilgiFetch, getEvent, loadOptions, mergeSchemas, mergeServices, mergeShared, parseURI, silgiGenerateType, useSilgi };
@@ -1,4 +1,4 @@
1
- import { SilgiCLIConfig, LoadConfigOptions, SilgiCLIOptions, SilgiCLI, SilgiConfig, Silgi, SilgiRouterTypes, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, SilgiModuleShared, DefaultNamespaces, BaseSchemaType } from 'silgi/types';
1
+ import { SilgiCLIConfig, LoadConfigOptions, SilgiCLIOptions, SilgiCLI, SilgiConfig, Silgi, SilgiRouterTypes, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, SilgiModuleShared, SilgiEvent, DefaultNamespaces, BaseSchemaType } from 'silgi/types';
2
2
  import { TSConfig } from 'pkg-types';
3
3
  import { FetchOptions } from 'ofetch';
4
4
  export { c as createStorage, s as silgi } from '../shared/silgi.40ZJYm8F.js';
@@ -14,28 +14,49 @@ declare function silgiGenerateType(silgi: SilgiCLI): Promise<{
14
14
 
15
15
  declare function createSilgi(config: SilgiConfig): Promise<Silgi>;
16
16
 
17
- type FetchResponseData<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
18
- output: any;
19
- } ? SilgiRouterTypes[Route][Method]['output'] : never;
20
- type RequestBodyOption<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
21
- input: any;
17
+ type StaticRoutes = keyof SilgiRouterTypes;
18
+ type ExtractStaticPath<T extends string> = T extends `${infer Start}/:${string}` ? Start : T;
19
+ type RouteWithParams<T extends string> = T | `${T}/${string}`;
20
+ type ValidRoute = StaticRoutes | RouteWithParams<ExtractStaticPath<StaticRoutes & string>>;
21
+ type FindMatchingRoute<T extends string> = {
22
+ [K in StaticRoutes]: ExtractStaticPath<K & string> extends never ? never : T extends `${ExtractStaticPath<K & string>}${string}` ? K : never;
23
+ }[StaticRoutes];
24
+ type Method<R extends ValidRoute> = R extends StaticRoutes ? keyof SilgiRouterTypes[R] : keyof SilgiRouterTypes[FindMatchingRoute<R & string>];
25
+ type DefaultMethodType = 'get' | 'post' | 'put' | 'delete';
26
+ type FetchResponseData<R extends ValidRoute, M extends Method<R>> = R extends StaticRoutes ? SilgiRouterTypes[R][M & keyof SilgiRouterTypes[R]]['output'] : SilgiRouterTypes[FindMatchingRoute<R & string>][M & keyof SilgiRouterTypes[FindMatchingRoute<R & string>]]['output'];
27
+ type RequestBodyOption<R extends ValidRoute, M extends Method<R>> = R extends StaticRoutes ? SilgiRouterTypes[R][M & keyof SilgiRouterTypes[R]] extends {
28
+ input: infer I;
22
29
  } ? {
23
- body: SilgiRouterTypes[Route][Method]['input'];
30
+ body: I;
31
+ } : {
32
+ body?: never;
33
+ } : SilgiRouterTypes[FindMatchingRoute<R & string>][M & keyof SilgiRouterTypes[FindMatchingRoute<R & string>]] extends {
34
+ input: infer I;
35
+ } ? {
36
+ body: I;
24
37
  } : {
25
38
  body?: never;
26
39
  };
27
- type RouterParams<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route]> = SilgiRouterTypes[Route][Method] extends {
28
- params: any;
40
+ type ExtractParams<T extends string> = T extends `${string}:${infer Param}/${infer Rest}` ? {
41
+ [K in Param]: string;
42
+ } & ExtractParams<Rest> : T extends `${string}:${infer Param}` ? {
43
+ [K in Param]: string;
44
+ } : object;
45
+ type RouterParams<R extends ValidRoute, M extends Method<R>> = R extends StaticRoutes ? SilgiRouterTypes[R][M & keyof SilgiRouterTypes[R]] extends {
46
+ params: infer P;
29
47
  } ? {
30
- params?: SilgiRouterTypes[Route][Method]['params'];
48
+ params: P;
49
+ } : R extends `${string}:${string}` ? {
50
+ params: ExtractParams<R>;
31
51
  } : {
32
52
  params?: never;
53
+ } : {
54
+ params: ExtractParams<FindMatchingRoute<R & string>>;
33
55
  };
34
- type DefaultMethod<Route extends keyof SilgiRouterTypes> = keyof SilgiRouterTypes[Route];
35
- type SilgiFetchOptions<Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>> = {
36
- method?: Method;
37
- } & RequestBodyOption<Route, Method> & RouterParams<Route, Method> & Omit<FetchOptions, 'query' | 'body' | 'method'>;
38
- type SilgiFetchClient = <Route extends keyof SilgiRouterTypes, Method extends keyof SilgiRouterTypes[Route] = DefaultMethod<Route>, ResT = FetchResponseData<Route, Method>>(url: Route, options?: SilgiFetchOptions<Route, Method>) => Promise<ResT>;
56
+ type SilgiFetchOptions<R extends ValidRoute, M extends Method<R>> = {
57
+ method: M;
58
+ } & RequestBodyOption<R, M> & RouterParams<R, M> & Omit<FetchOptions, 'query' | 'body' | 'method'>;
59
+ type SilgiFetchClient = <R extends ValidRoute, M extends Method<R> | DefaultMethodType = 'get'>(url: R, options: SilgiFetchOptions<R, M extends Method<R> ? M : Extract<Method<R>, DefaultMethodType>>) => Promise<FetchResponseData<R, M extends Method<R> ? M : Extract<Method<R>, DefaultMethodType>>>;
39
60
  declare function createSilgiFetch(options: FetchOptions | ((options: FetchOptions) => FetchOptions), localFetch?: typeof globalThis.$fetch): SilgiFetchClient;
40
61
 
41
62
  interface Options {
@@ -80,6 +101,8 @@ declare function mergeSchemas<T extends MergedSilgiSchema[]>(typesOrArray: [...T
80
101
  declare function mergeServices<T extends ServiceType<SilgiSchema>[]>(servicesOrArray: [...T] | T): RequiredServiceType<SilgiSchema>;
81
102
  declare function mergeShared<T extends SilgiModuleShared[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
82
103
 
104
+ declare function getEvent<T>(event?: SilgiEvent): T;
105
+
83
106
  declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces, Record<string, BaseSchemaType<StandardSchemaV1>>>>>(silgiType: T): {
84
107
  [K in keyof T]: {
85
108
  [P in keyof T[K]]: T[K][P];
@@ -133,4 +156,4 @@ declare class SilgiError extends Error {
133
156
 
134
157
  declare function useSilgi(): Silgi;
135
158
 
136
- export { SchemaParser, SilgiError, createSchema, createService, createShared, createSilgi, createSilgiFetch, loadOptions, mergeSchemas, mergeServices, mergeShared, parseURI, silgiGenerateType, useSilgi };
159
+ export { SchemaParser, SilgiError, createSchema, createService, createShared, createSilgi, createSilgiFetch, getEvent, loadOptions, mergeSchemas, mergeServices, mergeShared, parseURI, silgiGenerateType, useSilgi };
@@ -112,7 +112,8 @@ const SilgiCLIDefaults = {
112
112
  name: "h3",
113
113
  version: ""
114
114
  },
115
- extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".vue"]
115
+ extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".vue"],
116
+ ignoreOptions: undefined
116
117
  };
117
118
 
118
119
  const fallbackCompatibilityDate = "2025-02-04";
@@ -1139,10 +1140,14 @@ function getFetch(url, opts, localFetch) {
1139
1140
  }
1140
1141
  return globalThis.$fetch;
1141
1142
  }
1142
- function fillPath(path, params = {}) {
1143
- for (const [k, v] of Object.entries(params))
1144
- path = path.replace(`{${k}}`, encodeURIComponent(String(v)));
1145
- return path;
1143
+ function fillPath(path, params) {
1144
+ if (!params)
1145
+ return path;
1146
+ let result = path;
1147
+ for (const [key, value] of Object.entries(params)) {
1148
+ result = result.replace(`:${key}`, value);
1149
+ }
1150
+ return result;
1146
1151
  }
1147
1152
 
1148
1153
  class SchemaParser {
@@ -1306,11 +1311,6 @@ async function execute(uriString, input, event) {
1306
1311
  event
1307
1312
  };
1308
1313
  try {
1309
- await silgiCtx.callHook("method:before", {
1310
- operation,
1311
- input,
1312
- event
1313
- });
1314
1314
  const handler = silgiCtx.scannedHandlers.get(operation.uri);
1315
1315
  if (!handler) {
1316
1316
  return {
@@ -1321,10 +1321,14 @@ async function execute(uriString, input, event) {
1321
1321
  }
1322
1322
  };
1323
1323
  }
1324
- if (event)
1325
- await silgiCtx.callHook("event:before", event);
1326
- const cacheData = await cacheExecute(operation.uri, input, operation, handler, event);
1327
- await callModules(operation, handler, input, result, event);
1324
+ await silgiCtx.callHook("action:before", {
1325
+ operation,
1326
+ input,
1327
+ event,
1328
+ modules: handler.modules,
1329
+ result
1330
+ });
1331
+ const cacheData = await cacheExecute(input, operation, handler, event);
1328
1332
  if (cacheData?.success) {
1329
1333
  result = cacheData.data;
1330
1334
  success = cacheData.success;
@@ -1338,12 +1342,13 @@ async function execute(uriString, input, event) {
1338
1342
  result = await handler?.handler(router, input, silgiCtx.shared, event);
1339
1343
  success = true;
1340
1344
  }
1341
- await silgiCtx.callHook("method:after", {
1345
+ await silgiCtx.callHook("action:after", {
1342
1346
  operation,
1343
1347
  input,
1344
1348
  event,
1345
1349
  result,
1346
- success
1350
+ success,
1351
+ modules: handler.modules
1347
1352
  });
1348
1353
  if (!cached) {
1349
1354
  if (success && cacheData?.cachedKey && handler.storage) {
@@ -1363,7 +1368,7 @@ async function execute(uriString, input, event) {
1363
1368
  }
1364
1369
  };
1365
1370
  }
1366
- await silgiCtx.callHook("method:error", {
1371
+ await silgiCtx.callHook("action:error", {
1367
1372
  ...hookContext,
1368
1373
  error,
1369
1374
  timestamp: Date.now()
@@ -1377,17 +1382,7 @@ async function execute(uriString, input, event) {
1377
1382
  };
1378
1383
  }
1379
1384
  }
1380
- async function callModules(operation, handler, input, result, event) {
1381
- useSilgi();
1382
- if (!handler.modules)
1383
- return;
1384
- for (const [moduleKey, config] of Object.entries(handler.modules)) {
1385
- if (moduleKey) {
1386
- if (module) ;
1387
- }
1388
- }
1389
- }
1390
- async function cacheExecute(uriString, input, operation, handler, event) {
1385
+ async function cacheExecute(input, operation, handler, event) {
1391
1386
  if (!handler.storage)
1392
1387
  return;
1393
1388
  const cacheKey = handler.storage ? await generateStorageKey({
@@ -1429,6 +1424,10 @@ function mergeShared(sharedOrArray) {
1429
1424
  return merge(sharedOrArray);
1430
1425
  }
1431
1426
 
1427
+ function getEvent(event) {
1428
+ return event.event || event || {};
1429
+ }
1430
+
1432
1431
  function createSchema(silgiType) {
1433
1432
  return silgiType;
1434
1433
  }
@@ -1441,4 +1440,4 @@ function createShared(shared) {
1441
1440
  return shared;
1442
1441
  }
1443
1442
 
1444
- export { SchemaParser, SilgiError, createSchema, createService, createShared, createSilgi, createSilgiFetch, createStorage, loadOptions, mergeSchemas, mergeServices, mergeShared, parseURI, silgi, silgiGenerateType, useSilgi };
1443
+ export { SchemaParser, SilgiError, createSchema, createService, createShared, createSilgi, createSilgiFetch, createStorage, getEvent, loadOptions, mergeSchemas, mergeServices, mergeShared, parseURI, silgi, silgiGenerateType, useSilgi };
@@ -1,13 +1,14 @@
1
1
  import { Buffer } from 'node:buffer';
2
2
  import { GraphQLSchema } from 'graphql';
3
3
  import { SilgiCLI, GraphQLJSON, SilgiPreset, SilgiPresetMeta } from 'silgi/types';
4
- import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.CzUPBllI.mjs';
4
+ import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.DQSwjP5u.mjs';
5
5
  import 'defu';
6
6
  import '@graphql-tools/utils';
7
7
  import 'pkg-types';
8
8
  import '@standard-schema/spec';
9
9
  import 'consola';
10
10
  import 'hookable';
11
+ import 'ignore';
11
12
  import 'silgi/presets';
12
13
  import 'unimport';
13
14
  import 'unstorage';
@@ -17,7 +18,6 @@ import 'compatx';
17
18
  import 'unimport/unplugin';
18
19
  import 'std-env';
19
20
  import '../shared/silgi.40ZJYm8F.mjs';
20
- import 'ignore';
21
21
 
22
22
  /**
23
23
  * Resolve a module from a given root path using an algorithm patterned on
@@ -1,13 +1,14 @@
1
1
  import { Buffer } from 'node:buffer';
2
2
  import { GraphQLSchema } from 'graphql';
3
3
  import { SilgiCLI, GraphQLJSON, SilgiPreset, SilgiPresetMeta } from 'silgi/types';
4
- import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.D_LzzCtJ.js';
4
+ import { w as ModuleOptions, y as ModuleDefinition, F as SilgiModule } from '../shared/silgi.yr8vHHvd.js';
5
5
  import 'defu';
6
6
  import '@graphql-tools/utils';
7
7
  import 'pkg-types';
8
8
  import '@standard-schema/spec';
9
9
  import 'consola';
10
10
  import 'hookable';
11
+ import 'ignore';
11
12
  import 'silgi/presets';
12
13
  import 'unimport';
13
14
  import 'unstorage';
@@ -17,7 +18,6 @@ import 'compatx';
17
18
  import 'unimport/unplugin';
18
19
  import 'std-env';
19
20
  import '../shared/silgi.40ZJYm8F.js';
20
- import 'ignore';
21
21
 
22
22
  /**
23
23
  * Resolve a module from a given root path using an algorithm patterned on
@@ -1,3 +1,3 @@
1
- const version = "0.4.3";
1
+ const version = "0.4.4";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.4.3";
1
+ const version = "0.4.4";
2
2
 
3
3
  export { version };
@@ -4,6 +4,7 @@ import { TSConfig } from 'pkg-types';
4
4
  import { StandardSchemaV1 } from '@standard-schema/spec';
5
5
  import { ConsolaOptions, ConsolaInstance, LogLevel } from 'consola';
6
6
  import { Hookable } from 'hookable';
7
+ import { Ignore, Options } from 'ignore';
7
8
  import { PresetOptions, PresetName, PresetNameInput } from 'silgi/presets';
8
9
  import { StorageMounts as StorageMounts$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1, ResolvedServiceType as ResolvedServiceType$1, SilgiDefaultShared as SilgiDefaultShared$1, SilgiModules as SilgiModules$1, ModuleMeta as ModuleMeta$1 } from 'silgi/types';
9
10
  import { Unimport } from 'unimport';
@@ -14,7 +15,6 @@ import { DateString, CompatibilityDates, CompatibilityDateSpec } from 'compatx';
14
15
  import { UnimportPluginOptions } from 'unimport/unplugin';
15
16
  import { ProviderName } from 'std-env';
16
17
  import { s as silgi, u as useStorage } from './silgi.40ZJYm8F.mjs';
17
- import { Ignore } from 'ignore';
18
18
 
19
19
  type HookResult = Promise<void> | void;
20
20
 
@@ -90,8 +90,8 @@ type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<
90
90
  * @example
91
91
  * namespace: 'coreApi'
92
92
  * serviceName: 'basket'
93
- * action: 'post'
94
- * method: 'createBasket'
93
+ * method: 'post'
94
+ * action: 'createBasket'
95
95
  */
96
96
  interface SilgiOperation {
97
97
  /**
@@ -205,10 +205,10 @@ interface SilgiHooks {
205
205
  */
206
206
  'close': (silgi: Silgi) => HookResult;
207
207
  'app:setup:start': (silgi: Silgi) => HookResult;
208
- 'method:before': (context: ModuleHookContext) => HookResult;
209
- 'method:after': (context: ModuleHookContext) => HookResult;
210
- 'method:error': (context: ModuleHookContext) => HookResult;
211
- 'method:finally': (context: ModuleHookContext) => HookResult;
208
+ 'action:before': (context: ModuleHookContext) => HookResult;
209
+ 'action:after': (context: ModuleHookContext) => HookResult;
210
+ 'action:error': (context: ModuleHookContext) => HookResult;
211
+ 'action:finally': (context: ModuleHookContext) => HookResult;
212
212
  'event:before': (event: SilgiEvent) => HookResult;
213
213
  'error': CaptureError;
214
214
  }
@@ -527,6 +527,20 @@ interface SilgiCLIOptions extends PresetOptions {
527
527
  * @default ['silgi']
528
528
  */
529
529
  conditions: string[];
530
+ /**
531
+ * Pass options directly to `node-ignore` (which is used by Nuxt to ignore files).
532
+ *
533
+ *
534
+ * @see [node-ignore](https://github.com/kaelzhang/node-ignore)
535
+ *
536
+ * @example
537
+ * ```js
538
+ * ignoreOptions: {
539
+ * ignorecase: false
540
+ * }
541
+ * ```
542
+ */
543
+ ignoreOptions: Options;
530
544
  }
531
545
  /**
532
546
  * Silgi input config (silgi.config)
@@ -557,9 +571,9 @@ interface ImportItem {
557
571
  };
558
572
  customImports: string[];
559
573
  customContent?: string[];
560
- functions?: string[];
561
574
  }
562
575
  interface SilgiCLI {
576
+ _ignore?: Ignore;
563
577
  services: ResolvedServiceType$1;
564
578
  shareds: SilgiDefaultShared$1;
565
579
  uris: Record<string, any>;
@@ -634,10 +648,9 @@ interface SilgiCLIHooks {
634
648
  'module:register:before': (module: SilgiModule) => HookResult;
635
649
  'module:register:after': (module: SilgiCLI['scanModules'][number]) => HookResult;
636
650
  'module:setup:finish': (module: SilgiModule) => HookResult;
637
- 'module:before:excute': (context: ModuleHookContext) => HookResult;
638
- 'module:after:excute': (context: ModuleHookContext) => HookResult;
639
- 'module:error': (context: ModuleHookContext) => HookResult;
640
- 'prepare:createCoreFramework': (options: ImportItem) => HookResult;
651
+ 'prepare:createCoreFramework': (options: Pick<ImportItem, 'customImports' | 'importItems'> & {
652
+ functions?: string[];
653
+ }) => HookResult;
641
654
  'prepare:createDTSFramework': (options: ImportItem) => HookResult;
642
655
  /**
643
656
  * Allows extending compatibility checks.
@@ -780,11 +793,9 @@ type ModuleHookContext = Readonly<{
780
793
  input?: unknown;
781
794
  result?: unknown;
782
795
  modules?: ModuleConfigurations;
783
- config?: unknown;
784
796
  timestamp?: number;
785
797
  meta?: Record<string, unknown>;
786
798
  error?: Error;
787
- hookName?: string;
788
799
  success?: boolean;
789
800
  }>;
790
801
  /** The options received. */
@@ -4,6 +4,7 @@ import { TSConfig } from 'pkg-types';
4
4
  import { StandardSchemaV1 } from '@standard-schema/spec';
5
5
  import { ConsolaOptions, ConsolaInstance, LogLevel } from 'consola';
6
6
  import { Hookable } from 'hookable';
7
+ import { Ignore, Options } from 'ignore';
7
8
  import { PresetOptions, PresetName, PresetNameInput } from 'silgi/presets';
8
9
  import { StorageMounts as StorageMounts$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1, ResolvedServiceType as ResolvedServiceType$1, SilgiDefaultShared as SilgiDefaultShared$1, SilgiModules as SilgiModules$1, ModuleMeta as ModuleMeta$1 } from 'silgi/types';
9
10
  import { Unimport } from 'unimport';
@@ -14,7 +15,6 @@ import { DateString, CompatibilityDates, CompatibilityDateSpec } from 'compatx';
14
15
  import { UnimportPluginOptions } from 'unimport/unplugin';
15
16
  import { ProviderName } from 'std-env';
16
17
  import { s as silgi, u as useStorage } from './silgi.40ZJYm8F.js';
17
- import { Ignore } from 'ignore';
18
18
 
19
19
  type HookResult = Promise<void> | void;
20
20
 
@@ -90,8 +90,8 @@ type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<
90
90
  * @example
91
91
  * namespace: 'coreApi'
92
92
  * serviceName: 'basket'
93
- * action: 'post'
94
- * method: 'createBasket'
93
+ * method: 'post'
94
+ * action: 'createBasket'
95
95
  */
96
96
  interface SilgiOperation {
97
97
  /**
@@ -205,10 +205,10 @@ interface SilgiHooks {
205
205
  */
206
206
  'close': (silgi: Silgi) => HookResult;
207
207
  'app:setup:start': (silgi: Silgi) => HookResult;
208
- 'method:before': (context: ModuleHookContext) => HookResult;
209
- 'method:after': (context: ModuleHookContext) => HookResult;
210
- 'method:error': (context: ModuleHookContext) => HookResult;
211
- 'method:finally': (context: ModuleHookContext) => HookResult;
208
+ 'action:before': (context: ModuleHookContext) => HookResult;
209
+ 'action:after': (context: ModuleHookContext) => HookResult;
210
+ 'action:error': (context: ModuleHookContext) => HookResult;
211
+ 'action:finally': (context: ModuleHookContext) => HookResult;
212
212
  'event:before': (event: SilgiEvent) => HookResult;
213
213
  'error': CaptureError;
214
214
  }
@@ -527,6 +527,20 @@ interface SilgiCLIOptions extends PresetOptions {
527
527
  * @default ['silgi']
528
528
  */
529
529
  conditions: string[];
530
+ /**
531
+ * Pass options directly to `node-ignore` (which is used by Nuxt to ignore files).
532
+ *
533
+ *
534
+ * @see [node-ignore](https://github.com/kaelzhang/node-ignore)
535
+ *
536
+ * @example
537
+ * ```js
538
+ * ignoreOptions: {
539
+ * ignorecase: false
540
+ * }
541
+ * ```
542
+ */
543
+ ignoreOptions: Options;
530
544
  }
531
545
  /**
532
546
  * Silgi input config (silgi.config)
@@ -557,9 +571,9 @@ interface ImportItem {
557
571
  };
558
572
  customImports: string[];
559
573
  customContent?: string[];
560
- functions?: string[];
561
574
  }
562
575
  interface SilgiCLI {
576
+ _ignore?: Ignore;
563
577
  services: ResolvedServiceType$1;
564
578
  shareds: SilgiDefaultShared$1;
565
579
  uris: Record<string, any>;
@@ -634,10 +648,9 @@ interface SilgiCLIHooks {
634
648
  'module:register:before': (module: SilgiModule) => HookResult;
635
649
  'module:register:after': (module: SilgiCLI['scanModules'][number]) => HookResult;
636
650
  'module:setup:finish': (module: SilgiModule) => HookResult;
637
- 'module:before:excute': (context: ModuleHookContext) => HookResult;
638
- 'module:after:excute': (context: ModuleHookContext) => HookResult;
639
- 'module:error': (context: ModuleHookContext) => HookResult;
640
- 'prepare:createCoreFramework': (options: ImportItem) => HookResult;
651
+ 'prepare:createCoreFramework': (options: Pick<ImportItem, 'customImports' | 'importItems'> & {
652
+ functions?: string[];
653
+ }) => HookResult;
641
654
  'prepare:createDTSFramework': (options: ImportItem) => HookResult;
642
655
  /**
643
656
  * Allows extending compatibility checks.
@@ -780,11 +793,9 @@ type ModuleHookContext = Readonly<{
780
793
  input?: unknown;
781
794
  result?: unknown;
782
795
  modules?: ModuleConfigurations;
783
- config?: unknown;
784
796
  timestamp?: number;
785
797
  meta?: Record<string, unknown>;
786
798
  error?: Error;
787
- hookName?: string;
788
799
  success?: boolean;
789
800
  }>;
790
801
  /** The options received. */
@@ -1,11 +1,12 @@
1
- import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.CzUPBllI.mjs';
2
- export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.CzUPBllI.mjs';
1
+ import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.DQSwjP5u.mjs';
2
+ export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.DQSwjP5u.mjs';
3
3
  import { StandardSchemaV1 } from '@standard-schema/spec';
4
4
  import 'defu';
5
5
  import '@graphql-tools/utils';
6
6
  import 'pkg-types';
7
7
  import 'consola';
8
8
  import 'hookable';
9
+ import 'ignore';
9
10
  import 'silgi/presets';
10
11
  import 'silgi/types';
11
12
  import 'unimport';
@@ -16,7 +17,6 @@ import 'compatx';
16
17
  import 'unimport/unplugin';
17
18
  import 'std-env';
18
19
  import '../shared/silgi.40ZJYm8F.mjs';
19
- import 'ignore';
20
20
 
21
21
  interface SilgiModuleContext extends Record<string, any> {
22
22
  }
@@ -1,11 +1,12 @@
1
- import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.D_LzzCtJ.js';
2
- export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.D_LzzCtJ.js';
1
+ import { D as DefaultNamespaces, B as BaseSchemaType, S as SilgiServiceInterface } from '../shared/silgi.yr8vHHvd.js';
2
+ export { A as AppConfig, o as Awaitable, l as BaseSilgiMethodType, W as CaptureError, V as CapturedErrorContext, C as CreateScope, n as DeepPartial, m as DefaultHooks, N as EventHandlerResponse, a2 as ExtendShared, ae as ExtractInputFromURI, af as ExtractOutputFromURI, ag as ExtractRouterParamsFromURI, a3 as FrameworkContext, a7 as ImportItem, L as LoadConfigOptions, Y as MergedSilgiSchema, O as MethodHandlerType, Q as MethodResponse, K as MethodSchemaType, G as ModuleConfigurations, y as ModuleDefinition, v as ModuleHookContext, M as ModuleMeta, w as ModuleOptions, z as ModuleSetupInstallResult, E as ModuleSetupReturn, ab as NitroBuildInfo, _ as RequiredServiceType, P as ResolvedMethodHandlerType, R as ResolvedModuleMeta, x as ResolvedModuleOptions, $ as ResolvedServiceType, Z as ServiceType, a4 as Silgi, U as SilgiAppPlugin, a8 as SilgiCLI, b as SilgiCLIConfig, a9 as SilgiCLIDynamicConfig, c as SilgiCLIHooks, a as SilgiCLIOptions, u as SilgiCompatibility, d as SilgiCompatibilityIssue, e as SilgiCompatibilityIssues, a5 as SilgiConfig, a0 as SilgiDefaultShared, g as SilgiEvent, aa as SilgiFrameworkInfo, a6 as SilgiFunction, k as SilgiHook, p as SilgiHooks, h as SilgiMethods, F as SilgiModule, t as SilgiModuleInput, r as SilgiModuleMethods, s as SilgiModuleOptions, a1 as SilgiModuleShared, q as SilgiModules, i as SilgiNamespaces, H as SilgiOperation, f as SilgiOptions, I as SilgiPreset, J as SilgiPresetMeta, j as SilgiRouterTypes, X as SilgiSchema, ai as SilgiStorageBase, ac as SilgiURIs, ak as StorageConfig, aj as StorageKeyGenerator, al as StorageKeyParams, ah as StorageMounts, T as TSReference, ad as URIsTypes } from '../shared/silgi.yr8vHHvd.js';
3
3
  import { StandardSchemaV1 } from '@standard-schema/spec';
4
4
  import 'defu';
5
5
  import '@graphql-tools/utils';
6
6
  import 'pkg-types';
7
7
  import 'consola';
8
8
  import 'hookable';
9
+ import 'ignore';
9
10
  import 'silgi/presets';
10
11
  import 'silgi/types';
11
12
  import 'unimport';
@@ -16,7 +17,6 @@ import 'compatx';
16
17
  import 'unimport/unplugin';
17
18
  import 'std-env';
18
19
  import '../shared/silgi.40ZJYm8F.js';
19
- import 'ignore';
20
20
 
21
21
  interface SilgiModuleContext extends Record<string, any> {
22
22
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.4.3",
4
+ "version": "0.4.4",
5
5
  "sideEffects": false,
6
6
  "exports": {
7
7
  "./cli": {
@@ -189,7 +189,7 @@
189
189
  },
190
190
  "scripts": {
191
191
  "build": "pnpm gen-presets && pnpm build:package && pnpm --filter './modules/*' generate && pnpm build:module",
192
- "build:prepare": "pnpm gen-presets && pnpm build:package && pnpm --filter './modules/*' generate && pnpm build:prepare",
192
+ "build:prepare": "pnpm build:stub && pnpm --filter './modules/*' silgi:prepare",
193
193
  "build:package": "unbuild",
194
194
  "build:module": "pnpm --filter '@silgi/*' build",
195
195
  "build:stub": "pnpm gen-presets && unbuild --stub && pnpm --filter './modules/*' build:stub && pnpm --filter './module-builder' build:stub",