@modern-js/utils 2.0.0-beta.4 → 2.0.0-beta.7
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 +100 -0
- package/dist/chainId.d.ts +10 -0
- package/dist/chainId.js +10 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.js +20 -11
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,105 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
+
## 2.0.0-beta.7
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- dda38c9c3e: chore: v2
|
8
|
+
|
9
|
+
### Minor Changes
|
10
|
+
|
11
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
12
|
+
feat: modernjs 接入 builder 构建
|
13
|
+
- bbe4c4ab64: feat: add @modern-js/plugin-swc
|
14
|
+
|
15
|
+
feat: 新增 @modern-js/plugin-swc 插件
|
16
|
+
|
17
|
+
## 2.0.0-beta.6
|
18
|
+
|
19
|
+
### Major Changes
|
20
|
+
|
21
|
+
- dda38c9c3e: chore: v2
|
22
|
+
|
23
|
+
### Minor Changes
|
24
|
+
|
25
|
+
- 92f0eade39: feat:
|
26
|
+
|
27
|
+
1. core: 增加 test 函数
|
28
|
+
2. module plugins: 增加 `babel`, `mainField`, `target` 插件
|
29
|
+
3. storybook: 修改部分逻辑并且增加 tspath webpack 插件
|
30
|
+
4. 增加 designSystem 配置
|
31
|
+
|
32
|
+
feat:
|
33
|
+
|
34
|
+
1. core: add test method
|
35
|
+
2. module plugins: add `babel`, `mainField`, `target` plugin
|
36
|
+
3. storybook: change some logic and add tspath webpack plugin
|
37
|
+
4. add `designSystem` config
|
38
|
+
|
39
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
40
|
+
feat: modernjs 接入 builder 构建
|
41
|
+
- d5a31df781: refactor: remove unbundle configs and types
|
42
|
+
|
43
|
+
refactor: 移除 unbundle 相关的配置项和类型定义
|
44
|
+
|
45
|
+
- b710adb843: feat: extract the data loader
|
46
|
+
feat: 提取 data loader
|
47
|
+
- bbe4c4ab64: feat: add @modern-js/plugin-swc
|
48
|
+
|
49
|
+
feat: 新增 @modern-js/plugin-swc 插件
|
50
|
+
|
51
|
+
- e4558a0bc4: feat:
|
52
|
+
|
53
|
+
1. add `runBin` function
|
54
|
+
2. config internal plugins constants in the app/module/doc tools
|
55
|
+
3. add app/module/doc tools internal plugins
|
56
|
+
|
57
|
+
feat:
|
58
|
+
|
59
|
+
1. 添加 `runBin` 函数
|
60
|
+
2. 在 app/module/doc tools 里配置内部插件
|
61
|
+
3. 增加 app/module/doc tools 使用的插件常量
|
62
|
+
|
63
|
+
- 543be9558e: feat: compile server loader and support handle loader request
|
64
|
+
feat: 编译 server loader 并支持处理 loader 的请求
|
65
|
+
|
66
|
+
### Patch Changes
|
67
|
+
|
68
|
+
- 7879e8f711: refactor: remove enableModernMode config
|
69
|
+
|
70
|
+
refactor: 不再支持 enableModernMode 配置项
|
71
|
+
|
72
|
+
- 6aca875011: fix: remove phantom webpack dependencies in node-polyfill and webpack-dev-middleware
|
73
|
+
fix: 移除 node-polyfill 插件和 webpack-dev-middleware 中对 webpack 的幻影依赖
|
74
|
+
- 2e6031955e: fix: some optimizations for router and loader
|
75
|
+
fix: 一些 router 和 loader 的优化
|
76
|
+
q
|
77
|
+
- 7b7d12cf8f: refactor: Substract getCorejsVersion to the util package, so that swc plugin can reuse it.
|
78
|
+
refactor: 将 getCorejsVersion 提取到 util 包,让 swc 插件可以复用其逻辑
|
79
|
+
- 7efeed4: feat: add swc_polyfill_checker plugin.
|
80
|
+
feat: 加入了 swc 检查 polyfill 插件.
|
81
|
+
- cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
|
82
|
+
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
|
83
|
+
- 5b9049f2e9: feat: inject async js chunk when streaming ssr
|
84
|
+
feat: streaming ssr 时, 注入 async 类型的 js chunk
|
85
|
+
- 92004d1906: feat: support load chunks parallelly
|
86
|
+
feat: 支持并行加载 chunks
|
87
|
+
- b8bbe036c7: feat: change type logic
|
88
|
+
feat: 修改类型相关的逻辑
|
89
|
+
- 3bbea92b2a: feat: support Hook、Middleware new API
|
90
|
+
feat: 支持 Hook、Middleware 的新 API
|
91
|
+
- ea7cf06257: chore: bump webpack/babel-loader/postcss-loader/tsconfig-paths
|
92
|
+
|
93
|
+
chore: 升级 webpack/babel-loader/postcss-loader/tsconfig-paths 版本
|
94
|
+
|
95
|
+
- abf3421a75: fix(dev-server): isDepsExists add non pkgPath judege
|
96
|
+
|
97
|
+
修复: isDepsExists 方法添加 package.json 不存在的兜底
|
98
|
+
|
99
|
+
- 14b712da84: fix: use consistent alias type and default value across packages
|
100
|
+
|
101
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
102
|
+
|
3
103
|
## 2.0.0-beta.4
|
4
104
|
|
5
105
|
### Major Changes
|
package/dist/chainId.d.ts
CHANGED
@@ -23,6 +23,8 @@ export declare const CHAIN_ID: {
|
|
23
23
|
readonly LESS: "less";
|
24
24
|
/** Rule for sass */
|
25
25
|
readonly SASS: "sass";
|
26
|
+
/** Rule for stylus */
|
27
|
+
readonly STYLUS: "stylus";
|
26
28
|
/** Rule for svg */
|
27
29
|
readonly SVG: "svg";
|
28
30
|
/** Rule for pug */
|
@@ -68,6 +70,8 @@ export declare const CHAIN_ID: {
|
|
68
70
|
readonly SASS: "sass";
|
69
71
|
/** less-loader */
|
70
72
|
readonly LESS: "less";
|
73
|
+
/** stylus-loader */
|
74
|
+
readonly STYLUS: "stylus";
|
71
75
|
/** url-loader */
|
72
76
|
readonly URL: "url";
|
73
77
|
/** pug-loader */
|
@@ -102,6 +106,10 @@ export declare const CHAIN_ID: {
|
|
102
106
|
readonly MINI_CSS_EXTRACT: "mini-css-extract";
|
103
107
|
/** builder-plugin-image-compress.loader */
|
104
108
|
readonly IMAGE_COMPRESS: "image-compress";
|
109
|
+
/** builder-plugin-image-compress svgo-loader */
|
110
|
+
readonly SVGO: "svgo";
|
111
|
+
/** builder-plugin-imagex */
|
112
|
+
readonly IMAGEX: "imagex";
|
105
113
|
};
|
106
114
|
/** Predefined plugins */
|
107
115
|
readonly PLUGIN: {
|
@@ -151,6 +159,8 @@ export declare const CHAIN_ID: {
|
|
151
159
|
readonly AUTO_SET_ROOT_SIZE: "auto-set-root-size";
|
152
160
|
/** HtmlAsyncChunkPlugin */
|
153
161
|
readonly HTML_ASYNC_CHUNK: "html-async-chunk";
|
162
|
+
/** SwcPolyfillCheckerPlugin */
|
163
|
+
readonly SwcPolyfillCheckerPlugin: "swc-polyfill-checker-plugin";
|
154
164
|
};
|
155
165
|
/** Predefined minimizers */
|
156
166
|
readonly MINIMIZER: {
|
package/dist/chainId.js
CHANGED
@@ -26,6 +26,8 @@ exports.CHAIN_ID = {
|
|
26
26
|
LESS: 'less',
|
27
27
|
/** Rule for sass */
|
28
28
|
SASS: 'sass',
|
29
|
+
/** Rule for stylus */
|
30
|
+
STYLUS: 'stylus',
|
29
31
|
/** Rule for svg */
|
30
32
|
SVG: 'svg',
|
31
33
|
/** Rule for pug */
|
@@ -71,6 +73,8 @@ exports.CHAIN_ID = {
|
|
71
73
|
SASS: 'sass',
|
72
74
|
/** less-loader */
|
73
75
|
LESS: 'less',
|
76
|
+
/** stylus-loader */
|
77
|
+
STYLUS: 'stylus',
|
74
78
|
/** url-loader */
|
75
79
|
URL: 'url',
|
76
80
|
/** pug-loader */
|
@@ -105,6 +109,10 @@ exports.CHAIN_ID = {
|
|
105
109
|
MINI_CSS_EXTRACT: 'mini-css-extract',
|
106
110
|
/** builder-plugin-image-compress.loader */
|
107
111
|
IMAGE_COMPRESS: 'image-compress',
|
112
|
+
/** builder-plugin-image-compress svgo-loader */
|
113
|
+
SVGO: 'svgo',
|
114
|
+
/** builder-plugin-imagex */
|
115
|
+
IMAGEX: 'imagex',
|
108
116
|
},
|
109
117
|
/** Predefined plugins */
|
110
118
|
PLUGIN: {
|
@@ -154,6 +162,8 @@ exports.CHAIN_ID = {
|
|
154
162
|
AUTO_SET_ROOT_SIZE: 'auto-set-root-size',
|
155
163
|
/** HtmlAsyncChunkPlugin */
|
156
164
|
HTML_ASYNC_CHUNK: 'html-async-chunk',
|
165
|
+
/** SwcPolyfillCheckerPlugin */
|
166
|
+
SwcPolyfillCheckerPlugin: 'swc-polyfill-checker-plugin',
|
157
167
|
},
|
158
168
|
/** Predefined minimizers */
|
159
169
|
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.7",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/index.d.ts",
|
17
17
|
"main": "./dist/index.js",
|
@@ -131,12 +131,12 @@
|
|
131
131
|
"devDependencies": {
|
132
132
|
"@types/jest": "^27",
|
133
133
|
"@types/node": "^14",
|
134
|
-
"typescript": "^4",
|
135
134
|
"jest": "^27",
|
135
|
+
"typescript": "^4",
|
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.7",
|
138
|
+
"@scripts/jest-config": "2.0.0-beta.7",
|
139
|
+
"@scripts/build": "2.0.0-beta.7"
|
140
140
|
},
|
141
141
|
"sideEffects": false,
|
142
142
|
"scripts": {
|