@modern-js/bff-runtime 2.3.0 → 2.5.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/CHANGELOG.md +13 -0
- package/README.md +14 -18
- package/dist/{js/node → cjs}/compatible.js +0 -0
- package/dist/{js/node → cjs}/index.js +0 -0
- package/dist/{js/node → cjs}/match.js +3 -23
- package/dist/{js/node → cjs}/request.js +0 -0
- package/dist/{js/node → cjs}/response.js +0 -0
- package/dist/{js/node → cjs}/types.js +0 -0
- package/dist/{js/treeshaking → esm}/compatible.js +0 -0
- package/dist/{js/treeshaking → esm}/index.js +0 -0
- package/dist/{js/treeshaking → esm}/match.js +0 -0
- package/dist/{js/treeshaking → esm}/request.js +0 -0
- package/dist/{js/treeshaking → esm}/response.js +0 -0
- package/dist/{js/treeshaking → esm}/types.js +0 -0
- package/dist/{js/modern → esm-node}/compatible.js +0 -0
- package/dist/{js/modern → esm-node}/index.js +0 -0
- package/dist/{js/modern → esm-node}/match.js +3 -23
- package/dist/{js/modern → esm-node}/request.js +0 -0
- package/dist/{js/modern → esm-node}/response.js +0 -0
- package/dist/{js/modern → esm-node}/types.js +0 -0
- package/package.json +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @modern-js/bff-runtime
|
|
2
2
|
|
|
3
|
+
## 2.5.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 89ca6cc: refactor: merge build-config into scripts/build
|
|
8
|
+
|
|
9
|
+
refactor: 把 build-config 合并进 scripts/build
|
|
10
|
+
|
|
11
|
+
- 30614fa: chore: modify package.json entry fields and build config
|
|
12
|
+
chore: 更改 package.json entry 字段以及构建配置
|
|
13
|
+
|
|
14
|
+
## 2.4.0
|
|
15
|
+
|
|
3
16
|
## 2.3.0
|
|
4
17
|
|
|
5
18
|
## 2.2.0
|
package/README.md
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
1
|
<p align="center">
|
|
3
2
|
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
|
|
4
3
|
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Modern.js</h1>
|
|
6
|
+
|
|
5
7
|
<p align="center">
|
|
6
|
-
|
|
7
|
-
<br/>
|
|
8
|
-
<a href="https://modernjs.dev" target="blank">
|
|
9
|
-
modernjs.dev
|
|
10
|
-
</a>
|
|
11
|
-
</p>
|
|
12
|
-
<p align="center">
|
|
13
|
-
The meta-framework suite designed from scratch for frontend-focused modern web development
|
|
8
|
+
A Progressive React Framework for modern web development.
|
|
14
9
|
</p>
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.
|
|
11
|
+
## Getting Started
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
|
|
21
14
|
|
|
22
|
-
##
|
|
15
|
+
## Documentation
|
|
23
16
|
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [API References](https://modernjs.dev/docs/apis)
|
|
17
|
+
- [English Documentation](https://modernjs.dev/en/)
|
|
18
|
+
- [中文文档](https://modernjs.dev)
|
|
27
19
|
|
|
28
20
|
## Contributing
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
|
|
File without changes
|
|
File without changes
|
|
@@ -15,26 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var __async = (__this, __arguments, generator) => {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
var fulfilled = (value) => {
|
|
21
|
-
try {
|
|
22
|
-
step(generator.next(value));
|
|
23
|
-
} catch (e) {
|
|
24
|
-
reject(e);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var rejected = (value) => {
|
|
28
|
-
try {
|
|
29
|
-
step(generator.throw(value));
|
|
30
|
-
} catch (e) {
|
|
31
|
-
reject(e);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
18
|
var match_exports = {};
|
|
39
19
|
__export(match_exports, {
|
|
40
20
|
baseMatch: () => baseMatch,
|
|
@@ -62,18 +42,18 @@ const baseMatch = (schema, handler) => {
|
|
|
62
42
|
const validateApiOutput = (0, import_validator.createSchemaValidator)(
|
|
63
43
|
(0, import_farrow_schema.toSchemaCtor)(schema.response)
|
|
64
44
|
);
|
|
65
|
-
const handle = (input) =>
|
|
45
|
+
const handle = async (input) => {
|
|
66
46
|
const inputResult = validateApiInput(input);
|
|
67
47
|
if (inputResult.isErr) {
|
|
68
48
|
return (0, import_response.InputValidationError)(getErrorMessage(inputResult.value));
|
|
69
49
|
}
|
|
70
|
-
const output =
|
|
50
|
+
const output = await handler(input);
|
|
71
51
|
const outputResult = validateApiOutput(output);
|
|
72
52
|
if (outputResult.isErr) {
|
|
73
53
|
return (0, import_response.OutputValidationError)(getErrorMessage(outputResult.value));
|
|
74
54
|
}
|
|
75
55
|
return (0, import_response.HandleSuccess)(output);
|
|
76
|
-
}
|
|
56
|
+
};
|
|
77
57
|
return Object.assign(handle, {
|
|
78
58
|
schema,
|
|
79
59
|
[HANDLER_WITH_SCHEMA]: true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
var __async = (__this, __arguments, generator) => {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
var fulfilled = (value) => {
|
|
4
|
-
try {
|
|
5
|
-
step(generator.next(value));
|
|
6
|
-
} catch (e) {
|
|
7
|
-
reject(e);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var rejected = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
step(generator.throw(value));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
reject(e);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
1
|
import {
|
|
22
2
|
toSchemaCtor,
|
|
23
3
|
Struct,
|
|
@@ -47,18 +27,18 @@ const baseMatch = (schema, handler) => {
|
|
|
47
27
|
const validateApiOutput = createSchemaValidator(
|
|
48
28
|
toSchemaCtor(schema.response)
|
|
49
29
|
);
|
|
50
|
-
const handle = (input) =>
|
|
30
|
+
const handle = async (input) => {
|
|
51
31
|
const inputResult = validateApiInput(input);
|
|
52
32
|
if (inputResult.isErr) {
|
|
53
33
|
return InputValidationError(getErrorMessage(inputResult.value));
|
|
54
34
|
}
|
|
55
|
-
const output =
|
|
35
|
+
const output = await handler(input);
|
|
56
36
|
const outputResult = validateApiOutput(output);
|
|
57
37
|
if (outputResult.isErr) {
|
|
58
38
|
return OutputValidationError(getErrorMessage(outputResult.value));
|
|
59
39
|
}
|
|
60
40
|
return HandleSuccess(output);
|
|
61
|
-
}
|
|
41
|
+
};
|
|
62
42
|
return Object.assign(handle, {
|
|
63
43
|
schema,
|
|
64
44
|
[HANDLER_WITH_SCHEMA]: true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/bff-runtime",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "A Progressive React Framework for modern web development.",
|
|
4
4
|
"homepage": "https://modernjs.dev",
|
|
5
5
|
"bugs": "https://github.com/modern-js-dev/modern.js/issues",
|
|
6
6
|
"repository": "modern-js-dev/modern.js",
|
|
@@ -11,20 +11,19 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.5.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
|
-
"main": "./dist/
|
|
18
|
-
"module": "./dist/
|
|
19
|
-
"jsnext:modern": "./dist/js/modern/index.js",
|
|
17
|
+
"main": "./dist/cjs/index.js",
|
|
18
|
+
"module": "./dist/esm/index.js",
|
|
20
19
|
"exports": {
|
|
21
20
|
".": {
|
|
22
21
|
"node": {
|
|
23
22
|
"jsnext:source": "./src/index.ts",
|
|
24
|
-
"import": "./dist/
|
|
25
|
-
"require": "./dist/
|
|
23
|
+
"import": "./dist/esm-node/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.js"
|
|
26
25
|
},
|
|
27
|
-
"default": "./dist/
|
|
26
|
+
"default": "./dist/esm/index.js"
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
@@ -39,8 +38,8 @@
|
|
|
39
38
|
"jest": "^27",
|
|
40
39
|
"ts-jest": "^27.0.5",
|
|
41
40
|
"typescript": "^4",
|
|
42
|
-
"@scripts/build": "2.
|
|
43
|
-
"@scripts/jest-config": "2.
|
|
41
|
+
"@scripts/build": "2.5.0",
|
|
42
|
+
"@scripts/jest-config": "2.5.0"
|
|
44
43
|
},
|
|
45
44
|
"publishConfig": {
|
|
46
45
|
"registry": "https://registry.npmjs.org/",
|