@modern-js/utils 2.0.0-beta.3 → 2.0.0-beta.4

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 CHANGED
@@ -1,5 +1,89 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.0.0-beta.4
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
+ - bbe4c4a: feat: add @modern-js/plugin-swc
34
+
35
+ feat: 新增 @modern-js/plugin-swc 插件
36
+
37
+ - e4558a0: 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
+ - 7879e8f: refactor: remove enableModernMode config
55
+
56
+ refactor: 不再支持 enableModernMode 配置项
57
+
58
+ - 6aca875: 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
+ - 7b7d12c: refactor: Substract getCorejsVersion to the util package, so that swc plugin can reuse it.
64
+ refactor: 将 getCorejsVersion 提取到 util 包,让 swc 插件可以复用其逻辑
65
+ - cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
66
+ refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
67
+ - 5b9049f2e9: feat: inject async js chunk when streaming ssr
68
+ feat: streaming ssr 时, 注入 async 类型的 js chunk
69
+ - 92004d1906: feat: support load chunks parallelly
70
+ feat: 支持并行加载 chunks
71
+ - b8bbe036c7: feat: change type logic
72
+ feat: 修改类型相关的逻辑
73
+ - 3bbea92b2a: feat: support Hook、Middleware new API
74
+ feat: 支持 Hook、Middleware 的新 API
75
+ - ea7cf06: chore: bump webpack/babel-loader/postcss-loader/tsconfig-paths
76
+
77
+ chore: 升级 webpack/babel-loader/postcss-loader/tsconfig-paths 版本
78
+
79
+ - abf3421a75: fix(dev-server): isDepsExists add non pkgPath judege
80
+
81
+ 修复: isDepsExists 方法添加 package.json 不存在的兜底
82
+
83
+ - 14b712da84: fix: use consistent alias type and default value across packages
84
+
85
+ fix: 在各个包中使用一致的 alias 类型定义和默认值
86
+
3
87
  ## 2.0.0-beta.3
4
88
 
5
89
  ### Major Changes
@@ -71,11 +71,11 @@ export declare const INTERNAL_APP_TOOLS_PLUGINS: InternalPlugins;
71
71
  */
72
72
  export declare const INTERNAL_MODULE_TOOLS_PLUGINS: InternalPlugins;
73
73
  /**
74
- * Internal module-tools plugins that work as soon as they are installed.
74
+ * Internal monorepo-tools plugins that work as soon as they are installed.
75
75
  */
76
76
  export declare const INTERNAL_MONOREPO_TOOLS_PLUGINS: InternalPlugins;
77
77
  /**
78
- * Internal module-tools plugins that work as soon as they are installed.
78
+ * Internal doc-tools plugins that work as soon as they are installed.
79
79
  */
80
80
  export declare const INTERNAL_DOC_TOOLS_PLUGINS: InternalPlugins;
81
81
  /**
package/dist/constants.js CHANGED
@@ -90,8 +90,7 @@ exports.INTERNAL_APP_TOOLS_PLUGINS = {
90
90
  * Internal module-tools plugins that work as soon as they are installed.
91
91
  */
92
92
  exports.INTERNAL_MODULE_TOOLS_PLUGINS = {
93
- '@modern-js/module-tools': '@modern-js/module-tools/cli',
94
- '@modern-js/module-tools-v2': '@modern-js/module-tools-v2',
93
+ '@modern-js/module-tools': '@modern-js/module-tools',
95
94
  '@modern-js/doc-tools': '@modern-js/doc-tools',
96
95
  '@modern-js/runtime': '@modern-js/runtime/cli',
97
96
  '@modern-js/plugin-testing': '@modern-js/plugin-testing/cli',
@@ -101,14 +100,14 @@ exports.INTERNAL_MODULE_TOOLS_PLUGINS = {
101
100
  '@modern-js/plugin-nocode': '@modern-js/plugin-nocode/cli',
102
101
  };
103
102
  /**
104
- * Internal module-tools plugins that work as soon as they are installed.
103
+ * Internal monorepo-tools plugins that work as soon as they are installed.
105
104
  */
106
105
  exports.INTERNAL_MONOREPO_TOOLS_PLUGINS = {
107
106
  '@modern-js/monorepo-tools': '@modern-js/monorepo-tools/cli',
108
107
  '@modern-js/plugin-testing': '@modern-js/plugin-testing/cli',
109
108
  };
110
109
  /**
111
- * Internal module-tools plugins that work as soon as they are installed.
110
+ * Internal doc-tools plugins that work as soon as they are installed.
112
111
  */
113
112
  exports.INTERNAL_DOC_TOOLS_PLUGINS = {
114
113
  '@modern-js/doc-tools': '@modern-js/doc-tools',
@@ -121,8 +120,7 @@ exports.INTERNAL_DOC_TOOLS_PLUGINS = {
121
120
  exports.INTERNAL_CLI_PLUGINS = {
122
121
  '@modern-js/app-tools': '@modern-js/app-tools/cli',
123
122
  '@modern-js/monorepo-tools': '@modern-js/monorepo-tools/cli',
124
- '@modern-js/module-tools': '@modern-js/module-tools/cli',
125
- '@modern-js/module-tools-v2': '@modern-js/module-tools-v2',
123
+ '@modern-js/module-tools': '@modern-js/module-tools',
126
124
  '@modern-js/doc-tools': '@modern-js/doc-tools',
127
125
  '@modern-js/runtime': '@modern-js/runtime/cli',
128
126
  '@modern-js/plugin-proxy': '@modern-js/plugin-proxy/cli',
@@ -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
@@ -39,3 +39,4 @@ export * from './version';
39
39
  export * from './plugin';
40
40
  export * from './routes';
41
41
  export * from './test-utils';
42
+ export * from './getCoreJsVersion';
package/dist/index.js CHANGED
@@ -55,3 +55,4 @@ __exportStar(require("./version"), exports);
55
55
  __exportStar(require("./plugin"), exports);
56
56
  __exportStar(require("./routes"), exports);
57
57
  __exportStar(require("./test-utils"), exports);
58
+ __exportStar(require("./getCoreJsVersion"), exports);
@@ -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.3",
14
+ "version": "2.0.0-beta.4",
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.3",
138
- "@scripts/build": "2.0.0-beta.3",
139
- "@scripts/jest-config": "2.0.0-beta.3"
137
+ "@modern-js/types": "2.0.0-beta.4",
138
+ "@scripts/build": "2.0.0-beta.4",
139
+ "@scripts/jest-config": "2.0.0-beta.4"
140
140
  },
141
141
  "sideEffects": false,
142
142
  "scripts": {