@modern-js/core 2.0.0-beta.2 → 2.0.0-beta.3
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 +92 -0
- package/dist/config/createResolvedConfig.js +0 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5 -3
- package/dist/runBin.d.ts +5 -0
- package/dist/runBin.js +50 -0
- package/package.json +17 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,97 @@
|
|
|
1
1
|
# @modern-js/core
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9c3e: chore: v2
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- c9e800d39a: feat: support React18 streaming SSR
|
|
12
|
+
feat: 支持 React18 流式 SSR
|
|
13
|
+
- 92f0eade39: feat:
|
|
14
|
+
|
|
15
|
+
1. core: 增加 test 函数
|
|
16
|
+
2. module plugins: 增加 `babel`, `mainField`, `target` 插件
|
|
17
|
+
3. storybook: 修改部分逻辑并且增加 tspath webpack 插件
|
|
18
|
+
4. 增加 designSystem 配置
|
|
19
|
+
|
|
20
|
+
feat:
|
|
21
|
+
|
|
22
|
+
1. core: add test method
|
|
23
|
+
2. module plugins: add `babel`, `mainField`, `target` plugin
|
|
24
|
+
3. storybook: change some logic and add tspath webpack plugin
|
|
25
|
+
4. add `designSystem` config
|
|
26
|
+
|
|
27
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
|
28
|
+
feat: modernjs 接入 builder 构建
|
|
29
|
+
- d5a31df781: refactor: remove unbundle configs and types
|
|
30
|
+
|
|
31
|
+
refactor: 移除 unbundle 相关的配置项和类型定义
|
|
32
|
+
|
|
33
|
+
- e4558a0: feat:
|
|
34
|
+
|
|
35
|
+
1. add `runBin` function
|
|
36
|
+
2. config internal plugins constants in the app/module/doc tools
|
|
37
|
+
3. add app/module/doc tools internal plugins
|
|
38
|
+
|
|
39
|
+
feat:
|
|
40
|
+
|
|
41
|
+
1. 添加 `runBin` 函数
|
|
42
|
+
2. 在 app/module/doc tools 里配置内部插件
|
|
43
|
+
3. 增加 app/module/doc tools 使用的插件常量
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- 85edee888c: feat(app-tools): support tools.htmlPlugin config
|
|
48
|
+
|
|
49
|
+
feat(app-tools): 支持 tools.htmlPlugin 配置项
|
|
50
|
+
|
|
51
|
+
- b8bbe036c7: feat: change type logic
|
|
52
|
+
feat: 修改类型相关的逻辑
|
|
53
|
+
- 8b8e1bb571: feat: support nested routes
|
|
54
|
+
feat: 支持嵌套路由
|
|
55
|
+
- 3bbea92b2a: feat: support Hook、Middleware new API
|
|
56
|
+
feat: 支持 Hook、Middleware 的新 API
|
|
57
|
+
- b7a96c3: fix(app-tools): loose CLI init options after restart
|
|
58
|
+
|
|
59
|
+
fix(app-tools): 修复重启 CLI 后丢失 init options 的问题
|
|
60
|
+
|
|
61
|
+
- cce8ece: fix: handle some `TODO` & `FIXME`, change some tests
|
|
62
|
+
fix: 处理一些 `TODO` 和 `FIXME`, 修改了一些 tests
|
|
63
|
+
- ea7cf06: chore: bump webpack/babel-loader/postcss-loader/tsconfig-paths
|
|
64
|
+
|
|
65
|
+
chore: 升级 webpack/babel-loader/postcss-loader/tsconfig-paths 版本
|
|
66
|
+
|
|
67
|
+
- 14b712da84: fix: use consistent alias type and default value across packages
|
|
68
|
+
|
|
69
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [6aca875]
|
|
72
|
+
- Updated dependencies [2e60319]
|
|
73
|
+
- Updated dependencies [a2509bfbdb]
|
|
74
|
+
- Updated dependencies [92f0eade39]
|
|
75
|
+
- Updated dependencies [edd1cfb1af]
|
|
76
|
+
- Updated dependencies [cc971eabfc]
|
|
77
|
+
- Updated dependencies [5b9049f2e9]
|
|
78
|
+
- Updated dependencies [92004d1906]
|
|
79
|
+
- Updated dependencies [b8bbe036c7]
|
|
80
|
+
- Updated dependencies [d5a31df781]
|
|
81
|
+
- Updated dependencies [dda38c9c3e]
|
|
82
|
+
- Updated dependencies [3bbea92b2a]
|
|
83
|
+
- Updated dependencies [b710adb]
|
|
84
|
+
- Updated dependencies [f179749375]
|
|
85
|
+
- Updated dependencies [ea7cf06]
|
|
86
|
+
- Updated dependencies [bbe4c4a]
|
|
87
|
+
- Updated dependencies [e4558a0]
|
|
88
|
+
- Updated dependencies [abf3421a75]
|
|
89
|
+
- Updated dependencies [543be9558e]
|
|
90
|
+
- Updated dependencies [14b712da84]
|
|
91
|
+
- @modern-js/utils@2.0.0-beta.3
|
|
92
|
+
- @modern-js/node-bundle-require@2.0.0-beta.3
|
|
93
|
+
- @modern-js/plugin@2.0.0-beta.3
|
|
94
|
+
|
|
3
95
|
## 2.0.0-beta.2
|
|
4
96
|
|
|
5
97
|
### Major Changes
|
|
@@ -70,7 +70,6 @@ loaded, configs, schemas, onSchemaError = showAdditionalPropertiesError) => {
|
|
|
70
70
|
indent: 2,
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
-
// FIXME: pass temporarily
|
|
74
73
|
if (!valid && ((_a = validate.errors) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
75
74
|
await onSchemaError(validate === null || validate === void 0 ? void 0 : validate.errors[0]);
|
|
76
75
|
const errors = formatValidateError(userConfig);
|
package/dist/index.d.ts
CHANGED
|
@@ -46,13 +46,16 @@ export declare const mergeOptions: (options?: CoreOptions) => {
|
|
|
46
46
|
} | undefined;
|
|
47
47
|
};
|
|
48
48
|
export declare const cli: {
|
|
49
|
-
init: (options?: CoreOptions) => Promise<
|
|
49
|
+
init: (options?: CoreOptions) => Promise<{
|
|
50
|
+
resolved: import("./types").NormalizedConfig<{}, {}, {}, {}>;
|
|
51
|
+
appContext: import("./types").IAppContext;
|
|
52
|
+
}>;
|
|
50
53
|
run: (options?: CoreOptions) => Promise<void>;
|
|
51
54
|
test: (argv: string[], options?: {
|
|
52
55
|
coreOptions?: CoreOptions;
|
|
53
56
|
disableWatcher?: boolean;
|
|
54
57
|
}) => Promise<void>;
|
|
55
|
-
|
|
58
|
+
getPrevInitOptions: () => CoreOptions | undefined;
|
|
56
59
|
};
|
|
57
60
|
export { initAppDir, initAppContext };
|
|
58
61
|
declare module '@modern-js/utils/compiled/commander' {
|
package/dist/index.js
CHANGED
|
@@ -115,13 +115,15 @@ const createCli = () => {
|
|
|
115
115
|
const { resolved } = await hooksRunner.resolvedConfig({
|
|
116
116
|
resolved: normalizedConfig,
|
|
117
117
|
});
|
|
118
|
-
// FIXME: Why need to configContext again?
|
|
119
118
|
// update context value
|
|
120
119
|
context_1.ConfigContext.set(loaded.config);
|
|
121
120
|
context_1.ResolvedConfigContext.set(resolved);
|
|
122
|
-
// TODO: confirm the `addRuntimeExports` run order
|
|
123
121
|
await hooksRunner.addRuntimeExports();
|
|
124
122
|
await hooksRunner.prepare();
|
|
123
|
+
return {
|
|
124
|
+
resolved,
|
|
125
|
+
appContext: (0, context_1.useAppContext)(),
|
|
126
|
+
};
|
|
125
127
|
};
|
|
126
128
|
async function run(options) {
|
|
127
129
|
await init(options);
|
|
@@ -139,7 +141,7 @@ const createCli = () => {
|
|
|
139
141
|
init,
|
|
140
142
|
run,
|
|
141
143
|
test,
|
|
142
|
-
initOptions,
|
|
144
|
+
getPrevInitOptions: () => initOptions,
|
|
143
145
|
};
|
|
144
146
|
};
|
|
145
147
|
exports.cli = createCli();
|
package/dist/runBin.d.ts
ADDED
package/dist/runBin.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.run = void 0;
|
|
5
|
+
const utils_1 = require("@modern-js/utils");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
const run = async (otherCoreOptions = {}, options = {}) => {
|
|
8
|
+
const command = process.argv[2];
|
|
9
|
+
if (!process.env.NODE_ENV) {
|
|
10
|
+
if (['build', 'start', 'deploy', 'release'].includes(command)) {
|
|
11
|
+
process.env.NODE_ENV = 'production';
|
|
12
|
+
}
|
|
13
|
+
else if (command === 'test') {
|
|
14
|
+
process.env.NODE_ENV = 'test';
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
process.env.NODE_ENV = 'development';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const { version } = require('../package.json');
|
|
21
|
+
const cliParams = (0, utils_1.minimist)(process.argv.slice(2));
|
|
22
|
+
const runOptions = {
|
|
23
|
+
version,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Commands that support specify config files
|
|
27
|
+
* Some commands can't support this feature, such as `new`
|
|
28
|
+
*/
|
|
29
|
+
const SUPPORT_CONFIG_PARAM_COMMANDS = [
|
|
30
|
+
'dev',
|
|
31
|
+
'build',
|
|
32
|
+
'deploy',
|
|
33
|
+
'start',
|
|
34
|
+
'inspect',
|
|
35
|
+
];
|
|
36
|
+
const customConfigFile = cliParams.config || cliParams.c;
|
|
37
|
+
if (SUPPORT_CONFIG_PARAM_COMMANDS.includes(command) && customConfigFile) {
|
|
38
|
+
runOptions.configFile = customConfigFile;
|
|
39
|
+
}
|
|
40
|
+
if (typeof options.override === 'boolean' && options.override) {
|
|
41
|
+
await _1.cli.run(otherCoreOptions);
|
|
42
|
+
}
|
|
43
|
+
else if (typeof (options === null || options === void 0 ? void 0 : options.override) === 'function') {
|
|
44
|
+
await _1.cli.run(await options.override(runOptions));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
await _1.cli.run(utils_1.lodash.merge({}, runOptions, otherCoreOptions));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.run = run;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"modern",
|
|
11
11
|
"modern.js"
|
|
12
12
|
],
|
|
13
|
-
"version": "2.0.0-beta.
|
|
13
|
+
"version": "2.0.0-beta.3",
|
|
14
14
|
"jsnext:source": "./src/index.ts",
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"jsnext:source": "./src/bin.ts",
|
|
30
30
|
"default": "./dist/bin.js"
|
|
31
31
|
},
|
|
32
|
+
"./runBin": {
|
|
33
|
+
"jsnext:source": "./src/runBin.ts",
|
|
34
|
+
"default": "./dist/runBin.js"
|
|
35
|
+
},
|
|
32
36
|
"./types": {
|
|
33
37
|
"default": "./dist/types/index.js"
|
|
34
38
|
}
|
|
@@ -40,13 +44,16 @@
|
|
|
40
44
|
],
|
|
41
45
|
"types": [
|
|
42
46
|
"./dist/types/index.d.ts"
|
|
47
|
+
],
|
|
48
|
+
"runBin": [
|
|
49
|
+
"./dist/runBin.d.ts"
|
|
43
50
|
]
|
|
44
51
|
}
|
|
45
52
|
},
|
|
46
53
|
"dependencies": {
|
|
47
|
-
"@modern-js/node-bundle-require": "2.0.0-beta.
|
|
48
|
-
"@modern-js/
|
|
49
|
-
"@modern-js/
|
|
54
|
+
"@modern-js/node-bundle-require": "2.0.0-beta.3",
|
|
55
|
+
"@modern-js/utils": "2.0.0-beta.3",
|
|
56
|
+
"@modern-js/plugin": "2.0.0-beta.3"
|
|
50
57
|
},
|
|
51
58
|
"devDependencies": {
|
|
52
59
|
"@jest/types": "^27.0.6",
|
|
@@ -64,12 +71,12 @@
|
|
|
64
71
|
"sass": "^1.45.0",
|
|
65
72
|
"terser-webpack-plugin": "^5.1.4",
|
|
66
73
|
"typescript": "^4",
|
|
67
|
-
"webpack": "^5.
|
|
68
|
-
"@modern-js/builder-shared": "2.0.0-beta.
|
|
69
|
-
"@modern-js/babel-preset-app": "2.0.0-beta.
|
|
70
|
-
"@modern-js/types": "2.0.0-beta.
|
|
71
|
-
"@scripts/build": "2.0.0-beta.
|
|
72
|
-
"@scripts/jest-config": "2.0.0-beta.
|
|
74
|
+
"webpack": "^5.75.0",
|
|
75
|
+
"@modern-js/builder-shared": "2.0.0-beta.3",
|
|
76
|
+
"@modern-js/babel-preset-app": "2.0.0-beta.3",
|
|
77
|
+
"@modern-js/types": "2.0.0-beta.3",
|
|
78
|
+
"@scripts/build": "2.0.0-beta.3",
|
|
79
|
+
"@scripts/jest-config": "2.0.0-beta.3"
|
|
73
80
|
},
|
|
74
81
|
"sideEffects": false,
|
|
75
82
|
"publishConfig": {
|