@modern-js/plugin-ssg 1.2.4 → 1.2.5
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 +15 -0
- package/dist/js/modern/index.js +1 -3
- package/dist/js/modern/server/process.js +1 -1
- package/dist/js/modern/types.js +1 -1
- package/dist/js/node/index.js +1 -3
- package/dist/js/node/server/process.js +2 -2
- package/dist/js/node/types.js +1 -3
- package/dist/types/types.d.ts +8 -2
- package/package.json +23 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @modern-js/plugin-ssg
|
|
2
2
|
|
|
3
|
+
## 1.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 73306c0d: fix ssg type
|
|
8
|
+
- 59010b7a: rewrite server lifecycle, add unit test
|
|
9
|
+
- aed9912e: fix: output.ssg type error
|
|
10
|
+
- Updated dependencies [cc5e8001]
|
|
11
|
+
- Updated dependencies [2520ea86]
|
|
12
|
+
- Updated dependencies [db43dce6]
|
|
13
|
+
- Updated dependencies [e81fd9b7]
|
|
14
|
+
- Updated dependencies [1c411e71]
|
|
15
|
+
- @modern-js/core@1.4.6
|
|
16
|
+
- @modern-js/utils@1.3.4
|
|
17
|
+
|
|
3
18
|
## 1.2.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/js/modern/index.js
CHANGED
|
@@ -84,8 +84,6 @@ export default createPlugin(() => {
|
|
|
84
84
|
let entryOptions = intermediateOptions[entryName];
|
|
85
85
|
|
|
86
86
|
if (!agreedRoutes) {
|
|
87
|
-
var _entryOptions$routes;
|
|
88
|
-
|
|
89
87
|
// default behavior for non-agreed route
|
|
90
88
|
if (!entryOptions) {
|
|
91
89
|
return;
|
|
@@ -96,7 +94,7 @@ export default createPlugin(() => {
|
|
|
96
94
|
ssgRoutes.push(_objectSpread(_objectSpread({}, pageRoute), {}, {
|
|
97
95
|
output: entryPath
|
|
98
96
|
}));
|
|
99
|
-
} else if (
|
|
97
|
+
} else if (entryOptions.routes && entryOptions.routes.length > 0) {
|
|
100
98
|
// if entryOptions is object and has routes options
|
|
101
99
|
// add every route in options
|
|
102
100
|
const {
|
package/dist/js/modern/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@modern-js/core';
|
package/dist/js/node/index.js
CHANGED
|
@@ -103,8 +103,6 @@ var _default = (0, _core.createPlugin)(() => {
|
|
|
103
103
|
let entryOptions = intermediateOptions[entryName];
|
|
104
104
|
|
|
105
105
|
if (!agreedRoutes) {
|
|
106
|
-
var _entryOptions$routes;
|
|
107
|
-
|
|
108
106
|
// default behavior for non-agreed route
|
|
109
107
|
if (!entryOptions) {
|
|
110
108
|
return;
|
|
@@ -115,7 +113,7 @@ var _default = (0, _core.createPlugin)(() => {
|
|
|
115
113
|
ssgRoutes.push(_objectSpread(_objectSpread({}, pageRoute), {}, {
|
|
116
114
|
output: entryPath
|
|
117
115
|
}));
|
|
118
|
-
} else if (
|
|
116
|
+
} else if (entryOptions.routes && entryOptions.routes.length > 0) {
|
|
119
117
|
// if entryOptions is object and has routes options
|
|
120
118
|
// add every route in options
|
|
121
119
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _prodServer = _interopRequireDefault(require("@modern-js/prod-server"));
|
|
4
4
|
|
|
5
5
|
var _portfinder = _interopRequireDefault(require("portfinder"));
|
|
6
6
|
|
|
@@ -51,7 +51,7 @@ process.on('message', async chunk => {
|
|
|
51
51
|
const defaultPort = Number(process.env.PORT) || serverOptions.port;
|
|
52
52
|
_portfinder.default.basePort = defaultPort;
|
|
53
53
|
const port = await _portfinder.default.getPortPromise();
|
|
54
|
-
modernServer = await (0,
|
|
54
|
+
modernServer = await (0, _prodServer.default)({
|
|
55
55
|
pwd: appDirectory,
|
|
56
56
|
config: options,
|
|
57
57
|
routes,
|
package/dist/js/node/types.js
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ServerRoute as ModernRoute } from '@modern-js/types';
|
|
2
|
+
import '@modern-js/core';
|
|
2
3
|
export declare type AgreedRoute = {
|
|
3
4
|
path: string;
|
|
4
5
|
component: string;
|
|
@@ -25,10 +26,15 @@ export declare type RouteOptions = string | {
|
|
|
25
26
|
export declare type SingleEntryOptions = boolean | {
|
|
26
27
|
preventDefault?: string[];
|
|
27
28
|
headers?: Record<string, any>;
|
|
28
|
-
routes
|
|
29
|
+
routes?: RouteOptions[];
|
|
29
30
|
};
|
|
30
31
|
export declare type MultiEntryOptions = Record<string, SingleEntryOptions>;
|
|
31
32
|
export declare type SSG = boolean | SingleEntryOptions | MultiEntryOptions | ((entryName: string) => SingleEntryOptions);
|
|
32
33
|
export declare type ExtendOutputConfig = {
|
|
33
34
|
ssg: SSG;
|
|
34
|
-
};
|
|
35
|
+
};
|
|
36
|
+
declare module '@modern-js/core' {
|
|
37
|
+
interface OutputConfig {
|
|
38
|
+
ssg?: SSG;
|
|
39
|
+
}
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -11,12 +11,22 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.5",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
18
18
|
"module": "./dist/js/treeshaking/index.js",
|
|
19
19
|
"jsnext:modern": "./dist/js/modern/index.js",
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
"*": {
|
|
22
|
+
".": [
|
|
23
|
+
"./dist/types/index.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"types": [
|
|
26
|
+
"./dist/types/types.d.ts"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
20
30
|
"exports": {
|
|
21
31
|
".": {
|
|
22
32
|
"node": {
|
|
@@ -33,19 +43,27 @@
|
|
|
33
43
|
"require": "./dist/js/node/index.js"
|
|
34
44
|
},
|
|
35
45
|
"default": "./dist/js/treeshaking/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./types": {
|
|
48
|
+
"node": {
|
|
49
|
+
"import": "./dist/js/modern/types.js",
|
|
50
|
+
"require": "./dist/js/node/types.js",
|
|
51
|
+
"types": "./dist/types/types.d.ts"
|
|
52
|
+
},
|
|
53
|
+
"default": "./dist/js/treeshaking/types.js"
|
|
36
54
|
}
|
|
37
55
|
},
|
|
38
56
|
"dependencies": {
|
|
39
57
|
"@babel/runtime": "^7",
|
|
40
|
-
"@modern-js/utils": "^1.3.
|
|
58
|
+
"@modern-js/utils": "^1.3.4",
|
|
41
59
|
"node-mocks-http": "^1.10.1",
|
|
42
60
|
"normalize-path": "^3.0.0",
|
|
43
61
|
"portfinder": "^1.0.28",
|
|
44
62
|
"react-router-dom": "^5.2.1"
|
|
45
63
|
},
|
|
46
64
|
"devDependencies": {
|
|
47
|
-
"@modern-js/server": "^1.4.4",
|
|
48
65
|
"@modern-js/types": "^1.3.4",
|
|
66
|
+
"@modern-js/prod-server": "^1.0.2",
|
|
49
67
|
"@types/jest": "^26",
|
|
50
68
|
"@types/node": "^14",
|
|
51
69
|
"@types/react": "^17",
|
|
@@ -53,13 +71,13 @@
|
|
|
53
71
|
"@types/react-router": "^5.1.16",
|
|
54
72
|
"@types/react-router-dom": "^5.1.8",
|
|
55
73
|
"typescript": "^4",
|
|
56
|
-
"@modern-js/core": "^1.4.
|
|
74
|
+
"@modern-js/core": "^1.4.6",
|
|
57
75
|
"@scripts/build": "0.0.0",
|
|
58
76
|
"jest": "^27",
|
|
59
77
|
"@scripts/jest-config": "0.0.0"
|
|
60
78
|
},
|
|
61
79
|
"peerDependencies": {
|
|
62
|
-
"@modern-js/core": "^1.4.
|
|
80
|
+
"@modern-js/core": "^1.4.6"
|
|
63
81
|
},
|
|
64
82
|
"sideEffects": false,
|
|
65
83
|
"modernConfig": {
|