zenweb 3.1.0 → 3.3.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/README.md +113 -113
- package/dist/index.d.ts +17 -17
- package/dist/index.js +60 -60
- package/dist/types.d.ts +20 -20
- package/dist/types.js +2 -2
- package/package.json +52 -52
package/README.md
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
# ZenWeb
|
|
2
|
-
基于 Koa 的模块化轻量级 Web 开发框架。
|
|
3
|
-
本框架全部由 typescript 编写
|
|
4
|
-
|
|
5
|
-
## 快速开始
|
|
6
|
-
|
|
7
|
-
推荐使用 typescript 创建项目
|
|
8
|
-
|
|
9
|
-
package.json
|
|
10
|
-
```json
|
|
11
|
-
{
|
|
12
|
-
"name": "app",
|
|
13
|
-
"private": true,
|
|
14
|
-
"main": "app/index.js",
|
|
15
|
-
"scripts": {
|
|
16
|
-
"dev": "cross-env DEBUG=* NODE_ENV=development ts-node src/index.ts",
|
|
17
|
-
"build": "tsc",
|
|
18
|
-
"start": "node app"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
$ npm i zenweb
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
src/index.ts
|
|
28
|
-
```ts
|
|
29
|
-
import { create } from 'zenweb';
|
|
30
|
-
|
|
31
|
-
const app = create();
|
|
32
|
-
app.start();
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
src/controller/hello.ts
|
|
36
|
-
```ts
|
|
37
|
-
import { Context, inject, mapping } from 'zenweb';
|
|
38
|
-
|
|
39
|
-
export class HelloService {
|
|
40
|
-
@inject ctx: Context;
|
|
41
|
-
private i = 0;
|
|
42
|
-
|
|
43
|
-
say() {
|
|
44
|
-
this.i++;
|
|
45
|
-
return `Hello: ${this.ctx.path}, ${this.i}`;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export class Index {
|
|
50
|
-
@mapping({ path: '/' })
|
|
51
|
-
index(ctx: Context, hello: HelloService) {
|
|
52
|
-
ctx.success(hello.say());
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
tsconfig.json
|
|
58
|
-
```json
|
|
59
|
-
{
|
|
60
|
-
"compilerOptions": {
|
|
61
|
-
"experimentalDecorators": true,
|
|
62
|
-
"emitDecoratorMetadata": true,
|
|
63
|
-
"target": "ES2019",
|
|
64
|
-
"lib": [
|
|
65
|
-
"ES2019"
|
|
66
|
-
],
|
|
67
|
-
"module": "commonjs",
|
|
68
|
-
"strict": true,
|
|
69
|
-
"strictNullChecks": false,
|
|
70
|
-
"sourceMap": true,
|
|
71
|
-
"outDir": "./app"
|
|
72
|
-
},
|
|
73
|
-
"exclude": [
|
|
74
|
-
"node_modules",
|
|
75
|
-
"**/*.spec.ts"
|
|
76
|
-
],
|
|
77
|
-
"include": [
|
|
78
|
-
"src/**/*"
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
$ npm run dev
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## 内置模块
|
|
88
|
-
1. [meta](https://www.npmjs.com/package/@zenweb/meta) 运行基本信息,例如:请求耗时
|
|
89
|
-
2. [log](https://www.npmjs.com/package/@zenweb/log) 日志支持
|
|
90
|
-
3. [router](https://www.npmjs.com/package/@zenweb/router) 路由支持
|
|
91
|
-
4. [messagecode](https://www.npmjs.com/package/@zenweb/messagecode) 统一错误消息格式化
|
|
92
|
-
5. [body](https://www.npmjs.com/package/@zenweb/body) 表单提交,文件上传支持
|
|
93
|
-
6. [api](https://www.npmjs.com/package/@zenweb/api) 统一接口返回 ctx.success ctx.fail 方法
|
|
94
|
-
7. [helper](https://www.npmjs.com/package/@zenweb/helper) 输入数据验证
|
|
95
|
-
8. [inject](https://www.npmjs.com/package/@zenweb/inject) 注入支持
|
|
96
|
-
|
|
97
|
-
内置模块默认开启,可以通过设置配置项为 **false** 关闭
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
## 可选模块
|
|
101
|
-
9. [cors](https://www.npmjs.com/package/@zenweb/cors) 跨域支持
|
|
102
|
-
10. [sentry](https://www.npmjs.com/package/@zenweb/sentry) sentry 错误收集
|
|
103
|
-
11. [metric](https://www.npmjs.com/package/@zenweb/metric) 生产运行健康信息收集
|
|
104
|
-
12. [validation](https://www.npmjs.com/package/@zenweb/validation) JSONSchema 验证
|
|
105
|
-
13. [mysql](https://www.npmjs.com/package/@zenweb/mysql) MySQL 数据库支持
|
|
106
|
-
14. [orm](https://www.npmjs.com/package/@zenweb/orm) ORM 支持
|
|
107
|
-
15. [view](https://www.npmjs.com/package/@zenweb/view) 视图模版渲染
|
|
108
|
-
16. [schedule](https://www.npmjs.com/package/@zenweb/schedule) 定时任务
|
|
109
|
-
17. [form](https://www.npmjs.com/package/@zenweb/form) 统一表单(多用于后台)
|
|
110
|
-
18. [grid](https://www.npmjs.com/package/@zenweb/grid) 统一表格(多用于后台)
|
|
111
|
-
|
|
112
|
-
## 废弃模块
|
|
113
|
-
1. [service](https://www.npmjs.com/package/@zenweb/service) 废弃,已被 3.0 注入技术替代
|
|
1
|
+
# ZenWeb
|
|
2
|
+
基于 Koa 的模块化轻量级 Web 开发框架。
|
|
3
|
+
本框架全部由 typescript 编写
|
|
4
|
+
|
|
5
|
+
## 快速开始
|
|
6
|
+
|
|
7
|
+
推荐使用 typescript 创建项目
|
|
8
|
+
|
|
9
|
+
package.json
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"name": "app",
|
|
13
|
+
"private": true,
|
|
14
|
+
"main": "app/index.js",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "cross-env DEBUG=* NODE_ENV=development ts-node src/index.ts",
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"start": "node app"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
$ npm i zenweb
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
src/index.ts
|
|
28
|
+
```ts
|
|
29
|
+
import { create } from 'zenweb';
|
|
30
|
+
|
|
31
|
+
const app = create();
|
|
32
|
+
app.start();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
src/controller/hello.ts
|
|
36
|
+
```ts
|
|
37
|
+
import { Context, inject, mapping } from 'zenweb';
|
|
38
|
+
|
|
39
|
+
export class HelloService {
|
|
40
|
+
@inject ctx: Context;
|
|
41
|
+
private i = 0;
|
|
42
|
+
|
|
43
|
+
say() {
|
|
44
|
+
this.i++;
|
|
45
|
+
return `Hello: ${this.ctx.path}, ${this.i}`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class Index {
|
|
50
|
+
@mapping({ path: '/' })
|
|
51
|
+
index(ctx: Context, hello: HelloService) {
|
|
52
|
+
ctx.success(hello.say());
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
tsconfig.json
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"compilerOptions": {
|
|
61
|
+
"experimentalDecorators": true,
|
|
62
|
+
"emitDecoratorMetadata": true,
|
|
63
|
+
"target": "ES2019",
|
|
64
|
+
"lib": [
|
|
65
|
+
"ES2019"
|
|
66
|
+
],
|
|
67
|
+
"module": "commonjs",
|
|
68
|
+
"strict": true,
|
|
69
|
+
"strictNullChecks": false,
|
|
70
|
+
"sourceMap": true,
|
|
71
|
+
"outDir": "./app"
|
|
72
|
+
},
|
|
73
|
+
"exclude": [
|
|
74
|
+
"node_modules",
|
|
75
|
+
"**/*.spec.ts"
|
|
76
|
+
],
|
|
77
|
+
"include": [
|
|
78
|
+
"src/**/*"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
$ npm run dev
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 内置模块
|
|
88
|
+
1. [meta](https://www.npmjs.com/package/@zenweb/meta) 运行基本信息,例如:请求耗时
|
|
89
|
+
2. [log](https://www.npmjs.com/package/@zenweb/log) 日志支持
|
|
90
|
+
3. [router](https://www.npmjs.com/package/@zenweb/router) 路由支持
|
|
91
|
+
4. [messagecode](https://www.npmjs.com/package/@zenweb/messagecode) 统一错误消息格式化
|
|
92
|
+
5. [body](https://www.npmjs.com/package/@zenweb/body) 表单提交,文件上传支持
|
|
93
|
+
6. [api](https://www.npmjs.com/package/@zenweb/api) 统一接口返回 ctx.success ctx.fail 方法
|
|
94
|
+
7. [helper](https://www.npmjs.com/package/@zenweb/helper) 输入数据验证
|
|
95
|
+
8. [inject](https://www.npmjs.com/package/@zenweb/inject) 注入支持
|
|
96
|
+
|
|
97
|
+
内置模块默认开启,可以通过设置配置项为 **false** 关闭
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## 可选模块
|
|
101
|
+
9. [cors](https://www.npmjs.com/package/@zenweb/cors) 跨域支持
|
|
102
|
+
10. [sentry](https://www.npmjs.com/package/@zenweb/sentry) sentry 错误收集
|
|
103
|
+
11. [metric](https://www.npmjs.com/package/@zenweb/metric) 生产运行健康信息收集
|
|
104
|
+
12. [validation](https://www.npmjs.com/package/@zenweb/validation) JSONSchema 验证
|
|
105
|
+
13. [mysql](https://www.npmjs.com/package/@zenweb/mysql) MySQL 数据库支持
|
|
106
|
+
14. [orm](https://www.npmjs.com/package/@zenweb/orm) ORM 支持
|
|
107
|
+
15. [view](https://www.npmjs.com/package/@zenweb/view) 视图模版渲染
|
|
108
|
+
16. [schedule](https://www.npmjs.com/package/@zenweb/schedule) 定时任务
|
|
109
|
+
17. [form](https://www.npmjs.com/package/@zenweb/form) 统一表单(多用于后台)
|
|
110
|
+
18. [grid](https://www.npmjs.com/package/@zenweb/grid) 统一表格(多用于后台)
|
|
111
|
+
|
|
112
|
+
## 废弃模块
|
|
113
|
+
1. [service](https://www.npmjs.com/package/@zenweb/service) 废弃,已被 3.0 注入技术替代
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import '@zenweb/meta';
|
|
2
|
-
import '@zenweb/log';
|
|
3
|
-
import '@zenweb/messagecode';
|
|
4
|
-
import '@zenweb/body';
|
|
5
|
-
import '@zenweb/helper';
|
|
6
|
-
import { Core } from '@zenweb/core';
|
|
7
|
-
import { CreateOptions } from './types';
|
|
8
|
-
export { init, inject,
|
|
9
|
-
export { Router } from '@zenweb/router';
|
|
10
|
-
export { ResultFail } from '@zenweb/result';
|
|
11
|
-
export { Controller, controller, mapping } from '@zenweb/controller';
|
|
12
|
-
export { Next, SetupFunction, Context, Middleware } from '@zenweb/core';
|
|
13
|
-
export { Core, CreateOptions, };
|
|
14
|
-
/**
|
|
15
|
-
* @param options 模块配置项
|
|
16
|
-
*/
|
|
17
|
-
export declare function create(options?: CreateOptions): Core;
|
|
1
|
+
import '@zenweb/meta';
|
|
2
|
+
import '@zenweb/log';
|
|
3
|
+
import '@zenweb/messagecode';
|
|
4
|
+
import '@zenweb/body';
|
|
5
|
+
import '@zenweb/helper';
|
|
6
|
+
import { Core } from '@zenweb/core';
|
|
7
|
+
import { CreateOptions } from './types';
|
|
8
|
+
export { init, inject, factory } from '@zenweb/inject';
|
|
9
|
+
export { Router } from '@zenweb/router';
|
|
10
|
+
export { ResultFail } from '@zenweb/result';
|
|
11
|
+
export { Controller, controller, mapping } from '@zenweb/controller';
|
|
12
|
+
export { Next, SetupFunction, Context, Middleware } from '@zenweb/core';
|
|
13
|
+
export { Core, CreateOptions, };
|
|
14
|
+
/**
|
|
15
|
+
* @param options 模块配置项
|
|
16
|
+
*/
|
|
17
|
+
export declare function create(options?: CreateOptions): Core;
|
package/dist/index.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.create = exports.Core = exports.Context = exports.mapping = exports.controller = exports.Controller = exports.ResultFail = exports.Router = exports.
|
|
4
|
-
require("@zenweb/meta");
|
|
5
|
-
require("@zenweb/log");
|
|
6
|
-
require("@zenweb/messagecode");
|
|
7
|
-
require("@zenweb/body");
|
|
8
|
-
require("@zenweb/helper");
|
|
9
|
-
const inject_1 = require("@zenweb/inject");
|
|
10
|
-
const meta_1 = require("@zenweb/meta");
|
|
11
|
-
const log_1 = require("@zenweb/log");
|
|
12
|
-
const router_1 = require("@zenweb/router");
|
|
13
|
-
const messagecode_1 = require("@zenweb/messagecode");
|
|
14
|
-
const body_1 = require("@zenweb/body");
|
|
15
|
-
const result_1 = require("@zenweb/result");
|
|
16
|
-
const helper_1 = require("@zenweb/helper");
|
|
17
|
-
const controller_1 = require("@zenweb/controller");
|
|
18
|
-
const core_1 = require("@zenweb/core");
|
|
19
|
-
Object.defineProperty(exports, "Core", { enumerable: true, get: function () { return core_1.Core; } });
|
|
20
|
-
var inject_2 = require("@zenweb/inject");
|
|
21
|
-
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return inject_2.init; } });
|
|
22
|
-
Object.defineProperty(exports, "inject", { enumerable: true, get: function () { return inject_2.inject; } });
|
|
23
|
-
Object.defineProperty(exports, "
|
|
24
|
-
var router_2 = require("@zenweb/router");
|
|
25
|
-
Object.defineProperty(exports, "Router", { enumerable: true, get: function () { return router_2.Router; } });
|
|
26
|
-
var result_2 = require("@zenweb/result");
|
|
27
|
-
Object.defineProperty(exports, "ResultFail", { enumerable: true, get: function () { return result_2.ResultFail; } });
|
|
28
|
-
var controller_2 = require("@zenweb/controller");
|
|
29
|
-
Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return controller_2.Controller; } });
|
|
30
|
-
Object.defineProperty(exports, "controller", { enumerable: true, get: function () { return controller_2.controller; } });
|
|
31
|
-
Object.defineProperty(exports, "mapping", { enumerable: true, get: function () { return controller_2.mapping; } });
|
|
32
|
-
var core_2 = require("@zenweb/core");
|
|
33
|
-
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return core_2.Context; } });
|
|
34
|
-
/**
|
|
35
|
-
* @param options 模块配置项
|
|
36
|
-
*/
|
|
37
|
-
function create(options) {
|
|
38
|
-
options = options || {};
|
|
39
|
-
const core = new core_1.Core(options.core);
|
|
40
|
-
if (options.inject !== false)
|
|
41
|
-
core.setup((0, inject_1.default)());
|
|
42
|
-
if (options.meta !== false)
|
|
43
|
-
core.setup((0, meta_1.default)(options.meta));
|
|
44
|
-
if (options.log !== false)
|
|
45
|
-
core.setup((0, log_1.default)(options.log));
|
|
46
|
-
if (options.router !== false)
|
|
47
|
-
core.setup((0, router_1.default)());
|
|
48
|
-
if (options.messagecode !== false)
|
|
49
|
-
core.setup((0, messagecode_1.default)(options.messagecode));
|
|
50
|
-
if (options.body !== false)
|
|
51
|
-
core.setup((0, body_1.default)(options.body));
|
|
52
|
-
if (options.result !== false)
|
|
53
|
-
core.setup((0, result_1.default)(options.result));
|
|
54
|
-
if (options.helper !== false)
|
|
55
|
-
core.setup((0, helper_1.default)(options.helper));
|
|
56
|
-
if (options.controller !== false)
|
|
57
|
-
core.setup((0, controller_1.default)(options.controller));
|
|
58
|
-
return core;
|
|
59
|
-
}
|
|
60
|
-
exports.create = create;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = exports.Core = exports.Context = exports.mapping = exports.controller = exports.Controller = exports.ResultFail = exports.Router = exports.factory = exports.inject = exports.init = void 0;
|
|
4
|
+
require("@zenweb/meta");
|
|
5
|
+
require("@zenweb/log");
|
|
6
|
+
require("@zenweb/messagecode");
|
|
7
|
+
require("@zenweb/body");
|
|
8
|
+
require("@zenweb/helper");
|
|
9
|
+
const inject_1 = require("@zenweb/inject");
|
|
10
|
+
const meta_1 = require("@zenweb/meta");
|
|
11
|
+
const log_1 = require("@zenweb/log");
|
|
12
|
+
const router_1 = require("@zenweb/router");
|
|
13
|
+
const messagecode_1 = require("@zenweb/messagecode");
|
|
14
|
+
const body_1 = require("@zenweb/body");
|
|
15
|
+
const result_1 = require("@zenweb/result");
|
|
16
|
+
const helper_1 = require("@zenweb/helper");
|
|
17
|
+
const controller_1 = require("@zenweb/controller");
|
|
18
|
+
const core_1 = require("@zenweb/core");
|
|
19
|
+
Object.defineProperty(exports, "Core", { enumerable: true, get: function () { return core_1.Core; } });
|
|
20
|
+
var inject_2 = require("@zenweb/inject");
|
|
21
|
+
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return inject_2.init; } });
|
|
22
|
+
Object.defineProperty(exports, "inject", { enumerable: true, get: function () { return inject_2.inject; } });
|
|
23
|
+
Object.defineProperty(exports, "factory", { enumerable: true, get: function () { return inject_2.factory; } });
|
|
24
|
+
var router_2 = require("@zenweb/router");
|
|
25
|
+
Object.defineProperty(exports, "Router", { enumerable: true, get: function () { return router_2.Router; } });
|
|
26
|
+
var result_2 = require("@zenweb/result");
|
|
27
|
+
Object.defineProperty(exports, "ResultFail", { enumerable: true, get: function () { return result_2.ResultFail; } });
|
|
28
|
+
var controller_2 = require("@zenweb/controller");
|
|
29
|
+
Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return controller_2.Controller; } });
|
|
30
|
+
Object.defineProperty(exports, "controller", { enumerable: true, get: function () { return controller_2.controller; } });
|
|
31
|
+
Object.defineProperty(exports, "mapping", { enumerable: true, get: function () { return controller_2.mapping; } });
|
|
32
|
+
var core_2 = require("@zenweb/core");
|
|
33
|
+
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return core_2.Context; } });
|
|
34
|
+
/**
|
|
35
|
+
* @param options 模块配置项
|
|
36
|
+
*/
|
|
37
|
+
function create(options) {
|
|
38
|
+
options = options || {};
|
|
39
|
+
const core = new core_1.Core(options.core);
|
|
40
|
+
if (options.inject !== false)
|
|
41
|
+
core.setup((0, inject_1.default)());
|
|
42
|
+
if (options.meta !== false)
|
|
43
|
+
core.setup((0, meta_1.default)(options.meta));
|
|
44
|
+
if (options.log !== false)
|
|
45
|
+
core.setup((0, log_1.default)(options.log));
|
|
46
|
+
if (options.router !== false)
|
|
47
|
+
core.setup((0, router_1.default)());
|
|
48
|
+
if (options.messagecode !== false)
|
|
49
|
+
core.setup((0, messagecode_1.default)(options.messagecode));
|
|
50
|
+
if (options.body !== false)
|
|
51
|
+
core.setup((0, body_1.default)(options.body));
|
|
52
|
+
if (options.result !== false)
|
|
53
|
+
core.setup((0, result_1.default)(options.result));
|
|
54
|
+
if (options.helper !== false)
|
|
55
|
+
core.setup((0, helper_1.default)(options.helper));
|
|
56
|
+
if (options.controller !== false)
|
|
57
|
+
core.setup((0, controller_1.default)(options.controller));
|
|
58
|
+
return core;
|
|
59
|
+
}
|
|
60
|
+
exports.create = create;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { CoreOption } from '@zenweb/core';
|
|
2
|
-
import { MetaOption } from '@zenweb/meta';
|
|
3
|
-
import { LogOption } from '@zenweb/log';
|
|
4
|
-
import { MessageCodeOption } from '@zenweb/messagecode';
|
|
5
|
-
import { BodyOption } from '@zenweb/body';
|
|
6
|
-
import { ResultOption } from '@zenweb/result';
|
|
7
|
-
import { HelperOption } from '@zenweb/helper';
|
|
8
|
-
import { ControllerOption } from '@zenweb/controller';
|
|
9
|
-
export interface CreateOptions {
|
|
10
|
-
core?: CoreOption;
|
|
11
|
-
inject?: false;
|
|
12
|
-
meta?: MetaOption | false;
|
|
13
|
-
log?: LogOption | false;
|
|
14
|
-
router?: false;
|
|
15
|
-
messagecode?: MessageCodeOption | false;
|
|
16
|
-
body?: BodyOption | false;
|
|
17
|
-
result?: ResultOption | false;
|
|
18
|
-
helper?: HelperOption | false;
|
|
19
|
-
controller?: ControllerOption | false;
|
|
20
|
-
}
|
|
1
|
+
import { CoreOption } from '@zenweb/core';
|
|
2
|
+
import { MetaOption } from '@zenweb/meta';
|
|
3
|
+
import { LogOption } from '@zenweb/log';
|
|
4
|
+
import { MessageCodeOption } from '@zenweb/messagecode';
|
|
5
|
+
import { BodyOption } from '@zenweb/body';
|
|
6
|
+
import { ResultOption } from '@zenweb/result';
|
|
7
|
+
import { HelperOption } from '@zenweb/helper';
|
|
8
|
+
import { ControllerOption } from '@zenweb/controller';
|
|
9
|
+
export interface CreateOptions {
|
|
10
|
+
core?: CoreOption;
|
|
11
|
+
inject?: false;
|
|
12
|
+
meta?: MetaOption | false;
|
|
13
|
+
log?: LogOption | false;
|
|
14
|
+
router?: false;
|
|
15
|
+
messagecode?: MessageCodeOption | false;
|
|
16
|
+
body?: BodyOption | false;
|
|
17
|
+
result?: ResultOption | false;
|
|
18
|
+
helper?: HelperOption | false;
|
|
19
|
+
controller?: ControllerOption | false;
|
|
20
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "zenweb",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Modular lightweight web framework based on Koa",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"typings": "./dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "rimraf dist && tsc",
|
|
12
|
-
"prepublishOnly": "npm run build",
|
|
13
|
-
"dev": "cd example && cross-env DEBUG=* NODE_ENV=development ts-node src"
|
|
14
|
-
},
|
|
15
|
-
"author": {
|
|
16
|
-
"name": "YeFei",
|
|
17
|
-
"email": "316606233@qq.com"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"web",
|
|
21
|
-
"app",
|
|
22
|
-
"http",
|
|
23
|
-
"framework",
|
|
24
|
-
"koa"
|
|
25
|
-
],
|
|
26
|
-
"license": "MIT",
|
|
27
|
-
"repository": {
|
|
28
|
-
"type": "git",
|
|
29
|
-
"url": "git+https://github.com/yefei/zenweb.git"
|
|
30
|
-
},
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/yefei/zenweb/issues"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@zenweb/body": "^2.5.0",
|
|
36
|
-
"@zenweb/controller": "^3.
|
|
37
|
-
"@zenweb/core": "^3.0.
|
|
38
|
-
"@zenweb/helper": "^2.11.0",
|
|
39
|
-
"@zenweb/inject": "^3.
|
|
40
|
-
"@zenweb/log": "^2.3.1",
|
|
41
|
-
"@zenweb/messagecode": "^3.0.1",
|
|
42
|
-
"@zenweb/meta": "^2.4.0",
|
|
43
|
-
"@zenweb/result": "^2.3.5",
|
|
44
|
-
"@zenweb/router": "^3.1.0"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"cross-env": "^7.0.3",
|
|
48
|
-
"rimraf": "^4.1.2",
|
|
49
|
-
"ts-node": "^10.9.1",
|
|
50
|
-
"typescript": "^4.9.4"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "zenweb",
|
|
3
|
+
"version": "3.3.0",
|
|
4
|
+
"description": "Modular lightweight web framework based on Koa",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "./dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "rimraf dist && tsc",
|
|
12
|
+
"prepublishOnly": "npm run build",
|
|
13
|
+
"dev": "cd example && cross-env DEBUG=* NODE_ENV=development ts-node src"
|
|
14
|
+
},
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "YeFei",
|
|
17
|
+
"email": "316606233@qq.com"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"web",
|
|
21
|
+
"app",
|
|
22
|
+
"http",
|
|
23
|
+
"framework",
|
|
24
|
+
"koa"
|
|
25
|
+
],
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/yefei/zenweb.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/yefei/zenweb/issues"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@zenweb/body": "^2.5.0",
|
|
36
|
+
"@zenweb/controller": "^3.6.0",
|
|
37
|
+
"@zenweb/core": "^3.0.1",
|
|
38
|
+
"@zenweb/helper": "^2.11.0",
|
|
39
|
+
"@zenweb/inject": "^3.15.1",
|
|
40
|
+
"@zenweb/log": "^2.3.1",
|
|
41
|
+
"@zenweb/messagecode": "^3.0.1",
|
|
42
|
+
"@zenweb/meta": "^2.4.0",
|
|
43
|
+
"@zenweb/result": "^2.3.5",
|
|
44
|
+
"@zenweb/router": "^3.1.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"cross-env": "^7.0.3",
|
|
48
|
+
"rimraf": "^4.1.2",
|
|
49
|
+
"ts-node": "^10.9.1",
|
|
50
|
+
"typescript": "^4.9.4"
|
|
51
|
+
}
|
|
52
|
+
}
|