@modern-js/utils 2.0.0-beta.0 → 2.0.0-beta.1

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,56 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.0.0-beta.1
4
+
5
+ ### Major Changes
6
+
7
+ - dda38c9: 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
+ - 5b9049f: 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
+ - abf3421: fix(dev-server): isDepsExists add non pkgPath judege
47
+
48
+ 修复: isDepsExists 方法添加 package.json 不存在的兜底
49
+
50
+ - 14b712d: fix: use consistent alias type and default value across packages
51
+
52
+ fix: 在各个包中使用一致的 alias 类型定义和默认值
53
+
3
54
  ## 2.0.0-beta.0
4
55
 
5
56
  ### Major Changes
@@ -50,6 +50,14 @@ export declare const OUTPUT_CONFIG_FILE = "modern.config.json";
50
50
  * Default server config basename
51
51
  */
52
52
  export declare const DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
53
+ /**
54
+ * Routes manifest filename
55
+ */
56
+ export declare const ROUTE_MINIFEST_FILE = "routes-manifest.json";
57
+ /**
58
+ * Property mounted on window that describes route manifest
59
+ */
60
+ export declare const ROUTE_MANIFEST = "_MODERNJS_ROUTE_MANIFEST";
53
61
  /**
54
62
  * Internal plugins that work as soon as they are installed.
55
63
  */
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.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.INTERNAL_CLI_PLUGINS = 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
  */
@@ -52,6 +52,14 @@ exports.OUTPUT_CONFIG_FILE = 'modern.config.json';
52
52
  * Default server config basename
53
53
  */
54
54
  exports.DEFAULT_SERVER_CONFIG = 'modern.server-runtime.config';
55
+ /**
56
+ * Routes manifest filename
57
+ */
58
+ exports.ROUTE_MINIFEST_FILE = 'routes-manifest.json';
59
+ /**
60
+ * Property mounted on window that describes route manifest
61
+ */
62
+ exports.ROUTE_MANIFEST = `_MODERNJS_ROUTE_MANIFEST`;
55
63
  /**
56
64
  * Internal plugins that work as soon as they are installed.
57
65
  */
@@ -166,6 +174,10 @@ exports.PLUGIN_SCHEMAS = {
166
174
  target: 'source.designSystem.supportStyledComponents',
167
175
  schema: { type: ['boolean'] },
168
176
  },
177
+ {
178
+ target: 'designSystem',
179
+ schema: { typeof: ['object'] },
180
+ },
169
181
  ],
170
182
  '@modern-js/plugin-router': [
171
183
  {
package/dist/format.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * https://github.com/facebook/create-react-app/blob/master/LICENSE
7
7
  */
8
8
  import type { StatsCompilation } from 'webpack';
9
- declare function formatWebpackMessages(json?: StatsCompilation): {
9
+ declare function formatWebpackMessages(json?: Pick<StatsCompilation, 'errors' | 'warnings'>): {
10
10
  errors: string[];
11
11
  warnings: string[];
12
12
  };
package/dist/routes.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const getPathWithoutExt: (filename: string) => string;
2
- export declare const getRouteId: (componentPath: string, routesDir: string) => string;
2
+ export declare const getRouteId: (componentPath: string, routesDir: string, entryName: string) => string;
package/dist/routes.js CHANGED
@@ -11,9 +11,10 @@ const getPathWithoutExt = (filename) => {
11
11
  return filename.slice(0, -extname.length);
12
12
  };
13
13
  exports.getPathWithoutExt = getPathWithoutExt;
14
- const getRouteId = (componentPath, routesDir) => {
14
+ const getRouteId = (componentPath, routesDir, entryName) => {
15
15
  const relativePath = (0, path_2.normalizeToPosixPath)(path_1.default.relative(routesDir, componentPath));
16
- const id = (0, exports.getPathWithoutExt)(relativePath);
16
+ const pathWithoutExt = (0, exports.getPathWithoutExt)(relativePath);
17
+ const id = `${entryName}_${pathWithoutExt}`;
17
18
  return id;
18
19
  };
19
20
  exports.getRouteId = getRouteId;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.0",
14
+ "version": "2.0.0-beta.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/index.d.ts",
17
17
  "main": "./dist/index.js",
@@ -129,14 +129,14 @@
129
129
  "lodash": "^4.17.21"
130
130
  },
131
131
  "devDependencies": {
132
- "@modern-js/types": "2.0.0-beta.0",
133
- "@scripts/build": "2.0.0-beta.0",
134
- "@scripts/jest-config": "2.0.0-beta.0",
135
132
  "@types/jest": "^27",
136
133
  "@types/node": "^14",
137
134
  "typescript": "^4",
138
135
  "jest": "^27",
139
- "webpack": "^5.74.0"
136
+ "webpack": "^5.74.0",
137
+ "@modern-js/types": "2.0.0-beta.1",
138
+ "@scripts/build": "2.0.0-beta.1",
139
+ "@scripts/jest-config": "2.0.0-beta.1"
140
140
  },
141
141
  "sideEffects": false,
142
142
  "scripts": {