@esmx/router 3.0.0-rc.69 → 3.0.0-rc.71
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/README.md +8 -1
- package/README.zh-CN.md +7 -0
- package/dist/options.mjs +7 -7
- package/dist/router.mjs +7 -1
- package/package.json +6 -6
- package/src/router.ts +7 -4
package/README.md
CHANGED
|
@@ -39,7 +39,14 @@
|
|
|
39
39
|
## 📦 Installation
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
+
# npm
|
|
42
43
|
npm install @esmx/router
|
|
44
|
+
|
|
45
|
+
# pnpm
|
|
46
|
+
pnpm add @esmx/router
|
|
47
|
+
|
|
48
|
+
# yarn
|
|
49
|
+
yarn add @esmx/router
|
|
43
50
|
```
|
|
44
51
|
|
|
45
52
|
## 🚀 Quick Start
|
|
@@ -67,4 +74,4 @@ Visit the [official documentation](https://esmx.dev) for detailed usage guides a
|
|
|
67
74
|
|
|
68
75
|
## 📄 License
|
|
69
76
|
|
|
70
|
-
MIT © [Esmx Team](https://github.com/esmnext/esmx)
|
|
77
|
+
MIT © [Esmx Team](https://github.com/esmnext/esmx)
|
package/README.zh-CN.md
CHANGED
package/dist/options.mjs
CHANGED
|
@@ -48,14 +48,14 @@ export function parsedOptions(options = {}) {
|
|
|
48
48
|
apps: typeof options.apps === "function" ? options.apps : Object.assign({}, options.apps),
|
|
49
49
|
compiledRoutes,
|
|
50
50
|
matcher: createMatcher(routes, compiledRoutes),
|
|
51
|
-
normalizeURL: (_c = options.normalizeURL) != null ? _c : (url) => url,
|
|
51
|
+
normalizeURL: (_c = options.normalizeURL) != null ? _c : ((url) => url),
|
|
52
52
|
fallback: (_d = options.fallback) != null ? _d : fallback,
|
|
53
|
-
nextTick: (_e = options.nextTick) != null ? _e : () => {
|
|
54
|
-
},
|
|
55
|
-
handleBackBoundary: (_f = options.handleBackBoundary) != null ? _f : () => {
|
|
56
|
-
},
|
|
57
|
-
handleLayerClose: (_g = options.handleLayerClose) != null ? _g : () => {
|
|
58
|
-
}
|
|
53
|
+
nextTick: (_e = options.nextTick) != null ? _e : (() => {
|
|
54
|
+
}),
|
|
55
|
+
handleBackBoundary: (_f = options.handleBackBoundary) != null ? _f : (() => {
|
|
56
|
+
}),
|
|
57
|
+
handleLayerClose: (_g = options.handleLayerClose) != null ? _g : (() => {
|
|
58
|
+
})
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
export function fallback(to, from, router) {
|
package/dist/router.mjs
CHANGED
|
@@ -259,7 +259,13 @@ export class Router {
|
|
|
259
259
|
});
|
|
260
260
|
await router.replace(toInput);
|
|
261
261
|
router.afterEach((to, from) => {
|
|
262
|
-
if (layerOptions.shouldClose &&
|
|
262
|
+
if (layerOptions.shouldClose && ![
|
|
263
|
+
RouteType.pushWindow,
|
|
264
|
+
RouteType.replaceWindow,
|
|
265
|
+
RouteType.replace,
|
|
266
|
+
RouteType.restartApp,
|
|
267
|
+
RouteType.pushLayer
|
|
268
|
+
].includes(to.type)) {
|
|
263
269
|
const result = layerOptions.shouldClose(to, from, router);
|
|
264
270
|
if (result === true) {
|
|
265
271
|
router.destroy();
|
package/package.json
CHANGED
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@biomejs/biome": "1.9.4",
|
|
35
|
-
"@types/node": "^24.
|
|
35
|
+
"@types/node": "^24.10.0",
|
|
36
36
|
"@vitest/coverage-v8": "3.2.4",
|
|
37
|
-
"happy-dom": "^
|
|
38
|
-
"typescript": "5.9.
|
|
39
|
-
"unbuild": "3.6.
|
|
37
|
+
"happy-dom": "^20.0.10",
|
|
38
|
+
"typescript": "5.9.3",
|
|
39
|
+
"unbuild": "3.6.1",
|
|
40
40
|
"vitest": "3.2.4"
|
|
41
41
|
},
|
|
42
|
-
"version": "3.0.0-rc.
|
|
42
|
+
"version": "3.0.0-rc.71",
|
|
43
43
|
"type": "module",
|
|
44
44
|
"private": false,
|
|
45
45
|
"exports": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"template",
|
|
59
59
|
"public"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "1616c7a1f820387d4d14bac0babd42356f6f7f33"
|
|
62
62
|
}
|
package/src/router.ts
CHANGED
|
@@ -294,10 +294,13 @@ export class Router {
|
|
|
294
294
|
router.afterEach((to, from) => {
|
|
295
295
|
if (
|
|
296
296
|
layerOptions.shouldClose &&
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
297
|
+
![
|
|
298
|
+
RouteType.pushWindow,
|
|
299
|
+
RouteType.replaceWindow,
|
|
300
|
+
RouteType.replace,
|
|
301
|
+
RouteType.restartApp,
|
|
302
|
+
RouteType.pushLayer
|
|
303
|
+
].includes(to.type)
|
|
301
304
|
) {
|
|
302
305
|
const result = layerOptions.shouldClose(to, from, router);
|
|
303
306
|
if (result === true) {
|