@xmachines/play-solid-router 1.0.0-beta.7 → 1.0.0-beta.9

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 CHANGED
@@ -36,12 +36,12 @@ npm install @solidjs/router@^0.13.0 solid-js@^1.8.0 @xmachines/play-solid-router
36
36
 
37
37
  **Peer dependencies:**
38
38
 
39
- - `@solidjs/router` ^0.13.0 - SolidJS Router library
40
- - `solid-js` ^1.8.0 - SolidJS runtime
41
- - `@xmachines/play-solid` - Solid renderer (`PlayRenderer`)
42
- - `@xmachines/play-actor` - Actor base
43
- - `@xmachines/play-router` - Route extraction
44
- - `@xmachines/play-signals` - TC39 Signals polyfill
39
+ - `@solidjs/router` ^0.13.0 SolidJS Router library
40
+ - `solid-js` ^1.8.0 SolidJS runtime
41
+ - `@xmachines/play-solid` Solid renderer (`PlayRenderer`)
42
+ - `@xmachines/play-actor` Actor base
43
+ - `@xmachines/play-router` Route extraction
44
+ - `@xmachines/play-signals` TC39 Signals primitives
45
45
 
46
46
  ## Quick Start
47
47
 
@@ -142,35 +142,39 @@ class SolidRouterBridge {
142
142
 
143
143
  Bidirectional mapping between XMachines state IDs and SolidJS Router paths with pattern matching support.
144
144
 
145
- **Type Signature:**
145
+ `RouteMap` extends `BaseRouteMap` from `@xmachines/play-router`, inheriting bucket-indexed
146
+ bidirectional route matching. No routing logic lives in the adapter itself.
146
147
 
147
148
  ```typescript
148
149
  interface RouteMapping {
149
- stateId: string;
150
- path: string;
150
+ readonly stateId: string;
151
+ readonly path: string;
151
152
  }
152
153
 
153
- class RouteMap {
154
- constructor(mappings: RouteMapping[]);
155
- getPath(stateId: string, params?: Record<string, string>): string | undefined;
156
- getStateIdByPath(path: string): string | undefined;
157
- }
154
+ // RouteMap is a thin subclass of BaseRouteMap — no extra methods
155
+ class RouteMap extends BaseRouteMap {}
156
+
157
+ // Inherited API:
158
+ routeMap.getStateIdByPath(path: string): string | null
159
+ routeMap.getPathByStateId(stateId: string): string | null
158
160
  ```
159
161
 
162
+ `getStateIdByPath` and `getPathByStateId` both return `null` (not `undefined`) for misses.
163
+
160
164
  **Constructor Parameters:**
161
165
 
162
- - `mappings` - Array of mapping objects with:
163
- - `stateId` - State machine state ID (e.g., `'#profile'`)
164
- - `path` - SolidJS Router path pattern (e.g., `'/profile/:userId'`)
166
+ - `mappings` - Array of `{ stateId, path }` entries:
167
+ - `stateId` State machine state ID (e.g., `'#profile'`)
168
+ - `path` SolidJS Router path pattern (e.g., `'/profile/:userId'`)
165
169
 
166
170
  **Methods:**
167
171
 
168
- - `getPath(stateId, params?)` - Find path from state ID, optionally substitute params
169
- - `getStateIdByPath(path)` - Find state ID from path with pattern matching (supports `:param` and `:param?` syntax)
172
+ - `getPathByStateId(stateId)` Find path pattern from state ID
173
+ - `getStateIdByPath(path)` Find state ID from path with pattern matching (supports `:param` and `:param?` syntax)
170
174
 
171
175
  **Pattern Matching:**
172
176
 
173
- Uses URLPattern API for robust dynamic route matching:
177
+ Uses bucket-indexed RegExp matching for dynamic routes:
174
178
 
175
179
  ```typescript
176
180
  const routeMap = new RouteMap([{ stateId: "#settings", path: "/settings/:section?" }]);
@@ -178,6 +182,7 @@ const routeMap = new RouteMap([{ stateId: "#settings", path: "/settings/:section
178
182
  routeMap.getStateIdByPath("/settings"); // '#settings'
179
183
  routeMap.getStateIdByPath("/settings/account"); // '#settings'
180
184
  routeMap.getStateIdByPath("/settings/privacy"); // '#settings'
185
+ routeMap.getStateIdByPath("/other"); // null
181
186
  ```
182
187
 
183
188
  ## Examples
@@ -479,7 +484,7 @@ function App() {
479
484
  2. `actor.currentRoute` signal updates
480
485
  3. `createEffect(on(...))` fires with new route value
481
486
  4. Bridge extracts state ID from signal
482
- 5. Bridge looks up path via `routeMap.getPath(stateId, params)`
487
+ 5. Bridge looks up path via `routeMap.getPathByStateId(stateId)`
483
488
  6. Bridge calls `navigate(path)`
484
489
  7. SolidJS Router updates URL and renders component
485
490
 
@@ -603,15 +608,11 @@ function App() {
603
608
 
604
609
  ### Pattern Matching for Dynamic Routes
605
610
 
606
- **URLPattern API integration:**
611
+ **Bucket-indexed matching via `BaseRouteMap`:**
607
612
 
608
- ```typescript
609
- private matchesPattern(path: string, pattern: string): boolean {
610
- // Use URLPattern for robust matching
611
- const urlPattern = new URLPattern({ pathname: pattern });
612
- return urlPattern.test({ pathname: path });
613
- }
614
- ```
613
+ Routes are grouped by their first path segment into buckets. On each lookup only the
614
+ relevant bucket (plus the wildcard `*` bucket for `:param`-first routes) is scanned —
615
+ typically far fewer than all registered routes.
615
616
 
616
617
  **Supported syntax:**
617
618
 
@@ -1,78 +1,27 @@
1
1
  /**
2
- * RouteMap for bidirectional state ID ↔ path mapping
2
+ * Bidirectional route mapper for SolidJS Router.
3
3
  *
4
- * Provides efficient lookup between XMachines state IDs and SolidJS Router paths.
5
- * Supports pattern matching for dynamic routes with parameters.
4
+ * Extends {@link BaseRouteMap} from `@xmachines/play-router` all matching logic
5
+ * lives there. This class exists to provide a SolidJS Router-specific type name
6
+ * and to allow future adapter-specific extensions without breaking the shared base.
7
+ *
8
+ * **Inherited API:**
9
+ * - `getStateIdByPath(path): string | null` — path → state ID
10
+ * - `getPathByStateId(stateId): string | null` — state ID → path pattern
11
+ *
12
+ * @extends BaseRouteMap
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { createRouteMap } from "@xmachines/play-solid-router";
17
+ *
18
+ * const routeMap = createRouteMap(machine);
19
+ *
20
+ * routeMap.getStateIdByPath("/profile/123"); // "profile"
21
+ * routeMap.getPathByStateId("#settings"); // "/settings/:section?"
22
+ * ```
6
23
  */
7
- import type { RouteMapping } from "./types.js";
8
- export declare class RouteMap {
9
- private stateToPath;
10
- private pathToState;
11
- private patternBuckets;
12
- private pathMatchCache;
13
- /**
14
- * Create a RouteMap with bidirectional mappings
15
- *
16
- * @param mappings - Array of state ID to path mappings
17
- *
18
- * @example
19
- * ```typescript
20
- * const routeMap = new RouteMap([
21
- * { stateId: '#home', path: '/' },
22
- * { stateId: '#profile', path: '/profile/:userId' },
23
- * { stateId: '#settings', path: '/settings/:section?' }
24
- * ]);
25
- * ```
26
- */
27
- constructor(mappings: RouteMapping[]);
28
- /**
29
- * Get path pattern for a state ID
30
- *
31
- * @param stateId - XMachines state ID (e.g., '#profile')
32
- * @returns Path pattern or undefined if not found
33
- *
34
- * @example
35
- * ```typescript
36
- * routeMap.getPath('#profile'); // '/profile/:userId'
37
- * ```
38
- */
39
- getPath(stateId: string): string | undefined;
40
- /**
41
- * Get state ID for a path, with pattern matching support
42
- *
43
- * Performs exact match first, then fuzzy pattern matching for dynamic routes.
44
- * Supports both required (:param) and optional (:param?) parameters.
45
- *
46
- * @param path - Actual URL path (e.g., '/profile/123')
47
- * @returns State ID or undefined if no match found
48
- *
49
- * @example
50
- * ```typescript
51
- * routeMap.getStateIdByPath('/profile/123'); // '#profile'
52
- * routeMap.getStateIdByPath('/settings'); // '#settings'
53
- * routeMap.getStateIdByPath('/settings/account'); // '#settings'
54
- * ```
55
- */
56
- getStateIdByPath(path: string): string | undefined;
57
- /**
58
- * Check if a path matches a pattern
59
- *
60
- * Supports:
61
- * - Required parameters: :param
62
- * - Optional parameters: :param?
63
- *
64
- * @param path - Actual URL path
65
- * @param pattern - Route pattern with :param syntax
66
- * @returns true if path matches pattern
67
- *
68
- * @example
69
- * ```typescript
70
- * matchesPattern('/profile/123', '/profile/:userId'); // true
71
- * matchesPattern('/settings', '/settings/:section?'); // true
72
- * matchesPattern('/settings/account', '/settings/:section?'); // true
73
- * ```
74
- */
75
- private getIndexKey;
76
- private getCandidates;
24
+ import { BaseRouteMap } from "@xmachines/play-router";
25
+ export declare class RouteMap extends BaseRouteMap {
77
26
  }
78
27
  //# sourceMappingURL=route-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-map.d.ts","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,qBAAa,QAAQ;IACpB,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,cAAc,CAGlB;IACJ,OAAO,CAAC,cAAc,CAAoC;IAE1D;;;;;;;;;;;;;OAaG;gBACS,QAAQ,EAAE,YAAY,EAAE;IAuBpC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI5C;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IA4BlD;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,aAAa;CAwCrB"}
1
+ {"version":3,"file":"route-map.d.ts","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,qBAAa,QAAS,SAAQ,YAAY;CAAG"}
package/dist/route-map.js CHANGED
@@ -1,161 +1,27 @@
1
1
  /**
2
- * RouteMap for bidirectional state ID ↔ path mapping
2
+ * Bidirectional route mapper for SolidJS Router.
3
3
  *
4
- * Provides efficient lookup between XMachines state IDs and SolidJS Router paths.
5
- * Supports pattern matching for dynamic routes with parameters.
4
+ * Extends {@link BaseRouteMap} from `@xmachines/play-router` all matching logic
5
+ * lives there. This class exists to provide a SolidJS Router-specific type name
6
+ * and to allow future adapter-specific extensions without breaking the shared base.
7
+ *
8
+ * **Inherited API:**
9
+ * - `getStateIdByPath(path): string | null` — path → state ID
10
+ * - `getPathByStateId(stateId): string | null` — state ID → path pattern
11
+ *
12
+ * @extends BaseRouteMap
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { createRouteMap } from "@xmachines/play-solid-router";
17
+ *
18
+ * const routeMap = createRouteMap(machine);
19
+ *
20
+ * routeMap.getStateIdByPath("/profile/123"); // "profile"
21
+ * routeMap.getPathByStateId("#settings"); // "/settings/:section?"
22
+ * ```
6
23
  */
7
- export class RouteMap {
8
- stateToPath = new Map();
9
- pathToState = new Map();
10
- patternBuckets = new Map();
11
- pathMatchCache = new Map();
12
- /**
13
- * Create a RouteMap with bidirectional mappings
14
- *
15
- * @param mappings - Array of state ID to path mappings
16
- *
17
- * @example
18
- * ```typescript
19
- * const routeMap = new RouteMap([
20
- * { stateId: '#home', path: '/' },
21
- * { stateId: '#profile', path: '/profile/:userId' },
22
- * { stateId: '#settings', path: '/settings/:section?' }
23
- * ]);
24
- * ```
25
- */
26
- constructor(mappings) {
27
- let patternOrder = 0;
28
- mappings.forEach(({ stateId, path }) => {
29
- this.stateToPath.set(stateId, path);
30
- if (path.includes(":")) {
31
- const pattern = path
32
- .replace(/\/:(\w+)\?/g, "(?:/([^/]+))?")
33
- .replace(/\/:(\w+)/g, "/([^/]+)");
34
- const bucketKey = this.getIndexKey(path);
35
- const bucket = this.patternBuckets.get(bucketKey) ?? [];
36
- bucket.push({
37
- pattern: new RegExp(`^${pattern}$`),
38
- stateId,
39
- order: patternOrder++,
40
- });
41
- this.patternBuckets.set(bucketKey, bucket);
42
- return;
43
- }
44
- this.pathToState.set(path, stateId);
45
- });
46
- }
47
- /**
48
- * Get path pattern for a state ID
49
- *
50
- * @param stateId - XMachines state ID (e.g., '#profile')
51
- * @returns Path pattern or undefined if not found
52
- *
53
- * @example
54
- * ```typescript
55
- * routeMap.getPath('#profile'); // '/profile/:userId'
56
- * ```
57
- */
58
- getPath(stateId) {
59
- return this.stateToPath.get(stateId);
60
- }
61
- /**
62
- * Get state ID for a path, with pattern matching support
63
- *
64
- * Performs exact match first, then fuzzy pattern matching for dynamic routes.
65
- * Supports both required (:param) and optional (:param?) parameters.
66
- *
67
- * @param path - Actual URL path (e.g., '/profile/123')
68
- * @returns State ID or undefined if no match found
69
- *
70
- * @example
71
- * ```typescript
72
- * routeMap.getStateIdByPath('/profile/123'); // '#profile'
73
- * routeMap.getStateIdByPath('/settings'); // '#settings'
74
- * routeMap.getStateIdByPath('/settings/account'); // '#settings'
75
- * ```
76
- */
77
- getStateIdByPath(path) {
78
- // Strip query string and hash fragment for matching
79
- const cleanPath = path.split("?")[0].split("#")[0];
80
- // Direct lookup first (exact match)
81
- if (this.pathToState.has(cleanPath)) {
82
- return this.pathToState.get(cleanPath);
83
- }
84
- const cachedMatch = this.pathMatchCache.get(cleanPath);
85
- if (cachedMatch !== undefined) {
86
- return cachedMatch ?? undefined;
87
- }
88
- // Fuzzy match for dynamic routes
89
- const candidates = this.getCandidates(this.getIndexKey(cleanPath));
90
- for (const { pattern, stateId } of candidates) {
91
- if (pattern.test(cleanPath)) {
92
- this.pathMatchCache.set(cleanPath, stateId);
93
- return stateId;
94
- }
95
- }
96
- this.pathMatchCache.set(cleanPath, null);
97
- return undefined;
98
- }
99
- /**
100
- * Check if a path matches a pattern
101
- *
102
- * Supports:
103
- * - Required parameters: :param
104
- * - Optional parameters: :param?
105
- *
106
- * @param path - Actual URL path
107
- * @param pattern - Route pattern with :param syntax
108
- * @returns true if path matches pattern
109
- *
110
- * @example
111
- * ```typescript
112
- * matchesPattern('/profile/123', '/profile/:userId'); // true
113
- * matchesPattern('/settings', '/settings/:section?'); // true
114
- * matchesPattern('/settings/account', '/settings/:section?'); // true
115
- * ```
116
- */
117
- getIndexKey(path) {
118
- const trimmed = path.startsWith("/") ? path.slice(1) : path;
119
- if (trimmed.length === 0) {
120
- return "/";
121
- }
122
- const segment = trimmed.split("/")[0];
123
- if (segment.startsWith(":")) {
124
- return "*";
125
- }
126
- return segment;
127
- }
128
- getCandidates(indexKey) {
129
- const bucket = this.patternBuckets.get(indexKey) ?? [];
130
- const wildcardBucket = this.patternBuckets.get("*") ?? [];
131
- if (bucket.length === 0) {
132
- return wildcardBucket;
133
- }
134
- if (wildcardBucket.length === 0) {
135
- return bucket;
136
- }
137
- const merged = [];
138
- let bucketIndex = 0;
139
- let wildcardIndex = 0;
140
- while (bucketIndex < bucket.length && wildcardIndex < wildcardBucket.length) {
141
- if (bucket[bucketIndex].order < wildcardBucket[wildcardIndex].order) {
142
- merged.push(bucket[bucketIndex]);
143
- bucketIndex += 1;
144
- }
145
- else {
146
- merged.push(wildcardBucket[wildcardIndex]);
147
- wildcardIndex += 1;
148
- }
149
- }
150
- while (bucketIndex < bucket.length) {
151
- merged.push(bucket[bucketIndex]);
152
- bucketIndex += 1;
153
- }
154
- while (wildcardIndex < wildcardBucket.length) {
155
- merged.push(wildcardBucket[wildcardIndex]);
156
- wildcardIndex += 1;
157
- }
158
- return merged;
159
- }
24
+ import { BaseRouteMap } from "@xmachines/play-router";
25
+ export class RouteMap extends BaseRouteMap {
160
26
  }
161
27
  //# sourceMappingURL=route-map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-map.js","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,OAAO,QAAQ;IACZ,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,cAAc,GAAG,IAAI,GAAG,EAG7B,CAAC;IACI,cAAc,GAAG,IAAI,GAAG,EAAyB,CAAC;IAE1D;;;;;;;;;;;;;OAaG;IACH,YAAY,QAAwB;QACnC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACtC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB,MAAM,OAAO,GAAG,IAAI;qBAClB,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC;qBACvC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;gBACnC,MAAM,SA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,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,MAAM,CAAC;QACf,CAAC;QAED,MAAM,MAAM,GAA+D,EAAE,CAAC;QAC9E,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,IAAI,aAAa,GAAG,CAAC,CAAC;QAEtB,OAAO,WAAW,GAAG,MAAM,CAAC,MAAM,IAAI,aAAa,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;YAC7E,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,CAAC;gBACrE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;gBACjC,WAAW,IAAI,CAAC,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;gBAC3C,aAAa,IAAI,CAAC,CAAC;YACpB,CAAC;QACF,CAAC;QAED,OAAO,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;YACjC,WAAW,IAAI,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,aAAa,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;YAC9C,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;YAC3C,aAAa,IAAI,CAAC,CAAC;QACpB,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD"}
1
+ {"version":3,"file":"route-map.js","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,MAAM,OAAO,QAAS,SAAQ,YAAY;CAAG"}
@@ -56,7 +56,7 @@ export class SolidRouterBridge extends RouterBridgeBase {
56
56
  constructor(solidNavigate, location, _params, actor, routeMap) {
57
57
  super(actor, {
58
58
  getStateIdByPath: (path) => routeMap.getStateIdByPath(path),
59
- getPathByStateId: (id) => routeMap.getPath(id),
59
+ getPathByStateId: (id) => routeMap.getPathByStateId(id),
60
60
  });
61
61
  this.solidNavigate = solidNavigate;
62
62
  this.location = location;
@@ -1 +1 @@
1
- {"version":3,"file":"solid-router-bridge.js","sourceRoot":"","sources":["../src/solid-router-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IAapC;IACA;IAblB;;;;;;;;;;OAUG;IACH,YACkB,aAA4D,EAC5D,QAA8C,EAC/D,OAA2C,EAC3C,KAA8C,EAC9C,QAAkB;QAElB,KAAK,CAAC,KAAK,EAAE;YACZ,gBAAgB,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;YACnE,gBAAgB,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;SACtD,CAAC,CAAC;QATc,kBAAa,GAAb,aAAa,CAA+C;QAC5D,aAAQ,GAAR,QAAQ,CAAsC;IAShE,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,IAAY;QACpC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACgB,oBAAoB;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACO,kBAAkB;QAC3B,uEAAuE;QACvE,yEAAyE;QACzE,YAAY,CACX,EAAE,CACD,GAAG,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oB;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACO,kBAAkB;QAC3B,uEAAuE;QACvE,yEAAyE;QACzE,YAAY,CACX,EAAE,CACD,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAC5B,CAAC,QAAgB,EAAE,EAAE;YACpB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC,CACD,CACD,CAAC;IACH,CAAC;IAED;;;;OAIG;IACO,oBAAoB;QAC7B,uDAAuD;IACxD,CAAC;IAED;;;;;;;OAOG;IACH,OAAO;QACN,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/play-solid-router",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.9",
4
4
  "description": "SolidJS Router adapter for XMachines Universal Player Architecture",
5
5
  "license": "MIT",
6
6
  "author": "XMachines Contributors",
@@ -28,27 +28,29 @@
28
28
  },
29
29
  "scripts": {
30
30
  "build": "tsc --build",
31
- "test": "vitest run",
31
+ "test": "vitest",
32
32
  "test:watch": "vitest",
33
33
  "typecheck": "tsc --noEmit",
34
- "clean": "rm -rf dist *.tsbuildinfo",
34
+ "clean": "rm -rf dist *.tsbuildinfo node_modules/.vite node_modules/.vite-temp",
35
35
  "prepublishOnly": "npm run build"
36
36
  },
37
37
  "dependencies": {
38
- "@xmachines/play": "1.0.0-beta.7",
39
- "@xmachines/play-actor": "1.0.0-beta.7",
40
- "@xmachines/play-router": "1.0.0-beta.7",
41
- "@xmachines/play-signals": "1.0.0-beta.7"
38
+ "@xmachines/play": "1.0.0-beta.9",
39
+ "@xmachines/play-actor": "1.0.0-beta.9",
40
+ "@xmachines/play-router": "1.0.0-beta.9",
41
+ "@xmachines/play-signals": "1.0.0-beta.9"
42
42
  },
43
43
  "devDependencies": {
44
- "@solidjs/router": "^0.16.1",
44
+ "@solidjs/router": "^0.13.0",
45
45
  "@solidjs/testing-library": "^0.8.10",
46
- "@xmachines/shared": "1.0.0-beta.7",
46
+ "@xmachines/shared": "1.0.0-beta.9",
47
47
  "solid-js": "^1.9.11",
48
- "vite-plugin-solid": "^2.11.11"
48
+ "vite-plugin-solid": "^2.11.11",
49
+ "vitest": "^4.1.0",
50
+ "xstate": "^5.28.0"
49
51
  },
50
52
  "peerDependencies": {
51
- "@solidjs/router": "^0.16.1",
53
+ "@solidjs/router": "^0.13.0",
52
54
  "solid-js": "^1.8.0"
53
55
  }
54
56
  }