@modern-js/utils 2.0.0-beta.4 → 2.0.0-beta.6
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 +86 -0
- package/dist/chainId.d.ts +6 -0
- package/dist/chainId.js +6 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.js +20 -11
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# @modern-js/utils
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.6
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9c3e: chore: v2
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 92f0eade39: feat:
|
|
12
|
+
|
|
13
|
+
1. core: 增加 test 函数
|
|
14
|
+
2. module plugins: 增加 `babel`, `mainField`, `target` 插件
|
|
15
|
+
3. storybook: 修改部分逻辑并且增加 tspath webpack 插件
|
|
16
|
+
4. 增加 designSystem 配置
|
|
17
|
+
|
|
18
|
+
feat:
|
|
19
|
+
|
|
20
|
+
1. core: add test method
|
|
21
|
+
2. module plugins: add `babel`, `mainField`, `target` plugin
|
|
22
|
+
3. storybook: change some logic and add tspath webpack plugin
|
|
23
|
+
4. add `designSystem` config
|
|
24
|
+
|
|
25
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
|
26
|
+
feat: modernjs 接入 builder 构建
|
|
27
|
+
- d5a31df781: refactor: remove unbundle configs and types
|
|
28
|
+
|
|
29
|
+
refactor: 移除 unbundle 相关的配置项和类型定义
|
|
30
|
+
|
|
31
|
+
- b710adb843: feat: extract the data loader
|
|
32
|
+
feat: 提取 data loader
|
|
33
|
+
- bbe4c4ab64: feat: add @modern-js/plugin-swc
|
|
34
|
+
|
|
35
|
+
feat: 新增 @modern-js/plugin-swc 插件
|
|
36
|
+
|
|
37
|
+
- e4558a0bc4: feat:
|
|
38
|
+
|
|
39
|
+
1. add `runBin` function
|
|
40
|
+
2. config internal plugins constants in the app/module/doc tools
|
|
41
|
+
3. add app/module/doc tools internal plugins
|
|
42
|
+
|
|
43
|
+
feat:
|
|
44
|
+
|
|
45
|
+
1. 添加 `runBin` 函数
|
|
46
|
+
2. 在 app/module/doc tools 里配置内部插件
|
|
47
|
+
3. 增加 app/module/doc tools 使用的插件常量
|
|
48
|
+
|
|
49
|
+
- 543be9558e: feat: compile server loader and support handle loader request
|
|
50
|
+
feat: 编译 server loader 并支持处理 loader 的请求
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- 7879e8f711: refactor: remove enableModernMode config
|
|
55
|
+
|
|
56
|
+
refactor: 不再支持 enableModernMode 配置项
|
|
57
|
+
|
|
58
|
+
- 6aca875011: fix: remove phantom webpack dependencies in node-polyfill and webpack-dev-middleware
|
|
59
|
+
fix: 移除 node-polyfill 插件和 webpack-dev-middleware 中对 webpack 的幻影依赖
|
|
60
|
+
- 2e6031955e: fix: some optimizations for router and loader
|
|
61
|
+
fix: 一些 router 和 loader 的优化
|
|
62
|
+
q
|
|
63
|
+
- 7b7d12cf8f: refactor: Substract getCorejsVersion to the util package, so that swc plugin can reuse it.
|
|
64
|
+
refactor: 将 getCorejsVersion 提取到 util 包,让 swc 插件可以复用其逻辑
|
|
65
|
+
- 7efeed4: feat: add swc_polyfill_checker plugin.
|
|
66
|
+
feat: 加入了 swc 检查 polyfill 插件.
|
|
67
|
+
- cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
|
|
68
|
+
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
|
|
69
|
+
- 5b9049f2e9: feat: inject async js chunk when streaming ssr
|
|
70
|
+
feat: streaming ssr 时, 注入 async 类型的 js chunk
|
|
71
|
+
- 92004d1906: feat: support load chunks parallelly
|
|
72
|
+
feat: 支持并行加载 chunks
|
|
73
|
+
- b8bbe036c7: feat: change type logic
|
|
74
|
+
feat: 修改类型相关的逻辑
|
|
75
|
+
- 3bbea92b2a: feat: support Hook、Middleware new API
|
|
76
|
+
feat: 支持 Hook、Middleware 的新 API
|
|
77
|
+
- ea7cf06257: chore: bump webpack/babel-loader/postcss-loader/tsconfig-paths
|
|
78
|
+
|
|
79
|
+
chore: 升级 webpack/babel-loader/postcss-loader/tsconfig-paths 版本
|
|
80
|
+
|
|
81
|
+
- abf3421a75: fix(dev-server): isDepsExists add non pkgPath judege
|
|
82
|
+
|
|
83
|
+
修复: isDepsExists 方法添加 package.json 不存在的兜底
|
|
84
|
+
|
|
85
|
+
- 14b712da84: fix: use consistent alias type and default value across packages
|
|
86
|
+
|
|
87
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
|
88
|
+
|
|
3
89
|
## 2.0.0-beta.4
|
|
4
90
|
|
|
5
91
|
### Major Changes
|
package/dist/chainId.d.ts
CHANGED
|
@@ -102,6 +102,10 @@ export declare const CHAIN_ID: {
|
|
|
102
102
|
readonly MINI_CSS_EXTRACT: "mini-css-extract";
|
|
103
103
|
/** builder-plugin-image-compress.loader */
|
|
104
104
|
readonly IMAGE_COMPRESS: "image-compress";
|
|
105
|
+
/** builder-plugin-image-compress svgo-loader */
|
|
106
|
+
readonly SVGO: "svgo";
|
|
107
|
+
/** builder-plugin-imagex */
|
|
108
|
+
readonly IMAGEX: "imagex";
|
|
105
109
|
};
|
|
106
110
|
/** Predefined plugins */
|
|
107
111
|
readonly PLUGIN: {
|
|
@@ -151,6 +155,8 @@ export declare const CHAIN_ID: {
|
|
|
151
155
|
readonly AUTO_SET_ROOT_SIZE: "auto-set-root-size";
|
|
152
156
|
/** HtmlAsyncChunkPlugin */
|
|
153
157
|
readonly HTML_ASYNC_CHUNK: "html-async-chunk";
|
|
158
|
+
/** SwcPolyfillCheckerPlugin */
|
|
159
|
+
readonly SwcPolyfillCheckerPlugin: "swc-polyfill-checker-plugin";
|
|
154
160
|
};
|
|
155
161
|
/** Predefined minimizers */
|
|
156
162
|
readonly MINIMIZER: {
|
package/dist/chainId.js
CHANGED
|
@@ -105,6 +105,10 @@ exports.CHAIN_ID = {
|
|
|
105
105
|
MINI_CSS_EXTRACT: 'mini-css-extract',
|
|
106
106
|
/** builder-plugin-image-compress.loader */
|
|
107
107
|
IMAGE_COMPRESS: 'image-compress',
|
|
108
|
+
/** builder-plugin-image-compress svgo-loader */
|
|
109
|
+
SVGO: 'svgo',
|
|
110
|
+
/** builder-plugin-imagex */
|
|
111
|
+
IMAGEX: 'imagex',
|
|
108
112
|
},
|
|
109
113
|
/** Predefined plugins */
|
|
110
114
|
PLUGIN: {
|
|
@@ -154,6 +158,8 @@ exports.CHAIN_ID = {
|
|
|
154
158
|
AUTO_SET_ROOT_SIZE: 'auto-set-root-size',
|
|
155
159
|
/** HtmlAsyncChunkPlugin */
|
|
156
160
|
HTML_ASYNC_CHUNK: 'html-async-chunk',
|
|
161
|
+
/** SwcPolyfillCheckerPlugin */
|
|
162
|
+
SwcPolyfillCheckerPlugin: 'swc-polyfill-checker-plugin',
|
|
157
163
|
},
|
|
158
164
|
/** Predefined minimizers */
|
|
159
165
|
MINIMIZER: {
|
package/dist/constants.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export declare const LOADER_ROUTES_DIR = "loader-routes";
|
|
|
66
66
|
* Internal app-tools plugins that work as soon as they are installed.
|
|
67
67
|
*/
|
|
68
68
|
export declare const INTERNAL_APP_TOOLS_PLUGINS: InternalPlugins;
|
|
69
|
+
export declare const INTERNAL_APP_TOOLS_RUNTIME_PLUGINS: InternalPlugins;
|
|
69
70
|
/**
|
|
70
71
|
* Internal module-tools plugins that work as soon as they are installed.
|
|
71
72
|
*/
|
|
@@ -82,6 +83,13 @@ export declare const INTERNAL_DOC_TOOLS_PLUGINS: InternalPlugins;
|
|
|
82
83
|
* Internal plugins that work as soon as they are installed.
|
|
83
84
|
*/
|
|
84
85
|
export declare const INTERNAL_CLI_PLUGINS: InternalPlugins;
|
|
86
|
+
export declare const SERVER_PLUGIN_BFF = "@modern-js/plugin-bff";
|
|
87
|
+
export declare const SERVER_PLUGIN_EXPRESS = "@modern-js/plugin-express";
|
|
88
|
+
export declare const SERVER_PLUGIN_EGG = "@modern-js/plugin-egg";
|
|
89
|
+
export declare const SERVER_PLUGIN_KOA = "@modern-js/plugin-koa";
|
|
90
|
+
export declare const SERVER_PLUGIN_NEST = "@modern-js/plugin-nest";
|
|
91
|
+
export declare const SERVER_PLUGIN_SERVER = "@modern-js/plugin-server";
|
|
92
|
+
export declare const SERVER_PLUGIN_POLYFILL = "@modern-js/plugin-polyfill";
|
|
85
93
|
export declare const INTERNAL_SERVER_PLUGINS: InternalPlugins;
|
|
86
94
|
/**
|
|
87
95
|
* The schema registered in the plugin.
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PLUGIN_SCHEMAS = exports.INTERNAL_SERVER_PLUGINS = exports.INTERNAL_CLI_PLUGINS = exports.INTERNAL_DOC_TOOLS_PLUGINS = exports.INTERNAL_MONOREPO_TOOLS_PLUGINS = exports.INTERNAL_MODULE_TOOLS_PLUGINS = exports.INTERNAL_APP_TOOLS_PLUGINS = exports.LOADER_ROUTES_DIR = exports.ROUTE_MANIFEST = exports.ROUTE_MINIFEST_FILE = exports.DEFAULT_SERVER_CONFIG = exports.OUTPUT_CONFIG_FILE = exports.CONFIG_FILE_EXTENSIONS = exports.CONFIG_CACHE_DIR = exports.SHARED_DIR = exports.SERVER_DIR = exports.API_DIR = exports.LOADABLE_STATS_FILE = exports.SERVER_RENDER_FUNCTION_NAME = exports.ENTRY_NAME_PATTERN = exports.SERVER_BUNDLE_DIRECTORY = exports.LAUNCH_EDITOR_ENDPOINT = exports.MAIN_ENTRY_NAME = exports.ROUTE_SPEC_FILE = exports.HMR_SOCK_PATH = void 0;
|
|
3
|
+
exports.PLUGIN_SCHEMAS = exports.INTERNAL_SERVER_PLUGINS = exports.SERVER_PLUGIN_POLYFILL = exports.SERVER_PLUGIN_SERVER = exports.SERVER_PLUGIN_NEST = exports.SERVER_PLUGIN_KOA = exports.SERVER_PLUGIN_EGG = exports.SERVER_PLUGIN_EXPRESS = exports.SERVER_PLUGIN_BFF = exports.INTERNAL_CLI_PLUGINS = exports.INTERNAL_DOC_TOOLS_PLUGINS = exports.INTERNAL_MONOREPO_TOOLS_PLUGINS = exports.INTERNAL_MODULE_TOOLS_PLUGINS = exports.INTERNAL_APP_TOOLS_RUNTIME_PLUGINS = exports.INTERNAL_APP_TOOLS_PLUGINS = exports.LOADER_ROUTES_DIR = exports.ROUTE_MANIFEST = exports.ROUTE_MINIFEST_FILE = exports.DEFAULT_SERVER_CONFIG = exports.OUTPUT_CONFIG_FILE = exports.CONFIG_FILE_EXTENSIONS = exports.CONFIG_CACHE_DIR = exports.SHARED_DIR = exports.SERVER_DIR = exports.API_DIR = exports.LOADABLE_STATS_FILE = exports.SERVER_RENDER_FUNCTION_NAME = exports.ENTRY_NAME_PATTERN = exports.SERVER_BUNDLE_DIRECTORY = exports.LAUNCH_EDITOR_ENDPOINT = exports.MAIN_ENTRY_NAME = exports.ROUTE_SPEC_FILE = exports.HMR_SOCK_PATH = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* hmr socket connect path
|
|
6
6
|
*/
|
|
@@ -69,7 +69,6 @@ exports.LOADER_ROUTES_DIR = `loader-routes`;
|
|
|
69
69
|
*/
|
|
70
70
|
exports.INTERNAL_APP_TOOLS_PLUGINS = {
|
|
71
71
|
'@modern-js/app-tools': '@modern-js/app-tools/cli',
|
|
72
|
-
'@modern-js/runtime': '@modern-js/runtime/cli',
|
|
73
72
|
'@modern-js/plugin-proxy': '@modern-js/plugin-proxy/cli',
|
|
74
73
|
'@modern-js/plugin-ssg': '@modern-js/plugin-ssg/cli',
|
|
75
74
|
'@modern-js/plugin-bff': '@modern-js/plugin-bff/cli',
|
|
@@ -84,7 +83,10 @@ exports.INTERNAL_APP_TOOLS_PLUGINS = {
|
|
|
84
83
|
'@modern-js/plugin-tailwindcss': '@modern-js/plugin-tailwindcss/cli',
|
|
85
84
|
'@modern-js/plugin-polyfill': '@modern-js/plugin-polyfill/cli',
|
|
86
85
|
// legacy router (inner react-router-dom v5)
|
|
87
|
-
'@modern-js/plugin-router-
|
|
86
|
+
'@modern-js/plugin-router-v5': '@modern-js/plugin-router-v5/cli',
|
|
87
|
+
};
|
|
88
|
+
exports.INTERNAL_APP_TOOLS_RUNTIME_PLUGINS = {
|
|
89
|
+
'@modern-js/runtime': '@modern-js/runtime/cli',
|
|
88
90
|
};
|
|
89
91
|
/**
|
|
90
92
|
* Internal module-tools plugins that work as soon as they are installed.
|
|
@@ -140,16 +142,23 @@ exports.INTERNAL_CLI_PLUGINS = {
|
|
|
140
142
|
// TODO: Maybe can remove it
|
|
141
143
|
'@modern-js/plugin-nocode': '@modern-js/plugin-nocode/cli',
|
|
142
144
|
// legacy router (inner react-router-dom v5)
|
|
143
|
-
'@modern-js/plugin-router-
|
|
145
|
+
'@modern-js/plugin-router-v5': '@modern-js/plugin-router-v5/cli',
|
|
144
146
|
};
|
|
147
|
+
exports.SERVER_PLUGIN_BFF = '@modern-js/plugin-bff';
|
|
148
|
+
exports.SERVER_PLUGIN_EXPRESS = '@modern-js/plugin-express';
|
|
149
|
+
exports.SERVER_PLUGIN_EGG = '@modern-js/plugin-egg';
|
|
150
|
+
exports.SERVER_PLUGIN_KOA = '@modern-js/plugin-koa';
|
|
151
|
+
exports.SERVER_PLUGIN_NEST = '@modern-js/plugin-nest';
|
|
152
|
+
exports.SERVER_PLUGIN_SERVER = '@modern-js/plugin-server';
|
|
153
|
+
exports.SERVER_PLUGIN_POLYFILL = '@modern-js/plugin-polyfill';
|
|
145
154
|
exports.INTERNAL_SERVER_PLUGINS = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
155
|
+
[exports.SERVER_PLUGIN_BFF]: '@modern-js/plugin-bff/server',
|
|
156
|
+
[exports.SERVER_PLUGIN_EXPRESS]: '@modern-js/plugin-express/server',
|
|
157
|
+
[exports.SERVER_PLUGIN_EGG]: '@modern-js/plugin-egg/server',
|
|
158
|
+
[exports.SERVER_PLUGIN_KOA]: '@modern-js/plugin-koa/server',
|
|
159
|
+
[exports.SERVER_PLUGIN_NEST]: '@modern-js/plugin-nest/server',
|
|
160
|
+
[exports.SERVER_PLUGIN_SERVER]: '@modern-js/plugin-server/server',
|
|
161
|
+
[exports.SERVER_PLUGIN_POLYFILL]: '@modern-js/plugin-polyfill/server',
|
|
153
162
|
};
|
|
154
163
|
/**
|
|
155
164
|
* The schema registered in the plugin.
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0-beta.
|
|
14
|
+
"version": "2.0.0-beta.6",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"main": "./dist/index.js",
|
|
@@ -134,9 +134,9 @@
|
|
|
134
134
|
"typescript": "^4",
|
|
135
135
|
"jest": "^27",
|
|
136
136
|
"webpack": "^5.75.0",
|
|
137
|
-
"@modern-js/types": "2.0.0-beta.
|
|
138
|
-
"@scripts/
|
|
139
|
-
"@scripts/
|
|
137
|
+
"@modern-js/types": "2.0.0-beta.6",
|
|
138
|
+
"@scripts/jest-config": "2.0.0-beta.6",
|
|
139
|
+
"@scripts/build": "2.0.0-beta.6"
|
|
140
140
|
},
|
|
141
141
|
"sideEffects": false,
|
|
142
142
|
"scripts": {
|