@modern-js/utils 2.25.1 → 2.25.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/cli/index.js +0 -1
- package/dist/cjs/runtime/nestedRoutes.js +5 -2
- package/dist/esm/cli/index.js +0 -1
- package/dist/esm/runtime/nestedRoutes.js +5 -2
- package/dist/types/cli/index.d.ts +0 -1
- package/package.json +9 -9
- package/dist/cjs/cli/print.js +0 -37
- package/dist/esm/cli/print.js +0 -27
- package/dist/types/cli/print.d.ts +0 -8
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
+
## 2.25.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 63d8247: fix(utils): incorrect ora & commander exports path
|
8
|
+
|
9
|
+
fix(utils): 修复错误的 ora & commander 导出路径
|
10
|
+
|
11
|
+
- 6651684: fix(app-tools): failed to print error stack
|
12
|
+
|
13
|
+
fix(app-tools): 修复 build 报错时未打印错误堆栈的问题
|
14
|
+
|
15
|
+
- 272646c: feat(builder): bump webpack v5.88, support top level await
|
16
|
+
|
17
|
+
feat(builder): 升级 webpack v5.88, 支持 top level await
|
18
|
+
|
19
|
+
- 358ed24: fix: support configuration ts-node and avoid to register ts-node unnecessarily
|
20
|
+
fix: 支持配置 ts-node,避免对 ts-node 不必要的注册
|
21
|
+
|
3
22
|
## 2.25.1
|
4
23
|
|
5
24
|
### Patch Changes
|
package/dist/cjs/cli/index.js
CHANGED
@@ -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:
|
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
|
package/dist/esm/cli/index.js
CHANGED
@@ -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:
|
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
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.25.
|
18
|
+
"version": "2.25.2",
|
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",
|
@@ -227,17 +227,17 @@
|
|
227
227
|
}
|
228
228
|
},
|
229
229
|
"devDependencies": {
|
230
|
-
"react": "
|
231
|
-
"react-dom": "
|
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.
|
236
|
+
"webpack": "^5.88.1",
|
237
237
|
"@types/serialize-javascript": "^5.0.1",
|
238
|
-
"@modern-js/types": "2.25.
|
239
|
-
"@scripts/build": "2.25.
|
240
|
-
"@scripts/jest-config": "2.25.
|
238
|
+
"@modern-js/types": "2.25.2",
|
239
|
+
"@scripts/build": "2.25.2",
|
240
|
+
"@scripts/jest-config": "2.25.2"
|
241
241
|
},
|
242
242
|
"sideEffects": false,
|
243
243
|
"scripts": {
|
package/dist/cjs/cli/print.js
DELETED
@@ -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
|
-
}
|
package/dist/esm/cli/print.js
DELETED
@@ -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;
|