@modern-js/core 2.0.0-beta.0 → 2.0.0-beta.1
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 +64 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +12 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @modern-js/core
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.1
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9: chore: v2
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- c9e800d39a: feat: support React18 streaming SSR
|
|
12
|
+
feat: 支持 React18 流式 SSR
|
|
13
|
+
- 92f0ead: 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
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 85edee888c: feat(app-tools): support tools.htmlPlugin config
|
|
36
|
+
|
|
37
|
+
feat(app-tools): 支持 tools.htmlPlugin 配置项
|
|
38
|
+
|
|
39
|
+
- b8bbe036c7: feat: change type logic
|
|
40
|
+
feat: 修改类型相关的逻辑
|
|
41
|
+
- 8b8e1bb571: feat: support nested routes
|
|
42
|
+
feat: 支持嵌套路由
|
|
43
|
+
- 3bbea92b2a: feat: support Hook、Middleware new API
|
|
44
|
+
feat: 支持 Hook、Middleware 的新 API
|
|
45
|
+
- 14b712d: fix: use consistent alias type and default value across packages
|
|
46
|
+
|
|
47
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [a2509bfbdb]
|
|
50
|
+
- Updated dependencies [92f0ead]
|
|
51
|
+
- Updated dependencies [edd1cfb1af]
|
|
52
|
+
- Updated dependencies [cc971eabfc]
|
|
53
|
+
- Updated dependencies [5b9049f]
|
|
54
|
+
- Updated dependencies [92004d1]
|
|
55
|
+
- Updated dependencies [b8bbe036c7]
|
|
56
|
+
- Updated dependencies [d5a31df781]
|
|
57
|
+
- Updated dependencies [dda38c9]
|
|
58
|
+
- Updated dependencies [3bbea92b2a]
|
|
59
|
+
- Updated dependencies [f179749]
|
|
60
|
+
- Updated dependencies [abf3421]
|
|
61
|
+
- Updated dependencies [543be9558e]
|
|
62
|
+
- Updated dependencies [14b712d]
|
|
63
|
+
- @modern-js/node-bundle-require@2.0.0-beta.1
|
|
64
|
+
- @modern-js/utils@2.0.0-beta.1
|
|
65
|
+
- @modern-js/plugin@2.0.0-beta.1
|
|
66
|
+
|
|
3
67
|
## 2.0.0-beta.0
|
|
4
68
|
|
|
5
69
|
### Major Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type { PluginAPI } from './pluginAPI';
|
|
|
12
12
|
export type { IAppContext };
|
|
13
13
|
declare const initAppDir: (cwd?: string) => Promise<string>;
|
|
14
14
|
export interface CoreOptions {
|
|
15
|
+
cwd?: string;
|
|
15
16
|
version?: string;
|
|
16
17
|
configFile?: string;
|
|
17
18
|
serverConfigFile?: string;
|
|
@@ -30,6 +31,7 @@ export interface CoreOptions {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
export declare const mergeOptions: (options?: CoreOptions) => {
|
|
34
|
+
cwd?: string | undefined;
|
|
33
35
|
version?: string | undefined;
|
|
34
36
|
configFile?: string | undefined;
|
|
35
37
|
serverConfigFile: string;
|
|
@@ -55,6 +57,10 @@ export declare const cli: {
|
|
|
55
57
|
}>;
|
|
56
58
|
run: (argv: string[], options?: CoreOptions) => Promise<void>;
|
|
57
59
|
restart: () => Promise<void>;
|
|
60
|
+
test: (argv: string[], options?: {
|
|
61
|
+
coreOptions?: CoreOptions;
|
|
62
|
+
disableWatcher?: boolean;
|
|
63
|
+
}) => Promise<void>;
|
|
58
64
|
};
|
|
59
65
|
export { initAppDir, initAppContext };
|
|
60
66
|
declare module '@modern-js/utils/compiled/commander' {
|
package/dist/index.js
CHANGED
|
@@ -79,7 +79,7 @@ const createCli = () => {
|
|
|
79
79
|
manager_1.manager.clear();
|
|
80
80
|
const mergedOptions = (0, exports.mergeOptions)(options);
|
|
81
81
|
restartOptions = mergedOptions;
|
|
82
|
-
const appDirectory = await initAppDir();
|
|
82
|
+
const appDirectory = await initAppDir(options === null || options === void 0 ? void 0 : options.cwd);
|
|
83
83
|
(0, commander_1.initCommandsMap)();
|
|
84
84
|
setProgramVersion(options === null || options === void 0 ? void 0 : options.version);
|
|
85
85
|
const metaName = (_b = (_a = mergedOptions === null || mergedOptions === void 0 ? void 0 : mergedOptions.options) === null || _a === void 0 ? void 0 : _a.metaName) !== null && _b !== void 0 ? _b : 'MODERN';
|
|
@@ -164,10 +164,21 @@ const createCli = () => {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
+
async function test(argv, options) {
|
|
168
|
+
const newProgram = new utils_1.Command();
|
|
169
|
+
const { coreOptions } = options !== null && options !== void 0 ? options : {};
|
|
170
|
+
const { loadedConfig, appContext, resolved } = await init(argv, coreOptions);
|
|
171
|
+
await hooksRunner.commands({ program: newProgram });
|
|
172
|
+
if (!(options === null || options === void 0 ? void 0 : options.disableWatcher)) {
|
|
173
|
+
(0, initWatcher_1.initWatcher)(loadedConfig, appContext.appDirectory, resolved.source.configDir, hooksRunner, argv);
|
|
174
|
+
}
|
|
175
|
+
await newProgram.parseAsync(argv);
|
|
176
|
+
}
|
|
167
177
|
return {
|
|
168
178
|
init,
|
|
169
179
|
run,
|
|
170
180
|
restart,
|
|
181
|
+
test,
|
|
171
182
|
};
|
|
172
183
|
};
|
|
173
184
|
exports.cli = createCli();
|
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.1",
|
|
14
14
|
"jsnext:source": "./src/index.ts",
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
@@ -38,16 +38,12 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@modern-js/node-bundle-require": "2.0.0-beta.
|
|
42
|
-
"@modern-js/plugin": "2.0.0-beta.
|
|
43
|
-
"@modern-js/utils": "2.0.0-beta.
|
|
41
|
+
"@modern-js/node-bundle-require": "2.0.0-beta.1",
|
|
42
|
+
"@modern-js/plugin": "2.0.0-beta.1",
|
|
43
|
+
"@modern-js/utils": "2.0.0-beta.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@jest/types": "^27.0.6",
|
|
47
|
-
"@modern-js/babel-preset-app": "2.0.0-beta.0",
|
|
48
|
-
"@modern-js/types": "2.0.0-beta.0",
|
|
49
|
-
"@scripts/build": "2.0.0-beta.0",
|
|
50
|
-
"@scripts/jest-config": "2.0.0-beta.0",
|
|
51
47
|
"@types/babel__code-frame": "^7.0.3",
|
|
52
48
|
"@types/babel__core": "^7.1.16",
|
|
53
49
|
"@types/jest": "^27",
|
|
@@ -62,7 +58,11 @@
|
|
|
62
58
|
"sass": "^1.45.0",
|
|
63
59
|
"terser-webpack-plugin": "^5.1.4",
|
|
64
60
|
"typescript": "^4",
|
|
65
|
-
"webpack": "^5.74.0"
|
|
61
|
+
"webpack": "^5.74.0",
|
|
62
|
+
"@modern-js/babel-preset-app": "2.0.0-beta.1",
|
|
63
|
+
"@modern-js/types": "2.0.0-beta.1",
|
|
64
|
+
"@scripts/build": "2.0.0-beta.1",
|
|
65
|
+
"@scripts/jest-config": "2.0.0-beta.1"
|
|
66
66
|
},
|
|
67
67
|
"sideEffects": false,
|
|
68
68
|
"publishConfig": {
|