koatty 3.13.0 → 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.
@@ -0,0 +1 @@
1
+ {"dependencies":{"koa":"^3.0.3","koatty_config":"workspace:*","koatty_container":"^1.17.0","koatty_core":"workspace:*","koatty_exception":"workspace:*","koatty_lib":"^1.4.3","koatty_loader":"^1.3.0","koatty_logger":"2.8.1","koatty_router":"workspace:*","koatty_serve":"workspace:*","koatty_trace":"workspace:*","ts-morph":"^27.0.2"},"devDependencies":{"@commitlint/cli":"^19.x.x","@commitlint/config-conventional":"^19.x.x","@grpc/grpc-js":"^1.12.2","@microsoft/api-documenter":"^7.x.x","@microsoft/api-extractor":"^7.x.x","@rollup/plugin-commonjs":"^28.x.x","@rollup/plugin-json":"^6.x.x","@rollup/plugin-node-resolve":"^16.0.1","@rollup/plugin-terser":"^0.x.x","@types/formidable":"^3.x.x","@types/jest":"^29.x.x","@types/koa":"^2.x.x","@types/koa-compose":"^3.x.x","@types/lodash":"^4.x.x","@types/node":"^22.x.x","@types/on-finished":"^2.x.x","@types/supertest":"^6.x.x","@types/ws":"^8.x.x","@typescript-eslint/eslint-plugin":"^8.x.x","@typescript-eslint/parser":"^8.x.x","conventional-changelog-cli":"^5.x.x","eslint":"^8.x.x","eslint-plugin-jest":"^28.x.x","husky":"^4.x.x","jest":"^29.x.x","jest-html-reporters":"^3.x.x","koatty_validation":"~1.x.x","reflect-metadata":"^0.x.x","rollup":"^4.x.x","rollup-plugin-delete":"^2.x.x","rollup-plugin-typescript2":"^0.x.x","standard-version":"^9.x.x","supertest":"^7.x.x","ts-jest":"^29.x.x","ts-node":"^10.x.x","tslib":"^2.x.x","typescript":"^5.x.x"}}
package/.rollup.config.js CHANGED
@@ -1,82 +1,89 @@
1
- /**
2
- *
3
- * @Description:
4
- * @Author: richen
5
- * @Date: 2024-11-07 11:22:26
6
- * @LastEditTime: 2025-04-02 15:05:36
7
- * @License: BSD (3-Clause)
8
- * @Copyright (c): <richenlin(at)gmail.com>
9
- */
10
- import commonjs from '@rollup/plugin-commonjs';
11
- import json from "@rollup/plugin-json";
12
- import resolve from '@rollup/plugin-node-resolve';
13
- import { builtinModules } from 'module';
14
- import del from "rollup-plugin-delete";
15
- import typescript from 'rollup-plugin-typescript2';
16
- // import babel from '@rollup/plugin-babel';
17
- import terser from "@rollup/plugin-terser";
18
- const pkg = require('./package.json');
19
-
20
- export default [
21
- {
22
- input: './src/index.ts',
23
- output: [
24
- {
25
- format: 'cjs',
26
- file: './dist/index.js',
27
- banner: require('./scripts/copyright'),
28
- },
29
- {
30
- format: 'es',
31
- file: './dist/index.mjs',
32
- banner: require('./scripts/copyright'),
33
- }
34
- ],
35
- plugins: [
36
- del({ targets: ["dist/*", "temp/*", "docs/api"] }),
37
- // babel({
38
- // babelHelpers: "runtime",
39
- // configFile: './babel.config.js',
40
- // exclude: 'node_modules/**',
41
- // }),
42
- json(),
43
- resolve({
44
- preferBuiltins: true, // 优先选择内置模块
45
- }),
46
- commonjs(),
47
- typescript({
48
- tsconfigOverride: {
49
- compilerOptions: {
50
- declaration: false,
51
- declarationMap: false,
52
- module: "ESNext"
53
- }
54
- }
55
- }),
56
- terser({
57
- compress: {
58
- defaults: false, // 改为 `false`(新版本默认启用所有优化)
59
- arrows: true, // 保留箭头函数转换
60
- booleans: true, // 保留布尔简化
61
- drop_console: false, // 保留 console
62
- keep_fnames: true // 保留函数名
63
- },
64
- mangle: {
65
- reserved: ['$super'], // 保留关键字
66
- keep_classnames: true // 保留类名
67
- },
68
- format: {
69
- beautify: true, // 启用格式化
70
- indent_level: 2, // 缩进层级
71
- comments: /@Author|@License|@Copyright/ // 保留特定注释
72
- }
73
- })
74
- ],
75
- external: [
76
- ...builtinModules, // 排除 Node.js 内置模块
77
- ...Object.keys(pkg.dependencies || {}), // 排除 package.json 中的外部依赖
78
- ...Object.keys(pkg.devDependencies || {}),
79
- ],
80
- },
81
-
82
- ]
1
+ /**
2
+ *
3
+ * @Description:
4
+ * @Author: richen
5
+ * @Date: 2024-11-07 11:22:26
6
+ * @LastEditTime: 2025-04-02 15:05:36
7
+ * @License: BSD (3-Clause)
8
+ * @Copyright (c): <richenlin(at)gmail.com>
9
+ */
10
+ import commonjs from '@rollup/plugin-commonjs';
11
+ import json from "@rollup/plugin-json";
12
+ import resolve from '@rollup/plugin-node-resolve';
13
+ import { builtinModules } from 'module';
14
+ import del from "rollup-plugin-delete";
15
+ import typescript from 'rollup-plugin-typescript2';
16
+ // import babel from '@rollup/plugin-babel';
17
+ import terser from "@rollup/plugin-terser";
18
+ const pkg = require('./package.json');
19
+
20
+ export default [
21
+ {
22
+ input: './src/index.ts',
23
+ output: [
24
+ {
25
+ format: 'cjs',
26
+ file: './dist/index.js',
27
+ banner: require('./scripts/copyright'),
28
+ },
29
+ {
30
+ format: 'es',
31
+ file: './dist/index.mjs',
32
+ banner: require('./scripts/copyright'),
33
+ }
34
+ ],
35
+ plugins: [
36
+ del({ targets: ["dist/*", "temp/*", "docs/api"] }),
37
+ // babel({
38
+ // babelHelpers: "runtime",
39
+ // configFile: './babel.config.js',
40
+ // exclude: 'node_modules/**',
41
+ // }),
42
+ json(),
43
+ resolve({
44
+ preferBuiltins: true, // 优先选择内置模块
45
+ }),
46
+ commonjs(),
47
+ typescript({
48
+ tsconfigOverride: {
49
+ compilerOptions: {
50
+ declaration: false,
51
+ declarationMap: false,
52
+ module: "ESNext",
53
+ skipLibCheck: true,
54
+ // 不使用 paths,让 TypeScript 使用 node_modules 中的类型
55
+ // 这样可以避免类型冲突
56
+ }
57
+ },
58
+ // 使用 cache 来提高性能
59
+ useTsconfigDeclarationDir: false,
60
+ // 忽略类型错误,只做转译
61
+ check: false
62
+ }),
63
+ terser({
64
+ compress: {
65
+ defaults: false, // 改为 `false`(新版本默认启用所有优化)
66
+ arrows: true, // 保留箭头函数转换
67
+ booleans: true, // 保留布尔简化
68
+ drop_console: false, // 保留 console
69
+ keep_fnames: true // 保留函数名
70
+ },
71
+ mangle: {
72
+ reserved: ['$super'], // 保留关键字
73
+ keep_classnames: true // 保留类名
74
+ },
75
+ format: {
76
+ beautify: true, // 启用格式化
77
+ indent_level: 2, // 缩进层级
78
+ comments: /@Author|@License|@Copyright/ // 保留特定注释
79
+ }
80
+ })
81
+ ],
82
+ external: [
83
+ ...builtinModules, // 排除 Node.js 内置模块
84
+ ...Object.keys(pkg.dependencies || {}), // 排除 package.json 中的外部依赖
85
+ ...Object.keys(pkg.devDependencies || {}),
86
+ ],
87
+ },
88
+
89
+ ]
@@ -0,0 +1,86 @@
1
+
2
+
3
+ > koatty@3.14.0-beta.1 build /home/richen/workspace/nodejs/koatty-monorepo/packages/koatty
4
+ > npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp && npm run build:fix
5
+
6
+
7
+ > koatty@3.14.0-beta.1 build:js
8
+ > npx rollup --bundleConfigAsCjs -c .rollup.config.js
9
+
10
+ 
11
+ ./src/index.ts → ./dist/index.js, ./dist/index.mjs...
12
+ created ./dist/index.js, ./dist/index.mjs in 1.4s
13
+ ⠙⠙
14
+ > koatty@3.14.0-beta.1 build:dts
15
+ > npx tsc && npx api-extractor run --local --verbose
16
+
17
+ ⠙
18
+ api-extractor 7.53.2  - https://api-extractor.com/
19
+ 
20
+ Using configuration from ./api-extractor.json
21
+ Analysis will use the bundled TypeScript version 5.8.2
22
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
23
+ Writing: /home/richen/workspace/nodejs/koatty-monorepo/packages/koatty/temp/koatty.api.json
24
+ Writing package typings: /home/richen/workspace/nodejs/koatty-monorepo/packages/koatty/dist/index.d.ts
25
+ Warning: /home/richen/workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:35:4 - (tsdoc-undefined-tag) The TSDoc tag "@export" is not defined in this configuration
26
+ Warning: /home/richen/workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:36:4 - (tsdoc-undefined-tag) The TSDoc tag "@enum" is not defined in this configuration
27
+ Warning: /home/richen/workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:663:4 - (tsdoc-undefined-tag) The TSDoc tag "@interface" is not defined in this configuration
28
+ Warning: /home/richen/workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:664:4 - (tsdoc-undefined-tag) The TSDoc tag "@extends" is not defined in this configuration
29
+ Warning: src/core/Bootstrap.ts:21:4 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
30
+ Warning: src/core/Bootstrap.ts:33:1 - (ae-missing-release-tag) "Bootstrap" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
31
+ Warning: src/core/Bootstrap.ts:46:4 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
32
+ Warning: src/core/Bootstrap.ts:55:1 - (ae-missing-release-tag) "ExecBootStrap" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
33
+ Warning: src/core/Bootstrap.ts:68:31 - (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.
34
+ Warning: src/core/Bootstrap.ts:68:11 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
35
+ Warning: src/core/Bootstrap.ts:69:28 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
36
+ Warning: src/core/Bootstrap.ts:69:13 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
37
+ Warning: src/core/Bootstrap.ts:70:18 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
38
+ Warning: src/core/Bootstrap.ts:70:12 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
39
+ Warning: src/core/Bootstrap.ts:79:1 - (ae-missing-release-tag) "ComponentScan" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
40
+ Warning: src/core/Bootstrap.ts:96:4 - (tsdoc-code-fence-missing-delimiter) Error parsing code fence: Missing closing delimiter
41
+ Warning: src/core/Bootstrap.ts:97:4 - (tsdoc-characters-after-block-tag) The token "@ConfigurationScan" looks like a TSDoc tag but contains an invalid character "("; if it is not a tag, use a backslash to escape the "@"
42
+ Warning: src/core/Bootstrap.ts:98:36 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
43
+ Warning: src/core/Bootstrap.ts:100:4 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
44
+ Warning: src/core/Bootstrap.ts:102:1 - (ae-missing-release-tag) "ConfigurationScan" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
45
+ Warning: src/core/Bootstrap.ts:118:15 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
46
+ Warning: src/core/Bootstrap.ts:118:13 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
47
+ Warning: src/core/Bootstrap.ts:121:4 - (tsdoc-code-fence-missing-delimiter) Error parsing code fence: Missing closing delimiter
48
+ Warning: src/core/Bootstrap.ts:122:52 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
49
+ Warning: src/core/Bootstrap.ts:123:33 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
50
+ Warning: src/core/Bootstrap.ts:123:35 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
51
+ Warning: src/core/Bootstrap.ts:124:66 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
52
+ Warning: src/core/Bootstrap.ts:124:68 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
53
+ Warning: src/core/Bootstrap.ts:127:6 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
54
+ Warning: src/core/Bootstrap.ts:128:5 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
55
+ Warning: src/core/Bootstrap.ts:129:4 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
56
+ Warning: src/core/Bootstrap.ts:131:1 - (ae-missing-release-tag) "BindEventHook" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
57
+ Warning: src/util/Logger.ts:17:14 - (ae-missing-release-tag) "Logger" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
58
+
59
+ API Extractor completed successfully
60
+ ⠙⠙
61
+ > koatty@3.14.0-beta.1 build:doc
62
+ > npx api-documenter markdown --input temp --output docs/api
63
+
64
+ 
65
+ api-documenter 7.27.2  - https://api-extractor.com/
66
+ 
67
+ Reading koatty.api.json
68
+
69
+ Deleting old output from docs/api
70
+ Writing koatty package
71
+ ⠙⠙
72
+ > koatty@3.14.0-beta.1 build:cp
73
+ > node scripts/postBuild && npx copyfiles package.json LICENSE README.md dist/
74
+
75
+ ⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠙
76
+ > koatty@3.14.0-beta.1 build:fix
77
+ > node scripts/fixWorkspaceDeps
78
+
79
+ ✓ Fixed dependencies.koatty_config: workspace:* → ^1.2.2
80
+ ✓ Fixed dependencies.koatty_core: workspace:* → ^2.0.0
81
+ ✓ Fixed dependencies.koatty_exception: workspace:* → ^2.0.1
82
+ ✓ Fixed dependencies.koatty_router: workspace:* → ^2.0.2
83
+ ✓ Fixed dependencies.koatty_serve: workspace:* → ^3.0.0
84
+ ✓ Fixed dependencies.koatty_trace: workspace:* → ^2.0.0
85
+ ✅ Fixed workspace:* dependencies in dist/package.json
86
+ ⠙