@eggjs/router 4.0.0-beta.35 → 4.0.0-beta.36

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.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { Router } from './Router.ts';
2
- export type * from './types.ts';
3
- export * from './Layer.ts';
4
- export * from './Router.ts';
5
- export * from './EggRouter.ts';
6
- export declare const KoaRouter: typeof Router;
7
- export default Router;
1
+ import { MiddlewareFunc, MiddlewareFuncWithParamProperty, MiddlewareFuncWithRouter, Next, ParamMiddlewareFunc, ResourcesController } from "./types.js";
2
+ import { Layer, LayerOptions, LayerURLOptions } from "./Layer.js";
3
+ import { AllowedMethodsOptions, MatchedResult, RegisterOptions, Router, RouterMethod, RouterOptions } from "./Router.js";
4
+ import { EggRouter } from "./EggRouter.js";
5
+
6
+ //#region src/index.d.ts
7
+ declare const KoaRouter: typeof Router;
8
+ //#endregion
9
+ export { AllowedMethodsOptions, EggRouter, KoaRouter, Layer, LayerOptions, LayerURLOptions, MatchedResult, MiddlewareFunc, MiddlewareFuncWithParamProperty, MiddlewareFuncWithRouter, Next, ParamMiddlewareFunc, RegisterOptions, ResourcesController, Router, RouterMethod, RouterOptions, Router as default };
package/dist/index.js CHANGED
@@ -1,7 +1,10 @@
1
+ import { Layer } from "./Layer.js";
1
2
  import { Router } from "./Router.js";
2
- export * from "./Layer.js";
3
- export * from "./Router.js";
4
- export * from "./EggRouter.js";
5
- export const KoaRouter = Router;
6
- export default Router;
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUdyQyxjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGdCQUFnQixDQUFDO0FBRS9CLE1BQU0sQ0FBQyxNQUFNLFNBQVMsR0FBa0IsTUFBTSxDQUFDO0FBQy9DLGVBQWUsTUFBTSxDQUFDIn0=
3
+ import { EggRouter } from "./EggRouter.js";
4
+
5
+ //#region src/index.ts
6
+ const KoaRouter = Router;
7
+ var src_default = Router;
8
+
9
+ //#endregion
10
+ export { EggRouter, KoaRouter, Layer, Router, src_default as default };
package/dist/types.d.ts CHANGED
@@ -1,18 +1,21 @@
1
- export type Next = () => Promise<void>;
2
- export type MiddlewareFunc = (ctx: any, next: Next) => Promise<void> | void;
3
- export type MiddlewareFuncWithParamProperty = MiddlewareFunc & {
4
- param?: string;
1
+ //#region src/types.d.ts
2
+ type Next = () => Promise<void>;
3
+ type MiddlewareFunc = (ctx: any, next: Next) => Promise<void> | void;
4
+ type MiddlewareFuncWithParamProperty = MiddlewareFunc & {
5
+ param?: string;
5
6
  };
6
- export type ParamMiddlewareFunc = (param: string, ctx: any, next: Next) => Promise<void> | void;
7
- export type MiddlewareFuncWithRouter<T> = MiddlewareFunc & {
8
- router: T;
7
+ type ParamMiddlewareFunc = (param: string, ctx: any, next: Next) => Promise<void> | void;
8
+ type MiddlewareFuncWithRouter<T> = MiddlewareFunc & {
9
+ router: T;
9
10
  };
10
- export interface ResourcesController {
11
- index?: MiddlewareFunc;
12
- new?: MiddlewareFunc;
13
- create?: MiddlewareFunc;
14
- show?: MiddlewareFunc;
15
- edit?: MiddlewareFunc;
16
- update?: MiddlewareFunc;
17
- destroy?: MiddlewareFunc;
11
+ interface ResourcesController {
12
+ index?: MiddlewareFunc;
13
+ new?: MiddlewareFunc;
14
+ create?: MiddlewareFunc;
15
+ show?: MiddlewareFunc;
16
+ edit?: MiddlewareFunc;
17
+ update?: MiddlewareFunc;
18
+ destroy?: MiddlewareFunc;
18
19
  }
20
+ //#endregion
21
+ export { MiddlewareFunc, MiddlewareFuncWithParamProperty, MiddlewareFuncWithRouter, Next, ParamMiddlewareFunc, ResourcesController };
package/package.json CHANGED
@@ -1,26 +1,38 @@
1
1
  {
2
2
  "name": "@eggjs/router",
3
- "version": "4.0.0-beta.35",
4
- "engines": {
5
- "node": ">=22.18.0"
6
- },
3
+ "version": "4.0.0-beta.36",
7
4
  "description": "Router middleware for egg/koa. Provides RESTful resource routing.",
5
+ "keywords": [
6
+ "koa",
7
+ "middleware",
8
+ "route",
9
+ "router"
10
+ ],
11
+ "homepage": "https://github.com/eggjs/egg/tree/next/packages/router",
12
+ "bugs": {
13
+ "url": "https://github.com/eggjs/egg/issues"
14
+ },
15
+ "license": "MIT",
16
+ "author": "eggjs",
8
17
  "repository": {
9
18
  "type": "git",
10
19
  "url": "git+https://github.com/eggjs/egg.git",
11
20
  "directory": "packages/router"
12
21
  },
13
- "bugs": {
14
- "url": "https://github.com/eggjs/egg/issues"
15
- },
16
- "homepage": "https://github.com/eggjs/egg/tree/next/packages/router",
17
- "author": "eggjs",
18
- "keywords": [
19
- "koa",
20
- "middleware",
21
- "router",
22
- "route"
22
+ "files": [
23
+ "dist"
23
24
  ],
25
+ "type": "module",
26
+ "main": "./dist/index.js",
27
+ "module": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": "./dist/index.js",
31
+ "./package.json": "./package.json"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
24
36
  "dependencies": {
25
37
  "http-errors": "^2.0.0",
26
38
  "inflection": "^3.0.0",
@@ -36,34 +48,16 @@
36
48
  "@types/koa-compose": "^3.2.8",
37
49
  "@types/methods": "^1.1.4",
38
50
  "@types/urijs": "^1.19.25",
39
- "tsdown": "^0.17.0",
40
51
  "typescript": "^5.9.3",
41
- "vitest": "^4.0.15",
42
- "@eggjs/tsconfig": "3.1.0-beta.35",
43
- "@eggjs/koa": "3.1.0-beta.35",
44
- "@eggjs/supertest": "9.0.0-beta.35"
52
+ "@eggjs/koa": "3.1.0-beta.36",
53
+ "@eggjs/supertest": "9.0.0-beta.36",
54
+ "@eggjs/tsconfig": "3.1.0-beta.36"
45
55
  },
46
- "license": "MIT",
47
- "files": [
48
- "dist"
49
- ],
50
- "type": "module",
51
- "exports": {
52
- ".": "./dist/index.js",
53
- "./package.json": "./package.json"
54
- },
55
- "publishConfig": {
56
- "access": "public"
56
+ "engines": {
57
+ "node": ">=22.18.0"
57
58
  },
58
- "main": "./dist/index.js",
59
- "types": "./dist/index.d.ts",
60
- "module": "./dist/index.js",
61
59
  "scripts": {
62
- "lint": "oxlint --type-aware",
63
- "typecheck": "tsc --noEmit",
64
- "test": "vitest run",
65
- "build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
66
- "prebench": "npm run build",
60
+ "typecheck": "tsgo --noEmit",
67
61
  "bench": "cd bench && make"
68
62
  }
69
63
  }
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9