@modern-js/utils 2.0.0-beta.3 → 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 +170 -0
- package/dist/chainId.d.ts +6 -0
- package/dist/chainId.js +6 -0
- package/dist/constants.d.ts +10 -2
- package/dist/constants.js +24 -17
- package/dist/getCoreJsVersion.d.ts +1 -0
- package/dist/getCoreJsVersion.js +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/test-utils.js +3 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,175 @@
|
|
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
|
+
|
89
|
+
## 2.0.0-beta.4
|
90
|
+
|
91
|
+
### Major Changes
|
92
|
+
|
93
|
+
- dda38c9c3e: chore: v2
|
94
|
+
|
95
|
+
### Minor Changes
|
96
|
+
|
97
|
+
- 92f0eade39: feat:
|
98
|
+
|
99
|
+
1. core: 增加 test 函数
|
100
|
+
2. module plugins: 增加 `babel`, `mainField`, `target` 插件
|
101
|
+
3. storybook: 修改部分逻辑并且增加 tspath webpack 插件
|
102
|
+
4. 增加 designSystem 配置
|
103
|
+
|
104
|
+
feat:
|
105
|
+
|
106
|
+
1. core: add test method
|
107
|
+
2. module plugins: add `babel`, `mainField`, `target` plugin
|
108
|
+
3. storybook: change some logic and add tspath webpack plugin
|
109
|
+
4. add `designSystem` config
|
110
|
+
|
111
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
112
|
+
feat: modernjs 接入 builder 构建
|
113
|
+
- d5a31df781: refactor: remove unbundle configs and types
|
114
|
+
|
115
|
+
refactor: 移除 unbundle 相关的配置项和类型定义
|
116
|
+
|
117
|
+
- b710adb843: feat: extract the data loader
|
118
|
+
feat: 提取 data loader
|
119
|
+
- bbe4c4a: feat: add @modern-js/plugin-swc
|
120
|
+
|
121
|
+
feat: 新增 @modern-js/plugin-swc 插件
|
122
|
+
|
123
|
+
- e4558a0: feat:
|
124
|
+
|
125
|
+
1. add `runBin` function
|
126
|
+
2. config internal plugins constants in the app/module/doc tools
|
127
|
+
3. add app/module/doc tools internal plugins
|
128
|
+
|
129
|
+
feat:
|
130
|
+
|
131
|
+
1. 添加 `runBin` 函数
|
132
|
+
2. 在 app/module/doc tools 里配置内部插件
|
133
|
+
3. 增加 app/module/doc tools 使用的插件常量
|
134
|
+
|
135
|
+
- 543be9558e: feat: compile server loader and support handle loader request
|
136
|
+
feat: 编译 server loader 并支持处理 loader 的请求
|
137
|
+
|
138
|
+
### Patch Changes
|
139
|
+
|
140
|
+
- 7879e8f: refactor: remove enableModernMode config
|
141
|
+
|
142
|
+
refactor: 不再支持 enableModernMode 配置项
|
143
|
+
|
144
|
+
- 6aca875: fix: remove phantom webpack dependencies in node-polyfill and webpack-dev-middleware
|
145
|
+
fix: 移除 node-polyfill 插件和 webpack-dev-middleware 中对 webpack 的幻影依赖
|
146
|
+
- 2e6031955e: fix: some optimizations for router and loader
|
147
|
+
fix: 一些 router 和 loader 的优化
|
148
|
+
q
|
149
|
+
- 7b7d12c: refactor: Substract getCorejsVersion to the util package, so that swc plugin can reuse it.
|
150
|
+
refactor: 将 getCorejsVersion 提取到 util 包,让 swc 插件可以复用其逻辑
|
151
|
+
- cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
|
152
|
+
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
|
153
|
+
- 5b9049f2e9: feat: inject async js chunk when streaming ssr
|
154
|
+
feat: streaming ssr 时, 注入 async 类型的 js chunk
|
155
|
+
- 92004d1906: feat: support load chunks parallelly
|
156
|
+
feat: 支持并行加载 chunks
|
157
|
+
- b8bbe036c7: feat: change type logic
|
158
|
+
feat: 修改类型相关的逻辑
|
159
|
+
- 3bbea92b2a: feat: support Hook、Middleware new API
|
160
|
+
feat: 支持 Hook、Middleware 的新 API
|
161
|
+
- ea7cf06: chore: bump webpack/babel-loader/postcss-loader/tsconfig-paths
|
162
|
+
|
163
|
+
chore: 升级 webpack/babel-loader/postcss-loader/tsconfig-paths 版本
|
164
|
+
|
165
|
+
- abf3421a75: fix(dev-server): isDepsExists add non pkgPath judege
|
166
|
+
|
167
|
+
修复: isDepsExists 方法添加 package.json 不存在的兜底
|
168
|
+
|
169
|
+
- 14b712da84: fix: use consistent alias type and default value across packages
|
170
|
+
|
171
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
172
|
+
|
3
173
|
## 2.0.0-beta.3
|
4
174
|
|
5
175
|
### 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,22 +66,30 @@ 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
|
*/
|
72
73
|
export declare const INTERNAL_MODULE_TOOLS_PLUGINS: InternalPlugins;
|
73
74
|
/**
|
74
|
-
* Internal
|
75
|
+
* Internal monorepo-tools plugins that work as soon as they are installed.
|
75
76
|
*/
|
76
77
|
export declare const INTERNAL_MONOREPO_TOOLS_PLUGINS: InternalPlugins;
|
77
78
|
/**
|
78
|
-
* Internal
|
79
|
+
* Internal doc-tools plugins that work as soon as they are installed.
|
79
80
|
*/
|
80
81
|
export declare const INTERNAL_DOC_TOOLS_PLUGINS: InternalPlugins;
|
81
82
|
/**
|
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,14 +83,16 @@ 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.
|
91
93
|
*/
|
92
94
|
exports.INTERNAL_MODULE_TOOLS_PLUGINS = {
|
93
|
-
'@modern-js/module-tools': '@modern-js/module-tools
|
94
|
-
'@modern-js/module-tools-v2': '@modern-js/module-tools-v2',
|
95
|
+
'@modern-js/module-tools': '@modern-js/module-tools',
|
95
96
|
'@modern-js/doc-tools': '@modern-js/doc-tools',
|
96
97
|
'@modern-js/runtime': '@modern-js/runtime/cli',
|
97
98
|
'@modern-js/plugin-testing': '@modern-js/plugin-testing/cli',
|
@@ -101,14 +102,14 @@ exports.INTERNAL_MODULE_TOOLS_PLUGINS = {
|
|
101
102
|
'@modern-js/plugin-nocode': '@modern-js/plugin-nocode/cli',
|
102
103
|
};
|
103
104
|
/**
|
104
|
-
* Internal
|
105
|
+
* Internal monorepo-tools plugins that work as soon as they are installed.
|
105
106
|
*/
|
106
107
|
exports.INTERNAL_MONOREPO_TOOLS_PLUGINS = {
|
107
108
|
'@modern-js/monorepo-tools': '@modern-js/monorepo-tools/cli',
|
108
109
|
'@modern-js/plugin-testing': '@modern-js/plugin-testing/cli',
|
109
110
|
};
|
110
111
|
/**
|
111
|
-
* Internal
|
112
|
+
* Internal doc-tools plugins that work as soon as they are installed.
|
112
113
|
*/
|
113
114
|
exports.INTERNAL_DOC_TOOLS_PLUGINS = {
|
114
115
|
'@modern-js/doc-tools': '@modern-js/doc-tools',
|
@@ -121,8 +122,7 @@ exports.INTERNAL_DOC_TOOLS_PLUGINS = {
|
|
121
122
|
exports.INTERNAL_CLI_PLUGINS = {
|
122
123
|
'@modern-js/app-tools': '@modern-js/app-tools/cli',
|
123
124
|
'@modern-js/monorepo-tools': '@modern-js/monorepo-tools/cli',
|
124
|
-
'@modern-js/module-tools': '@modern-js/module-tools
|
125
|
-
'@modern-js/module-tools-v2': '@modern-js/module-tools-v2',
|
125
|
+
'@modern-js/module-tools': '@modern-js/module-tools',
|
126
126
|
'@modern-js/doc-tools': '@modern-js/doc-tools',
|
127
127
|
'@modern-js/runtime': '@modern-js/runtime/cli',
|
128
128
|
'@modern-js/plugin-proxy': '@modern-js/plugin-proxy/cli',
|
@@ -142,16 +142,23 @@ exports.INTERNAL_CLI_PLUGINS = {
|
|
142
142
|
// TODO: Maybe can remove it
|
143
143
|
'@modern-js/plugin-nocode': '@modern-js/plugin-nocode/cli',
|
144
144
|
// legacy router (inner react-router-dom v5)
|
145
|
-
'@modern-js/plugin-router-
|
145
|
+
'@modern-js/plugin-router-v5': '@modern-js/plugin-router-v5/cli',
|
146
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';
|
147
154
|
exports.INTERNAL_SERVER_PLUGINS = {
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
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',
|
155
162
|
};
|
156
163
|
/**
|
157
164
|
* The schema registered in the plugin.
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const getCoreJsVersion: (corejsPkgPath: string) => string;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.getCoreJsVersion = void 0;
|
27
|
+
const fs = __importStar(require("../compiled/fs-extra"));
|
28
|
+
const getCoreJsVersion = (corejsPkgPath) => {
|
29
|
+
try {
|
30
|
+
const { version } = fs.readJSONSync(corejsPkgPath);
|
31
|
+
const [major, minor] = version.split('.');
|
32
|
+
return `${major}.${minor}`;
|
33
|
+
}
|
34
|
+
catch (err) {
|
35
|
+
return '3';
|
36
|
+
}
|
37
|
+
};
|
38
|
+
exports.getCoreJsVersion = getCoreJsVersion;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/test-utils.js
CHANGED
@@ -16,10 +16,10 @@ const initSnapshotSerializer = (root) => {
|
|
16
16
|
typeof val === 'string'
|
17
17
|
? // eslint-disable-next-line no-nested-ternary
|
18
18
|
val.includes('node_modules')
|
19
|
-
? `"${val.replace(/.+node_modules/, ``)}"`
|
19
|
+
? `"${val.replace(/.+node_modules/, ``).replace(/\\/g, '/')}"`
|
20
20
|
: val.includes('modern.js')
|
21
|
-
? `"${val.replace(/.+modern\.js/, ``)}"`
|
22
|
-
: `"${val.replace(root, '')}"`
|
21
|
+
? `"${val.replace(/.+modern\.js/, ``).replace(/\\/g, '/')}"`
|
22
|
+
: `"${val.replace(root, '').replace(/\\/g, '/')}"`
|
23
23
|
: val,
|
24
24
|
});
|
25
25
|
};
|
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": {
|