clear-router 2.8.1 → 2.8.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/core/helpers.cjs +23 -0
- package/dist/core/helpers.d.cts +15 -1
- package/dist/core/helpers.d.mts +14 -1
- package/dist/core/helpers.mjs +24 -1
- package/dist/core/index.cjs +1 -8
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +2 -2
- package/dist/core/router.cjs +31 -2
- package/dist/core/router.d.cts +4 -2
- package/dist/core/router.d.mts +4 -2
- package/dist/core/router.mjs +31 -2
- package/dist/express/router.cjs +2 -2
- package/dist/express/router.d.cts +2 -2
- package/dist/express/router.d.mts +2 -2
- package/dist/express/router.mjs +2 -2
- package/dist/fastify/router.cjs +2 -2
- package/dist/fastify/router.d.cts +2 -2
- package/dist/fastify/router.d.mts +2 -2
- package/dist/fastify/router.mjs +2 -2
- package/dist/h3/router.cjs +2 -2
- package/dist/h3/router.d.cts +2 -2
- package/dist/h3/router.d.mts +2 -2
- package/dist/h3/router.mjs +2 -2
- package/dist/hono/router.cjs +2 -2
- package/dist/hono/router.d.cts +2 -2
- package/dist/hono/router.d.mts +2 -2
- package/dist/hono/router.mjs +2 -2
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/koa/router.cjs +2 -2
- package/dist/koa/router.d.cts +2 -2
- package/dist/koa/router.d.mts +2 -2
- package/dist/koa/router.mjs +2 -2
- package/dist/types/basic.d.cts +12 -1
- package/dist/types/basic.d.mts +12 -1
- package/dist/types/index.d.mts +1 -0
- package/package.json +5 -2
package/dist/core/helpers.cjs
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
let node_path = require("node:path");
|
|
2
|
+
let jiti = require("jiti");
|
|
3
|
+
let node_url = require("node:url");
|
|
1
4
|
|
|
2
5
|
//#region src/core/helpers.ts
|
|
3
6
|
const wrap = (value) => {
|
|
4
7
|
if (value === null || value === void 0) return [];
|
|
5
8
|
return Array.isArray(value) ? value : [value];
|
|
6
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Dynamically imports a file at the given path with full TypeScript support,
|
|
13
|
+
* including `tsconfig.json` path aliases.
|
|
14
|
+
*
|
|
15
|
+
* @param filePath - The path to the file to import.
|
|
16
|
+
* @returns The imported module typed as `T`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const config = await importFile<AppConfig>('./config/app.ts')
|
|
20
|
+
*/
|
|
21
|
+
const importFile = async (filePath, userOptions, resolveOptions) => {
|
|
22
|
+
const resolvedPath = (0, node_path.resolve)(filePath);
|
|
23
|
+
return await (0, jiti.createJiti)((0, node_url.pathToFileURL)(resolvedPath).href, {
|
|
24
|
+
...userOptions,
|
|
25
|
+
interopDefault: false,
|
|
26
|
+
tsconfigPaths: true
|
|
27
|
+
}).import(resolvedPath, resolveOptions);
|
|
28
|
+
};
|
|
7
29
|
|
|
8
30
|
//#endregion
|
|
31
|
+
exports.importFile = importFile;
|
|
9
32
|
exports.wrap = wrap;
|
package/dist/core/helpers.d.cts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
import { FileImporter } from "../types/basic.cjs";
|
|
2
|
+
|
|
1
3
|
//#region src/core/helpers.d.ts
|
|
2
4
|
declare const wrap: <T>(value: T | T[] | null | undefined) => T[];
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Dynamically imports a file at the given path with full TypeScript support,
|
|
8
|
+
* including `tsconfig.json` path aliases.
|
|
9
|
+
*
|
|
10
|
+
* @param filePath - The path to the file to import.
|
|
11
|
+
* @returns The imported module typed as `T`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const config = await importFile<AppConfig>('./config/app.ts')
|
|
15
|
+
*/
|
|
16
|
+
declare const importFile: FileImporter;
|
|
3
17
|
//#endregion
|
|
4
|
-
export { wrap };
|
|
18
|
+
export { importFile, wrap };
|
package/dist/core/helpers.d.mts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
import { FileImporter } from "../types/basic.mjs";
|
|
1
2
|
//#region src/core/helpers.d.ts
|
|
2
3
|
declare const wrap: <T>(value: T | T[] | null | undefined) => T[];
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Dynamically imports a file at the given path with full TypeScript support,
|
|
7
|
+
* including `tsconfig.json` path aliases.
|
|
8
|
+
*
|
|
9
|
+
* @param filePath - The path to the file to import.
|
|
10
|
+
* @returns The imported module typed as `T`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const config = await importFile<AppConfig>('./config/app.ts')
|
|
14
|
+
*/
|
|
15
|
+
declare const importFile: FileImporter;
|
|
3
16
|
//#endregion
|
|
4
|
-
export { wrap };
|
|
17
|
+
export { importFile, wrap };
|
package/dist/core/helpers.mjs
CHANGED
|
@@ -1,8 +1,31 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { createJiti } from "jiti";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
|
|
1
5
|
//#region src/core/helpers.ts
|
|
2
6
|
const wrap = (value) => {
|
|
3
7
|
if (value === null || value === void 0) return [];
|
|
4
8
|
return Array.isArray(value) ? value : [value];
|
|
5
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Dynamically imports a file at the given path with full TypeScript support,
|
|
13
|
+
* including `tsconfig.json` path aliases.
|
|
14
|
+
*
|
|
15
|
+
* @param filePath - The path to the file to import.
|
|
16
|
+
* @returns The imported module typed as `T`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const config = await importFile<AppConfig>('./config/app.ts')
|
|
20
|
+
*/
|
|
21
|
+
const importFile = async (filePath, userOptions, resolveOptions) => {
|
|
22
|
+
const resolvedPath = resolve(filePath);
|
|
23
|
+
return await createJiti(pathToFileURL(resolvedPath).href, {
|
|
24
|
+
...userOptions,
|
|
25
|
+
interopDefault: false,
|
|
26
|
+
tsconfigPaths: true
|
|
27
|
+
}).import(resolvedPath, resolveOptions);
|
|
28
|
+
};
|
|
6
29
|
|
|
7
30
|
//#endregion
|
|
8
|
-
export { wrap };
|
|
31
|
+
export { importFile, wrap };
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
1
|
const require_Request = require('./Request.cjs');
|
|
3
2
|
const require_Response = require('./Response.cjs');
|
|
4
3
|
const require_plugins = require('./plugins.cjs');
|
|
5
|
-
const require_router = require('./router.cjs');
|
|
6
4
|
const require_helpers = require('./helpers.cjs');
|
|
7
|
-
|
|
8
|
-
exports.CoreRouter = require_router.CoreRouter;
|
|
9
|
-
exports.Request = require_Request.Request;
|
|
10
|
-
exports.Response = require_Response.Response;
|
|
11
|
-
exports.definePlugin = require_plugins.definePlugin;
|
|
12
|
-
exports.wrap = require_helpers.wrap;
|
|
5
|
+
const require_router = require('./router.cjs');
|
package/dist/core/index.d.cts
CHANGED
|
@@ -2,5 +2,5 @@ import { Response } from "./Response.cjs";
|
|
|
2
2
|
import { Request } from "./Request.cjs";
|
|
3
3
|
import { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, definePlugin } from "./plugins.cjs";
|
|
4
4
|
import { CoreRouter } from "./router.cjs";
|
|
5
|
-
import { wrap } from "./helpers.cjs";
|
|
6
|
-
export { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, definePlugin, wrap };
|
|
5
|
+
import { importFile, wrap } from "./helpers.cjs";
|
|
6
|
+
export { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, definePlugin, importFile, wrap };
|
package/dist/core/index.d.mts
CHANGED
|
@@ -2,5 +2,5 @@ import { Response } from "./Response.mjs";
|
|
|
2
2
|
import { Request } from "./Request.mjs";
|
|
3
3
|
import { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, definePlugin } from "./plugins.mjs";
|
|
4
4
|
import { CoreRouter } from "./router.mjs";
|
|
5
|
-
import { wrap } from "./helpers.mjs";
|
|
6
|
-
export { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, definePlugin, wrap };
|
|
5
|
+
import { importFile, wrap } from "./helpers.mjs";
|
|
6
|
+
export { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, definePlugin, importFile, wrap };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Request } from "./Request.mjs";
|
|
2
2
|
import { Response } from "./Response.mjs";
|
|
3
3
|
import { definePlugin } from "./plugins.mjs";
|
|
4
|
+
import { importFile, wrap } from "./helpers.mjs";
|
|
4
5
|
import { CoreRouter } from "./router.mjs";
|
|
5
|
-
import { wrap } from "./helpers.mjs";
|
|
6
6
|
|
|
7
|
-
export { CoreRouter, Request, Response, definePlugin, wrap };
|
|
7
|
+
export { CoreRouter, Request, Response, definePlugin, importFile, wrap };
|
package/dist/core/router.cjs
CHANGED
|
@@ -3,6 +3,9 @@ const require_Response = require('./Response.cjs');
|
|
|
3
3
|
const require_bindings = require('./bindings.cjs');
|
|
4
4
|
const require_ResourceRoutes = require('../ResourceRoutes.cjs');
|
|
5
5
|
const require_Route = require('../Route.cjs');
|
|
6
|
+
const require_helpers = require('./helpers.cjs');
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
let node_fs_promises = require("node:fs/promises");
|
|
6
9
|
let node_async_hooks = require("node:async_hooks");
|
|
7
10
|
let node_module = require("node:module");
|
|
8
11
|
|
|
@@ -640,7 +643,7 @@ var CoreRouter = class {
|
|
|
640
643
|
* @param callback
|
|
641
644
|
* @param middlewares
|
|
642
645
|
*/
|
|
643
|
-
static async group(prefix,
|
|
646
|
+
static async group(prefix, source, middlewares) {
|
|
644
647
|
this.ensureState();
|
|
645
648
|
const context = this.groupContext.getStore();
|
|
646
649
|
const previousPrefix = context?.prefix ?? this.prefix;
|
|
@@ -651,9 +654,35 @@ var CoreRouter = class {
|
|
|
651
654
|
groupMiddlewares: [...previousMiddlewares, ...middlewares || []]
|
|
652
655
|
};
|
|
653
656
|
await this.groupContext.run(nextContext, async () => {
|
|
654
|
-
|
|
657
|
+
if (typeof source === "function") {
|
|
658
|
+
await Promise.resolve(source());
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
for (const file of await this.resolveGroupFiles(source)) await require_helpers.importFile(file);
|
|
655
662
|
});
|
|
656
663
|
}
|
|
664
|
+
static async resolveGroupFiles(source) {
|
|
665
|
+
const resolved = (0, node_path.isAbsolute)(source) ? source : (0, node_path.resolve)(process.cwd(), source);
|
|
666
|
+
let sourceStat;
|
|
667
|
+
try {
|
|
668
|
+
sourceStat = await (0, node_fs_promises.stat)(resolved);
|
|
669
|
+
} catch {
|
|
670
|
+
throw new Error(`Route group source not found: ${source}`);
|
|
671
|
+
}
|
|
672
|
+
if (sourceStat.isFile()) return [resolved];
|
|
673
|
+
if (!sourceStat.isDirectory()) throw new Error(`Route group source must be a file or directory: ${source}`);
|
|
674
|
+
return this.readGroupDirectory(resolved);
|
|
675
|
+
}
|
|
676
|
+
static async readGroupDirectory(directory) {
|
|
677
|
+
const entries = await (0, node_fs_promises.readdir)(directory, { withFileTypes: true });
|
|
678
|
+
const files = [];
|
|
679
|
+
for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
|
|
680
|
+
const path = (0, node_path.join)(directory, entry.name);
|
|
681
|
+
if (entry.isDirectory()) files.push(...await this.readGroupDirectory(path));
|
|
682
|
+
else if (entry.isFile() && /\.(?:[cm]?ts)$/.test(entry.name) && !entry.name.endsWith(".d.ts")) files.push(path);
|
|
683
|
+
}
|
|
684
|
+
return files;
|
|
685
|
+
}
|
|
657
686
|
/**
|
|
658
687
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
659
688
|
*
|
package/dist/core/router.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouterConfig } from "../types/basic.cjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource, RouterConfig } from "../types/basic.cjs";
|
|
2
2
|
import { Response } from "./Response.cjs";
|
|
3
3
|
import { Route } from "../Route.cjs";
|
|
4
4
|
import { Request } from "./Request.cjs";
|
|
@@ -219,7 +219,9 @@ declare abstract class CoreRouter {
|
|
|
219
219
|
* @param callback
|
|
220
220
|
* @param middlewares
|
|
221
221
|
*/
|
|
222
|
-
static group(prefix: string,
|
|
222
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: any[]): Promise<void>;
|
|
223
|
+
protected static resolveGroupFiles(source: string): Promise<string[]>;
|
|
224
|
+
protected static readGroupDirectory(directory: string): Promise<string[]>;
|
|
223
225
|
/**
|
|
224
226
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
225
227
|
*
|
package/dist/core/router.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouterConfig } from "../types/basic.mjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource, RouterConfig } from "../types/basic.mjs";
|
|
2
2
|
import { Response } from "./Response.mjs";
|
|
3
3
|
import { Route } from "../Route.mjs";
|
|
4
4
|
import { Request } from "./Request.mjs";
|
|
@@ -219,7 +219,9 @@ declare abstract class CoreRouter {
|
|
|
219
219
|
* @param callback
|
|
220
220
|
* @param middlewares
|
|
221
221
|
*/
|
|
222
|
-
static group(prefix: string,
|
|
222
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: any[]): Promise<void>;
|
|
223
|
+
protected static resolveGroupFiles(source: string): Promise<string[]>;
|
|
224
|
+
protected static readGroupDirectory(directory: string): Promise<string[]>;
|
|
223
225
|
/**
|
|
224
226
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
225
227
|
*
|
package/dist/core/router.mjs
CHANGED
|
@@ -3,7 +3,10 @@ import { Response } from "./Response.mjs";
|
|
|
3
3
|
import { Container, getBindingMetadataFromTargets, getDesignParamTypes, getStandardMetadata, isClass } from "./bindings.mjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.mjs";
|
|
5
5
|
import { Route } from "../Route.mjs";
|
|
6
|
+
import { importFile } from "./helpers.mjs";
|
|
6
7
|
import { createRequire } from "node:module";
|
|
8
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
9
|
+
import { readdir, stat } from "node:fs/promises";
|
|
7
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
11
|
|
|
9
12
|
//#region src/core/router.ts
|
|
@@ -640,7 +643,7 @@ var CoreRouter = class {
|
|
|
640
643
|
* @param callback
|
|
641
644
|
* @param middlewares
|
|
642
645
|
*/
|
|
643
|
-
static async group(prefix,
|
|
646
|
+
static async group(prefix, source, middlewares) {
|
|
644
647
|
this.ensureState();
|
|
645
648
|
const context = this.groupContext.getStore();
|
|
646
649
|
const previousPrefix = context?.prefix ?? this.prefix;
|
|
@@ -651,9 +654,35 @@ var CoreRouter = class {
|
|
|
651
654
|
groupMiddlewares: [...previousMiddlewares, ...middlewares || []]
|
|
652
655
|
};
|
|
653
656
|
await this.groupContext.run(nextContext, async () => {
|
|
654
|
-
|
|
657
|
+
if (typeof source === "function") {
|
|
658
|
+
await Promise.resolve(source());
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
for (const file of await this.resolveGroupFiles(source)) await importFile(file);
|
|
655
662
|
});
|
|
656
663
|
}
|
|
664
|
+
static async resolveGroupFiles(source) {
|
|
665
|
+
const resolved = isAbsolute(source) ? source : resolve(process.cwd(), source);
|
|
666
|
+
let sourceStat;
|
|
667
|
+
try {
|
|
668
|
+
sourceStat = await stat(resolved);
|
|
669
|
+
} catch {
|
|
670
|
+
throw new Error(`Route group source not found: ${source}`);
|
|
671
|
+
}
|
|
672
|
+
if (sourceStat.isFile()) return [resolved];
|
|
673
|
+
if (!sourceStat.isDirectory()) throw new Error(`Route group source must be a file or directory: ${source}`);
|
|
674
|
+
return this.readGroupDirectory(resolved);
|
|
675
|
+
}
|
|
676
|
+
static async readGroupDirectory(directory) {
|
|
677
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
678
|
+
const files = [];
|
|
679
|
+
for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
|
|
680
|
+
const path = join(directory, entry.name);
|
|
681
|
+
if (entry.isDirectory()) files.push(...await this.readGroupDirectory(path));
|
|
682
|
+
else if (entry.isFile() && /\.(?:[cm]?ts)$/.test(entry.name) && !entry.name.endsWith(".d.ts")) files.push(path);
|
|
683
|
+
}
|
|
684
|
+
return files;
|
|
685
|
+
}
|
|
657
686
|
/**
|
|
658
687
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
659
688
|
*
|
package/dist/express/router.cjs
CHANGED
|
@@ -141,8 +141,8 @@ var Router = class Router extends require_router.CoreRouter {
|
|
|
141
141
|
* @param callback
|
|
142
142
|
* @param middlewares
|
|
143
143
|
*/
|
|
144
|
-
static async group(prefix,
|
|
145
|
-
await super.group(prefix,
|
|
144
|
+
static async group(prefix, source, middlewares) {
|
|
145
|
+
await super.group(prefix, source, middlewares);
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.cjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.cjs";
|
|
2
2
|
import { Handler, HttpContext, Middleware } from "../types/express.cjs";
|
|
3
3
|
import { Route } from "../Route.cjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.cjs";
|
|
@@ -101,7 +101,7 @@ declare class Router$1 extends CoreRouter {
|
|
|
101
101
|
* @param callback
|
|
102
102
|
* @param middlewares
|
|
103
103
|
*/
|
|
104
|
-
static group(prefix: string,
|
|
104
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
107
107
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.mjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.mjs";
|
|
2
2
|
import { Handler, HttpContext, Middleware } from "../types/express.mjs";
|
|
3
3
|
import { Route } from "../Route.mjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.mjs";
|
|
@@ -101,7 +101,7 @@ declare class Router$1 extends CoreRouter {
|
|
|
101
101
|
* @param callback
|
|
102
102
|
* @param middlewares
|
|
103
103
|
*/
|
|
104
|
-
static group(prefix: string,
|
|
104
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
107
107
|
*
|
package/dist/express/router.mjs
CHANGED
|
@@ -141,8 +141,8 @@ var Router = class Router extends CoreRouter {
|
|
|
141
141
|
* @param callback
|
|
142
142
|
* @param middlewares
|
|
143
143
|
*/
|
|
144
|
-
static async group(prefix,
|
|
145
|
-
await super.group(prefix,
|
|
144
|
+
static async group(prefix, source, middlewares) {
|
|
145
|
+
await super.group(prefix, source, middlewares);
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Adds global middlewares to the router, which will be applied to all routes.
|
package/dist/fastify/router.cjs
CHANGED
|
@@ -134,8 +134,8 @@ var Router = class Router extends require_router.CoreRouter {
|
|
|
134
134
|
* @param callback
|
|
135
135
|
* @param middlewares
|
|
136
136
|
*/
|
|
137
|
-
static async group(prefix,
|
|
138
|
-
await super.group(prefix,
|
|
137
|
+
static async group(prefix, source, middlewares) {
|
|
138
|
+
await super.group(prefix, source, middlewares);
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Apply middlewares to a group of routes defined within the callback
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.cjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.cjs";
|
|
2
2
|
import { FastifyApp, Handler, HttpContext, Middleware } from "../types/fastify.cjs";
|
|
3
3
|
import { Route } from "../Route.cjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.cjs";
|
|
@@ -99,7 +99,7 @@ declare class Router extends CoreRouter {
|
|
|
99
99
|
* @param callback
|
|
100
100
|
* @param middlewares
|
|
101
101
|
*/
|
|
102
|
-
static group(prefix: string,
|
|
102
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
103
103
|
/**
|
|
104
104
|
* Apply middlewares to a group of routes defined within the callback
|
|
105
105
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.mjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.mjs";
|
|
2
2
|
import { FastifyApp, Handler, HttpContext, Middleware } from "../types/fastify.mjs";
|
|
3
3
|
import { Route } from "../Route.mjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.mjs";
|
|
@@ -99,7 +99,7 @@ declare class Router extends CoreRouter {
|
|
|
99
99
|
* @param callback
|
|
100
100
|
* @param middlewares
|
|
101
101
|
*/
|
|
102
|
-
static group(prefix: string,
|
|
102
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
103
103
|
/**
|
|
104
104
|
* Apply middlewares to a group of routes defined within the callback
|
|
105
105
|
*
|
package/dist/fastify/router.mjs
CHANGED
|
@@ -134,8 +134,8 @@ var Router = class Router extends CoreRouter {
|
|
|
134
134
|
* @param callback
|
|
135
135
|
* @param middlewares
|
|
136
136
|
*/
|
|
137
|
-
static async group(prefix,
|
|
138
|
-
await super.group(prefix,
|
|
137
|
+
static async group(prefix, source, middlewares) {
|
|
138
|
+
await super.group(prefix, source, middlewares);
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Apply middlewares to a group of routes defined within the callback
|
package/dist/h3/router.cjs
CHANGED
|
@@ -143,8 +143,8 @@ var Router = class Router extends require_router.CoreRouter {
|
|
|
143
143
|
* @param callback
|
|
144
144
|
* @param middlewares
|
|
145
145
|
*/
|
|
146
|
-
static async group(prefix,
|
|
147
|
-
await super.group(prefix,
|
|
146
|
+
static async group(prefix, source, middlewares) {
|
|
147
|
+
await super.group(prefix, source, middlewares);
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* Adds global middlewares to the router, which will be applied to all routes.
|
package/dist/h3/router.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.cjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.cjs";
|
|
2
2
|
import { H3App, Handler, HttpContext, Middleware as Middleware$1 } from "../types/h3.cjs";
|
|
3
3
|
import { Route } from "../Route.cjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.cjs";
|
|
@@ -101,7 +101,7 @@ declare class Router extends CoreRouter {
|
|
|
101
101
|
* @param callback
|
|
102
102
|
* @param middlewares
|
|
103
103
|
*/
|
|
104
|
-
static group(prefix: string,
|
|
104
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware$1[]): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
107
107
|
*
|
package/dist/h3/router.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.mjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.mjs";
|
|
2
2
|
import { H3App, Handler, HttpContext, Middleware as Middleware$1 } from "../types/h3.mjs";
|
|
3
3
|
import { Route } from "../Route.mjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.mjs";
|
|
@@ -101,7 +101,7 @@ declare class Router extends CoreRouter {
|
|
|
101
101
|
* @param callback
|
|
102
102
|
* @param middlewares
|
|
103
103
|
*/
|
|
104
|
-
static group(prefix: string,
|
|
104
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware$1[]): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Adds global middlewares to the router, which will be applied to all routes.
|
|
107
107
|
*
|
package/dist/h3/router.mjs
CHANGED
|
@@ -143,8 +143,8 @@ var Router = class Router extends CoreRouter {
|
|
|
143
143
|
* @param callback
|
|
144
144
|
* @param middlewares
|
|
145
145
|
*/
|
|
146
|
-
static async group(prefix,
|
|
147
|
-
await super.group(prefix,
|
|
146
|
+
static async group(prefix, source, middlewares) {
|
|
147
|
+
await super.group(prefix, source, middlewares);
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* Adds global middlewares to the router, which will be applied to all routes.
|
package/dist/hono/router.cjs
CHANGED
|
@@ -147,8 +147,8 @@ var Router = class Router extends require_router.CoreRouter {
|
|
|
147
147
|
* @param callback
|
|
148
148
|
* @param middlewares
|
|
149
149
|
*/
|
|
150
|
-
static async group(prefix,
|
|
151
|
-
await super.group(prefix,
|
|
150
|
+
static async group(prefix, source, middlewares) {
|
|
151
|
+
await super.group(prefix, source, middlewares);
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* Apply middlewares to a group of routes defined within the callback
|
package/dist/hono/router.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.cjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.cjs";
|
|
2
2
|
import { Handler, HonoApp, HttpContext, Middleware } from "../types/hono.cjs";
|
|
3
3
|
import { Route } from "../Route.cjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.cjs";
|
|
@@ -101,7 +101,7 @@ declare class Router extends CoreRouter {
|
|
|
101
101
|
* @param callback
|
|
102
102
|
* @param middlewares
|
|
103
103
|
*/
|
|
104
|
-
static group(prefix: string,
|
|
104
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Apply middlewares to a group of routes defined within the callback
|
|
107
107
|
*
|
package/dist/hono/router.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.mjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.mjs";
|
|
2
2
|
import { Handler, HonoApp, HttpContext, Middleware } from "../types/hono.mjs";
|
|
3
3
|
import { Route } from "../Route.mjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.mjs";
|
|
@@ -101,7 +101,7 @@ declare class Router extends CoreRouter {
|
|
|
101
101
|
* @param callback
|
|
102
102
|
* @param middlewares
|
|
103
103
|
*/
|
|
104
|
-
static group(prefix: string,
|
|
104
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Apply middlewares to a group of routes defined within the callback
|
|
107
107
|
*
|
package/dist/hono/router.mjs
CHANGED
|
@@ -147,8 +147,8 @@ var Router = class Router extends CoreRouter {
|
|
|
147
147
|
* @param callback
|
|
148
148
|
* @param middlewares
|
|
149
149
|
*/
|
|
150
|
-
static async group(prefix,
|
|
151
|
-
await super.group(prefix,
|
|
150
|
+
static async group(prefix, source, middlewares) {
|
|
151
|
+
await super.group(prefix, source, middlewares);
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* Apply middlewares to a group of routes defined within the callback
|
package/dist/index.cjs
CHANGED
|
@@ -5,8 +5,8 @@ const require_Route = require('./Route.cjs');
|
|
|
5
5
|
const require_Request = require('./core/Request.cjs');
|
|
6
6
|
const require_Response = require('./core/Response.cjs');
|
|
7
7
|
const require_plugins = require('./core/plugins.cjs');
|
|
8
|
-
const require_router = require('./core/router.cjs');
|
|
9
8
|
const require_helpers = require('./core/helpers.cjs');
|
|
9
|
+
const require_router = require('./core/router.cjs');
|
|
10
10
|
require('./core/index.cjs');
|
|
11
11
|
|
|
12
12
|
exports.ClearRequest = require_ClearRequest.ClearRequest;
|
|
@@ -16,4 +16,5 @@ exports.Request = require_Request.Request;
|
|
|
16
16
|
exports.Response = require_Response.Response;
|
|
17
17
|
exports.Route = require_Route.Route;
|
|
18
18
|
exports.definePlugin = require_plugins.definePlugin;
|
|
19
|
+
exports.importFile = require_helpers.importFile;
|
|
19
20
|
exports.wrap = require_helpers.wrap;
|
package/dist/index.d.cts
CHANGED
|
@@ -6,5 +6,5 @@ import { ClearRequest } from "./ClearRequest.cjs";
|
|
|
6
6
|
import { Controller } from "./Controller.cjs";
|
|
7
7
|
import { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, definePlugin } from "./core/plugins.cjs";
|
|
8
8
|
import { CoreRouter } from "./core/router.cjs";
|
|
9
|
-
import { wrap } from "./core/helpers.cjs";
|
|
10
|
-
export { ClearHttpContext, ClearRequest, ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, Controller, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, Route, RouteParameter, definePlugin, wrap };
|
|
9
|
+
import { importFile, wrap } from "./core/helpers.cjs";
|
|
10
|
+
export { ClearHttpContext, ClearRequest, ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, Controller, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, Route, RouteParameter, definePlugin, importFile, wrap };
|
package/dist/index.d.mts
CHANGED
|
@@ -6,5 +6,5 @@ import { ClearRequest } from "./ClearRequest.mjs";
|
|
|
6
6
|
import { Controller } from "./Controller.mjs";
|
|
7
7
|
import { ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, definePlugin } from "./core/plugins.mjs";
|
|
8
8
|
import { CoreRouter } from "./core/router.mjs";
|
|
9
|
-
import { wrap } from "./core/helpers.mjs";
|
|
10
|
-
export { ClearHttpContext, ClearRequest, ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, Controller, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, Route, RouteParameter, definePlugin, wrap };
|
|
9
|
+
import { importFile, wrap } from "./core/helpers.mjs";
|
|
10
|
+
export { ClearHttpContext, ClearRequest, ClearRouterPlugin, ClearRouterPluginArgumentsContext, ClearRouterPluginContext, ClearRouterPluginInput, ClearRouterPluginRequestContext, Controller, CoreRouter, PluginArgumentsResolver, PluginBind, PluginBindFactory, PluginBindValue, PluginSetupResult, Request, Response, Route, RouteParameter, definePlugin, importFile, wrap };
|
package/dist/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { Route } from "./Route.mjs";
|
|
|
4
4
|
import { Request } from "./core/Request.mjs";
|
|
5
5
|
import { Response } from "./core/Response.mjs";
|
|
6
6
|
import { definePlugin } from "./core/plugins.mjs";
|
|
7
|
+
import { importFile, wrap } from "./core/helpers.mjs";
|
|
7
8
|
import { CoreRouter } from "./core/router.mjs";
|
|
8
|
-
import { wrap } from "./core/helpers.mjs";
|
|
9
9
|
import "./core/index.mjs";
|
|
10
10
|
|
|
11
|
-
export { ClearRequest, Controller, CoreRouter, Request, Response, Route, definePlugin, wrap };
|
|
11
|
+
export { ClearRequest, Controller, CoreRouter, Request, Response, Route, definePlugin, importFile, wrap };
|
package/dist/koa/router.cjs
CHANGED
|
@@ -157,8 +157,8 @@ var Router = class Router extends require_router.CoreRouter {
|
|
|
157
157
|
* @param callback
|
|
158
158
|
* @param middlewares
|
|
159
159
|
*/
|
|
160
|
-
static async group(prefix,
|
|
161
|
-
await super.group(prefix,
|
|
160
|
+
static async group(prefix, source, middlewares) {
|
|
161
|
+
await super.group(prefix, source, middlewares);
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Apply middlewares to a group of routes defined within the callback
|
package/dist/koa/router.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.cjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.cjs";
|
|
2
2
|
import { Handler, HttpContext, KoaRouterApp, Middleware } from "../types/koa.cjs";
|
|
3
3
|
import { Route } from "../Route.cjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.cjs";
|
|
@@ -102,7 +102,7 @@ declare class Router extends CoreRouter {
|
|
|
102
102
|
* @param callback
|
|
103
103
|
* @param middlewares
|
|
104
104
|
*/
|
|
105
|
-
static group(prefix: string,
|
|
105
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
106
106
|
/**
|
|
107
107
|
* Apply middlewares to a group of routes defined within the callback
|
|
108
108
|
*
|
package/dist/koa/router.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiResourceMiddleware, HttpMethod, ResourceAction } from "../types/basic.mjs";
|
|
1
|
+
import { ApiResourceMiddleware, HttpMethod, ResourceAction, RouteGroupSource } from "../types/basic.mjs";
|
|
2
2
|
import { Handler, HttpContext, KoaRouterApp, Middleware } from "../types/koa.mjs";
|
|
3
3
|
import { Route } from "../Route.mjs";
|
|
4
4
|
import { ResourceRoutes } from "../ResourceRoutes.mjs";
|
|
@@ -102,7 +102,7 @@ declare class Router extends CoreRouter {
|
|
|
102
102
|
* @param callback
|
|
103
103
|
* @param middlewares
|
|
104
104
|
*/
|
|
105
|
-
static group(prefix: string,
|
|
105
|
+
static group(prefix: string, source: RouteGroupSource, middlewares?: Middleware[]): Promise<void>;
|
|
106
106
|
/**
|
|
107
107
|
* Apply middlewares to a group of routes defined within the callback
|
|
108
108
|
*
|
package/dist/koa/router.mjs
CHANGED
|
@@ -157,8 +157,8 @@ var Router = class Router extends CoreRouter {
|
|
|
157
157
|
* @param callback
|
|
158
158
|
* @param middlewares
|
|
159
159
|
*/
|
|
160
|
-
static async group(prefix,
|
|
161
|
-
await super.group(prefix,
|
|
160
|
+
static async group(prefix, source, middlewares) {
|
|
161
|
+
await super.group(prefix, source, middlewares);
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Apply middlewares to a group of routes defined within the callback
|
package/dist/types/basic.d.cts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { JitiOptions, JitiResolveOptions } from "jiti";
|
|
2
|
+
|
|
1
3
|
//#region src/types/basic.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Controller method reference
|
|
4
6
|
*/
|
|
5
7
|
type ControllerHandler = [any, string];
|
|
6
8
|
type MaybePromise<T = any> = T | Promise<T>;
|
|
9
|
+
type RouteGroupCallback = () => MaybePromise<void>;
|
|
10
|
+
type RouteGroupSource = RouteGroupCallback | string;
|
|
7
11
|
type MiddlewareHandle<Args extends any[] = any[], Return = any> = (...args: Args) => MaybePromise<Return>;
|
|
8
12
|
type MiddlewareClass<M extends MiddlewareHandle = MiddlewareHandle> = new () => {
|
|
9
13
|
handle: M;
|
|
@@ -48,5 +52,12 @@ interface RouterConfig {
|
|
|
48
52
|
autoDiscover?: boolean;
|
|
49
53
|
};
|
|
50
54
|
}
|
|
55
|
+
interface FileImporter {
|
|
56
|
+
<T = unknown>(filePath: string): Promise<T>;
|
|
57
|
+
<T = unknown>(filePath: string, userOptions?: JitiOptions | undefined): Promise<T>;
|
|
58
|
+
<T = unknown>(filePath: string, userOptions?: JitiOptions | undefined, resolveOptions?: (JitiResolveOptions & {
|
|
59
|
+
default?: true;
|
|
60
|
+
})): Promise<T>;
|
|
61
|
+
}
|
|
51
62
|
//#endregion
|
|
52
|
-
export { ApiResourceMiddleware, ClassMiddleware, ControllerHandler, HttpMethod, MiddlewareHandle, RequestData, ResourceAction, RouterConfig };
|
|
63
|
+
export { ApiResourceMiddleware, ClassMiddleware, ControllerHandler, FileImporter, HttpMethod, MiddlewareHandle, RequestData, ResourceAction, RouteGroupSource, RouterConfig };
|
package/dist/types/basic.d.mts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { JitiOptions, JitiResolveOptions } from "jiti";
|
|
2
|
+
|
|
1
3
|
//#region src/types/basic.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* Controller method reference
|
|
4
6
|
*/
|
|
5
7
|
type ControllerHandler = [any, string];
|
|
6
8
|
type MaybePromise<T = any> = T | Promise<T>;
|
|
9
|
+
type RouteGroupCallback = () => MaybePromise<void>;
|
|
10
|
+
type RouteGroupSource = RouteGroupCallback | string;
|
|
7
11
|
type MiddlewareHandle<Args extends any[] = any[], Return = any> = (...args: Args) => MaybePromise<Return>;
|
|
8
12
|
type MiddlewareClass<M extends MiddlewareHandle = MiddlewareHandle> = new () => {
|
|
9
13
|
handle: M;
|
|
@@ -48,5 +52,12 @@ interface RouterConfig {
|
|
|
48
52
|
autoDiscover?: boolean;
|
|
49
53
|
};
|
|
50
54
|
}
|
|
55
|
+
interface FileImporter {
|
|
56
|
+
<T = unknown>(filePath: string): Promise<T>;
|
|
57
|
+
<T = unknown>(filePath: string, userOptions?: JitiOptions | undefined): Promise<T>;
|
|
58
|
+
<T = unknown>(filePath: string, userOptions?: JitiOptions | undefined, resolveOptions?: (JitiResolveOptions & {
|
|
59
|
+
default?: true;
|
|
60
|
+
})): Promise<T>;
|
|
61
|
+
}
|
|
51
62
|
//#endregion
|
|
52
|
-
export { ApiResourceMiddleware, ClassMiddleware, ControllerHandler, HttpMethod, MiddlewareHandle, RequestData, ResourceAction, RouterConfig };
|
|
63
|
+
export { ApiResourceMiddleware, ClassMiddleware, ControllerHandler, FileImporter, HttpMethod, MaybePromise, MiddlewareClass, MiddlewareHandle, MiddlewareInstance, RequestData, ResourceAction, RouteGroupCallback, RouteGroupSource, RouterConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ApiResourceMiddleware, ClassMiddleware, ControllerHandler, FileImporter, HttpMethod, MaybePromise, MiddlewareClass, MiddlewareHandle, MiddlewareInstance, RequestData, ResourceAction, RouteGroupCallback, RouteGroupSource, RouterConfig } from "./basic.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clear-router",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.2",
|
|
4
4
|
"description": "Laravel-style routing for Node.js with support for Express, H3, Fastify, Hono, and Koa, including CommonJS, ESM, and TypeScript support.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"h3",
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"LICENSE"
|
|
83
83
|
],
|
|
84
84
|
"peerDependencies": {
|
|
85
|
+
"@h3ravel/support": "^0.15.11",
|
|
85
86
|
"@koa/router": "^15.0.0",
|
|
86
87
|
"express": "^5.1.0",
|
|
87
88
|
"fastify": "^5.0.0",
|
|
88
89
|
"h3": "^2.0.1-rc.16",
|
|
89
90
|
"hono": "^4.0.0",
|
|
90
91
|
"koa": "^3.0.0",
|
|
91
|
-
"@h3ravel/support": "^0.15.11",
|
|
92
92
|
"reflect-metadata": "^0.2.2"
|
|
93
93
|
},
|
|
94
94
|
"peerDependenciesMeta": {
|
|
@@ -144,6 +144,9 @@
|
|
|
144
144
|
"engines": {
|
|
145
145
|
"node": ">=20.0.0"
|
|
146
146
|
},
|
|
147
|
+
"dependencies": {
|
|
148
|
+
"jiti": "^2.7.0"
|
|
149
|
+
},
|
|
147
150
|
"scripts": {
|
|
148
151
|
"test": "vitest run",
|
|
149
152
|
"test:watch": "vitest --watch",
|