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.
- package/dist/cli/index.mjs +1 -1
- package/dist/kit/index.d.mts +5 -4
- package/dist/kit/index.mjs +3 -3
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/kit/index.d.mts
CHANGED
|
@@ -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;
|
package/dist/kit/index.mjs
CHANGED
|
@@ -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
|
};
|