silgi 0.29.38 → 0.29.39

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.29.38";
4
+ const version = "0.29.39";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -40,19 +40,20 @@ declare function addNPMPackage(data: {
40
40
  * @param preset The framework preset to use
41
41
  * @example
42
42
  * ```ts
43
- * const h3Handler = defineFramework('h3').build((options) => {
43
+ * const h3Handler = defineFramework('h3').build(async (options) => {
44
44
  * // Type-safe access to h3 router
45
45
  * const router = options.framework
46
- * // Implementation here
46
+ * // Implementation here with async/await support
47
+ * await someAsyncOperation()
47
48
  * })
48
49
  * ```
49
50
  */
50
51
  declare function defineFramework<T extends PresetName>(preset: T): {
51
52
  /**
52
53
  * Build the framework handler
53
- * @param callback The callback function that will receive typed options
54
+ * @param callback The callback function that will receive typed options (can be async)
54
55
  */
55
- build(callback: (options: DefineFrameworkOptions<T>) => void): (options: DefineFrameworkOptions<T>) => void;
56
+ build(callback: (options: DefineFrameworkOptions<T>) => void | Promise<void>): (options: DefineFrameworkOptions<T>) => Promise<void>;
56
57
  };
57
58
 
58
59
  declare function hasError(type: SilgiCLI['errors'][0]['type'], silgi?: SilgiCLI): boolean;
@@ -193,11 +193,11 @@ function defineFramework(preset) {
193
193
  return {
194
194
  /**
195
195
  * Build the framework handler
196
- * @param callback The callback function that will receive typed options
196
+ * @param callback The callback function that will receive typed options (can be async)
197
197
  */
198
198
  build(callback) {
199
- return function handler(options) {
200
- callback(options);
199
+ return async function handler(options) {
200
+ await callback(options);
201
201
  };
202
202
  }
203
203
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.29.38",
4
+ "version": "0.29.39",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {