@modern-js/utils 2.25.1 → 2.26.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.26.0
4
+
5
+ ## 2.25.2
6
+
7
+ ### Patch Changes
8
+
9
+ - 63d8247: fix(utils): incorrect ora & commander exports path
10
+
11
+ fix(utils): 修复错误的 ora & commander 导出路径
12
+
13
+ - 6651684: fix(app-tools): failed to print error stack
14
+
15
+ fix(app-tools): 修复 build 报错时未打印错误堆栈的问题
16
+
17
+ - 272646c: feat(builder): bump webpack v5.88, support top level await
18
+
19
+ feat(builder): 升级 webpack v5.88, 支持 top level await
20
+
21
+ - 358ed24: fix: support configuration ts-node and avoid to register ts-node unnecessarily
22
+ fix: 支持配置 ts-node,避免对 ts-node 不必要的注册
23
+
3
24
  ## 2.25.1
4
25
 
5
26
  ### Patch Changes
@@ -20,7 +20,6 @@ _export_star._(require("./path"), exports);
20
20
  _export_star._(require("./pathSerializer"), exports);
21
21
  _export_star._(require("./port"), exports);
22
22
  _export_star._(require("./prettyInstructions"), exports);
23
- _export_star._(require("./print"), exports);
24
23
  _export_star._(require("./require"), exports);
25
24
  _export_star._(require("./runtimeExports"), exports);
26
25
  _export_star._(require("./watch"), exports);
@@ -30,7 +30,7 @@ const transformNestedRoutes = (routes) => {
30
30
  return (0, _reactrouterdom.createRoutesFromElements)(routeElements);
31
31
  };
32
32
  const renderNestedRoute = (nestedRoute, options = {}) => {
33
- const { children, index, id, component, isRoot, lazyImport, config } = nestedRoute;
33
+ const { children, index, id, component, isRoot, lazyImport, config, handle } = nestedRoute;
34
34
  const Component = component;
35
35
  const { parent, DeferredDataComponent, props = {} } = options;
36
36
  const routeProps = {
@@ -41,7 +41,10 @@ const renderNestedRoute = (nestedRoute, options = {}) => {
41
41
  action: nestedRoute.action,
42
42
  hasErrorBoundary: nestedRoute.hasErrorBoundary,
43
43
  shouldRevalidate: nestedRoute.shouldRevalidate,
44
- handle: typeof config === "object" ? config === null || config === void 0 ? void 0 : config.handle : {},
44
+ handle: {
45
+ ...handle,
46
+ ...typeof config === "object" ? config === null || config === void 0 ? void 0 : config.handle : {}
47
+ },
45
48
  index: nestedRoute.index,
46
49
  element: nestedRoute.element,
47
50
  errorElement: nestedRoute.errorElement
@@ -15,7 +15,6 @@ export * from "./path";
15
15
  export * from "./pathSerializer";
16
16
  export * from "./port";
17
17
  export * from "./prettyInstructions";
18
- export * from "./print";
19
18
  export * from "./require";
20
19
  export * from "./runtimeExports";
21
20
  export * from "./watch";
@@ -10,7 +10,7 @@ export const transformNestedRoutes = (routes) => {
10
10
  return createRoutesFromElements(routeElements);
11
11
  };
12
12
  export const renderNestedRoute = (nestedRoute, options = {}) => {
13
- const { children, index, id, component, isRoot, lazyImport, config } = nestedRoute;
13
+ const { children, index, id, component, isRoot, lazyImport, config, handle } = nestedRoute;
14
14
  const Component = component;
15
15
  const { parent, DeferredDataComponent, props = {} } = options;
16
16
  const routeProps = {
@@ -21,7 +21,10 @@ export const renderNestedRoute = (nestedRoute, options = {}) => {
21
21
  action: nestedRoute.action,
22
22
  hasErrorBoundary: nestedRoute.hasErrorBoundary,
23
23
  shouldRevalidate: nestedRoute.shouldRevalidate,
24
- handle: typeof config === "object" ? config === null || config === void 0 ? void 0 : config.handle : {},
24
+ handle: {
25
+ ...handle,
26
+ ...typeof config === "object" ? config === null || config === void 0 ? void 0 : config.handle : {}
27
+ },
25
28
  index: nestedRoute.index,
26
29
  element: nestedRoute.element,
27
30
  errorElement: nestedRoute.errorElement
@@ -15,7 +15,6 @@ export * from './path';
15
15
  export * from './pathSerializer';
16
16
  export * from './port';
17
17
  export * from './prettyInstructions';
18
- export * from './print';
19
18
  export * from './require';
20
19
  export * from './runtimeExports';
21
20
  export * from './watch';
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.25.1",
18
+ "version": "2.26.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -77,8 +77,8 @@
77
77
  "default": "./dist/cjs/universal/pluginDagSort.js"
78
78
  },
79
79
  "./ajv": "./dist/compiled/ajv/index.js",
80
- "./commander": "./compiled/commander/index.js",
81
- "./ora": "./compiled/ora/index.js",
80
+ "./commander": "./dist/compiled/commander/index.js",
81
+ "./ora": "./dist/compiled/ora/index.js",
82
82
  "./glob": "./dist/compiled/glob/index.js",
83
83
  "./chalk": "./dist/compiled/chalk/index.js",
84
84
  "./execa": "./dist/compiled/execa/index.js",
@@ -210,8 +210,8 @@
210
210
  "caniuse-lite": "^1.0.30001489",
211
211
  "lodash": "^4.17.21",
212
212
  "serialize-javascript": "^6.0.0",
213
- "react-router-dom": "^6.8.1",
214
- "@remix-run/router": "1.6.2",
213
+ "react-router-dom": "6.11.1",
214
+ "@remix-run/router": "1.6.1",
215
215
  "@swc/helpers": "0.5.1"
216
216
  },
217
217
  "peerDependencies": {
@@ -227,17 +227,17 @@
227
227
  }
228
228
  },
229
229
  "devDependencies": {
230
- "react": ">=17.0.0",
231
- "react-dom": ">=17.0.0",
230
+ "react": "^18.2.0",
231
+ "react-dom": "^18.2.0",
232
232
  "@types/jest": "^29",
233
233
  "@types/node": "^14",
234
234
  "jest": "^29",
235
235
  "typescript": "^5",
236
- "webpack": "^5.82.1",
236
+ "webpack": "^5.88.1",
237
237
  "@types/serialize-javascript": "^5.0.1",
238
- "@modern-js/types": "2.25.1",
239
- "@scripts/build": "2.25.1",
240
- "@scripts/jest-config": "2.25.1"
238
+ "@modern-js/types": "2.26.0",
239
+ "@scripts/jest-config": "2.26.0",
240
+ "@scripts/build": "2.26.0"
241
241
  },
242
242
  "sideEffects": false,
243
243
  "scripts": {
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "printBuildError", {
6
- enumerable: true,
7
- get: function() {
8
- return printBuildError;
9
- }
10
- });
11
- const _compiled = require("../compiled");
12
- const _logger = require("./logger");
13
- function printBuildError(err) {
14
- const message = err != null && err.message;
15
- const stack = err != null && err.stack;
16
- if (stack && typeof message === "string" && message.indexOf("from Terser") !== -1) {
17
- try {
18
- const matched = /(.+)\[(.+):(.+),(.+)\]\[.+\]/.exec(stack);
19
- if (!matched) {
20
- throw new Error("Using errors for control flow is bad.");
21
- }
22
- const problemPath = matched[2];
23
- const line = matched[3];
24
- const column = matched[4];
25
- _logger.logger.error(`Failed to minify the code from this file:
26
-
27
- ${_compiled.chalk.yellow(` ${problemPath}:${line}${column !== "0" ? ":" + column : ""}`)}
28
- `);
29
- } catch (ignored) {
30
- _logger.logger.error(`Failed to minify the bundle. ${err}
31
- `);
32
- }
33
- } else {
34
- _logger.logger.error((message || err) + "\n");
35
- }
36
- _logger.logger.log();
37
- }
@@ -1,27 +0,0 @@
1
- import { chalk } from "../compiled";
2
- import { logger } from "./logger";
3
- export function printBuildError(err) {
4
- const message = err != null && err.message;
5
- const stack = err != null && err.stack;
6
- if (stack && typeof message === "string" && message.indexOf("from Terser") !== -1) {
7
- try {
8
- const matched = /(.+)\[(.+):(.+),(.+)\]\[.+\]/.exec(stack);
9
- if (!matched) {
10
- throw new Error("Using errors for control flow is bad.");
11
- }
12
- const problemPath = matched[2];
13
- const line = matched[3];
14
- const column = matched[4];
15
- logger.error(`Failed to minify the code from this file:
16
-
17
- ${chalk.yellow(` ${problemPath}:${line}${column !== "0" ? ":" + column : ""}`)}
18
- `);
19
- } catch (ignored) {
20
- logger.error(`Failed to minify the bundle. ${err}
21
- `);
22
- }
23
- } else {
24
- logger.error((message || err) + "\n");
25
- }
26
- logger.log();
27
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file at
6
- * https://github.com/facebook/create-react-app/blob/master/LICENSE
7
- */
8
- export declare function printBuildError(err: Error): void;