koatty 3.13.2 → 4.0.0

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/package.json CHANGED
@@ -1,106 +1,107 @@
1
- {
2
- "name": "koatty",
3
- "version": "3.13.2",
4
- "description": "Koa2 + Typescript = koatty. Use Typescript's decorator implement auto injection.",
5
- "scripts": {
6
- "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
7
- "build:cp": "node scripts/postBuild && npx copyfiles package.json LICENSE README.md dist/",
8
- "build:js": "npx rollup --bundleConfigAsCjs -c .rollup.config.js",
9
- "build:doc": "npx api-documenter markdown --input temp --output docs/api",
10
- "build:dts": "npx tsc && npx api-extractor run --local --verbose",
11
- "eslint": "eslint --ext .ts,.js ./",
12
- "prepublishOnly": "npm test && npm run build && git push --follow-tags origin",
13
- "prerelease": "npm test && npm run build",
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"
21
- },
22
- "main": "./dist/index.js",
23
- "exports": {
24
- "require": "./dist/index.js",
25
- "import": "./dist/index.mjs",
26
- "types": "./dist/index.d.ts"
27
- },
28
- "directories": {
29
- "doc": "docs"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "git+https://github.com/thinkkoa/koatty.git"
34
- },
35
- "engines": {
36
- "node": ">12.0.0"
37
- },
38
- "author": {
39
- "name": "richenlin",
40
- "email": "richenlin@gmail.com"
41
- },
42
- "license": "BSD-3-Clause",
43
- "bugs": {
44
- "url": "https://github.com/thinkkoa/koatty/issues"
45
- },
46
- "homepage": "https://github.com/thinkkoa/koatty",
47
- "maintainers": [
48
- {
49
- "name": "richenlin",
50
- "email": "richenlin@gmail.com"
51
- }
52
- ],
53
- "devDependencies": {
54
- "@commitlint/cli": "^19.x.x",
55
- "@commitlint/config-conventional": "^19.x.x",
56
- "@grpc/grpc-js": "^1.12.2",
57
- "@microsoft/api-documenter": "^7.x.x",
58
- "@microsoft/api-extractor": "^7.x.x",
59
- "@rollup/plugin-commonjs": "^28.x.x",
60
- "@rollup/plugin-json": "^6.x.x",
61
- "@rollup/plugin-node-resolve": "^16.0.1",
62
- "@rollup/plugin-terser": "^0.x.x",
63
- "@types/formidable": "^3.x.x",
64
- "@types/jest": "^29.x.x",
65
- "@types/koa": "^2.x.x",
66
- "@types/koa-compose": "^3.x.x",
67
- "@types/lodash": "^4.x.x",
68
- "@types/node": "^22.x.x",
69
- "@types/on-finished": "^2.x.x",
70
- "@types/supertest": "^6.x.x",
71
- "@types/ws": "^8.x.x",
72
- "@typescript-eslint/eslint-plugin": "^8.x.x",
73
- "@typescript-eslint/parser": "^8.x.x",
74
- "conventional-changelog-cli": "^5.x.x",
75
- "eslint": "^8.x.x",
76
- "eslint-plugin-jest": "^28.x.x",
77
- "husky": "^4.x.x",
78
- "jest": "^29.x.x",
79
- "jest-html-reporters": "^3.x.x",
80
- "koatty_validation": "~1.x.x",
81
- "reflect-metadata": "^0.x.x",
82
- "rollup": "^4.x.x",
83
- "rollup-plugin-delete": "^2.x.x",
84
- "rollup-plugin-typescript2": "^0.x.x",
85
- "standard-version": "^9.x.x",
86
- "supertest": "^7.x.x",
87
- "ts-jest": "^29.x.x",
88
- "ts-node": "^10.x.x",
89
- "tslib": "^2.x.x",
90
- "typescript": "^5.x.x"
91
- },
92
- "dependencies": {
93
- "koa": "~2.16.1",
94
- "koatty_config": "~1.2.0",
95
- "koatty_container": "~1.12.0",
96
- "koatty_core": "~1.16.2",
97
- "koatty_exception": "~1.6.0",
98
- "koatty_lib": "~1.4.2",
99
- "koatty_loader": "~1.1.0",
100
- "koatty_logger": "~2.2.0",
101
- "koatty_router": "~1.15.0",
102
- "koatty_serve": "~2.4.0",
103
- "koatty_trace": "~1.15.2",
104
- "ts-morph": "^25.0.1"
105
- }
106
- }
1
+ {
2
+ "name": "koatty",
3
+ "version": "4.0.0",
4
+ "description": "Koa + Typescript = koatty. Use Typescript's decorator implement auto injection.",
5
+ "scripts": {
6
+ "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp && npm run build:fix",
7
+ "build:cp": "npx copyfiles package.json LICENSE README.md dist/ && node scripts/postBuild",
8
+ "build:fix": "node scripts/fixWorkspaceDeps",
9
+ "build:js": "npx rollup --bundleConfigAsCjs -c .rollup.config.js",
10
+ "build:doc": "npx api-documenter markdown --input temp --output docs/api",
11
+ "build:dts": "npx tsc --skipLibCheck && npx api-extractor run --local --verbose",
12
+ "eslint": "eslint --ext .ts,.js ./",
13
+ "prepublishOnly": "echo 'Skipping prepublishOnly in monorepo'",
14
+ "prerelease": "npm test && npm run build",
15
+ "release": "standard-version",
16
+ "release:pre": "npm run release -- --prerelease",
17
+ "release:major": "npm run release -- --release-as major",
18
+ "release:minor": "npm run release -- --release-as minor",
19
+ "test": "npm run eslint && jest --passWithNoTests",
20
+ "test:cov": "jest --collectCoverage --detectOpenHandles",
21
+ "version": "conventional-changelog -p angular -i CHANGELOG.md -s"
22
+ },
23
+ "main": "./dist/index.js",
24
+ "exports": {
25
+ "require": "./dist/index.js",
26
+ "import": "./dist/index.mjs",
27
+ "types": "./dist/index.d.ts"
28
+ },
29
+ "directories": {
30
+ "doc": "docs"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/thinkkoa/koatty.git"
35
+ },
36
+ "engines": {
37
+ "node": ">=18.0.0"
38
+ },
39
+ "author": {
40
+ "name": "richenlin",
41
+ "email": "richenlin@gmail.com"
42
+ },
43
+ "license": "BSD-3-Clause",
44
+ "bugs": {
45
+ "url": "https://github.com/thinkkoa/koatty/issues"
46
+ },
47
+ "homepage": "https://github.com/thinkkoa/koatty",
48
+ "maintainers": [
49
+ {
50
+ "name": "richenlin",
51
+ "email": "richenlin@gmail.com"
52
+ }
53
+ ],
54
+ "devDependencies": {
55
+ "@commitlint/cli": "^19.x.x",
56
+ "@commitlint/config-conventional": "^19.x.x",
57
+ "@grpc/grpc-js": "^1.12.2",
58
+ "@microsoft/api-documenter": "^7.x.x",
59
+ "@microsoft/api-extractor": "^7.x.x",
60
+ "@rollup/plugin-commonjs": "^28.x.x",
61
+ "@rollup/plugin-json": "^6.x.x",
62
+ "@rollup/plugin-node-resolve": "^16.0.1",
63
+ "@rollup/plugin-terser": "^0.x.x",
64
+ "@types/formidable": "^3.x.x",
65
+ "@types/jest": "^29.x.x",
66
+ "@types/koa": "^2.x.x",
67
+ "@types/koa-compose": "^3.x.x",
68
+ "@types/lodash": "^4.x.x",
69
+ "@types/node": "^22.x.x",
70
+ "@types/on-finished": "^2.x.x",
71
+ "@types/supertest": "^6.x.x",
72
+ "@types/ws": "^8.x.x",
73
+ "@typescript-eslint/eslint-plugin": "^8.x.x",
74
+ "@typescript-eslint/parser": "^8.x.x",
75
+ "conventional-changelog-cli": "^5.x.x",
76
+ "eslint": "^8.x.x",
77
+ "eslint-plugin-jest": "^28.x.x",
78
+ "husky": "^4.x.x",
79
+ "jest": "^29.x.x",
80
+ "jest-html-reporters": "^3.x.x",
81
+ "koatty_validation": "~1.x.x",
82
+ "reflect-metadata": "^0.x.x",
83
+ "rollup": "^4.x.x",
84
+ "rollup-plugin-delete": "^2.x.x",
85
+ "rollup-plugin-typescript2": "^0.x.x",
86
+ "standard-version": "^9.x.x",
87
+ "supertest": "^7.x.x",
88
+ "ts-jest": "^29.x.x",
89
+ "ts-node": "^10.x.x",
90
+ "tslib": "^2.x.x",
91
+ "typescript": "^5.x.x"
92
+ },
93
+ "dependencies": {
94
+ "koa": "^3.0.3",
95
+ "koatty_config": "^1.2.2",
96
+ "koatty_container": "^1.17.0",
97
+ "koatty_core": "^2.0.8",
98
+ "koatty_exception": "^2.0.4",
99
+ "koatty_lib": "^1.4.3",
100
+ "koatty_loader": "^1.3.0",
101
+ "koatty_logger": "2.8.1",
102
+ "koatty_router": "^2.0.2",
103
+ "koatty_serve": "^3.0.0",
104
+ "koatty_trace": "^2.0.0",
105
+ "ts-morph": "^27.0.2"
106
+ }
107
+ }
@@ -0,0 +1,88 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var commonjs = require('@rollup/plugin-commonjs');
6
+ var json = require('@rollup/plugin-json');
7
+ var resolve = require('@rollup/plugin-node-resolve');
8
+ var module$1 = require('module');
9
+ var del = require('rollup-plugin-delete');
10
+ var typescript = require('rollup-plugin-typescript2');
11
+ var terser = require('@rollup/plugin-terser');
12
+
13
+ /**
14
+ *
15
+ * @Description:
16
+ * @Author: richen
17
+ * @Date: 2024-11-07 11:22:26
18
+ * @LastEditTime: 2025-04-02 15:05:36
19
+ * @License: BSD (3-Clause)
20
+ * @Copyright (c): <richenlin(at)gmail.com>
21
+ */
22
+ const pkg = require('./package.json');
23
+
24
+ var _rollup_config = [
25
+ {
26
+ input: './src/index.ts',
27
+ output: [
28
+ {
29
+ format: 'cjs',
30
+ file: './dist/index.js',
31
+ banner: require('./scripts/copyright'),
32
+ },
33
+ {
34
+ format: 'es',
35
+ file: './dist/index.mjs',
36
+ banner: require('./scripts/copyright'),
37
+ }
38
+ ],
39
+ plugins: [
40
+ del({ targets: ["dist/*", "temp/*", "docs/api"] }),
41
+ // babel({
42
+ // babelHelpers: "runtime",
43
+ // configFile: './babel.config.js',
44
+ // exclude: 'node_modules/**',
45
+ // }),
46
+ json(),
47
+ resolve({
48
+ preferBuiltins: true, // 优先选择内置模块
49
+ }),
50
+ commonjs(),
51
+ typescript({
52
+ tsconfigOverride: {
53
+ compilerOptions: {
54
+ declaration: false,
55
+ declarationMap: false,
56
+ module: "ESNext"
57
+ }
58
+ }
59
+ }),
60
+ terser({
61
+ compress: {
62
+ defaults: false, // 改为 `false`(新版本默认启用所有优化)
63
+ arrows: true, // 保留箭头函数转换
64
+ booleans: true, // 保留布尔简化
65
+ drop_console: false, // 保留 console
66
+ keep_fnames: true // 保留函数名
67
+ },
68
+ mangle: {
69
+ reserved: ['$super'], // 保留关键字
70
+ keep_classnames: true // 保留类名
71
+ },
72
+ format: {
73
+ beautify: true, // 启用格式化
74
+ indent_level: 2, // 缩进层级
75
+ comments: /@Author|@License|@Copyright/ // 保留特定注释
76
+ }
77
+ })
78
+ ],
79
+ external: [
80
+ ...module$1.builtinModules, // 排除 Node.js 内置模块
81
+ ...Object.keys(pkg.dependencies || {}), // 排除 package.json 中的外部依赖
82
+ ...Object.keys(pkg.devDependencies || {}),
83
+ ],
84
+ },
85
+
86
+ ];
87
+
88
+ exports.default = _rollup_config;
@@ -1,15 +1,15 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "types": [
5
- "jest",
6
- "node"
7
- ]
8
- },
9
- "exclude": [
10
- "node_modules"
11
- ],
12
- "include": [
13
- "test/*.test.ts"
14
- ]
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "types": [
5
+ "jest",
6
+ "node"
7
+ ]
8
+ },
9
+ "exclude": [
10
+ "node_modules"
11
+ ],
12
+ "include": [
13
+ "test/*.test.ts"
14
+ ]
15
15
  }
@@ -1,42 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "launch",
7
- "name": "Koatty Demo Program",
8
- "args": [
9
- "${workspaceRoot}/demo/src/App.ts"
10
- ],
11
- "runtimeArgs": [
12
- "--nolazy",
13
- "-r",
14
- "ts-node/register"
15
- ],
16
- "env": {
17
- "NODE_ENV": "development"
18
- },
19
- "outputCapture": "std",
20
- "sourceMaps": true,
21
- "cwd": "${workspaceRoot}",
22
- "protocol": "inspector",
23
- "internalConsoleOptions": "neverOpen"
24
- },
25
- {
26
- "type": "node",
27
- "name": "vscode-jest-tests",
28
- "request": "launch",
29
- "console": "integratedTerminal",
30
- "internalConsoleOptions": "neverOpen",
31
- "disableOptimisticBPs": true,
32
- "program": "${workspaceFolder}/node_modules/.bin/jest",
33
- "cwd": "${workspaceFolder}",
34
- "args": [
35
- "--config",
36
- "jest.config.js",
37
- "--runInBand",
38
- "--watchAll=false"
39
- ]
40
- }
41
- ]
42
- }