@modern-js/core 2.3.0 → 2.4.1-beta.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 +22 -0
- package/README.md +14 -18
- package/dist/config/createLoadedConfig.d.ts +2 -2
- package/dist/config/createLoadedConfig.js +1 -1
- package/dist/types/config/index.d.ts +5 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @modern-js/core
|
|
2
2
|
|
|
3
|
+
## 2.4.1-beta.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [11c053b]
|
|
8
|
+
- @modern-js/utils@2.4.1-beta.0
|
|
9
|
+
- @modern-js/node-bundle-require@2.4.1-beta.0
|
|
10
|
+
|
|
11
|
+
## 2.4.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 8c2db5f: feat(core): improve support for exporting a function in config file
|
|
16
|
+
|
|
17
|
+
feat(core): 完善对配置文件中导出函数的支持
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [98a2733]
|
|
20
|
+
- Updated dependencies [8c2db5f]
|
|
21
|
+
- @modern-js/node-bundle-require@2.4.0
|
|
22
|
+
- @modern-js/utils@2.4.0
|
|
23
|
+
- @modern-js/plugin@2.4.0
|
|
24
|
+
|
|
3
25
|
## 2.3.0
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
1
|
<p align="center">
|
|
3
2
|
<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
3
|
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Modern.js</h1>
|
|
6
|
+
|
|
5
7
|
<p align="center">
|
|
6
|
-
|
|
7
|
-
<br/>
|
|
8
|
-
<a href="https://modernjs.dev" target="blank">
|
|
9
|
-
modernjs.dev
|
|
10
|
-
</a>
|
|
11
|
-
</p>
|
|
12
|
-
<p align="center">
|
|
13
|
-
The meta-framework suite designed from scratch for frontend-focused modern web development
|
|
8
|
+
A Progressive React Framework for modern web development.
|
|
14
9
|
</p>
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.
|
|
11
|
+
## Getting Started
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
|
|
21
14
|
|
|
22
|
-
##
|
|
15
|
+
## Documentation
|
|
23
16
|
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [API References](https://modernjs.dev/docs/apis)
|
|
17
|
+
- [English Documentation](https://modernjs.dev/en/)
|
|
18
|
+
- [中文文档](https://modernjs.dev)
|
|
27
19
|
|
|
28
20
|
## Contributing
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LoadedConfig, UserConfig
|
|
1
|
+
import { LoadedConfig, UserConfig } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Assign the pkg config into the user config.
|
|
4
4
|
*/
|
|
5
|
-
export declare const assignPkgConfig: (userConfig?: UserConfig, pkgConfig?:
|
|
5
|
+
export declare const assignPkgConfig: (userConfig?: UserConfig, pkgConfig?: UserConfig) => UserConfig;
|
|
6
6
|
export declare function createLoadedConfig(appDirectory: string, filePath?: string, packageJsonConfig?: string): Promise<LoadedConfig<{}>>;
|
|
@@ -28,7 +28,7 @@ exports.assignPkgConfig = assignPkgConfig;
|
|
|
28
28
|
*/
|
|
29
29
|
async function getConfigObject(config) {
|
|
30
30
|
if (typeof config === 'function') {
|
|
31
|
-
return (await config(0)) || {};
|
|
31
|
+
return (await config({ env: (0, utils_1.getNodeEnv)(), command: (0, utils_1.getCommand)() })) || {};
|
|
32
32
|
}
|
|
33
33
|
return config || {};
|
|
34
34
|
}
|
|
@@ -46,4 +46,8 @@ export type LoadedConfig<Extends extends {
|
|
|
46
46
|
pkgConfig: UserConfig<Extends>;
|
|
47
47
|
jsConfig: UserConfig<Extends>;
|
|
48
48
|
};
|
|
49
|
-
export type ConfigParams =
|
|
49
|
+
export type ConfigParams = {
|
|
50
|
+
env: string;
|
|
51
|
+
command: string;
|
|
52
|
+
};
|
|
53
|
+
export type UserConfigExport<Config = UserConfig> = Config | ((env: ConfigParams) => Config | Promise<Config>);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/core",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "A Progressive React Framework for modern web development.",
|
|
4
4
|
"homepage": "https://modernjs.dev",
|
|
5
5
|
"bugs": "https://github.com/modern-js-dev/modern.js/issues",
|
|
6
6
|
"repository": "modern-js-dev/modern.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"modern",
|
|
11
11
|
"modern.js"
|
|
12
12
|
],
|
|
13
|
-
"version": "2.
|
|
13
|
+
"version": "2.4.1-beta.0",
|
|
14
14
|
"jsnext:source": "./src/index.ts",
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@modern-js/node-bundle-require": "2.
|
|
55
|
-
"@modern-js/
|
|
56
|
-
"@modern-js/
|
|
54
|
+
"@modern-js/node-bundle-require": "2.4.1-beta.0",
|
|
55
|
+
"@modern-js/utils": "2.4.1-beta.0",
|
|
56
|
+
"@modern-js/plugin": "2.4.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@jest/types": "^27.0.6",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"terser-webpack-plugin": "^5.1.4",
|
|
72
72
|
"typescript": "^4",
|
|
73
73
|
"webpack": "^5.75.0",
|
|
74
|
-
"@modern-js/builder-shared": "2.
|
|
75
|
-
"@modern-js/babel-preset-app": "2.
|
|
76
|
-
"@modern-js/types": "2.
|
|
77
|
-
"@scripts/jest-config": "2.
|
|
78
|
-
"@scripts/build": "2.
|
|
74
|
+
"@modern-js/builder-shared": "2.5.0-beta.0",
|
|
75
|
+
"@modern-js/babel-preset-app": "2.4.1-beta.0",
|
|
76
|
+
"@modern-js/types": "2.4.0",
|
|
77
|
+
"@scripts/jest-config": "2.4.0",
|
|
78
|
+
"@scripts/build": "2.4.0"
|
|
79
79
|
},
|
|
80
80
|
"sideEffects": false,
|
|
81
81
|
"publishConfig": {
|