@xmachines/play-solid-router 1.0.0-beta.9 → 1.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/LICENSE +21 -0
- package/README.md +140 -557
- package/dist/create-play-router-provider.d.ts +62 -0
- package/dist/create-play-router-provider.d.ts.map +1 -0
- package/dist/create-play-router-provider.jsx +45 -0
- package/dist/create-play-router-provider.jsx.map +1 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/play-router-provider.d.ts +69 -17
- package/dist/play-router-provider.d.ts.map +1 -1
- package/dist/play-router-provider.jsx +38 -8
- package/dist/play-router-provider.jsx.map +1 -1
- package/dist/solid-router-bridge.d.ts +55 -13
- package/dist/solid-router-bridge.d.ts.map +1 -1
- package/dist/solid-router-bridge.js +71 -15
- package/dist/solid-router-bridge.js.map +1 -1
- package/dist/types.d.ts +0 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +29 -15
- package/dist/create-route-map.d.ts +0 -25
- package/dist/create-route-map.d.ts.map +0 -1
- package/dist/create-route-map.js +0 -36
- package/dist/create-route-map.js.map +0 -1
- package/dist/route-map.d.ts +0 -27
- package/dist/route-map.d.ts.map +0 -1
- package/dist/route-map.js +0 -27
- package/dist/route-map.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-solid-router",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.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@gitlab.com
|
|
9
|
+
"url": "git+ssh://git@gitlab.com/xmachin-es/xmachines-js.git",
|
|
10
10
|
"directory": "packages/play-solid-router"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
+
"source": "./src/index.ts",
|
|
22
23
|
"types": "./dist/index.d.ts",
|
|
23
24
|
"default": "./dist/index.js"
|
|
24
25
|
}
|
|
@@ -28,29 +29,42 @@
|
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
30
31
|
"build": "tsc --build",
|
|
32
|
+
"lint": "oxlint .",
|
|
33
|
+
"format": "oxfmt .",
|
|
31
34
|
"test": "vitest",
|
|
32
35
|
"test:watch": "vitest",
|
|
33
|
-
"
|
|
34
|
-
"clean": "rm -rf dist *.tsbuildinfo node_modules/.vite node_modules/.vite-temp",
|
|
36
|
+
"clean": "rm -rf dist *.tsbuildinfo coverage node_modules/.svelte2tsx-* node_modules/.vite*",
|
|
35
37
|
"prepublishOnly": "npm run build"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@xmachines/play": "1.0.0
|
|
39
|
-
"@xmachines/play-actor": "1.0.0
|
|
40
|
-
"@xmachines/play-router": "1.0.0
|
|
41
|
-
"@xmachines/play-signals": "1.0.0
|
|
40
|
+
"@xmachines/play": "1.0.0",
|
|
41
|
+
"@xmachines/play-actor": "1.0.0",
|
|
42
|
+
"@xmachines/play-router": "1.0.0",
|
|
43
|
+
"@xmachines/play-signals": "1.0.0"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@solidjs/router": "^0.
|
|
46
|
+
"@solidjs/router": "^0.16.1",
|
|
45
47
|
"@solidjs/testing-library": "^0.8.10",
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
+
"@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": "1.0.0",
|
|
52
|
+
"@xmachines/play-xstate": "1.0.0",
|
|
53
|
+
"@xmachines/shared": "1.0.0",
|
|
54
|
+
"jsdom": "^29.1.0",
|
|
55
|
+
"oxfmt": "^0.58.0",
|
|
56
|
+
"oxlint": "^1.73.0",
|
|
57
|
+
"solid-js": "^1.9.12",
|
|
48
58
|
"vite-plugin-solid": "^2.11.11",
|
|
49
|
-
"vitest": "^4.1.
|
|
50
|
-
"xstate": "^5.
|
|
59
|
+
"vitest": "^4.1.10",
|
|
60
|
+
"xstate": "^5.31.0"
|
|
51
61
|
},
|
|
52
62
|
"peerDependencies": {
|
|
53
|
-
"@solidjs/router": "^0.
|
|
54
|
-
"solid-js": "^1.8.0"
|
|
63
|
+
"@solidjs/router": "^0.16.1",
|
|
64
|
+
"solid-js": "^1.8.0",
|
|
65
|
+
"xstate": "^5.31.0"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=22.0.0"
|
|
55
69
|
}
|
|
56
70
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create RouteMap helper for SolidJS Router adapter
|
|
3
|
-
*
|
|
4
|
-
* Simplifies demo code by hiding route extraction complexity.
|
|
5
|
-
* Internally calls extractMachineRoutes() and getRoutableRoutes(),
|
|
6
|
-
* then constructs RouteMap with proper state ID ↔ path mappings.
|
|
7
|
-
*/
|
|
8
|
-
import type { AnyStateMachine } from "xstate";
|
|
9
|
-
import { RouteMap } from "./route-map.js";
|
|
10
|
-
/**
|
|
11
|
-
* Create a RouteMap from an XState machine
|
|
12
|
-
*
|
|
13
|
-
* @param machine - XState machine with route: {} config on states
|
|
14
|
-
* @returns RouteMap for bidirectional state ID ↔ path resolution
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { createRouteMap } from '@xmachines/play-solid-router';
|
|
19
|
-
* import { authMachine } from './machine.js';
|
|
20
|
-
*
|
|
21
|
-
* const routeMap = createRouteMap(authMachine);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function createRouteMap(machine: AnyStateMachine): RouteMap;
|
|
25
|
-
//# sourceMappingURL=create-route-map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-route-map.d.ts","sourceRoot":"","sources":["../src/create-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAcjE"}
|
package/dist/create-route-map.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create RouteMap helper for SolidJS Router adapter
|
|
3
|
-
*
|
|
4
|
-
* Simplifies demo code by hiding route extraction complexity.
|
|
5
|
-
* Internally calls extractMachineRoutes() and getRoutableRoutes(),
|
|
6
|
-
* then constructs RouteMap with proper state ID ↔ path mappings.
|
|
7
|
-
*/
|
|
8
|
-
import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router";
|
|
9
|
-
import { RouteMap } from "./route-map.js";
|
|
10
|
-
/**
|
|
11
|
-
* Create a RouteMap from an XState machine
|
|
12
|
-
*
|
|
13
|
-
* @param machine - XState machine with route: {} config on states
|
|
14
|
-
* @returns RouteMap for bidirectional state ID ↔ path resolution
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { createRouteMap } from '@xmachines/play-solid-router';
|
|
19
|
-
* import { authMachine } from './machine.js';
|
|
20
|
-
*
|
|
21
|
-
* const routeMap = createRouteMap(authMachine);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export function createRouteMap(machine) {
|
|
25
|
-
// Extract route tree from machine
|
|
26
|
-
const routeTree = extractMachineRoutes(machine);
|
|
27
|
-
// Get only routable nodes (states with route: {} config)
|
|
28
|
-
const routes = getRoutableRoutes(routeTree);
|
|
29
|
-
// Map to RouteMapping format expected by RouteMap constructor
|
|
30
|
-
const mappings = routes.map((node) => ({
|
|
31
|
-
stateId: node.stateId,
|
|
32
|
-
path: node.fullPath,
|
|
33
|
-
}));
|
|
34
|
-
return new RouteMap(mappings);
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=create-route-map.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-route-map.js","sourceRoot":"","sources":["../src/create-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,OAAwB;IACtD,kCAAkC;IAClC,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEhD,yDAAyD;IACzD,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAE5C,8DAA8D;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACtC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,IAAI,CAAC,QAAQ;KACnB,CAAC,CAAC,CAAC;IAEJ,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/route-map.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bidirectional route mapper for SolidJS Router.
|
|
3
|
-
*
|
|
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
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
import { BaseRouteMap } from "@xmachines/play-router";
|
|
25
|
-
export declare class RouteMap extends BaseRouteMap {
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=route-map.d.ts.map
|
package/dist/route-map.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bidirectional route mapper for SolidJS Router.
|
|
3
|
-
*
|
|
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
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
import { BaseRouteMap } from "@xmachines/play-router";
|
|
25
|
-
export class RouteMap extends BaseRouteMap {
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=route-map.js.map
|
package/dist/route-map.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|