@xmachines/play-router 1.0.0-beta.53 → 1.0.0-beta.55
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 +11 -8
- package/dist/base-route-map.d.ts +15 -2
- package/dist/base-route-map.d.ts.map +1 -1
- package/dist/base-route-map.js +30 -20
- package/dist/base-route-map.js.map +1 -1
- package/dist/build-tree.d.ts +7 -0
- package/dist/build-tree.d.ts.map +1 -1
- package/dist/build-tree.js +14 -1
- package/dist/build-tree.js.map +1 -1
- package/dist/create-route-map-from-tree.d.ts +1 -1
- package/dist/create-route-map-from-tree.js +1 -1
- package/dist/errors.d.ts +27 -26
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +27 -26
- package/dist/errors.js.map +1 -1
- package/dist/extract-routes.d.ts.map +1 -1
- package/dist/extract-routes.js +5 -4
- package/dist/extract-routes.js.map +1 -1
- package/dist/find-route.d.ts.map +1 -1
- package/dist/find-route.js +7 -2
- package/dist/find-route.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/query.d.ts +6 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +59 -26
- package/dist/query.js.map +1 -1
- package/dist/router-bridge-base.d.ts +53 -8
- package/dist/router-bridge-base.d.ts.map +1 -1
- package/dist/router-bridge-base.js +85 -42
- package/dist/router-bridge-base.js.map +1 -1
- package/dist/router-sync.d.ts +8 -0
- package/dist/router-sync.d.ts.map +1 -1
- package/dist/router-sync.js +33 -4
- package/dist/router-sync.js.map +1 -1
- package/dist/types.d.ts +5 -5
- package/dist/url-pattern-utils.d.ts +57 -0
- package/dist/url-pattern-utils.d.ts.map +1 -1
- package/dist/url-pattern-utils.js +99 -0
- package/dist/url-pattern-utils.js.map +1 -1
- package/dist/validate-routes.d.ts +23 -5
- package/dist/validate-routes.d.ts.map +1 -1
- package/dist/validate-routes.js +13 -6
- package/dist/validate-routes.js.map +1 -1
- package/package.json +13 -12
- package/dist/create-route-matcher.d.ts +0 -66
- package/dist/create-route-matcher.d.ts.map +0 -1
- package/dist/create-route-matcher.js +0 -83
- package/dist/create-route-matcher.js.map +0 -1
package/README.md
CHANGED
|
@@ -187,7 +187,6 @@ bridge.disconnect();
|
|
|
187
187
|
|
|
188
188
|
| Export | Description |
|
|
189
189
|
| ----------------------------- | ------------------------------------------------------------------------------------------ |
|
|
190
|
-
| `createRouteMatcher(tree)` | Create a `RouteMatcher` that matches URL paths to `#stateId` values and extracts params |
|
|
191
190
|
| `RouteMap` | Bidirectional `stateId ↔ path` lookup class; supports O(1) exact and O(k) pattern matching |
|
|
192
191
|
| `findRouteById(tree, id)` | Look up a `RouteNode` by state ID |
|
|
193
192
|
| `findRouteByPath(tree, path)` | Look up a `RouteNode` by URL path (supports dynamic patterns) |
|
|
@@ -214,11 +213,11 @@ bridge.disconnect();
|
|
|
214
213
|
|
|
215
214
|
### Validation
|
|
216
215
|
|
|
217
|
-
| Export | Description
|
|
218
|
-
| ---------------------------------------- |
|
|
219
|
-
| `validateRouteFormat(route, stateId)` | Assert route path is non-empty
|
|
220
|
-
| `validateStateExists(stateId, stateIds)` | Assert a state ID is present in the machine graph
|
|
221
|
-
| `detectDuplicateRoutes(routes)` | Throw if any two states
|
|
216
|
+
| Export | Description |
|
|
217
|
+
| ---------------------------------------- | ----------------------------------------------------- |
|
|
218
|
+
| `validateRouteFormat(route, stateId)` | Assert route path is non-empty |
|
|
219
|
+
| `validateStateExists(stateId, stateIds)` | Assert a state ID is present in the machine graph |
|
|
220
|
+
| `detectDuplicateRoutes(routes)` | Throw if any two states resolve to the same full path |
|
|
222
221
|
|
|
223
222
|
### Key Types
|
|
224
223
|
|
|
@@ -330,10 +329,13 @@ npm test -w @xmachines/play-router
|
|
|
330
329
|
npm run test:watch -w @xmachines/play-router
|
|
331
330
|
```
|
|
332
331
|
|
|
333
|
-
|
|
332
|
+
A router bridge contract test suite for adapter authors lives in
|
|
333
|
+
`@xmachines/play-router-shared` (it drives a real actor, so it sits one layer
|
|
334
|
+
above this package to keep `@xmachines/play-router` free of an actor-runtime
|
|
335
|
+
dependency):
|
|
334
336
|
|
|
335
337
|
```typescript
|
|
336
|
-
import { runBridgeContractTests } from "@xmachines/play-router/test/contract.js";
|
|
338
|
+
import { runBridgeContractTests } from "@xmachines/play-router-shared/test/router-bridge-contract.js";
|
|
337
339
|
|
|
338
340
|
runBridgeContractTests({
|
|
339
341
|
name: "MyRouterBridge",
|
|
@@ -349,6 +351,7 @@ runBridgeContractTests({
|
|
|
349
351
|
- **[@xmachines/play-actor](../play-actor/README.md)** — Abstract actor base class (`AbstractActor`, `Routable`); all `AbstractActor` subclasses satisfy `RoutableActor` structurally
|
|
350
352
|
- **[@xmachines/play-signals](../play-signals/README.md)** — TC39 Signals polyfill used for actor route observation
|
|
351
353
|
- **[@xmachines/play-xstate](../play-xstate/README.md)** — XState v5 logic adapter that integrates with route trees
|
|
354
|
+
- **[@xmachines/play-tanstack-router](../play-tanstack-router/README.md)** — Shared TanStack Router bridge base (framework-agnostic)
|
|
352
355
|
- **[@xmachines/play-tanstack-react-router](../play-tanstack-react-router/README.md)** — TanStack Router adapter (React)
|
|
353
356
|
- **[@xmachines/play-tanstack-solid-router](../play-tanstack-solid-router/README.md)** — TanStack Router adapter (SolidJS)
|
|
354
357
|
- **[@xmachines/play-react-router](../play-react-router/README.md)** — React Router v7 adapter
|
package/dist/base-route-map.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Algorithm: O(1) exact match via Map, then bucket-based O(k) pattern match
|
|
8
8
|
* where k = routes in the first-segment bucket (typically << total routes).
|
|
9
|
-
* Uses URLPattern for parameterized route matching
|
|
9
|
+
* Uses URLPattern for parameterized route matching.
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* A single state ID ↔ path mapping entry.
|
|
@@ -42,9 +42,16 @@ export interface RouteMapping {
|
|
|
42
42
|
* - Results are cached after the first match in an LRU cache (default 500 entries,
|
|
43
43
|
* configurable via the `cacheSize` constructor option)
|
|
44
44
|
*
|
|
45
|
-
* **Pattern syntax** (`:param` / `:param?`):
|
|
45
|
+
* **Pattern syntax** (`:param` / `:param?` / `*`):
|
|
46
46
|
* - `:param` — required segment, matches exactly one non-`/` segment
|
|
47
47
|
* - `:param?` — optional segment, matches zero or one non-`/` segment
|
|
48
|
+
* - `*` — wildcard, matches any number of segments (URLPattern semantics)
|
|
49
|
+
*
|
|
50
|
+
* **StateId forms:** stateIds may be registered and looked up in either
|
|
51
|
+
* `"#stateId"` or `"stateId"` form — `RouteMap` canonicalizes internally.
|
|
52
|
+
* `getStateIdByPath` returns the stateId exactly as registered;
|
|
53
|
+
* `getPathByStateId` accepts both forms. Registering the same stateId in both
|
|
54
|
+
* forms refers to one entry (the later registration wins for reverse lookup).
|
|
48
55
|
*
|
|
49
56
|
* @example
|
|
50
57
|
* ```typescript
|
|
@@ -66,6 +73,7 @@ export interface RouteMapping {
|
|
|
66
73
|
* ```
|
|
67
74
|
*/
|
|
68
75
|
export declare class RouteMap {
|
|
76
|
+
/** Keyed on the canonical (bare, `#`-stripped) stateId form. */
|
|
69
77
|
private stateIdToPath;
|
|
70
78
|
private pathToStateId;
|
|
71
79
|
private patternBuckets;
|
|
@@ -109,12 +117,17 @@ export declare class RouteMap {
|
|
|
109
117
|
/**
|
|
110
118
|
* Look up the path pattern registered for a state ID.
|
|
111
119
|
*
|
|
120
|
+
* Accepts the stateId in either `"#stateId"` or `"stateId"` form regardless of
|
|
121
|
+
* which form was used at registration — lookups are canonicalized internally,
|
|
122
|
+
* so consumers never need to try both forms.
|
|
123
|
+
*
|
|
112
124
|
* @param stateId - State machine state ID (e.g., `"profile"`, `"#settings"`)
|
|
113
125
|
* @returns The registered path pattern, or `null` if the state ID is unknown
|
|
114
126
|
*
|
|
115
127
|
* @example
|
|
116
128
|
* ```typescript
|
|
117
129
|
* map.getPathByStateId("profile"); // "/profile/:userId"
|
|
130
|
+
* map.getPathByStateId("#profile"); // "/profile/:userId" (same entry)
|
|
118
131
|
* map.getPathByStateId("missing"); // null
|
|
119
132
|
* ```
|
|
120
133
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-route-map.d.ts","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"base-route-map.d.ts","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA0BH;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,oFAAoF;IACpF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBAAa,QAAQ;IACpB,gEAAgE;IAChE,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,cAAc,CAGpB;IACF,OAAO,CAAC,cAAc,CAAkC;IAExD;;;;;;;;;;;;;;;OAeG;gBACS,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,SAAe,EAAE,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO;IAmCtF;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAuB7C;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAGhD"}
|
package/dist/base-route-map.js
CHANGED
|
@@ -6,27 +6,22 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Algorithm: O(1) exact match via Map, then bucket-based O(k) pattern match
|
|
8
8
|
* where k = routes in the first-segment bucket (typically << total routes).
|
|
9
|
-
* Uses URLPattern for parameterized route matching
|
|
9
|
+
* Uses URLPattern for parameterized route matching.
|
|
10
10
|
*/
|
|
11
11
|
import QuickLRU from "quick-lru";
|
|
12
|
-
import { getURLPatternCtor, getIndexKey, getCandidates, } from "./url-pattern-utils.js";
|
|
12
|
+
import { getURLPatternCtor, getCompiledPattern, getIndexKey, getCandidates, isParameterizedPattern, } from "./url-pattern-utils.js";
|
|
13
13
|
import { URLPatternUnavailableError, InvalidRoutePatternError } from "./errors.js";
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Canonical stateId key: the bare form with any leading `#` stripped.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* normalizeParamNames("/docs/:cat-id/:page-num?")
|
|
24
|
-
* // → "/docs/:cat_id/:page_num?"
|
|
17
|
+
* `RouteMap` accepts stateIds in both `"#stateId"` and `"stateId"` form on insert
|
|
18
|
+
* and on lookup. Internally every stateId is keyed on this canonical bare form so
|
|
19
|
+
* consumers never need to re-implement dual-form handling. The *registered* form
|
|
20
|
+
* is preserved and returned by `getStateIdByPath` so the map is transparent about
|
|
21
|
+
* how routes were declared.
|
|
25
22
|
*/
|
|
26
|
-
function
|
|
27
|
-
return
|
|
28
|
-
return `:${name.replace(/-/g, "_")}${optional}`;
|
|
29
|
-
});
|
|
23
|
+
function canonicalStateIdKey(stateId) {
|
|
24
|
+
return stateId.startsWith("#") ? stateId.slice(1) : stateId;
|
|
30
25
|
}
|
|
31
26
|
/**
|
|
32
27
|
* Shared bidirectional route map base class.
|
|
@@ -41,9 +36,16 @@ function normalizeParamNames(path) {
|
|
|
41
36
|
* - Results are cached after the first match in an LRU cache (default 500 entries,
|
|
42
37
|
* configurable via the `cacheSize` constructor option)
|
|
43
38
|
*
|
|
44
|
-
* **Pattern syntax** (`:param` / `:param?`):
|
|
39
|
+
* **Pattern syntax** (`:param` / `:param?` / `*`):
|
|
45
40
|
* - `:param` — required segment, matches exactly one non-`/` segment
|
|
46
41
|
* - `:param?` — optional segment, matches zero or one non-`/` segment
|
|
42
|
+
* - `*` — wildcard, matches any number of segments (URLPattern semantics)
|
|
43
|
+
*
|
|
44
|
+
* **StateId forms:** stateIds may be registered and looked up in either
|
|
45
|
+
* `"#stateId"` or `"stateId"` form — `RouteMap` canonicalizes internally.
|
|
46
|
+
* `getStateIdByPath` returns the stateId exactly as registered;
|
|
47
|
+
* `getPathByStateId` accepts both forms. Registering the same stateId in both
|
|
48
|
+
* forms refers to one entry (the later registration wins for reverse lookup).
|
|
47
49
|
*
|
|
48
50
|
* @example
|
|
49
51
|
* ```typescript
|
|
@@ -65,6 +67,7 @@ function normalizeParamNames(path) {
|
|
|
65
67
|
* ```
|
|
66
68
|
*/
|
|
67
69
|
export class RouteMap {
|
|
70
|
+
/** Keyed on the canonical (bare, `#`-stripped) stateId form. */
|
|
68
71
|
stateIdToPath;
|
|
69
72
|
pathToStateId;
|
|
70
73
|
patternBuckets;
|
|
@@ -92,8 +95,10 @@ export class RouteMap {
|
|
|
92
95
|
this.pathMatchCache = new QuickLRU({ maxSize: Math.max(1, cacheSize) });
|
|
93
96
|
let patternOrder = 0;
|
|
94
97
|
for (const { stateId, path } of mappings) {
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
// Key on the canonical (bare) form so getPathByStateId accepts both
|
|
99
|
+
// "#stateId" and "stateId". The registered form is kept for returns.
|
|
100
|
+
this.stateIdToPath.set(canonicalStateIdKey(stateId), path);
|
|
101
|
+
if (isParameterizedPattern(path)) {
|
|
97
102
|
const URLPatternCtorFn = getURLPatternCtor();
|
|
98
103
|
if (!URLPatternCtorFn) {
|
|
99
104
|
throw new URLPatternUnavailableError();
|
|
@@ -102,7 +107,7 @@ export class RouteMap {
|
|
|
102
107
|
const bucket = this.patternBuckets.get(bucketKey) ?? [];
|
|
103
108
|
try {
|
|
104
109
|
bucket.push({
|
|
105
|
-
pattern:
|
|
110
|
+
pattern: getCompiledPattern(path, URLPatternCtorFn),
|
|
106
111
|
stateId,
|
|
107
112
|
order: patternOrder++,
|
|
108
113
|
});
|
|
@@ -156,17 +161,22 @@ export class RouteMap {
|
|
|
156
161
|
/**
|
|
157
162
|
* Look up the path pattern registered for a state ID.
|
|
158
163
|
*
|
|
164
|
+
* Accepts the stateId in either `"#stateId"` or `"stateId"` form regardless of
|
|
165
|
+
* which form was used at registration — lookups are canonicalized internally,
|
|
166
|
+
* so consumers never need to try both forms.
|
|
167
|
+
*
|
|
159
168
|
* @param stateId - State machine state ID (e.g., `"profile"`, `"#settings"`)
|
|
160
169
|
* @returns The registered path pattern, or `null` if the state ID is unknown
|
|
161
170
|
*
|
|
162
171
|
* @example
|
|
163
172
|
* ```typescript
|
|
164
173
|
* map.getPathByStateId("profile"); // "/profile/:userId"
|
|
174
|
+
* map.getPathByStateId("#profile"); // "/profile/:userId" (same entry)
|
|
165
175
|
* map.getPathByStateId("missing"); // null
|
|
166
176
|
* ```
|
|
167
177
|
*/
|
|
168
178
|
getPathByStateId(stateId) {
|
|
169
|
-
return this.stateIdToPath.get(stateId) ?? null;
|
|
179
|
+
return this.stateIdToPath.get(canonicalStateIdKey(stateId)) ?? null;
|
|
170
180
|
}
|
|
171
181
|
}
|
|
172
182
|
//# sourceMappingURL=base-route-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-route-map.js","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAEN,iBAAiB,EACjB,WAAW,EACX,aAAa,
|
|
1
|
+
{"version":3,"file":"base-route-map.js","sourceRoot":"","sources":["../src/base-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAEN,iBAAiB,EAC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AC;QAElD,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9E,KAAK,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,UAAU,EAAE,CAAC;YAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YACpD,IAAI,KAAK,EAAE,CAAC;gBACX,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;gBAC5C,OAAO,OAAO,CAAC;YAChB,CAAC;QACF,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,OAAe;QAC/B,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC;IACrE,CAAC;CACD"}
|
package/dist/build-tree.d.ts
CHANGED
|
@@ -6,8 +6,15 @@ import type { RouteInfo, RouteTree } from "./types.js";
|
|
|
6
6
|
* Absolute routes become top-level, relative routes nest under parents.
|
|
7
7
|
* Creates bidirectional maps for state ID ↔ path lookup.
|
|
8
8
|
*
|
|
9
|
+
* Duplicate detection runs here — after relative routes are resolved against
|
|
10
|
+
* their parent's full path — so two relative routes with the same raw string
|
|
11
|
+
* under different parents are valid, while distinct raw strings that resolve to
|
|
12
|
+
* the same full path (which would silently overwrite each other in `byPath`)
|
|
13
|
+
* are rejected.
|
|
14
|
+
*
|
|
9
15
|
* @param routes - Flat list of RouteInfo from extraction
|
|
10
16
|
* @returns RouteTree with root, byStateId map, and byPath map
|
|
17
|
+
* @throws {DuplicateRoutePathError} If two states resolve to the same full path
|
|
11
18
|
*/
|
|
12
19
|
export declare const buildRouteTree: (routes: RouteInfo[]) => RouteTree;
|
|
13
20
|
//# sourceMappingURL=build-tree.d.ts.map
|
package/dist/build-tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-tree.d.ts","sourceRoot":"","sources":["../src/build-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAA4B,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"build-tree.d.ts","sourceRoot":"","sources":["../src/build-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAA4B,SAAS,EAAE,MAAM,YAAY,CAAC;AAGjF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,EAAE,KAAG,SAwEpD,CAAC"}
|
package/dist/build-tree.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { detectDuplicateRoutes } from "./validate-routes.js";
|
|
1
2
|
/**
|
|
2
3
|
* Build hierarchical route tree from flat route list
|
|
3
4
|
*
|
|
@@ -5,8 +6,15 @@
|
|
|
5
6
|
* Absolute routes become top-level, relative routes nest under parents.
|
|
6
7
|
* Creates bidirectional maps for state ID ↔ path lookup.
|
|
7
8
|
*
|
|
9
|
+
* Duplicate detection runs here — after relative routes are resolved against
|
|
10
|
+
* their parent's full path — so two relative routes with the same raw string
|
|
11
|
+
* under different parents are valid, while distinct raw strings that resolve to
|
|
12
|
+
* the same full path (which would silently overwrite each other in `byPath`)
|
|
13
|
+
* are rejected.
|
|
14
|
+
*
|
|
8
15
|
* @param routes - Flat list of RouteInfo from extraction
|
|
9
16
|
* @returns RouteTree with root, byStateId map, and byPath map
|
|
17
|
+
* @throws {DuplicateRoutePathError} If two states resolve to the same full path
|
|
10
18
|
*/
|
|
11
19
|
export const buildRouteTree = (routes) => {
|
|
12
20
|
// 1. Create root node
|
|
@@ -26,7 +34,8 @@ export const buildRouteTree = (routes) => {
|
|
|
26
34
|
// 3. Sort routes by depth (shallowest first for proper parent linking)
|
|
27
35
|
// oxlint-disable-next-line unicorn/no-array-sort
|
|
28
36
|
const sorted = routes.slice().sort((a, b) => a.statePath.length - b.statePath.length);
|
|
29
|
-
// 4. Build tree
|
|
37
|
+
// 4. Build tree, collecting inserted nodes for resolved-path duplicate detection
|
|
38
|
+
const insertedNodes = [];
|
|
30
39
|
for (const route of sorted) {
|
|
31
40
|
// Find parent by walking up state path.
|
|
32
41
|
// Each entry in statePath is a full dotted stateId (e.g., "chain.app.section"),
|
|
@@ -63,7 +72,11 @@ export const buildRouteTree = (routes) => {
|
|
|
63
72
|
// Add to maps for bidirectional lookup
|
|
64
73
|
byStateId.set(node.stateId, node);
|
|
65
74
|
byPath.set(node.fullPath, node);
|
|
75
|
+
insertedNodes.push(node);
|
|
66
76
|
}
|
|
77
|
+
// 5. Reject resolved full-path collisions — a silent byPath overwrite would
|
|
78
|
+
// leave one state unreachable by URL.
|
|
79
|
+
detectDuplicateRoutes(insertedNodes);
|
|
67
80
|
return { root, byStateId, byPath };
|
|
68
81
|
};
|
|
69
82
|
//# sourceMappingURL=build-tree.js.map
|
package/dist/build-tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-tree.js","sourceRoot":"","sources":["../src/build-tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-tree.js","sourceRoot":"","sources":["../src/build-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAmB,EAAa,EAAE;IAChE,sBAAsB;IACtB,MAAM,IAAI,GAAc;QACvB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,KAAK,EAAE,+BAA+B;QACh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AC,SAAS,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAEpE,cAAc;QACd,MAAM,IAAI,GAAc;YACvB,EAAE,EAAE,KAAK,CAAC,OAAO;YACjB,IAAI,EAAE,KAAK,CAAC,SAAS;YACrB,QAAQ;YACR,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,UAAU;YAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACxB,CAAC;QAEF,2BAA2B;QAC3B,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,CAAC;QAED,iBAAiB;QACjB,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/B,uCAAuC;QACvC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAChC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,4EAA4E;IAC5E,sCAAsC;IACtC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAErC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACpC,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { RouteMapOptions } from "./create-route-map.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Create a `RouteMap` from a `RouteTree` node structure.
|
|
6
6
|
*
|
|
7
|
-
* Used by framework-router adapters
|
|
7
|
+
* Used by framework-router adapters that pass a
|
|
8
8
|
* `RouteTree` produced by `extractMachineRoutes()` rather than calling
|
|
9
9
|
* `createRouteMap()` directly.
|
|
10
10
|
*
|
|
@@ -2,7 +2,7 @@ import { RouteMap } from "./base-route-map.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Create a `RouteMap` from a `RouteTree` node structure.
|
|
4
4
|
*
|
|
5
|
-
* Used by framework-router adapters
|
|
5
|
+
* Used by framework-router adapters that pass a
|
|
6
6
|
* `RouteTree` produced by `extractMachineRoutes()` rather than calling
|
|
7
7
|
* `createRouteMap()` directly.
|
|
8
8
|
*
|
package/dist/errors.d.ts
CHANGED
|
@@ -55,8 +55,9 @@ export declare class DuplicateBridgeError extends PlayError {
|
|
|
55
55
|
constructor();
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* Thrown by `
|
|
59
|
-
* current runtime environment and no
|
|
58
|
+
* Thrown by the `RouteMap` constructor when a parameterized route is registered but
|
|
59
|
+
* the `URLPattern` API is not available in the current runtime environment and no
|
|
60
|
+
* polyfill has been loaded.
|
|
60
61
|
*
|
|
61
62
|
* **How to fix:** Load `urlpattern-polyfill` at your application entry point, before
|
|
62
63
|
* any import of `@xmachines/play-router`:
|
|
@@ -74,30 +75,6 @@ export declare class DuplicateBridgeError extends PlayError {
|
|
|
74
75
|
export declare class URLPatternUnavailableError extends PlayError {
|
|
75
76
|
constructor();
|
|
76
77
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Thrown by `createRouteMatcher()` when a route pattern string cannot be compiled by
|
|
79
|
-
* `URLPattern`. The `pattern` field contains the rejected string; `cause` wraps the
|
|
80
|
-
* original `URLPattern` constructor error.
|
|
81
|
-
*
|
|
82
|
-
* Common causes:
|
|
83
|
-
* - Unmatched parentheses or brackets in the pattern string
|
|
84
|
-
* - Characters that are invalid in a URL pathname pattern
|
|
85
|
-
*
|
|
86
|
-
* **Error code:** `PLAY_ROUTE_MAP_INVALID_PATTERN`
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```typescript
|
|
90
|
-
* import { InvalidRoutePatternError } from "@xmachines/play-router/errors";
|
|
91
|
-
*
|
|
92
|
-
* try {
|
|
93
|
-
* const routeMatcher = createRouteMatcher(tree);
|
|
94
|
-
* } catch (err) {
|
|
95
|
-
* if (err instanceof InvalidRoutePatternError) {
|
|
96
|
-
* console.error(`Bad route pattern: "${err.pattern}"`, err.cause);
|
|
97
|
-
* }
|
|
98
|
-
* }
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
78
|
/**
|
|
102
79
|
* Thrown by `validateRouteFormat()` when a state declares `meta.route` with an
|
|
103
80
|
* empty string path.
|
|
@@ -143,6 +120,30 @@ export declare class UnknownStateTypeError extends PlayError {
|
|
|
143
120
|
readonly nodeId: string;
|
|
144
121
|
constructor(stateType: string, nodeId: string, validTypes: string[]);
|
|
145
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Thrown by the `RouteMap` constructor when a route pattern string cannot be compiled
|
|
125
|
+
* by `URLPattern`. The `pattern` field contains the rejected string; `cause` wraps the
|
|
126
|
+
* original `URLPattern` constructor error.
|
|
127
|
+
*
|
|
128
|
+
* Common causes:
|
|
129
|
+
* - Unmatched parentheses or brackets in the pattern string
|
|
130
|
+
* - Characters that are invalid in a URL pathname pattern
|
|
131
|
+
*
|
|
132
|
+
* **Error code:** `PLAY_ROUTE_MAP_INVALID_PATTERN`
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* import { InvalidRoutePatternError } from "@xmachines/play-router/errors";
|
|
137
|
+
*
|
|
138
|
+
* try {
|
|
139
|
+
* const routeMap = createRouteMap(machine);
|
|
140
|
+
* } catch (err) {
|
|
141
|
+
* if (err instanceof InvalidRoutePatternError) {
|
|
142
|
+
* console.error(`Bad route pattern: "${err.pattern}"`, err.cause);
|
|
143
|
+
* }
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
146
147
|
export declare class InvalidRoutePatternError extends PlayError {
|
|
147
148
|
/** The route pattern string that could not be compiled by URLPattern. */
|
|
148
149
|
readonly pattern: string;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAgB,SAAQ,SAAS;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;;CAUlD;AAED
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAgB,SAAQ,SAAS;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;;CAUlD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,0BAA2B,SAAQ,SAAS;;CASxD;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IACjD,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,EAAE,MAAM;CAS3B;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IACjD,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,EAAE,MAAM;CAS3B;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,SAAS;IACrD,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;gBAElB,UAAU,EAAE,MAAM,EAAE;CAWhC;AAED;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,SAAS;IACnD,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE;CAWnE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,wBAAyB,SAAQ,SAAS;IACtD,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAUnD"}
|
package/dist/errors.js
CHANGED
|
@@ -62,8 +62,9 @@ export class DuplicateBridgeError extends PlayError {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Thrown by `
|
|
66
|
-
* current runtime environment and no
|
|
65
|
+
* Thrown by the `RouteMap` constructor when a parameterized route is registered but
|
|
66
|
+
* the `URLPattern` API is not available in the current runtime environment and no
|
|
67
|
+
* polyfill has been loaded.
|
|
67
68
|
*
|
|
68
69
|
* **How to fix:** Load `urlpattern-polyfill` at your application entry point, before
|
|
69
70
|
* any import of `@xmachines/play-router`:
|
|
@@ -84,30 +85,6 @@ export class URLPatternUnavailableError extends PlayError {
|
|
|
84
85
|
this.name = "URLPatternUnavailableError";
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Thrown by `createRouteMatcher()` when a route pattern string cannot be compiled by
|
|
89
|
-
* `URLPattern`. The `pattern` field contains the rejected string; `cause` wraps the
|
|
90
|
-
* original `URLPattern` constructor error.
|
|
91
|
-
*
|
|
92
|
-
* Common causes:
|
|
93
|
-
* - Unmatched parentheses or brackets in the pattern string
|
|
94
|
-
* - Characters that are invalid in a URL pathname pattern
|
|
95
|
-
*
|
|
96
|
-
* **Error code:** `PLAY_ROUTE_MAP_INVALID_PATTERN`
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```typescript
|
|
100
|
-
* import { InvalidRoutePatternError } from "@xmachines/play-router/errors";
|
|
101
|
-
*
|
|
102
|
-
* try {
|
|
103
|
-
* const routeMatcher = createRouteMatcher(tree);
|
|
104
|
-
* } catch (err) {
|
|
105
|
-
* if (err instanceof InvalidRoutePatternError) {
|
|
106
|
-
* console.error(`Bad route pattern: "${err.pattern}"`, err.cause);
|
|
107
|
-
* }
|
|
108
|
-
* }
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
88
|
/**
|
|
112
89
|
* Thrown by `validateRouteFormat()` when a state declares `meta.route` with an
|
|
113
90
|
* empty string path.
|
|
@@ -173,6 +150,30 @@ export class UnknownStateTypeError extends PlayError {
|
|
|
173
150
|
this.nodeId = nodeId;
|
|
174
151
|
}
|
|
175
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Thrown by the `RouteMap` constructor when a route pattern string cannot be compiled
|
|
155
|
+
* by `URLPattern`. The `pattern` field contains the rejected string; `cause` wraps the
|
|
156
|
+
* original `URLPattern` constructor error.
|
|
157
|
+
*
|
|
158
|
+
* Common causes:
|
|
159
|
+
* - Unmatched parentheses or brackets in the pattern string
|
|
160
|
+
* - Characters that are invalid in a URL pathname pattern
|
|
161
|
+
*
|
|
162
|
+
* **Error code:** `PLAY_ROUTE_MAP_INVALID_PATTERN`
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* import { InvalidRoutePatternError } from "@xmachines/play-router/errors";
|
|
167
|
+
*
|
|
168
|
+
* try {
|
|
169
|
+
* const routeMap = createRouteMap(machine);
|
|
170
|
+
* } catch (err) {
|
|
171
|
+
* if (err instanceof InvalidRoutePatternError) {
|
|
172
|
+
* console.error(`Bad route pattern: "${err.pattern}"`, err.cause);
|
|
173
|
+
* }
|
|
174
|
+
* }
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
176
177
|
export class InvalidRoutePatternError extends PlayError {
|
|
177
178
|
/** The route pattern string that could not be compiled by URLPattern. */
|
|
178
179
|
pattern;
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC7C,YAAY,OAAe,EAAE,OAAsB;QAClD,KAAK,CAAC,kBAAkB,EAAE,yBAAyB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACvE,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAC/B,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAClD;QACC,KAAK,CACJ,kBAAkB,EAClB,8BAA8B,EAC9B,iEAAiE;YAChE,uEAAuE,CACxE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACpC,CAAC;CACD;AAED
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC7C,YAAY,OAAe,EAAE,OAAsB;QAClD,KAAK,CAAC,kBAAkB,EAAE,yBAAyB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACvE,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAC/B,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAClD;QACC,KAAK,CACJ,kBAAkB,EAClB,8BAA8B,EAC9B,iEAAiE;YAChE,uEAAu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O,qBAAsB,SAAQ,SAAS;IACnD,0CAA0C;IACjC,SAAS,CAAS;IAC3B,sDAAsD;IAC7C,MAAM,CAAS;IAExB,YAAY,SAAiB,EAAE,MAAc,EAAE,UAAoB;QAClE,KAAK,CACJ,gBAAgB,EAChB,+BAA+B,EAC/B,8BAA8B,SAAS,cAAc,MAAM,KAAK;YAC/D,oBAAoB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC7C,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,wBAAyB,SAAQ,SAAS;IACtD,yEAAyE;IAChE,OAAO,CAAS;IAEzB,YAAY,OAAe,EAAE,OAAsB;QAClD,KAAK,CACJ,UAAU,EACV,gCAAgC,EAChC,2BAA2B,OAAO,GAAG,EACrC,OAAO,CACP,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-routes.d.ts","sourceRoot":"","sources":["../src/extract-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAA6C,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"extract-routes.d.ts","sourceRoot":"","sources":["../src/extract-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAA6C,MAAM,YAAY,CAAC;AA2EvF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,eAAe,KAAG,SAmB/D,CAAC"}
|
package/dist/extract-routes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { machineToGraph } from "./machine-to-graph.js";
|
|
2
|
-
import { validateRouteFormat, validateStateExists
|
|
2
|
+
import { validateRouteFormat, validateStateExists } from "./validate-routes.js";
|
|
3
3
|
import { buildRouteTree } from "./build-tree.js";
|
|
4
4
|
/**
|
|
5
5
|
* Build statePath for a graph node by walking the parentId chain.
|
|
@@ -73,9 +73,10 @@ export const extractMachineRoutes = (machine) => {
|
|
|
73
73
|
const routes = graph.nodes
|
|
74
74
|
.map((node) => extractRouteFromNode(node, stateIds, graphNodeMap))
|
|
75
75
|
.filter((r) => r !== null);
|
|
76
|
-
// 4.
|
|
77
|
-
|
|
78
|
-
//
|
|
76
|
+
// 4. Build hierarchical tree and attach graph.
|
|
77
|
+
// Duplicate-route detection happens inside buildRouteTree, AFTER relative
|
|
78
|
+
// routes are resolved to full paths — raw route strings are not comparable
|
|
79
|
+
// (two relative "settings" routes under different parents are distinct).
|
|
79
80
|
const tree = buildRouteTree(routes);
|
|
80
81
|
return { ...tree, graph };
|
|
81
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-routes.js","sourceRoot":"","sources":["../src/extract-routes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAqB,MAAM,uBAAuB,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"extract-routes.js","sourceRoot":"","sources":["../src/extract-routes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAqB,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,cAAc,GAAG,CACtB,SAAqC,EACrC,YAAqD,EAC1C,EAAE;IACb,M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O,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"find-route.d.ts","sourceRoot":"","sources":["../src/find-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAqCvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,EAAE,IAAI,MAAM,KAAG,SAAS,GAAG,SAEvE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,EAAE,MAAM,MAAM,KAAG,SAAS,GAAG,SAyB3E,CAAC"}
|
package/dist/find-route.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getURLPatternCtor } from "./url-pattern-utils.js";
|
|
1
|
+
import { getURLPatternCtor, getCompiledPattern } from "./url-pattern-utils.js";
|
|
2
2
|
import { URLPatternUnavailableError, InvalidRoutePatternError } from "./errors.js";
|
|
3
3
|
/**
|
|
4
4
|
* Check if a URL path matches a route pattern using URLPattern.
|
|
@@ -7,6 +7,11 @@ import { URLPatternUnavailableError, InvalidRoutePatternError } from "./errors.j
|
|
|
7
7
|
* URLPattern is never required for polyfill-free environments that only use
|
|
8
8
|
* static routes.
|
|
9
9
|
*
|
|
10
|
+
* Uses the shared module-level compiled-pattern cache (`getCompiledPattern`)
|
|
11
|
+
* so repeated lookups never recompile the same pattern, and hyphenated param
|
|
12
|
+
* names (`:cat-id`) are normalized exactly as `RouteMap` does — the same single
|
|
13
|
+
* matching engine underneath.
|
|
14
|
+
*
|
|
10
15
|
* Throws `URLPatternUnavailableError` when a parameterised pattern is tested
|
|
11
16
|
* and URLPattern is not available on `globalThis`.
|
|
12
17
|
* Throws `InvalidRoutePatternError` when URLPattern cannot compile the pattern.
|
|
@@ -24,7 +29,7 @@ function matchesPattern(path, pattern) {
|
|
|
24
29
|
if (!Ctor)
|
|
25
30
|
throw new URLPatternUnavailableError();
|
|
26
31
|
try {
|
|
27
|
-
return
|
|
32
|
+
return getCompiledPattern(pattern, Ctor).test({ pathname: path });
|
|
28
33
|
}
|
|
29
34
|
catch (err) {
|
|
30
35
|
throw new InvalidRoutePatternError(pattern, { cause: err });
|
package/dist/find-route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-route.js","sourceRoot":"","sources":["../src/find-route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"find-route.js","sourceRoot":"","sources":["../src/find-route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAS,cAAc,CAAC,IAAY,EAAE,OAAe;IACpD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,KAAK,OAAO,CAAC;IACpD,MAAM,IAAI,GAAG,iBAAiB,EAAE,CAAC;IACjC,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,0BAA0B,EAAE,CAAC;IAClD,IAAI,CAAC;QACJ,OAAO,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAe,EAAE,EAAU,EAAyB,EAAE;IACnF,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAe,EAAE,IAAY,EAAyB,EAAE;IACvF,yDAAyD;IACzD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,IAAI,EAAE,QAAQ,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,oEAAoE;IACpE,gBAAgB;IAChB,yDAAyD;IACzD,wDAAwD;IACxD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzB,SAAS,CAAC,0BAA0B;QACrC,CAAC;QAED,4CAA4C;QAC5C,IAAI,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QAClB,CAAC;IACF,CAAC;IAED,+DAA+D;IAC/D,OAAO,IAAI,CAAC;AACb,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ export type { RouteWatcherHandle } from "./router-bridge-base.js";
|
|
|
3
3
|
export { sanitizePathname, buildPlayRouteEvent, extractQuery, extractRouteParams, } from "./router-sync.js";
|
|
4
4
|
export type { RouteMatch, BuildPlayRouteEventOptions } from "./router-sync.js";
|
|
5
5
|
export { validateRouteFormat, validateStateExists, detectDuplicateRoutes, } from "./validate-routes.js";
|
|
6
|
+
export type { ResolvedRoutePath } from "./validate-routes.js";
|
|
6
7
|
export { buildRouteTree } from "./build-tree.js";
|
|
7
8
|
export { extractMachineRoutes } from "./extract-routes.js";
|
|
8
9
|
export { getNavigableRoutes, getRoutableRoutes, routeExists, getTransitionReachableRoutes, isRouteReachable, } from "./query.js";
|
|
9
10
|
export { machineToGraph } from "./machine-to-graph.js";
|
|
10
11
|
export type { MachineGraph } from "./machine-to-graph.js";
|
|
11
12
|
export type { RouteInfo, RouteNode, RouteTree, RouteObject, RouteMetadata, PlayRouteEvent, RoutableActor, PlayActor, RouterBridge, MachineNodeData, MachineEdgeData, WindowLike, LocationLike, } from "./types.js";
|
|
12
|
-
export { createRouteMatcher, type RouteMatcher } from "./create-route-matcher.js";
|
|
13
13
|
export { RouteMap, type RouteMapping, type RouteMapping as BaseRouteMapping, } from "./base-route-map.js";
|
|
14
14
|
export { createRouteMap } from "./create-route-map.js";
|
|
15
15
|
export type { RouteMapOptions } from "./create-route-map.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACN,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,4BAA4B,EAC5B,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,YA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CAAC;AAI7B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGzE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,8 +9,6 @@ export { extractMachineRoutes } from "./extract-routes.js";
|
|
|
9
9
|
export { getNavigableRoutes, getRoutableRoutes, routeExists, getTransitionReachableRoutes, isRouteReachable, } from "./query.js";
|
|
10
10
|
// Graph adapter — converts XState machines to @statelyai/graph Graph
|
|
11
11
|
export { machineToGraph } from "./machine-to-graph.js";
|
|
12
|
-
// URL-pattern-based matcher (createRouteMatcher / RouteMatcher interface)
|
|
13
|
-
export { createRouteMatcher } from "./create-route-matcher.js";
|
|
14
12
|
// Shared bidirectional route mapping base class.
|
|
15
13
|
// RouteMapping is exported directly; BaseRouteMapping kept as alias for compatibility.
|
|
16
14
|
export { RouteMap, } from "./base-route-map.js";
|