@mokup/cli 1.1.0 → 1.1.2

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/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Manifest } from '@mokup/runtime';
2
2
  import { MiddlewareHandler } from '@mokup/shared/hono';
3
+ import * as _mokup_shared_define_config from '@mokup/shared/define-config';
3
4
  import { Command } from 'commander';
4
5
 
5
6
  /**
@@ -212,47 +213,9 @@ declare function buildManifest(options?: BuildOptions): Promise<{
212
213
  manifestPath: string;
213
214
  }>;
214
215
 
215
- type HookHandler = () => void | Promise<void>;
216
- interface ConfigApp {
217
- use: (...handlers: MiddlewareHandler[]) => void;
218
- }
219
- type DefineConfigFactory = (context: {
220
- app: ConfigApp;
221
- }) => RouteDirectoryConfig | void | Promise<RouteDirectoryConfig | void>;
222
- declare function onBeforeAll(handler: HookHandler): void;
223
- declare function onAfterAll(handler: HookHandler): void;
224
- /**
225
- * Define a directory config with hook-based middleware registration.
226
- *
227
- * @param input - Config object or factory callback.
228
- * @returns Route directory config with middleware metadata.
229
- *
230
- * @example
231
- * import { defineConfig, onBeforeAll, onAfterAll } from '@mokup/cli'
232
- *
233
- * export default defineConfig(({ app }) => {
234
- * onBeforeAll(() => {
235
- * app.use(async (c, next) => {
236
- * c.header('x-before', '1')
237
- * await next()
238
- * })
239
- * })
240
- *
241
- * app.use(async (_c, next) => {
242
- * await next()
243
- * })
244
- *
245
- * onAfterAll(() => {
246
- * app.use(async (c, next) => {
247
- * await next()
248
- * c.header('x-after', '1')
249
- * })
250
- * })
251
- *
252
- * return { delay: 120 }
253
- * })
254
- */
255
- declare function defineConfig(input: RouteDirectoryConfig | DefineConfigFactory): RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
216
+ declare const defineConfig: (input: RouteDirectoryConfig | _mokup_shared_define_config.DefineConfigFactory<RouteDirectoryConfig, MiddlewareHandler>) => RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
217
+ declare const onBeforeAll: (handler: _mokup_shared_define_config.HookHandler) => void;
218
+ declare const onAfterAll: (handler: _mokup_shared_define_config.HookHandler) => void;
256
219
 
257
220
  /**
258
221
  * Create the mokup CLI program instance.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Manifest } from '@mokup/runtime';
2
2
  import { MiddlewareHandler } from '@mokup/shared/hono';
3
+ import * as _mokup_shared_define_config from '@mokup/shared/define-config';
3
4
  import { Command } from 'commander';
4
5
 
5
6
  /**
@@ -212,47 +213,9 @@ declare function buildManifest(options?: BuildOptions): Promise<{
212
213
  manifestPath: string;
213
214
  }>;
214
215
 
215
- type HookHandler = () => void | Promise<void>;
216
- interface ConfigApp {
217
- use: (...handlers: MiddlewareHandler[]) => void;
218
- }
219
- type DefineConfigFactory = (context: {
220
- app: ConfigApp;
221
- }) => RouteDirectoryConfig | void | Promise<RouteDirectoryConfig | void>;
222
- declare function onBeforeAll(handler: HookHandler): void;
223
- declare function onAfterAll(handler: HookHandler): void;
224
- /**
225
- * Define a directory config with hook-based middleware registration.
226
- *
227
- * @param input - Config object or factory callback.
228
- * @returns Route directory config with middleware metadata.
229
- *
230
- * @example
231
- * import { defineConfig, onBeforeAll, onAfterAll } from '@mokup/cli'
232
- *
233
- * export default defineConfig(({ app }) => {
234
- * onBeforeAll(() => {
235
- * app.use(async (c, next) => {
236
- * c.header('x-before', '1')
237
- * await next()
238
- * })
239
- * })
240
- *
241
- * app.use(async (_c, next) => {
242
- * await next()
243
- * })
244
- *
245
- * onAfterAll(() => {
246
- * app.use(async (c, next) => {
247
- * await next()
248
- * c.header('x-after', '1')
249
- * })
250
- * })
251
- *
252
- * return { delay: 120 }
253
- * })
254
- */
255
- declare function defineConfig(input: RouteDirectoryConfig | DefineConfigFactory): RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
216
+ declare const defineConfig: (input: RouteDirectoryConfig | _mokup_shared_define_config.DefineConfigFactory<RouteDirectoryConfig, MiddlewareHandler>) => RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
217
+ declare const onBeforeAll: (handler: _mokup_shared_define_config.HookHandler) => void;
218
+ declare const onAfterAll: (handler: _mokup_shared_define_config.HookHandler) => void;
256
219
 
257
220
  /**
258
221
  * Create the mokup CLI program instance.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Manifest } from '@mokup/runtime';
2
2
  import { MiddlewareHandler } from '@mokup/shared/hono';
3
+ import * as _mokup_shared_define_config from '@mokup/shared/define-config';
3
4
  import { Command } from 'commander';
4
5
 
5
6
  /**
@@ -212,47 +213,9 @@ declare function buildManifest(options?: BuildOptions): Promise<{
212
213
  manifestPath: string;
213
214
  }>;
214
215
 
215
- type HookHandler = () => void | Promise<void>;
216
- interface ConfigApp {
217
- use: (...handlers: MiddlewareHandler[]) => void;
218
- }
219
- type DefineConfigFactory = (context: {
220
- app: ConfigApp;
221
- }) => RouteDirectoryConfig | void | Promise<RouteDirectoryConfig | void>;
222
- declare function onBeforeAll(handler: HookHandler): void;
223
- declare function onAfterAll(handler: HookHandler): void;
224
- /**
225
- * Define a directory config with hook-based middleware registration.
226
- *
227
- * @param input - Config object or factory callback.
228
- * @returns Route directory config with middleware metadata.
229
- *
230
- * @example
231
- * import { defineConfig, onBeforeAll, onAfterAll } from '@mokup/cli'
232
- *
233
- * export default defineConfig(({ app }) => {
234
- * onBeforeAll(() => {
235
- * app.use(async (c, next) => {
236
- * c.header('x-before', '1')
237
- * await next()
238
- * })
239
- * })
240
- *
241
- * app.use(async (_c, next) => {
242
- * await next()
243
- * })
244
- *
245
- * onAfterAll(() => {
246
- * app.use(async (c, next) => {
247
- * await next()
248
- * c.header('x-after', '1')
249
- * })
250
- * })
251
- *
252
- * return { delay: 120 }
253
- * })
254
- */
255
- declare function defineConfig(input: RouteDirectoryConfig | DefineConfigFactory): RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
216
+ declare const defineConfig: (input: RouteDirectoryConfig | _mokup_shared_define_config.DefineConfigFactory<RouteDirectoryConfig, MiddlewareHandler>) => RouteDirectoryConfig | Promise<RouteDirectoryConfig>;
217
+ declare const onBeforeAll: (handler: _mokup_shared_define_config.HookHandler) => void;
218
+ declare const onAfterAll: (handler: _mokup_shared_define_config.HookHandler) => void;
256
219
 
257
220
  /**
258
221
  * Create the mokup CLI program instance.