@modern-js/core 1.0.0-rc.10 → 1.0.0-rc.14
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 +48 -0
- package/README.md +13 -21
- package/dist/js/modern/config/defaults.js +2 -1
- package/dist/js/modern/config/schema/deploy.js +1 -15
- package/dist/js/modern/config/schema/index.js +3 -0
- package/dist/js/modern/index.js +3 -1
- package/dist/js/node/config/defaults.js +2 -1
- package/dist/js/node/config/schema/deploy.js +1 -15
- package/dist/js/node/config/schema/index.js +3 -0
- package/dist/js/node/index.js +40 -1
- package/dist/types/config/defaults.d.ts +1 -0
- package/dist/types/config/index.d.ts +2 -3
- package/dist/types/config/schema/deploy.d.ts +1 -15
- package/dist/types/config/schema/index.d.ts +4 -15
- package/dist/types/index.d.ts +2 -0
- package/package.json +7 -7
- package/src/config/defaults.ts +1 -1
- package/src/config/index.ts +2 -3
- package/src/config/schema/deploy.ts +1 -7
- package/src/config/schema/index.ts +6 -1
- package/src/index.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @modern-js/core
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 224f7fe: fix server route match
|
|
8
|
+
- 204c626: feat: initial
|
|
9
|
+
- Updated dependencies [224f7fe]
|
|
10
|
+
- Updated dependencies [204c626]
|
|
11
|
+
- @modern-js/load-config@1.0.0-rc.14
|
|
12
|
+
- @modern-js/plugin@1.0.0-rc.14
|
|
13
|
+
- @modern-js/utils@1.0.0-rc.14
|
|
14
|
+
|
|
15
|
+
## 1.0.0-rc.13
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 224f7fe: fix server route match
|
|
20
|
+
- 204c626: feat: initial
|
|
21
|
+
- Updated dependencies [224f7fe]
|
|
22
|
+
- Updated dependencies [204c626]
|
|
23
|
+
- @modern-js/load-config@1.0.0-rc.13
|
|
24
|
+
- @modern-js/plugin@1.0.0-rc.13
|
|
25
|
+
- @modern-js/utils@1.0.0-rc.13
|
|
26
|
+
|
|
27
|
+
## 1.0.0-rc.12
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 224f7fe: fix server route match
|
|
32
|
+
- 204c626: feat: initial
|
|
33
|
+
- Updated dependencies [224f7fe]
|
|
34
|
+
- Updated dependencies [204c626]
|
|
35
|
+
- @modern-js/load-config@1.0.0-rc.12
|
|
36
|
+
- @modern-js/plugin@1.0.0-rc.12
|
|
37
|
+
- @modern-js/utils@1.0.0-rc.12
|
|
38
|
+
|
|
39
|
+
## 1.0.0-rc.11
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- 224f7fe: fix server route match
|
|
44
|
+
- 204c626: feat: initial
|
|
45
|
+
- Updated dependencies [224f7fe]
|
|
46
|
+
- Updated dependencies [204c626]
|
|
47
|
+
- @modern-js/load-config@1.0.0-rc.11
|
|
48
|
+
- @modern-js/plugin@1.0.0-rc.11
|
|
49
|
+
- @modern-js/utils@1.0.0-rc.11
|
|
50
|
+
|
|
3
51
|
## 1.0.0-rc.10
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,30 +3,22 @@
|
|
|
3
3
|
<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
4
|
</p>
|
|
5
5
|
|
|
6
|
-
<p align="center"
|
|
6
|
+
<p align="center">
|
|
7
|
+
现代 Web 工程体系
|
|
8
|
+
<br/>
|
|
9
|
+
<a href="https://modernjs.dev" target="blank">
|
|
10
|
+
modernjs.dev
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
7
14
|
|
|
8
|
-
##
|
|
15
|
+
## 参考链接
|
|
9
16
|
- [迈入现代 Web 开发](https://zhuanlan.zhihu.com/p/386607009)
|
|
10
17
|
- [现代 Web 开发者问卷调查报告](https://zhuanlan.zhihu.com/p/403206195)
|
|
18
|
+
- [字节跳动是如何落地微前端的](https://mp.weixin.qq.com/s/L9wbfNG5fTXF5bx7dcgj4Q)
|
|
11
19
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
Modern.js 的 1.0.0.rc 版已经发到 npm,目前在做测试改进,README 文档之后统一提供(现阶段加入测试和开发,可以发 [issue](https://github.com/modern-js-dev/modern.js/issues) 留微信联系),完整的文档站计划在10月14日上线
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
## 近期计划
|
|
31
21
|
|
|
22
|
+
Modern.js 的 1.0.0.rc 版已经发到 npm,目前在做测试改进和文档建设。
|
|
32
23
|
|
|
24
|
+
README、完整的文档站、介绍等,都计划在 10 月 27 日上线。
|
|
@@ -3,21 +3,7 @@ export const deploy = {
|
|
|
3
3
|
type: 'object',
|
|
4
4
|
properties: {
|
|
5
5
|
microFrontend: {
|
|
6
|
-
type: 'object'
|
|
7
|
-
dependencies: {
|
|
8
|
-
enableHtmlEntry: {
|
|
9
|
-
properties: {
|
|
10
|
-
enableLegacy: {
|
|
11
|
-
enum: [false]
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
properties: {
|
|
17
|
-
enableHtmlEntry: {
|
|
18
|
-
type: 'boolean'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
6
|
+
type: ['boolean', 'object']
|
|
21
7
|
},
|
|
22
8
|
domain: {
|
|
23
9
|
type: ['array', 'string']
|
package/dist/js/modern/index.js
CHANGED
|
@@ -15,6 +15,8 @@ import { AppContext, ConfigContext, initAppContext, ResolvedConfigContext, useAp
|
|
|
15
15
|
import { initWatcher } from "./initWatcher";
|
|
16
16
|
import { loadEnv } from "./loadEnv";
|
|
17
17
|
export { defaultsConfig } from "./config";
|
|
18
|
+
export * from '@modern-js/plugin';
|
|
19
|
+
export * from '@modern-js/plugin/node';
|
|
18
20
|
program.name('modern').usage('<command> [options]').version(process.env.MODERN_JS_VERSION || '0.1.0');
|
|
19
21
|
const hooksMap = {
|
|
20
22
|
config: createParallelWorkflow(),
|
|
@@ -53,6 +55,7 @@ const createCli = () => {
|
|
|
53
55
|
let isRestart = false;
|
|
54
56
|
|
|
55
57
|
const init = async (argv = []) => {
|
|
58
|
+
enable();
|
|
56
59
|
manager.clear();
|
|
57
60
|
const appDirectory = await initAppDir();
|
|
58
61
|
loadEnv(appDirectory);
|
|
@@ -100,7 +103,6 @@ const createCli = () => {
|
|
|
100
103
|
};
|
|
101
104
|
|
|
102
105
|
async function run(argv) {
|
|
103
|
-
enable();
|
|
104
106
|
const {
|
|
105
107
|
loadedConfig,
|
|
106
108
|
appContext,
|
|
@@ -11,21 +11,7 @@ const deploy = {
|
|
|
11
11
|
type: 'object',
|
|
12
12
|
properties: {
|
|
13
13
|
microFrontend: {
|
|
14
|
-
type: 'object'
|
|
15
|
-
dependencies: {
|
|
16
|
-
enableHtmlEntry: {
|
|
17
|
-
properties: {
|
|
18
|
-
enableLegacy: {
|
|
19
|
-
enum: [false]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
properties: {
|
|
25
|
-
enableHtmlEntry: {
|
|
26
|
-
type: 'boolean'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
14
|
+
type: ['boolean', 'object']
|
|
29
15
|
},
|
|
30
16
|
domain: {
|
|
31
17
|
type: ['array', 'string']
|
package/dist/js/node/index.js
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
manager: true,
|
|
8
|
+
createPlugin: true,
|
|
9
|
+
registerHook: true,
|
|
10
|
+
mountHook: true,
|
|
11
|
+
usePlugins: true,
|
|
12
|
+
cli: true,
|
|
13
|
+
createContext: true,
|
|
14
|
+
defineConfig: true,
|
|
15
|
+
defaultsConfig: true,
|
|
16
|
+
AppContext: true,
|
|
17
|
+
useAppContext: true,
|
|
18
|
+
useConfigContext: true,
|
|
19
|
+
useResolvedConfigContext: true
|
|
20
|
+
};
|
|
6
21
|
Object.defineProperty(exports, "AppContext", {
|
|
7
22
|
enumerable: true,
|
|
8
23
|
get: function () {
|
|
@@ -54,8 +69,32 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
54
69
|
|
|
55
70
|
var _plugin = require("@modern-js/plugin");
|
|
56
71
|
|
|
72
|
+
Object.keys(_plugin).forEach(function (key) {
|
|
73
|
+
if (key === "default" || key === "__esModule") return;
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
75
|
+
if (key in exports && exports[key] === _plugin[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _plugin[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
57
84
|
var _node = require("@modern-js/plugin/node");
|
|
58
85
|
|
|
86
|
+
Object.keys(_node).forEach(function (key) {
|
|
87
|
+
if (key === "default" || key === "__esModule") return;
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
89
|
+
if (key in exports && exports[key] === _node[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _node[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
59
98
|
var _utils = require("@modern-js/utils");
|
|
60
99
|
|
|
61
100
|
var _commander = require("./utils/commander");
|
|
@@ -123,6 +162,7 @@ const createCli = () => {
|
|
|
123
162
|
let isRestart = false;
|
|
124
163
|
|
|
125
164
|
const init = async (argv = []) => {
|
|
165
|
+
(0, _node.enable)();
|
|
126
166
|
manager.clear();
|
|
127
167
|
const appDirectory = await initAppDir();
|
|
128
168
|
(0, _loadEnv.loadEnv)(appDirectory);
|
|
@@ -173,7 +213,6 @@ const createCli = () => {
|
|
|
173
213
|
};
|
|
174
214
|
|
|
175
215
|
async function run(argv) {
|
|
176
|
-
(0, _node.enable)();
|
|
177
216
|
const {
|
|
178
217
|
loadedConfig,
|
|
179
218
|
appContext,
|
|
@@ -76,11 +76,10 @@ export interface ServerConfig {
|
|
|
76
76
|
}
|
|
77
77
|
export interface DevConfig {
|
|
78
78
|
assetPrefix?: string | boolean;
|
|
79
|
+
https?: boolean;
|
|
79
80
|
}
|
|
80
81
|
export interface DeployConfig {
|
|
81
|
-
microFrontend?:
|
|
82
|
-
enableHtmlEntry?: boolean;
|
|
83
|
-
};
|
|
82
|
+
microFrontend?: boolean | Record<string, unknown>;
|
|
84
83
|
domain?: string | Array<string>;
|
|
85
84
|
domainByEntries?: Record<string, string | Array<string>>;
|
|
86
85
|
}
|
|
@@ -2,21 +2,7 @@ export declare const deploy: {
|
|
|
2
2
|
type: string;
|
|
3
3
|
properties: {
|
|
4
4
|
microFrontend: {
|
|
5
|
-
type: string;
|
|
6
|
-
dependencies: {
|
|
7
|
-
enableHtmlEntry: {
|
|
8
|
-
properties: {
|
|
9
|
-
enableLegacy: {
|
|
10
|
-
enum: boolean[];
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
properties: {
|
|
16
|
-
enableHtmlEntry: {
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
5
|
+
type: string[];
|
|
20
6
|
};
|
|
21
7
|
domain: {
|
|
22
8
|
type: string[];
|
|
@@ -394,21 +394,7 @@ export declare const patchSchema: (pluginSchemas: Array<PluginValidateSchema | P
|
|
|
394
394
|
type: string;
|
|
395
395
|
properties: {
|
|
396
396
|
microFrontend: {
|
|
397
|
-
type: string;
|
|
398
|
-
dependencies: {
|
|
399
|
-
enableHtmlEntry: {
|
|
400
|
-
properties: {
|
|
401
|
-
enableLegacy: {
|
|
402
|
-
enum: boolean[];
|
|
403
|
-
};
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
};
|
|
407
|
-
properties: {
|
|
408
|
-
enableHtmlEntry: {
|
|
409
|
-
type: string;
|
|
410
|
-
};
|
|
411
|
-
};
|
|
397
|
+
type: string[];
|
|
412
398
|
};
|
|
413
399
|
domain: {
|
|
414
400
|
type: string[];
|
|
@@ -433,6 +419,9 @@ export declare const patchSchema: (pluginSchemas: Array<PluginValidateSchema | P
|
|
|
433
419
|
assetPrefix: {
|
|
434
420
|
type: string[];
|
|
435
421
|
};
|
|
422
|
+
https: {
|
|
423
|
+
type: string;
|
|
424
|
+
};
|
|
436
425
|
};
|
|
437
426
|
additionalProperties: boolean;
|
|
438
427
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { AppContext, IAppContext, useAppContext, useConfigContext, useResolvedCo
|
|
|
6
6
|
import { NormalizedConfig } from './config/mergeConfig';
|
|
7
7
|
export type { Hooks };
|
|
8
8
|
export { defaultsConfig } from './config';
|
|
9
|
+
export * from '@modern-js/plugin';
|
|
10
|
+
export * from '@modern-js/plugin/node';
|
|
9
11
|
export declare type HooksRunner = Progresses2Runners<{
|
|
10
12
|
config: ParallelWorkflow<void>;
|
|
11
13
|
validateSchema: ParallelWorkflow<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/core",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.14",
|
|
4
4
|
"jsnext:source": "./src/index.ts",
|
|
5
5
|
"types": "./dist/types/index.d.ts",
|
|
6
6
|
"main": "./dist/js/node/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@babel/runtime": "^7",
|
|
29
29
|
"@babel/code-frame": "^7.14.5",
|
|
30
|
-
"@modern-js/load-config": "^1.0.0-rc.
|
|
31
|
-
"@modern-js/plugin": "^1.0.0-rc.
|
|
32
|
-
"@modern-js/utils": "^1.0.0-rc.
|
|
30
|
+
"@modern-js/load-config": "^1.0.0-rc.14",
|
|
31
|
+
"@modern-js/plugin": "^1.0.0-rc.14",
|
|
32
|
+
"@modern-js/utils": "^1.0.0-rc.14",
|
|
33
33
|
"address": "^1.1.2",
|
|
34
34
|
"ajv": "^8.6.2",
|
|
35
35
|
"ajv-keywords": "^5.0.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/babel__code-frame": "^7.0.3",
|
|
49
|
-
"@modern-js/types": "^1.0.0-rc.
|
|
49
|
+
"@modern-js/types": "^1.0.0-rc.14",
|
|
50
50
|
"@types/jest": "^26",
|
|
51
51
|
"@types/lodash.clonedeep": "^4.5.6",
|
|
52
52
|
"@types/lodash.mergewith": "^4.6.6",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@types/react-dom": "^17",
|
|
56
56
|
"@types/signale": "^1.4.2",
|
|
57
57
|
"typescript": "^4",
|
|
58
|
-
"@modern-js/plugin-testing": "^1.0.0-rc.
|
|
59
|
-
"@modern-js/module-tools": "^1.0.0-rc.
|
|
58
|
+
"@modern-js/plugin-testing": "^1.0.0-rc.14",
|
|
59
|
+
"@modern-js/module-tools": "^1.0.0-rc.14"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"modernConfig": {
|
package/src/config/defaults.ts
CHANGED
package/src/config/index.ts
CHANGED
|
@@ -111,12 +111,11 @@ export interface ServerConfig {
|
|
|
111
111
|
|
|
112
112
|
export interface DevConfig {
|
|
113
113
|
assetPrefix?: string | boolean;
|
|
114
|
+
https?: boolean;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
export interface DeployConfig {
|
|
117
|
-
microFrontend?:
|
|
118
|
-
enableHtmlEntry?: boolean;
|
|
119
|
-
};
|
|
118
|
+
microFrontend?: boolean | Record<string, unknown>;
|
|
120
119
|
domain?: string | Array<string>;
|
|
121
120
|
domainByEntries?: Record<string, string | Array<string>>;
|
|
122
121
|
}
|
|
@@ -4,13 +4,7 @@ export const deploy = {
|
|
|
4
4
|
type: 'object',
|
|
5
5
|
properties: {
|
|
6
6
|
microFrontend: {
|
|
7
|
-
type: 'object',
|
|
8
|
-
dependencies: {
|
|
9
|
-
enableHtmlEntry: { properties: { enableLegacy: { enum: [false] } } },
|
|
10
|
-
},
|
|
11
|
-
properties: {
|
|
12
|
-
enableHtmlEntry: { type: 'boolean' },
|
|
13
|
-
},
|
|
7
|
+
type: ['boolean', 'object'],
|
|
14
8
|
},
|
|
15
9
|
domain: { type: ['array', 'string'] },
|
|
16
10
|
domainByEntries: {
|
|
@@ -16,7 +16,12 @@ const plugins = {
|
|
|
16
16
|
|
|
17
17
|
const dev = {
|
|
18
18
|
type: 'object',
|
|
19
|
-
properties: {
|
|
19
|
+
properties: {
|
|
20
|
+
assetPrefix: { type: ['boolean', 'string'] },
|
|
21
|
+
https: {
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
20
25
|
additionalProperties: false,
|
|
21
26
|
};
|
|
22
27
|
export interface PluginValidateSchema {
|
package/src/index.ts
CHANGED
|
@@ -42,6 +42,9 @@ import { loadEnv } from './loadEnv';
|
|
|
42
42
|
export type { Hooks };
|
|
43
43
|
export { defaultsConfig } from './config';
|
|
44
44
|
|
|
45
|
+
export * from '@modern-js/plugin';
|
|
46
|
+
export * from '@modern-js/plugin/node';
|
|
47
|
+
|
|
45
48
|
program
|
|
46
49
|
.name('modern')
|
|
47
50
|
.usage('<command> [options]')
|
|
@@ -136,6 +139,8 @@ const createCli = () => {
|
|
|
136
139
|
let isRestart = false;
|
|
137
140
|
|
|
138
141
|
const init = async (argv: string[] = []) => {
|
|
142
|
+
enable();
|
|
143
|
+
|
|
139
144
|
manager.clear();
|
|
140
145
|
|
|
141
146
|
const appDirectory = await initAppDir();
|
|
@@ -201,8 +206,6 @@ const createCli = () => {
|
|
|
201
206
|
};
|
|
202
207
|
|
|
203
208
|
async function run(argv: string[]) {
|
|
204
|
-
enable();
|
|
205
|
-
|
|
206
209
|
const { loadedConfig, appContext, resolved } = await init(argv);
|
|
207
210
|
|
|
208
211
|
initWatcher(
|