@xmachines/play-sveltekit-router 3.0.0 → 5.0.0
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 +31 -45
- package/dist/connect-router.d.ts +4 -3
- package/dist/connect-router.d.ts.map +1 -1
- package/dist/connect-router.js +7 -5
- package/dist/connect-router.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/sveltekit-router-bridge.d.ts +2 -2
- package/dist/sveltekit-router-bridge.d.ts.map +1 -1
- package/dist/sveltekit-router-bridge.js.map +1 -1
- package/dist/types.d.ts +1 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -2,36 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
SvelteKit router adapter for the XMachines Universal Player Architecture. It keeps the state machine routes of a `RoutableActor` and the browser URL in step, in both directions, through the `$app/navigation` module of SvelteKit.
|
|
4
4
|
|
|
5
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-sveltekit-router)
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
pnpm add @xmachines/play-sveltekit-router
|
|
10
|
+
pnpm add @xmachines/play-sveltekit-router @xmachines/play-router
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
**Peer dependencies.** Install them separately:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
pnpm add @sveltejs/kit svelte
|
|
16
|
+
pnpm add @sveltejs/kit svelte
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
| Peer dependency | Required version |
|
|
20
20
|
| --------------- | ---------------- |
|
|
21
21
|
| `@sveltejs/kit` | `^2.0.0` |
|
|
22
22
|
| `svelte` | `^5.0.0` |
|
|
23
|
-
| `xstate` | `^5.31.0` |
|
|
24
23
|
|
|
25
24
|
## Quick Start
|
|
26
25
|
|
|
27
26
|
```typescript
|
|
28
27
|
import { onDestroy } from "svelte";
|
|
29
|
-
import { connectRouter
|
|
30
|
-
import {
|
|
28
|
+
import { connectRouter } from "@xmachines/play-sveltekit-router";
|
|
29
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
30
|
+
import { definePlayer, compose, PlayerActor } from "@xmachines/play-xstate";
|
|
31
|
+
import { withRouting } from "@xmachines/play-xstate/routing";
|
|
31
32
|
import { myMachine } from "./machine.js";
|
|
32
33
|
|
|
33
|
-
// 1. Create the actor
|
|
34
|
-
const createPlayer = definePlayer({ machine: myMachine });
|
|
34
|
+
// 1. Create the actor — `connectRouter` needs the routing capability
|
|
35
|
+
const createPlayer = definePlayer({ machine: myMachine, actor: compose(PlayerActor, withRouting) });
|
|
35
36
|
const actor = createPlayer();
|
|
36
37
|
actor.start();
|
|
37
38
|
|
|
@@ -48,7 +49,7 @@ onDestroy(() => disconnect());
|
|
|
48
49
|
The bridge works in both directions:
|
|
49
50
|
|
|
50
51
|
- **URL → actor:** the bridge converts each SvelteKit `afterNavigate` event into a `play.route` event, then sends it to the actor.
|
|
51
|
-
- **Actor → URL:** the bridge writes each change of the actor `currentRoute`
|
|
52
|
+
- **Actor → URL:** the bridge writes each change of the actor `currentRoute` atom to the browser URL with `goto()`.
|
|
52
53
|
|
|
53
54
|
## Usage
|
|
54
55
|
|
|
@@ -58,8 +59,8 @@ This function is the primary integration point. It creates a `SvelteKitRouterBri
|
|
|
58
59
|
|
|
59
60
|
```typescript
|
|
60
61
|
import { onDestroy } from "svelte";
|
|
61
|
-
import { connectRouter
|
|
62
|
-
|
|
62
|
+
import { connectRouter } from "@xmachines/play-sveltekit-router";
|
|
63
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
63
64
|
// machine and actor as in the Quick Start above
|
|
64
65
|
const routeMap = createRouteMap(machine);
|
|
65
66
|
|
|
@@ -87,11 +88,11 @@ onDestroy(() => disconnect());
|
|
|
87
88
|
|
|
88
89
|
### `SvelteKitRouterBridge` — low-level class
|
|
89
90
|
|
|
90
|
-
This class extends `RouterBridgeBase` from `@xmachines/play-router
|
|
91
|
+
This class extends `RouterBridgeBase` from [`@xmachines/play-router`](../play-router/README.md). Use it directly when you need more control over the connection lifecycle.
|
|
91
92
|
|
|
92
93
|
```typescript
|
|
93
|
-
import { SvelteKitRouterBridge
|
|
94
|
-
|
|
94
|
+
import { SvelteKitRouterBridge } from "@xmachines/play-sveltekit-router";
|
|
95
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
95
96
|
// machine and actor as in the Quick Start above
|
|
96
97
|
const routeMap = createRouteMap(machine);
|
|
97
98
|
const bridge = new SvelteKitRouterBridge(actor, routeMap, location);
|
|
@@ -107,12 +108,12 @@ bridge.disconnect();
|
|
|
107
108
|
- `watchRouterChanges` → registers an `afterNavigate` callback through an indirection cell, which prevents a direct capture of `this`
|
|
108
109
|
- `unwatchRouterChanges` → sets the indirection cell to null, which releases the bridge reference before the component unmounts (SvelteKit has no API to cancel `afterNavigate`)
|
|
109
110
|
|
|
110
|
-
### `createRouteMap(machine)`
|
|
111
|
+
### `createRouteMap(machine)` — from `@xmachines/play-router/xstate`
|
|
111
112
|
|
|
112
|
-
This factory builds a `RouteMap` from an XState machine definition. It reads each route pattern from `state.meta.route`.
|
|
113
|
+
This factory builds a `RouteMap` from an XState machine definition. It reads each route pattern from `state.meta.route`. This package re-exports it never: the barrel names no state machine, so import the function from [`@xmachines/play-router/xstate`](../play-router/README.md).
|
|
113
114
|
|
|
114
115
|
```typescript
|
|
115
|
-
import { createRouteMap } from "@xmachines/play-
|
|
116
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
116
117
|
import { createMachine } from "xstate";
|
|
117
118
|
|
|
118
119
|
const machine = createMachine({
|
|
@@ -130,7 +131,7 @@ const routeMap = createRouteMap(machine);
|
|
|
130
131
|
|
|
131
132
|
### `RouteMap` / `RouteMapping`
|
|
132
133
|
|
|
133
|
-
The bidirectional map between the state IDs and the URL paths. It comes from `@xmachines/play-router
|
|
134
|
+
The bidirectional map between the state IDs and the URL paths. It comes from [`@xmachines/play-router`](../play-router/README.md).
|
|
134
135
|
|
|
135
136
|
```typescript
|
|
136
137
|
import { RouteMap } from "@xmachines/play-sveltekit-router";
|
|
@@ -146,19 +147,18 @@ const routeMap = new RouteMap([
|
|
|
146
147
|
|
|
147
148
|
### Exported symbols
|
|
148
149
|
|
|
149
|
-
| Export | Kind | Description
|
|
150
|
-
| ----------------------- | -------- |
|
|
151
|
-
| `connectRouter` | function | High-level factory — connects the SvelteKit router to an actor, returns a cleanup function
|
|
152
|
-
| `SvelteKitRouterBridge` | class | The low-level bridge class. It extends `RouterBridgeBase`. Use it directly for full lifecycle control
|
|
153
|
-
| `ConnectRouterOptions` | type | The options object for `connectRouter`
|
|
154
|
-
| `
|
|
155
|
-
| `
|
|
156
|
-
| `
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
160
|
-
| `
|
|
161
|
-
| `RoutableActor` | type | Minimal actor interface from `@xmachines/play-router` — `currentRoute`, `initialRoute`, `send(PlayRouteEvent)` |
|
|
150
|
+
| Export | Kind | Description |
|
|
151
|
+
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
152
|
+
| `connectRouter` | function | High-level factory — connects the SvelteKit router to an actor, returns a cleanup function |
|
|
153
|
+
| `SvelteKitRouterBridge` | class | The low-level bridge class. It extends `RouterBridgeBase`. Use it directly for full lifecycle control |
|
|
154
|
+
| `ConnectRouterOptions` | type | The options object for `connectRouter` |
|
|
155
|
+
| `RouteMap` | class | Bidirectional state ID ↔ URL path mapping (re-exported from [`@xmachines/play-router`](../play-router/README.md)) |
|
|
156
|
+
| `RouteMapping` | type | Single `{ stateId, path }` entry for `RouteMap` construction |
|
|
157
|
+
| `RouteMapOptions` | type | Options for `RouteMap` construction |
|
|
158
|
+
| `LocationLike` | type | Minimal `{ pathname, search }` interface for location stubs |
|
|
159
|
+
| `PlayRouteEvent` | type | The event that the bridge sends to the actor on a URL change (`{ type: "play.route", to, params?, query? }`) |
|
|
160
|
+
| `RouterBridge` | type | The interface that `SvelteKitRouterBridge` implements |
|
|
161
|
+
| `RoutableActor` | type | Minimal actor interface from [`@xmachines/play-router`](../play-router/README.md) — `currentRoute`, `initialRoute`, `send(PlayRouteEvent)` |
|
|
162
162
|
|
|
163
163
|
## Demo
|
|
164
164
|
|
|
@@ -171,20 +171,6 @@ pnpm --filter @xmachines/play-sveltekit-router-demo run dev
|
|
|
171
171
|
|
|
172
172
|
Then open `http://localhost:5173`.
|
|
173
173
|
|
|
174
|
-
## Testing
|
|
175
|
-
|
|
176
|
-
Run tests for this package in isolation:
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
# From the monorepo root
|
|
180
|
-
pnpm --filter @xmachines/play-sveltekit-router test
|
|
181
|
-
|
|
182
|
-
# Or from this package directory
|
|
183
|
-
pnpm test
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Coverage thresholds: **80%** lines, functions, branches, and statements.
|
|
187
|
-
|
|
188
174
|
## License
|
|
189
175
|
|
|
190
176
|
MIT — see [LICENSE](LICENSE).
|
package/dist/connect-router.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type RouterConnection } from "@xmachines/play-router";
|
|
2
|
-
import type {
|
|
3
|
-
export interface ConnectRouterOptions extends
|
|
2
|
+
import type { RouterBridgeOptions, RoutableActor, RouteMap, LocationLike } from "@xmachines/play-router";
|
|
3
|
+
export interface ConnectRouterOptions extends RouterBridgeOptions {
|
|
4
4
|
readonly actor: RoutableActor;
|
|
5
5
|
readonly routeMap: RouteMap;
|
|
6
6
|
/**
|
|
@@ -17,7 +17,8 @@ export interface ConnectRouterOptions extends BasePathOptions {
|
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```typescript
|
|
20
|
-
* import { connectRouter
|
|
20
|
+
* import { connectRouter } from '@xmachines/play-sveltekit-router';
|
|
21
|
+
* import { createRouteMap } from '@xmachines/play-router/xstate';
|
|
21
22
|
* const routeMap = createRouteMap(machine);
|
|
22
23
|
* const disconnect = connectRouter({ actor, routeMap });
|
|
23
24
|
* onDestroy(() => disconnect());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-router.d.ts","sourceRoot":"","sources":["../src/connect-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,KAAK,EACX,
|
|
1
|
+
{"version":3,"file":"connect-router.d.ts","sourceRoot":"","sources":["../src/connect-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,KAAK,EACX,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAChE,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,gBAAgB,CAQ7E"}
|
package/dist/connect-router.js
CHANGED
|
@@ -7,17 +7,19 @@ import { SvelteKitRouterBridge } from "./sveltekit-router-bridge.js";
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
|
-
* import { connectRouter
|
|
10
|
+
* import { connectRouter } from '@xmachines/play-sveltekit-router';
|
|
11
|
+
* import { createRouteMap } from '@xmachines/play-router/xstate';
|
|
11
12
|
* const routeMap = createRouteMap(machine);
|
|
12
13
|
* const disconnect = connectRouter({ actor, routeMap });
|
|
13
14
|
* onDestroy(() => disconnect());
|
|
14
15
|
* ```
|
|
15
16
|
*/
|
|
16
17
|
export function connectRouter(options) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
// The REST travels whole, exactly as `openProviderBridge` hands it on. A hand-written
|
|
19
|
+
// list of the bridge options dropped every cache of the caller in silence there, and
|
|
20
|
+
// it would drop whatever a later release adds here.
|
|
21
|
+
const { actor, routeMap, location: loc, ...bridgeOptions } = options;
|
|
22
|
+
const bridge = new SvelteKitRouterBridge(actor, routeMap, loc, bridgeOptions);
|
|
21
23
|
bridge.connect();
|
|
22
24
|
return createRouterConnection(bridge);
|
|
23
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-router.js","sourceRoot":"","sources":["../src/connect-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,wBAAwB,CAAC;AAOvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAarE
|
|
1
|
+
{"version":3,"file":"connect-router.js","sourceRoot":"","sources":["../src/connect-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,wBAAwB,CAAC;AAOvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAarE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IAC1D,sFAAsF;IACtF,qFAAqF;IACrF,oDAAoD;IACpD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IACrE,MAAM,MAAM,GAAG,IAAI,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC;IAC9E,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @xmachines/play-sveltekit-router - SvelteKit router adapter for XMachines Play
|
|
3
3
|
*/
|
|
4
|
-
export { RouteMap,
|
|
4
|
+
export { RouteMap, type RouteMapping, type RouteMapOptions } from "@xmachines/play-router";
|
|
5
5
|
export { SvelteKitRouterBridge } from "./sveltekit-router-bridge.js";
|
|
6
6
|
export { connectRouter } from "./connect-router.js";
|
|
7
7
|
export type { BasePathOptions, RouterConnection } from "@xmachines/play-router";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @xmachines/play-sveltekit-router - SvelteKit router adapter for XMachines Play
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
// This barrel names NO state machine. `createRouteMap` and `extractMachineRoutes`
|
|
5
|
+
// read an XState machine, and they live in `@xmachines/play-router/xstate`, where
|
|
6
|
+
// `xstate` is an OPTIONAL peer. A re-export here loads that module for every
|
|
7
|
+
// consumer of this package, and the import fails when the consumer installed no
|
|
8
|
+
// `xstate`. Import those two from `@xmachines/play-router/xstate` directly.
|
|
9
|
+
export { RouteMap } from "@xmachines/play-router";
|
|
5
10
|
export { SvelteKitRouterBridge } from "./sveltekit-router-bridge.js";
|
|
6
11
|
export { connectRouter } from "./connect-router.js";
|
|
7
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,kFAAkF;AAClF,kFAAkF;AAClF,6EAA6E;AAC7E,gFAAgF;AAChF,4EAA4E;AAE5E,OAAO,EAAE,QAAQ,EAA2C,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RouterBridgeBase } from "@xmachines/play-router";
|
|
2
2
|
import type { LocationLike, RouteMap } from "@xmachines/play-router";
|
|
3
3
|
import type { RoutableActor } from "@xmachines/play-router";
|
|
4
|
-
import type {
|
|
4
|
+
import type { RouterBridgeOptions } from "@xmachines/play-router";
|
|
5
5
|
/**
|
|
6
6
|
* The SvelteKit router bridge — it connects the SvelteKit navigation to RouterBridgeBase.
|
|
7
7
|
*
|
|
@@ -39,7 +39,7 @@ export declare class SvelteKitRouterBridge extends RouterBridgeBase {
|
|
|
39
39
|
* callback registry of SvelteKit untouched.
|
|
40
40
|
*/
|
|
41
41
|
private afterNavigateCell;
|
|
42
|
-
constructor(actor: RoutableActor, routeMap: RouteMap, loc?: LocationLike | null, options?:
|
|
42
|
+
constructor(actor: RoutableActor, routeMap: RouteMap, loc?: LocationLike | null, options?: RouterBridgeOptions);
|
|
43
43
|
/**
|
|
44
44
|
* Pushes a RESOLVED concrete URL path through the SvelteKit `goto` function.
|
|
45
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sveltekit-router-bridge.d.ts","sourceRoot":"","sources":["../src/sveltekit-router-bridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sveltekit-router-bridge.d.ts","sourceRoot":"","sources":["../src/sveltekit-router-bridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAclE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsB;IAE1C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,iBAAiB,CAAsC;gBAG9D,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,EAClB,GAAG,GAAE,YAAY,GAAG,IAAmE,EACvF,OAAO,CAAC,EAAE,mBAAmB;IAM9B;;;;;;OAMG;IACH,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI5C,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAmBpC;;;;;;;OAOG;IACH,SAAS,CAAC,oBAAoB,IAAI,IAAI;cAOnB,oBAAoB,IAAI,MAAM,GAAG,IAAI;cAIrC,sBAAsB,IAAI,MAAM,GAAG,SAAS;CAG/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sveltekit-router-bridge.js","sourceRoot":"","sources":["../src/sveltekit-router-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAiB1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,qBAAsB,SAAQ,gBAAgB;IACzC,GAAG,CAAsB;IAE1C;;;;;;;;;;;OAWG;IACK,iBAAiB,GAAiC,IAAI,CAAC;IAE/D,YACC,KAAoB,EACpB,QAAkB,EAClB,MAA4B,UAA0C,CAAC,QAAQ,IAAI,IAAI,EACvF,
|
|
1
|
+
{"version":3,"file":"sveltekit-router-bridge.js","sourceRoot":"","sources":["../src/sveltekit-router-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAiB1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,qBAAsB,SAAQ,gBAAgB;IACzC,GAAG,CAAsB;IAE1C;;;;;;;;;;;OAWG;IACK,iBAAiB,GAAiC,IAAI,CAAC;IAE/D,YACC,KAAoB,EACpB,QAAkB,EAClB,MAA4B,UAA0C,CAAC,QAAQ,IAAI,IAAI,EACvF,OAA6B;QAE7B,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACO,cAAc,CAAC,IAAY;QACpC,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAES,kBAAkB;QAC3B,iFAAiF;QACjF,iFAAiF;QACjF,0CAA0C;QAC1C,MAAM,IAAI,GAA0B,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACrD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAE9B,aAAa,CAAC,CAAC,UAAU,EAAE,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI,CAAC,MAAM;gBAAE,OAAO;YAEpB,MAAM,GAAG,GAAG,UAAU,CAAC,EAAE,EAAE,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC;YAC7C,oBAAoB;YACpB,IAAI,CAAC,GAAG;gBAAE,OAAO;YAEjB,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACO,oBAAoB;QAC7B,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;YACrC,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,IAAI,CAAC;YACrC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC/B,CAAC;IACF,CAAC;IAEkB,oBAAoB;QACtC,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,IAAI,IAAI,CAAC;IACnC,CAAC;IAEkB,sBAAsB;QACxC,OAAO,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,SAAS,CAAC;IACtC,CAAC;CACD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The type definitions of @xmachines/play-sveltekit-router
|
|
3
3
|
*/
|
|
4
|
-
import type { AbstractActor, Routable } from "@xmachines/play-actor";
|
|
5
|
-
import type { AnyActorLogic } from "xstate";
|
|
6
4
|
export type { PlayRouteEvent, RouterBridge } from "@xmachines/play-router";
|
|
7
|
-
export type RoutableActor
|
|
5
|
+
export type { RoutableActor } from "@xmachines/play-router";
|
|
8
6
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3E,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-sveltekit-router",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "SvelteKit router adapter for XMachines Universal Player Architecture",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -40,38 +40,38 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "vite build && tsc --build",
|
|
42
42
|
"lint": "oxlint .",
|
|
43
|
+
"lint:security": "node ../../scripts/semgrep-scan.mjs",
|
|
43
44
|
"format": "oxfmt .",
|
|
44
45
|
"test": "vitest",
|
|
45
46
|
"test:coverage": "vitest run --coverage",
|
|
46
47
|
"clean": "rm -rf dist *.tsbuildinfo coverage .vitest-attachments node_modules/.svelte2tsx-* node_modules/.vite*"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@xmachines/play": "
|
|
50
|
-
"@xmachines/play-actor": "3.0.0",
|
|
51
|
-
"@xmachines/play-router": "3.0.0",
|
|
52
|
-
"@xmachines/play-signals": "3.0.0"
|
|
50
|
+
"@xmachines/play-router": "5.0.0"
|
|
53
51
|
},
|
|
54
52
|
"devDependencies": {
|
|
55
|
-
"@sveltejs/kit": "^2.70.
|
|
56
|
-
"@sveltejs/vite-plugin-svelte": "^7.
|
|
57
|
-
"@testing-library/jest-dom": "^
|
|
58
|
-
"@types/node": "^26.2
|
|
59
|
-
"@vitest/browser-playwright": "^
|
|
60
|
-
"@xmachines/play
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"svelte": "
|
|
53
|
+
"@sveltejs/kit": "^2.70.3",
|
|
54
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
55
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
56
|
+
"@types/node": "^26.6.2",
|
|
57
|
+
"@vitest/browser-playwright": "^5.0.1",
|
|
58
|
+
"@xmachines/play": "5.0.0",
|
|
59
|
+
"@xmachines/play-actor": "5.0.0",
|
|
60
|
+
"@xmachines/play-atom": "5.0.0",
|
|
61
|
+
"@xmachines/play-svelte": "5.0.0",
|
|
62
|
+
"oxfmt": "^0.70.0",
|
|
63
|
+
"oxlint": "^1.85.0",
|
|
64
|
+
"svelte": "^5.57.0",
|
|
64
65
|
"typescript": "^5.9.3 || ^6.0.3",
|
|
65
|
-
"vite": "^8.0
|
|
66
|
-
"vitest": "^
|
|
67
|
-
"xstate": "^5.
|
|
66
|
+
"vite": "^8.3.0",
|
|
67
|
+
"vitest": "^5.0.1",
|
|
68
|
+
"xstate": "^5.33.0"
|
|
68
69
|
},
|
|
69
70
|
"peerDependencies": {
|
|
70
71
|
"@sveltejs/kit": "^2.0.0",
|
|
71
|
-
"svelte": "^5.0.0"
|
|
72
|
-
"xstate": "^5.31.0"
|
|
72
|
+
"svelte": "^5.0.0"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
|
-
"node": ">=
|
|
75
|
+
"node": ">=24.0.0"
|
|
76
76
|
}
|
|
77
77
|
}
|