@xmachines/play-solid-router 2.0.0-alpha.1 → 2.1.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@xmachines/play-solid-router",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.1.0",
4
4
  "description": "SolidJS Router adapter for XMachines Universal Player Architecture",
5
5
  "license": "MIT",
6
6
  "author": "XMachines Contributors",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+ssh://git@gitlab.com/xmachin-es/xmachines-js.git",
9
+ "url": "git+https://gitlab.com/xmachin-es/xmachines-js.git",
10
10
  "directory": "packages/play-solid-router"
11
11
  },
12
12
  "files": [
@@ -15,54 +15,54 @@
15
15
  "LICENSE"
16
16
  ],
17
17
  "type": "module",
18
+ "sideEffects": false,
18
19
  "main": "./dist/index.js",
19
20
  "types": "./dist/index.d.ts",
20
21
  "exports": {
21
22
  ".": {
22
- "source": "./src/index.ts",
23
23
  "types": "./dist/index.d.ts",
24
24
  "default": "./dist/index.js"
25
- }
25
+ },
26
+ "./package.json": "./package.json"
26
27
  },
27
28
  "publishConfig": {
28
29
  "access": "public"
29
30
  },
30
31
  "scripts": {
31
- "build": "tsc --build",
32
+ "build": "vite build && tsc --build",
32
33
  "lint": "oxlint .",
33
34
  "format": "oxfmt .",
34
35
  "test": "vitest",
36
+ "test:coverage": "vitest run --coverage",
35
37
  "test:watch": "vitest",
36
- "clean": "rm -rf dist *.tsbuildinfo coverage node_modules/.svelte2tsx-* node_modules/.vite*",
37
- "prepublishOnly": "npm run build"
38
+ "clean": "rm -rf dist *.tsbuildinfo coverage node_modules/.svelte2tsx-* node_modules/.vite*"
38
39
  },
39
40
  "dependencies": {
40
- "@xmachines/play": "2.0.0-alpha.1",
41
- "@xmachines/play-actor": "2.0.0-alpha.1",
42
- "@xmachines/play-router": "2.0.0-alpha.1",
43
- "@xmachines/play-signals": "2.0.0-alpha.1"
41
+ "@xmachines/play": "2.1.0",
42
+ "@xmachines/play-actor": "2.1.0",
43
+ "@xmachines/play-router": "2.1.0",
44
+ "@xmachines/play-signals": "2.1.0"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@solidjs/router": "^0.16.1",
47
48
  "@solidjs/testing-library": "^0.8.10",
48
49
  "@testing-library/jest-dom": "^6.9.1",
49
- "@types/node": "^26.1.1",
50
- "@vitest/browser-playwright": "^4.1.10",
51
- "@xmachines/play-router-shared": "2.0.0-alpha.1",
52
- "@xmachines/play-xstate": "2.0.0-alpha.1",
53
- "@xmachines/shared": "2.0.0-alpha.1",
50
+ "@types/node": "^26.2.0",
51
+ "@vitest/browser-playwright": "^4.1.11",
52
+ "@xmachines/play-xstate": "2.1.0",
54
53
  "jsdom": "^29.1.0",
55
- "oxfmt": "^0.58.0",
56
- "oxlint": "^1.73.0",
54
+ "oxfmt": "^0.64.0",
55
+ "oxlint": "^1.79.0",
57
56
  "solid-js": "^1.9.12",
57
+ "vite": "^8.0.10",
58
58
  "vite-plugin-solid": "^2.11.11",
59
- "vitest": "^4.1.10",
60
- "xstate": "^6.0.0-alpha.20"
59
+ "vitest": "^4.1.11",
60
+ "xstate": "^5.31.0"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@solidjs/router": "^0.16.1",
64
64
  "solid-js": "^1.8.0",
65
- "xstate": "^6.0.0-alpha.20"
65
+ "xstate": "^5.31.0"
66
66
  },
67
67
  "engines": {
68
68
  "node": ">=22.0.0"
@@ -1,45 +0,0 @@
1
- /**
2
- * createPlayRouterProvider — factory for Solid `PlayRouterProvider` components
3
- *
4
- * Captures the provider component shape used by this package's
5
- * `PlayRouterProvider` — create a bridge synchronously at component evaluation
6
- * time, `connect()` it, and `disconnect()` in `onCleanup` — so that Solid
7
- * bridges with the standard `(router, actor, routeMap)` constructor can be
8
- * wrapped in a provider with a single call. Only the bridge class (and
9
- * therefore the `router` prop type) differs between providers created by this
10
- * factory.
11
- *
12
- * @packageDocumentation
13
- */
14
- import { onCleanup } from "solid-js";
15
- /**
16
- * Create a Solid `PlayRouterProvider` component bound to a specific bridge class.
17
- *
18
- * The returned component connects a `PlayerActor` to the framework router,
19
- * keeping actor state and browser URL in sync bidirectionally.
20
- *
21
- * The bridge is created synchronously at component evaluation time (Solid's
22
- * execution model) and torn down via `onCleanup` when the component is disposed.
23
- * Unlike React, prop stability is not a concern — Solid's `props` accessor is
24
- * already reactive and the bridge is created once per component instance.
25
- *
26
- * @param BridgeCtor - Bridge class constructed as `new BridgeCtor(router, actor, routeMap)`.
27
- * @returns A `PlayRouterProvider` component, generic over the actor type so the
28
- * `renderer` callback receives the same concrete actor type that was passed in.
29
- *
30
- * @example
31
- * ```tsx
32
- * export const PlayRouterProvider = createPlayRouterProvider(MySolidRouterBridge);
33
- * ```
34
- */
35
- export function createPlayRouterProvider(BridgeCtor) {
36
- return function PlayRouterProvider(props) {
37
- const bridge = new BridgeCtor(props.router, props.actor, props.routeMap);
38
- void bridge.connect();
39
- onCleanup(() => {
40
- void bridge.disconnect();
41
- });
42
- return <>{props.renderer(props.actor, props.router)}</>;
43
- };
44
- }
45
- //# sourceMappingURL=create-play-router-provider.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-play-router-provider.jsx","sourceRoot":"","sources":["../src/create-play-router-provider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;AAkC/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,wBAAwB,CACvC,UAAgD;IAEhD,OAAO,SAAS,kBAAkB,CACjC,KAAmD;QAEnD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzE,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;QAEtB,SAAS,CAAC,GAAG,EAAE;YACd,KAAK,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;IACzD,CAAC,CAAC;AACH,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAO/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAK5E,OAAO,EACN,QAAQ,EACR,cAAc,GAGd,MAAM,wBAAwB,CAAC"}
@@ -1,41 +0,0 @@
1
- import { SolidRouterBridge } from "./solid-router-bridge.js";
2
- import { createPlayRouterProvider, } from "./create-play-router-provider.js";
3
- /**
4
- * Adapter binding `SolidRouterBridge`'s hook-argument constructor to the
5
- * `(router, actor, routeMap)` shape expected by `createPlayRouterProvider`.
6
- */
7
- class SolidHooksRouterBridge extends SolidRouterBridge {
8
- constructor(router, actor, routeMap) {
9
- super(router.navigate, router.location, router.params, actor, routeMap);
10
- }
11
- }
12
- /**
13
- * Connects a `PlayerActor` to Solid Router, keeping actor state and browser URL
14
- * in sync bidirectionally.
15
- *
16
- * The bridge is created synchronously at component evaluation time (Solid's
17
- * execution model) and torn down via `onCleanup` when the component is disposed.
18
- * Unlike React, prop stability is not a concern — Solid's `props` accessor is
19
- * already reactive and the bridge is created once per component instance.
20
- *
21
- * The `router` prop must be obtained from Solid Router hooks in the parent component:
22
- *
23
- * ```tsx
24
- * function AppShell() {
25
- * const navigate = useNavigate();
26
- * const location = useLocation();
27
- * const params = useParams();
28
- *
29
- * return (
30
- * <PlayRouterProvider
31
- * actor={actor}
32
- * routeMap={routeMap}
33
- * router={{ navigate, location, params }}
34
- * renderer={(a) => <PlayRenderer actor={a} registry={registry} />}
35
- * />
36
- * );
37
- * }
38
- * ```
39
- */
40
- export const PlayRouterProvider = createPlayRouterProvider(SolidHooksRouterBridge);
41
- //# sourceMappingURL=play-router-provider.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"play-router-provider.jsx","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACN,wBAAwB,GAExB,MAAM,kCAAkC,CAAC;AAwC1C;;;GAGG;AACH,MAAM,sBAAuB,SAAQ,iBAAiB;IACrD,YAAY,MAAwB,EAAE,KAAgB,EAAE,QAAkB;QACzE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzE,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,sBAAsB,CAAC,CAAC"}
package/dist/types.js DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Type definitions for @xmachines/play-solid-router
3
- */
4
- export {};
5
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}