@modern-js/server-core 2.6.0 → 2.7.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 +21 -0
- package/dist/cjs/types/config/dev.js +15 -0
- package/dist/esm/types/config/dev.js +0 -0
- package/dist/types/plugin.d.ts +2 -1
- package/dist/types/types/config/bff.d.ts +2 -0
- package/dist/types/types/config/dev.d.ts +4 -0
- package/dist/types/types/config/index.d.ts +3 -0
- package/dist/types/types/config/server.d.ts +2 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @modern-js/server-plugin
|
|
2
2
|
|
|
3
|
+
## 2.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 84bfb439b8: feat: support custom apiDir, lambdaDir and style of writing for bff
|
|
8
|
+
feat: 支持定制 api 目录,lambda 目录,bff 的写法
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 1eea234fdd: chore: make test files naming consistent
|
|
13
|
+
|
|
14
|
+
chore: 统一测试文件命名为小驼峰格式
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [0f15fc597c]
|
|
17
|
+
- Updated dependencies [dcad887024]
|
|
18
|
+
- Updated dependencies [a4672f7c16]
|
|
19
|
+
- Updated dependencies [7fff9020e1]
|
|
20
|
+
- Updated dependencies [84bfb439b8]
|
|
21
|
+
- @modern-js/utils@2.7.0
|
|
22
|
+
- @modern-js/plugin@2.7.0
|
|
23
|
+
|
|
3
24
|
## 2.6.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var dev_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(dev_exports);
|
|
File without changes
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
3
|
import type { Component } from 'react';
|
|
4
4
|
import { CommonAPI, ToThreads, AsyncSetup, PluginOptions } from '@modern-js/plugin';
|
|
5
|
-
import type { ModernServerContext, BaseSSRServerContext, AfterMatchContext, AfterRenderContext, MiddlewareContext, ISAppContext, ServerRoute } from '@modern-js/types';
|
|
5
|
+
import type { ModernServerContext, BaseSSRServerContext, AfterMatchContext, AfterRenderContext, MiddlewareContext, ISAppContext, ServerRoute, HttpMethodDecider } from '@modern-js/types';
|
|
6
6
|
import type { BffUserConfig, ServerOptions, UserConfig } from './types/config';
|
|
7
7
|
export type WebAdapter = (ctx: MiddlewareContext) => void | Promise<void>;
|
|
8
8
|
export type Adapter = (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
@@ -14,6 +14,7 @@ export type BeforeRouteHandler = (context: ModernServerContext) => Promise<void>
|
|
|
14
14
|
export type APIServerStartInput = {
|
|
15
15
|
pwd: string;
|
|
16
16
|
prefix?: string;
|
|
17
|
+
httpMethodDecider?: HttpMethodDecider;
|
|
17
18
|
config?: {
|
|
18
19
|
middleware?: Array<any>;
|
|
19
20
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Options } from 'http-proxy-middleware';
|
|
2
|
+
import type { HttpMethodDecider } from '@modern-js/types';
|
|
2
3
|
export interface BffUserConfig {
|
|
3
4
|
prefix?: string;
|
|
4
5
|
proxy?: Record<string, Options>;
|
|
6
|
+
httpMethodDecider?: HttpMethodDecider;
|
|
5
7
|
enableHandleWeb?: boolean;
|
|
6
8
|
}
|
|
7
9
|
export type BffNormalizedConfig = BffUserConfig;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BffNormalizedConfig, BffUserConfig } from './bff';
|
|
2
|
+
import { DevNormalizedConfig, DevUserConfig } from './dev';
|
|
2
3
|
import { HtmlNormalizedConfig, HtmlUserConfig } from './html';
|
|
3
4
|
import { OutputNormalizedConfig, OutputUserConfig } from './output';
|
|
4
5
|
import { ServerNormalizedConfig, ServerUserConfig } from './server';
|
|
@@ -22,6 +23,7 @@ export interface UserConfig {
|
|
|
22
23
|
runtime?: RuntimeUserConfig;
|
|
23
24
|
html?: HtmlUserConfig;
|
|
24
25
|
bff?: BffUserConfig;
|
|
26
|
+
dev?: DevUserConfig;
|
|
25
27
|
}
|
|
26
28
|
export type ServerOptions = {
|
|
27
29
|
output: OutputNormalizedConfig;
|
|
@@ -31,4 +33,5 @@ export type ServerOptions = {
|
|
|
31
33
|
runtime: RuntimeNormalizedConfig;
|
|
32
34
|
html: HtmlNormalizedConfig;
|
|
33
35
|
bff: BffNormalizedConfig;
|
|
36
|
+
dev?: DevNormalizedConfig;
|
|
34
37
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SSRMode } from '@modern-js/types';
|
|
1
2
|
import type { WatchOptions } from '@modern-js/utils';
|
|
2
3
|
type Route = string | string[] | {
|
|
3
4
|
route?: string | string[];
|
|
@@ -7,7 +8,7 @@ type Route = string | string[] | {
|
|
|
7
8
|
export type Routes = Record<string, Route>;
|
|
8
9
|
export type SSR = boolean | {
|
|
9
10
|
forceCSR?: boolean;
|
|
10
|
-
mode?:
|
|
11
|
+
mode?: SSRMode;
|
|
11
12
|
};
|
|
12
13
|
export type SSRByEntries = Record<string, SSR>;
|
|
13
14
|
export interface ServerUserConfig {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.7.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/cjs/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@modern-js/plugin": "2.
|
|
32
|
-
"@modern-js/utils": "2.
|
|
31
|
+
"@modern-js/plugin": "2.7.0",
|
|
32
|
+
"@modern-js/utils": "2.7.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "^27",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"jest": "^27",
|
|
39
39
|
"ts-jest": "^27.0.4",
|
|
40
40
|
"typescript": "^4",
|
|
41
|
-
"@modern-js/types": "2.
|
|
42
|
-
"@modern-js/babel-preset-app": "2.
|
|
43
|
-
"@scripts/build": "2.
|
|
44
|
-
"@scripts/jest-config": "2.
|
|
41
|
+
"@modern-js/types": "2.7.0",
|
|
42
|
+
"@modern-js/babel-preset-app": "2.7.0",
|
|
43
|
+
"@scripts/build": "2.7.0",
|
|
44
|
+
"@scripts/jest-config": "2.7.0"
|
|
45
45
|
},
|
|
46
46
|
"sideEffects": false,
|
|
47
47
|
"publishConfig": {
|