koatty_router 1.7.5 → 1.7.6

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.
@@ -0,0 +1,63 @@
1
+ /*
2
+ * @Description:
3
+ * @Usage:
4
+ * @Author: richen
5
+ * @Date: 2021-12-17 10:20:44
6
+ * @LastEditTime: 2021-12-18 11:58:46
7
+ */
8
+ import json from "@rollup/plugin-json";
9
+ import typescript from 'rollup-plugin-typescript2';
10
+ // import babel from '@rollup/plugin-babel';
11
+
12
+ export default [
13
+ {
14
+ input: './src/index.ts',
15
+ output: [{
16
+ format: 'cjs',
17
+ file: './dist/index.js',
18
+ banner: require('./scripts/copyright')
19
+ }],
20
+ plugins: [
21
+ // babel({
22
+ // babelHelpers: "runtime",
23
+ // configFile: './babel.config.js',
24
+ // exclude: 'node_modules/**',
25
+ // }),
26
+ json(),
27
+ typescript({
28
+ tsconfigOverride: {
29
+ compilerOptions: {
30
+ declaration: false,
31
+ declarationMap: false,
32
+ module: "ESNext"
33
+ }
34
+ }
35
+ })
36
+ ]
37
+ },
38
+ {
39
+ input: './src/index.ts',
40
+ output: [{
41
+ format: 'es',
42
+ file: './dist/index.mjs',
43
+ banner: require('./scripts/copyright')
44
+ }],
45
+ plugins: [
46
+ // babel({
47
+ // babelHelpers: "runtime",
48
+ // configFile: './babel.config.js',
49
+ // exclude: 'node_modules/**',
50
+ // }),
51
+ json(),
52
+ typescript({
53
+ tsconfigOverride: {
54
+ compilerOptions: {
55
+ declaration: false,
56
+ declarationMap: false,
57
+ module: "ESNext"
58
+ }
59
+ }
60
+ })
61
+ ]
62
+ }
63
+ ]
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.7.6](https://github.com/koatty/koatty_router/compare/v1.7.5...v1.7.6) (2022-05-27)
6
+
5
7
  ### [1.7.5](https://github.com/koatty/koatty_router/compare/v1.7.4...v1.7.5) (2022-03-14)
6
8
 
7
9
  ### [1.7.4](https://github.com/koatty/koatty_router/compare/v1.7.3...v1.7.4) (2022-03-14)
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2022-03-14 17:27:39
3
+ * @Date: 2022-05-27 10:03:18
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2022-03-14 17:27:24
3
+ * @Date: 2022-05-27 10:02:58
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -21,21 +21,21 @@ var KoaRouter = require('@koa/router');
21
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
22
22
 
23
23
  function _interopNamespace(e) {
24
- if (e && e.__esModule) return e;
25
- var n = Object.create(null);
26
- if (e) {
27
- Object.keys(e).forEach(function (k) {
28
- if (k !== 'default') {
29
- var d = Object.getOwnPropertyDescriptor(e, k);
30
- Object.defineProperty(n, k, d.get ? d : {
31
- enumerable: true,
32
- get: function () { return e[k]; }
33
- });
34
- }
24
+ if (e && e.__esModule) return e;
25
+ var n = Object.create(null);
26
+ if (e) {
27
+ Object.keys(e).forEach(function (k) {
28
+ if (k !== 'default') {
29
+ var d = Object.getOwnPropertyDescriptor(e, k);
30
+ Object.defineProperty(n, k, d.get ? d : {
31
+ enumerable: true,
32
+ get: function () { return e[k]; }
35
33
  });
36
- }
37
- n["default"] = e;
38
- return Object.freeze(n);
34
+ }
35
+ });
36
+ }
37
+ n["default"] = e;
38
+ return Object.freeze(n);
39
39
  }
40
40
 
41
41
  var Helper__namespace = /*#__PURE__*/_interopNamespace(Helper);
@@ -46,7 +46,7 @@ var KoaRouter__default = /*#__PURE__*/_interopDefaultLegacy(KoaRouter);
46
46
  * @Usage:
47
47
  * @Author: richen
48
48
  * @Date: 2021-11-24 23:21:26
49
- * @LastEditTime: 2022-03-09 18:14:25
49
+ * @LastEditTime: 2022-03-15 17:11:03
50
50
  */
51
51
  /**
52
52
  * Parameter binding assignment.
@@ -299,7 +299,7 @@ const HeadMapping = (path = "/", routerOptions = {}) => {
299
299
  * @Usage:
300
300
  * @Author: richen
301
301
  * @Date: 2021-11-10 16:58:57
302
- * @LastEditTime: 2022-03-09 18:14:12
302
+ * @LastEditTime: 2022-03-15 17:10:46
303
303
  */
304
304
  /**
305
305
  * controller handler
@@ -417,7 +417,7 @@ function injectParam(app, target, instance) {
417
417
  * @Usage:
418
418
  * @Author: richen
419
419
  * @Date: 2021-06-29 14:10:30
420
- * @LastEditTime: 2022-03-14 17:22:28
420
+ * @LastEditTime: 2022-03-15 17:10:19
421
421
  */
422
422
  class GrpcRouter {
423
423
  constructor(app, options) {
@@ -525,7 +525,7 @@ class GrpcRouter {
525
525
  * @Usage:
526
526
  * @Author: richen
527
527
  * @Date: 2021-06-28 19:02:06
528
- * @LastEditTime: 2022-03-14 17:22:32
528
+ * @LastEditTime: 2022-03-15 17:10:25
529
529
  */
530
530
  /**
531
531
  * HttpRouter class
@@ -603,7 +603,7 @@ class HttpRouter {
603
603
  * @Usage:
604
604
  * @Author: richen
605
605
  * @Date: 2021-06-29 14:16:44
606
- * @LastEditTime: 2022-03-14 17:22:41
606
+ * @LastEditTime: 2022-03-15 17:10:30
607
607
  */
608
608
  class WebsocketRouter {
609
609
  constructor(app, options) {
@@ -679,7 +679,7 @@ class WebsocketRouter {
679
679
  * @Usage:
680
680
  * @Author: richen
681
681
  * @Date: 2021-11-17 17:36:13
682
- * @LastEditTime: 2022-03-14 11:23:26
682
+ * @LastEditTime: 2022-03-15 17:11:09
683
683
  */
684
684
  /**
685
685
  * Get request header.
@@ -857,7 +857,7 @@ const Inject = (fn, name) => {
857
857
  * @Usage:
858
858
  * @Author: richen
859
859
  * @Date: 2021-06-28 18:48:14
860
- * @LastEditTime: 2022-02-23 11:16:36
860
+ * @LastEditTime: 2022-03-15 17:10:39
861
861
  */
862
862
  /**
863
863
  * get instance of Router
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2022-03-14 17:27:24
3
+ * @Date: 2022-05-27 10:02:58
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -20,7 +20,7 @@ import KoaRouter from '@koa/router';
20
20
  * @Usage:
21
21
  * @Author: richen
22
22
  * @Date: 2021-11-24 23:21:26
23
- * @LastEditTime: 2022-03-09 18:14:25
23
+ * @LastEditTime: 2022-03-15 17:11:03
24
24
  */
25
25
  /**
26
26
  * Parameter binding assignment.
@@ -273,7 +273,7 @@ const HeadMapping = (path = "/", routerOptions = {}) => {
273
273
  * @Usage:
274
274
  * @Author: richen
275
275
  * @Date: 2021-11-10 16:58:57
276
- * @LastEditTime: 2022-03-09 18:14:12
276
+ * @LastEditTime: 2022-03-15 17:10:46
277
277
  */
278
278
  /**
279
279
  * controller handler
@@ -391,7 +391,7 @@ function injectParam(app, target, instance) {
391
391
  * @Usage:
392
392
  * @Author: richen
393
393
  * @Date: 2021-06-29 14:10:30
394
- * @LastEditTime: 2022-03-14 17:22:28
394
+ * @LastEditTime: 2022-03-15 17:10:19
395
395
  */
396
396
  class GrpcRouter {
397
397
  constructor(app, options) {
@@ -499,7 +499,7 @@ class GrpcRouter {
499
499
  * @Usage:
500
500
  * @Author: richen
501
501
  * @Date: 2021-06-28 19:02:06
502
- * @LastEditTime: 2022-03-14 17:22:32
502
+ * @LastEditTime: 2022-03-15 17:10:25
503
503
  */
504
504
  /**
505
505
  * HttpRouter class
@@ -577,7 +577,7 @@ class HttpRouter {
577
577
  * @Usage:
578
578
  * @Author: richen
579
579
  * @Date: 2021-06-29 14:16:44
580
- * @LastEditTime: 2022-03-14 17:22:41
580
+ * @LastEditTime: 2022-03-15 17:10:30
581
581
  */
582
582
  class WebsocketRouter {
583
583
  constructor(app, options) {
@@ -653,7 +653,7 @@ class WebsocketRouter {
653
653
  * @Usage:
654
654
  * @Author: richen
655
655
  * @Date: 2021-11-17 17:36:13
656
- * @LastEditTime: 2022-03-14 11:23:26
656
+ * @LastEditTime: 2022-03-15 17:11:09
657
657
  */
658
658
  /**
659
659
  * Get request header.
@@ -831,7 +831,7 @@ const Inject = (fn, name) => {
831
831
  * @Usage:
832
832
  * @Author: richen
833
833
  * @Date: 2021-06-28 18:48:14
834
- * @LastEditTime: 2022-02-23 11:16:36
834
+ * @LastEditTime: 2022-03-15 17:10:39
835
835
  */
836
836
  /**
837
837
  * get instance of Router
package/dist/package.json CHANGED
@@ -1,23 +1,18 @@
1
1
  {
2
2
  "name": "koatty_router",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "Koatty routing component, adapt to http1/2, websocket, gRPC.",
5
5
  "scripts": {
6
6
  "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
7
7
  "build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
8
- "build:js": "del-cli --force dist && npx rollup -c",
8
+ "build:js": "del-cli --force dist && npx rollup -c .rollup.config.js",
9
9
  "build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
10
10
  "build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
11
11
  "eslint": "eslint --ext .ts,.js ./",
12
12
  "prepublishOnly": "npm test && npm run build",
13
13
  "prerelease": "npm test && npm run build",
14
14
  "release": "standard-version",
15
- "release:pre": "npm run release -- --prerelease",
16
- "release:major": "npm run release -- --release-as major",
17
- "release:minor": "npm run release -- --release-as minor",
18
- "test": "npm run eslint && jest --passWithNoTests",
19
- "test:cov": "jest --collectCoverage --detectOpenHandles",
20
- "version": "conventional-changelog -p angular -i CHANGELOG.md -s"
15
+ "test": "npm run eslint && jest --passWithNoTests"
21
16
  },
22
17
  "main": "./dist/index.js",
23
18
  "exports": {
@@ -34,7 +29,8 @@
34
29
  "author": "richenlin@gmail.com",
35
30
  "license": "BSD-3-Clause",
36
31
  "devDependencies": {
37
- "@grpc/grpc-js": "^1.x.x",
32
+ "@commitlint/cli": "^17.x.x",
33
+ "@commitlint/config-conventional": "^17.x.x",
38
34
  "@microsoft/api-documenter": "^7.x.x",
39
35
  "@microsoft/api-extractor": "^7.x.x",
40
36
  "@rollup/plugin-json": "^4.x.x",
@@ -42,24 +38,22 @@
42
38
  "@types/koa": "^2.x.x",
43
39
  "@types/koa__router": "^8.0.11",
44
40
  "@types/node": "^16.x.x",
45
- "@types/validator": "^13.7.0",
46
- "@types/ws": "^8.x.x",
41
+ "@types/validator": "^13.7.2",
42
+ "@types/ws": "^8.5.3",
47
43
  "@typescript-eslint/eslint-plugin": "^5.x.x",
48
44
  "@typescript-eslint/parser": "^5.x.x",
49
- "commitlint": "^15.x.x",
50
- "commitlint-config-gitmoji": "^2.x.x",
51
45
  "conventional-changelog-cli": "^2.x.x",
52
46
  "copyfiles": "^2.x.x",
53
47
  "del-cli": "^4.x.x",
54
48
  "eslint": "^8.x.x",
55
- "eslint-plugin-jest": "^25.x.x",
56
- "husky": "^7.x.x",
57
- "jest": "^27.x.x",
58
- "jest-html-reporters": "^2.x.x",
49
+ "eslint-plugin-jest": "^26.x.x",
50
+ "husky": "^4.x.x",
51
+ "jest": "^28.x.x",
52
+ "jest-html-reporters": "^3.x.x",
59
53
  "rollup": "^2.x.x",
60
54
  "rollup-plugin-typescript2": "^0.x.x",
61
55
  "standard-version": "^9.x.x",
62
- "ts-jest": "^27.x.x",
56
+ "ts-jest": "^28.x.x",
63
57
  "ts-node": "^10.x.x",
64
58
  "typescript": "^4.x.x"
65
59
  },
@@ -72,7 +66,7 @@
72
66
  "koatty_logger": "^1.x.x",
73
67
  "koatty_proto": "^1.x.x",
74
68
  "koatty_validation": "^1.x.x",
75
- "tslib": "^2.3.1"
69
+ "tslib": "^2.4.0"
76
70
  },
77
71
  "peerDependencies": {
78
72
  "koatty_container": "^1.x.x",
package/package.json CHANGED
@@ -1,23 +1,18 @@
1
1
  {
2
2
  "name": "koatty_router",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "Koatty routing component, adapt to http1/2, websocket, gRPC.",
5
5
  "scripts": {
6
6
  "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
7
7
  "build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
8
- "build:js": "del-cli --force dist && npx rollup -c",
8
+ "build:js": "del-cli --force dist && npx rollup -c .rollup.config.js",
9
9
  "build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
10
10
  "build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
11
11
  "eslint": "eslint --ext .ts,.js ./",
12
12
  "prepublishOnly": "npm test && npm run build",
13
13
  "prerelease": "npm test && npm run build",
14
14
  "release": "standard-version",
15
- "release:pre": "npm run release -- --prerelease",
16
- "release:major": "npm run release -- --release-as major",
17
- "release:minor": "npm run release -- --release-as minor",
18
- "test": "npm run eslint && jest --passWithNoTests",
19
- "test:cov": "jest --collectCoverage --detectOpenHandles",
20
- "version": "conventional-changelog -p angular -i CHANGELOG.md -s"
15
+ "test": "npm run eslint && jest --passWithNoTests"
21
16
  },
22
17
  "main": "./dist/index.js",
23
18
  "exports": {
@@ -34,7 +29,8 @@
34
29
  "author": "richenlin@gmail.com",
35
30
  "license": "BSD-3-Clause",
36
31
  "devDependencies": {
37
- "@grpc/grpc-js": "^1.x.x",
32
+ "@commitlint/cli": "^17.x.x",
33
+ "@commitlint/config-conventional": "^17.x.x",
38
34
  "@microsoft/api-documenter": "^7.x.x",
39
35
  "@microsoft/api-extractor": "^7.x.x",
40
36
  "@rollup/plugin-json": "^4.x.x",
@@ -42,24 +38,22 @@
42
38
  "@types/koa": "^2.x.x",
43
39
  "@types/koa__router": "^8.0.11",
44
40
  "@types/node": "^16.x.x",
45
- "@types/validator": "^13.7.0",
46
- "@types/ws": "^8.x.x",
41
+ "@types/validator": "^13.7.2",
42
+ "@types/ws": "^8.5.3",
47
43
  "@typescript-eslint/eslint-plugin": "^5.x.x",
48
44
  "@typescript-eslint/parser": "^5.x.x",
49
- "commitlint": "^15.x.x",
50
- "commitlint-config-gitmoji": "^2.x.x",
51
45
  "conventional-changelog-cli": "^2.x.x",
52
46
  "copyfiles": "^2.x.x",
53
47
  "del-cli": "^4.x.x",
54
48
  "eslint": "^8.x.x",
55
- "eslint-plugin-jest": "^25.x.x",
56
- "husky": "^7.x.x",
57
- "jest": "^27.x.x",
58
- "jest-html-reporters": "^2.x.x",
49
+ "eslint-plugin-jest": "^26.x.x",
50
+ "husky": "^4.x.x",
51
+ "jest": "^28.x.x",
52
+ "jest-html-reporters": "^3.x.x",
59
53
  "rollup": "^2.x.x",
60
54
  "rollup-plugin-typescript2": "^0.x.x",
61
55
  "standard-version": "^9.x.x",
62
- "ts-jest": "^27.x.x",
56
+ "ts-jest": "^28.x.x",
63
57
  "ts-node": "^10.x.x",
64
58
  "typescript": "^4.x.x"
65
59
  },
@@ -72,7 +66,7 @@
72
66
  "koatty_logger": "^1.x.x",
73
67
  "koatty_proto": "^1.x.x",
74
68
  "koatty_validation": "^1.x.x",
75
- "tslib": "^2.3.1"
69
+ "tslib": "^2.4.0"
76
70
  },
77
71
  "peerDependencies": {
78
72
  "koatty_container": "^1.x.x",