@modern-js/utils 2.0.0-beta.1 → 2.0.0-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +51 -0
- package/dist/compatRequire.d.ts +1 -0
- package/dist/compatRequire.js +4 -1
- package/dist/constants.js +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,56 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
+
## 2.0.0-beta.2
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- dda38c9c3e: chore: v2
|
8
|
+
|
9
|
+
### Minor Changes
|
10
|
+
|
11
|
+
- 92f0ead: 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
|
+
- 543be9558e: feat: compile server loader and support handle loader request
|
32
|
+
feat: 编译 server loader 并支持处理 loader 的请求
|
33
|
+
|
34
|
+
### Patch Changes
|
35
|
+
|
36
|
+
- cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
|
37
|
+
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
|
38
|
+
- 5b9049f2e9: feat: inject async js chunk when streaming ssr
|
39
|
+
feat: streaming ssr 时, 注入 async 类型的 js chunk
|
40
|
+
- 92004d1: feat: support load chunks parallelly
|
41
|
+
feat: 支持并行加载 chunks
|
42
|
+
- b8bbe036c7: feat: change type logic
|
43
|
+
feat: 修改类型相关的逻辑
|
44
|
+
- 3bbea92b2a: feat: support Hook、Middleware new API
|
45
|
+
feat: 支持 Hook、Middleware 的新 API
|
46
|
+
- abf3421a75: fix(dev-server): isDepsExists add non pkgPath judege
|
47
|
+
|
48
|
+
修复: isDepsExists 方法添加 package.json 不存在的兜底
|
49
|
+
|
50
|
+
- 14b712da84: fix: use consistent alias type and default value across packages
|
51
|
+
|
52
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
53
|
+
|
3
54
|
## 2.0.0-beta.1
|
4
55
|
|
5
56
|
### Major Changes
|
package/dist/compatRequire.d.ts
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
* @returns module export object.
|
5
5
|
*/
|
6
6
|
export declare const compatRequire: (filePath: string, interop?: boolean) => any;
|
7
|
+
export declare const dynamicImport: Function;
|
7
8
|
export declare const requireExistModule: (filename: string, opt?: {
|
8
9
|
extensions?: string[];
|
9
10
|
interop?: boolean;
|
package/dist/compatRequire.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.cleanRequireCache = exports.requireExistModule = exports.compatRequire = void 0;
|
3
|
+
exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
4
4
|
const findExists_1 = require("./findExists");
|
5
5
|
/**
|
6
6
|
* Require function compatible with esm and cjs module.
|
@@ -13,6 +13,9 @@ const compatRequire = (filePath, interop = true) => {
|
|
13
13
|
return rtnESMDefault ? mod.default : mod;
|
14
14
|
};
|
15
15
|
exports.compatRequire = compatRequire;
|
16
|
+
// Avoid `import` to be tranpiled to `require` by babel/tsc/rollup
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func
|
18
|
+
exports.dynamicImport = new Function('modulePath', 'return import(modulePath)');
|
16
19
|
const requireExistModule = (filename, opt) => {
|
17
20
|
const final = {
|
18
21
|
extensions: ['.ts', '.js'],
|
package/dist/constants.js
CHANGED
@@ -68,6 +68,7 @@ exports.INTERNAL_CLI_PLUGINS = {
|
|
68
68
|
'@modern-js/monorepo-tools': '@modern-js/monorepo-tools/cli',
|
69
69
|
'@modern-js/module-tools': '@modern-js/module-tools/cli',
|
70
70
|
'@modern-js/module-tools-v2': '@modern-js/module-tools-v2',
|
71
|
+
'@modern-js/doc-tools': '@modern-js/doc-tools',
|
71
72
|
'@modern-js/runtime': '@modern-js/runtime/cli',
|
72
73
|
'@modern-js/plugin-proxy': '@modern-js/plugin-proxy/cli',
|
73
74
|
'@modern-js/plugin-ssg': '@modern-js/plugin-ssg/cli',
|
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.2",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/index.d.ts",
|
17
17
|
"main": "./dist/index.js",
|
@@ -134,13 +134,13 @@
|
|
134
134
|
"typescript": "^4",
|
135
135
|
"jest": "^27",
|
136
136
|
"webpack": "^5.74.0",
|
137
|
-
"@modern-js/types": "2.0.0-beta.
|
138
|
-
"@scripts/build": "2.0.0-beta.
|
139
|
-
"@scripts/jest-config": "2.0.0-beta.
|
137
|
+
"@modern-js/types": "2.0.0-beta.2",
|
138
|
+
"@scripts/build": "2.0.0-beta.2",
|
139
|
+
"@scripts/jest-config": "2.0.0-beta.2"
|
140
140
|
},
|
141
141
|
"sideEffects": false,
|
142
142
|
"scripts": {
|
143
|
-
"new": "modern new",
|
143
|
+
"new": "modern-lib new",
|
144
144
|
"dev": "tsc --watch",
|
145
145
|
"build": "tsc",
|
146
146
|
"test": "jest --passWithNoTests"
|