@xmachines/docs 1.0.0-beta.46 → 1.0.0-beta.48
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 +135 -7
- package/api/@xmachines/play/README.md +134 -57
- package/api/@xmachines/play/classes/NonNullableError.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +130 -155
- package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
- package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-dom/README.md +140 -232
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
- package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +13 -13
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +6 -6
- package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +4 -4
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +12 -12
- package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +5 -5
- package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +5 -5
- package/api/@xmachines/play-dom/type-aliases/ActionFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/Actions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +7 -7
- package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomSchema.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/SetState.md +1 -1
- package/api/@xmachines/play-dom/variables/schema.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +160 -158
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-react/README.md +109 -320
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +107 -124
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +23 -23
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/README.md +235 -475
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +23 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMatcher.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatcher.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/README.md +105 -73
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +117 -263
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +93 -606
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-svelte/README.md +111 -103
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-svelte/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/README.md +156 -17
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +168 -17
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +147 -122
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +23 -23
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +195 -173
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +24 -24
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +3 -3
- package/api/@xmachines/play-vue/README.md +126 -271
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +148 -528
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +24 -24
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +167 -496
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +12 -12
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/README.md +81 -294
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/examples/@xmachines/play-dom-demo/README.md +3 -3
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-dom-router-demo/README.md +2 -2
- package/examples/@xmachines/play-react-demo/README.md +1 -1
- package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-react-router-demo/README.md +1 -1
- package/examples/@xmachines/play-solid-demo/README.md +1 -1
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/README.md +1 -1
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-spa-router-demo/README.md +2 -2
- package/examples/@xmachines/play-sveltekit-router-demo/README.md +2 -2
- package/examples/@xmachines/play-vue-demo/README.md +1 -1
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
- package/examples/README.md +24 -25
- package/examples/form-validation.md +2 -2
- package/guides/README.md +7 -7
- package/guides/actor-model.md +18 -18
- package/guides/architecture.md +500 -0
- package/guides/configuration.md +556 -0
- package/guides/deployment.md +336 -0
- package/guides/development.md +617 -0
- package/guides/getting-started.md +351 -142
- package/guides/signals.md +19 -19
- package/guides/state-machines.md +16 -16
- package/guides/testing.md +460 -0
- package/package.json +5 -5
- package/guides/installation.md +0 -257
package/README.md
CHANGED
|
@@ -1,15 +1,143 @@
|
|
|
1
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
+
|
|
1
3
|
# @xmachines/docs
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> Documentation, guides, RFCs, and generated API reference for XMachines.
|
|
6
|
+
|
|
7
|
+
Part of the `XMachines Play monorepo`.
|
|
8
|
+
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
10
|
+
[](https://www.npmjs.com/package/@xmachines/docs)
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
`@xmachines/docs` is the documentation package for the XMachines Play monorepo. It ships five categories of content:
|
|
4
15
|
|
|
5
|
-
|
|
16
|
+
| Location | Contents |
|
|
17
|
+
| ----------- | ---------------------------------------------------------------- |
|
|
18
|
+
| `rfc/` | Request-for-Comment specs that define the XMachines architecture |
|
|
19
|
+
| `guides/` | Concept guides, tutorials, operational docs, and architecture |
|
|
20
|
+
| `examples/` | Runnable code examples and demo application references |
|
|
21
|
+
| `api/` | TypeDoc-generated API reference for all public packages |
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @xmachines/docs
|
|
27
|
+
```
|
|
6
28
|
|
|
7
29
|
## Usage
|
|
8
30
|
|
|
9
|
-
|
|
31
|
+
### Import the package URL
|
|
32
|
+
|
|
33
|
+
The package default export is its own module URL — useful for resolving doc assets at runtime:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import docsUrl from "@xmachines/docs";
|
|
37
|
+
// docsUrl is the resolved URL of the docs package entry point
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Access documentation files directly
|
|
41
|
+
|
|
42
|
+
All documentation directories are exposed as package exports:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// Access RFC files
|
|
46
|
+
import playRfc from "@xmachines/docs/rfc/play.md";
|
|
47
|
+
|
|
48
|
+
// Access guide files
|
|
49
|
+
import gettingStarted from "@xmachines/docs/guides/getting-started.md";
|
|
50
|
+
|
|
51
|
+
// Access example files
|
|
52
|
+
import basicExample from "@xmachines/docs/examples/basic-state-machine.md";
|
|
53
|
+
|
|
54
|
+
// Access API reference
|
|
55
|
+
import apiDocs from "@xmachines/docs/api/README.md";
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Contents
|
|
59
|
+
|
|
60
|
+
### RFCs
|
|
61
|
+
|
|
62
|
+
Architectural specifications that define the XMachines system:
|
|
63
|
+
|
|
64
|
+
| File | Title | Description |
|
|
65
|
+
| ---------------------------------- | ------- | -------------------------------------------------------------------- |
|
|
66
|
+
| [`rfc/play.md`](rfc/play.md) | Play | Universal Player Architecture — core protocol, roles, and invariants |
|
|
67
|
+
| [`rfc/streams.md`](rfc/streams.md) | Streams | WHATWG Streams as integration boundary |
|
|
68
|
+
| [`rfc/broker.md`](rfc/broker.md) | Broker | Event broker specification |
|
|
69
|
+
| [`rfc/git.md`](rfc/git.md) | Git | Git-compatible ID and history model |
|
|
70
|
+
| [`rfc/run.md`](rfc/run.md) | Run | Runtime execution model |
|
|
71
|
+
| [`rfc/browser.md`](rfc/browser.md) | Browser | Browser environment adapter |
|
|
72
|
+
| [`rfc/node.md`](rfc/node.md) | Node | Node.js environment adapter |
|
|
73
|
+
| [`rfc/cli.md`](rfc/cli.md) | CLI | Command-line interface specification |
|
|
74
|
+
| [`rfc/rest.md`](rfc/rest.md) | REST | REST adapter specification |
|
|
75
|
+
| [`rfc/mcp.md`](rfc/mcp.md) | MCP | Model Context Protocol adapter |
|
|
76
|
+
|
|
77
|
+
### Guides
|
|
78
|
+
|
|
79
|
+
Concept guides, tutorials, and operational docs for working with XMachines:
|
|
80
|
+
|
|
81
|
+
**Learning:**
|
|
82
|
+
|
|
83
|
+
- **[Installation](guides/installation.md)** — Core packages, framework-specific additions, TypeScript config, ESM setup
|
|
84
|
+
- **[Getting Started](guides/getting-started.md)** — `setup().createMachine()` → `definePlayer()` → `actor.start()` → TC39 Signals
|
|
85
|
+
- **[Understanding State Machines](guides/state-machines.md)** — `meta.route`, `meta.view`, and why machines replace boolean flags
|
|
86
|
+
- **[Understanding the Actor Model](guides/actor-model.md)** — Actor/infrastructure split, `AbstractActor`, and the reset invariant
|
|
87
|
+
- **[Understanding TC39 Signals](guides/signals.md)** — Signal primitives and the five architectural invariants they enforce
|
|
88
|
+
|
|
89
|
+
**Development & Operations:**
|
|
90
|
+
|
|
91
|
+
- **[Architecture](guides/architecture.md)** — Package layers, data flows, key abstractions, TypeScript build graph
|
|
92
|
+
- **[Configuration](guides/configuration.md)** — TypeScript, linting, formatting, Vitest, CI/CD, and release configuration
|
|
93
|
+
- **[Development](guides/development.md)** — Monorepo setup, build system, adding packages, code conventions
|
|
94
|
+
- **[Testing](guides/testing.md)** — Vitest setup, node vs browser modes, test patterns, coverage requirements
|
|
95
|
+
- **[Deployment](guides/deployment.md)** — npm publishing, semantic-release process, GitLab CI pipeline
|
|
96
|
+
|
|
97
|
+
### Examples
|
|
98
|
+
|
|
99
|
+
Practical code examples demonstrating XMachines patterns:
|
|
100
|
+
|
|
101
|
+
- **[Basic State Machine](examples/basic-state-machine.md)** — `setup().createMachine()` + `definePlayer()` + TC39 Signals
|
|
102
|
+
- **[Traffic Light](examples/traffic-light.md)** — Multi-state machine with `meta.route` and `formatPlayRouteTransitions`
|
|
103
|
+
- **[Form Validation](examples/form-validation.md)** — Typed context mutations with `setup.assign`, guards, and `$bindState`
|
|
104
|
+
- **[Routing Patterns](examples/routing-patterns.md)** — `meta.route`, `play.route` events, `always` auth guards
|
|
105
|
+
- **[Multi-Router Integration](examples/multi-router-integration.md)** — All 8 router adapters
|
|
106
|
+
|
|
107
|
+
### API Reference
|
|
108
|
+
|
|
109
|
+
TypeDoc-generated API reference for all public packages — see [`api/README.md`](api/README.md).
|
|
110
|
+
|
|
111
|
+
Packages documented:
|
|
112
|
+
|
|
113
|
+
- [`@xmachines/play`](../play/README.md) — Core protocols (`PlayEvent`, `PlayError`)
|
|
114
|
+
- [`@xmachines/play-actor`](../play-actor/README.md) — `AbstractActor`, `Routable`, `Viewable`
|
|
115
|
+
- [`@xmachines/play-signals`](../play-signals/README.md) — TC39 Signals polyfill, `watchSignal`
|
|
116
|
+
- [`@xmachines/play-router`](../play-router/README.md) — `extractMachineRoutes`, `RouterBridgeBase`
|
|
117
|
+
- [`@xmachines/play-xstate`](../play-xstate/README.md) — `definePlayer`, `formatPlayRouteTransitions`, `PlayerActor`
|
|
118
|
+
- [`@xmachines/play-dom`](../play-dom/README.md), [`play-react`](../play-react/README.md), [`play-solid`](../play-solid/README.md), [`play-svelte`](../play-svelte/README.md), [`play-vue`](../play-vue/README.md) — View renderers
|
|
119
|
+
- [`@xmachines/play-dom-router`](../play-dom-router/README.md), [`play-react-router`](../play-react-router/README.md), [`play-tanstack-react-router`](../play-tanstack-react-router/README.md), [`play-solid-router`](../play-solid-router/README.md), [`play-tanstack-solid-router`](../play-tanstack-solid-router/README.md), [`play-vue-router`](../play-vue-router/README.md), [`play-svelte-spa-router`](../play-svelte-spa-router/README.md), [`play-sveltekit-router`](../play-sveltekit-router/README.md) — Router adapters
|
|
120
|
+
|
|
121
|
+
## Testing
|
|
122
|
+
|
|
123
|
+
Run the docs package tests in isolation:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# From the monorepo root
|
|
127
|
+
npm test -w @xmachines/docs
|
|
128
|
+
|
|
129
|
+
# Or from within the package directory
|
|
130
|
+
npm test
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Regenerating API Docs
|
|
134
|
+
|
|
135
|
+
The `api/` directory is auto-generated by TypeDoc and must not be edited directly. Regenerate it from the monorepo root:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm run docs
|
|
139
|
+
```
|
|
10
140
|
|
|
11
|
-
|
|
141
|
+
## License
|
|
12
142
|
|
|
13
|
-
|
|
14
|
-
2. Run `npm install` in the root directory.
|
|
15
|
-
3. Run `npm run docs` to generate the documentation into `packages/docs/api`.
|
|
143
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
[API](../../README.md) / @xmachines/play
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# `@xmachines/play`
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
class used across all adapters and actor implementations, while keeping framework and runtime
|
|
9
|
-
concerns out of business logic.
|
|
7
|
+
> Core protocol layer for the Universal Player Architecture — defines `PlayEvent`, `PlayError`, and architectural contracts enabling loose coupling between business logic and runtime adapters.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
This package exports the shared Play protocol surface. It exists to preserve strict separation between:
|
|
14
|
-
|
|
15
|
-
- **Actors** (business authority)
|
|
16
|
-
- **Infrastructure adapters** (routers/renderers that observe and forward)
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
10
|
+
[](https://www.npmjs.com/package/@xmachines/play)
|
|
17
11
|
|
|
18
|
-
|
|
12
|
+
Part of the [XMachines JS monorepo](../../README.md).
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
- **Strict Separation (INV-02):** protocol types are framework-agnostic
|
|
22
|
-
- **Passive Infrastructure (INV-04):** adapters reflect actor decisions
|
|
14
|
+
---
|
|
23
15
|
|
|
24
16
|
## Installation
|
|
25
17
|
|
|
@@ -27,84 +19,169 @@ Per [Play RFC](../../../rfc/play.md), this package supports:
|
|
|
27
19
|
npm install @xmachines/play
|
|
28
20
|
```
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
> **Node.js `>= 22.0.0` required.** All packages are ES modules (`"type": "module"`).
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
`@xmachines/play` is the foundational package in the XMachines ecosystem. It defines the minimal set of types and utilities that all other `@xmachines/*` packages build upon:
|
|
29
|
+
|
|
30
|
+
- **`PlayEvent<TPayload>`** — the universal event contract for Actor ↔ Infrastructure communication
|
|
31
|
+
- **`PlayError`** — the typed base class for all `@xmachines/*` runtime errors
|
|
32
|
+
- **`NonNullableError`** — thrown when a required value is `null` or `undefined`
|
|
33
|
+
- **`assertNonNullable()`** — assertion utility that narrows `T | null | undefined` to `T`
|
|
34
|
+
|
|
35
|
+
These protocols implement the architectural invariants defined in the Play RFC:
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
| # | Invariant | Description |
|
|
38
|
+
| ------ | -------------------------- | --------------------------------------------------------------- |
|
|
39
|
+
| INV-01 | **Actor Authority** | The Actor is the final authority; guards decide all transitions |
|
|
40
|
+
| INV-02 | **Strict Separation** | Business logic never imports UI frameworks or routing libraries |
|
|
41
|
+
| INV-04 | **Passive Infrastructure** | Infrastructure observes Actor signals; it never enforces guards |
|
|
33
42
|
|
|
34
|
-
|
|
35
|
-
| ----------- | ----- | ------------------------------------------------- |
|
|
36
|
-
| `PlayEvent` | type | Minimal event shape — `{ type: string, ...rest }` |
|
|
37
|
-
| `PlayError` | class | Base class for all `@xmachines/*` typed errors |
|
|
43
|
+
---
|
|
38
44
|
|
|
39
|
-
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### `PlayEvent<TPayload>`
|
|
48
|
+
|
|
49
|
+
The minimal event contract: any object with a `type: string` property. Framework-agnostic — works with XState, Robot, and any other state machine library.
|
|
40
50
|
|
|
41
51
|
```typescript
|
|
42
52
|
import type { PlayEvent } from "@xmachines/play";
|
|
43
53
|
|
|
44
|
-
// Flexible (
|
|
45
|
-
const event: PlayEvent = { type: "auth.login", userId: "
|
|
54
|
+
// Flexible (accepts any additional fields):
|
|
55
|
+
const event: PlayEvent = { type: "auth.login", userId: "user123" };
|
|
46
56
|
|
|
47
|
-
// Type-safe (with generic):
|
|
48
|
-
type LoginEvent = PlayEvent<{ userId: string }>;
|
|
49
|
-
const login: LoginEvent = { type: "auth.login", userId: "123" };
|
|
50
|
-
```
|
|
57
|
+
// Type-safe (with generic payload):
|
|
58
|
+
type LoginEvent = PlayEvent<{ userId: string; timestamp: number }>;
|
|
51
59
|
|
|
52
|
-
|
|
60
|
+
const loginEvent: LoginEvent = {
|
|
61
|
+
type: "auth.login",
|
|
62
|
+
userId: "user123",
|
|
63
|
+
timestamp: Date.now(),
|
|
64
|
+
};
|
|
53
65
|
|
|
54
|
-
|
|
66
|
+
// TypeScript error: missing required field
|
|
67
|
+
const invalid: LoginEvent = { type: "auth.login" }; // Error!
|
|
68
|
+
```
|
|
55
69
|
|
|
56
|
-
|
|
70
|
+
### `PlayError`
|
|
57
71
|
|
|
58
|
-
|
|
59
|
-
- **`code`** — a stable, machine-readable identifier (e.g. `"PLAY_ROUTER_SYNC_FAILED"`)
|
|
72
|
+
Base class for all `@xmachines/*` runtime errors. Every error has a stable `scope` (throwing class/module) and `code` (machine-readable identifier). Always branch on `.code` or subclass — never on `.message`.
|
|
60
73
|
|
|
61
74
|
```typescript
|
|
62
75
|
import { PlayError } from "@xmachines/play";
|
|
76
|
+
import { NonNullableError } from "@xmachines/play/errors";
|
|
63
77
|
|
|
64
|
-
// Catching any @xmachines/* error:
|
|
65
78
|
try {
|
|
66
79
|
bridge.connect();
|
|
67
80
|
} catch (err) {
|
|
68
|
-
if (err instanceof
|
|
81
|
+
if (err instanceof NonNullableError) {
|
|
82
|
+
// err.scope === "assertNonNullable"
|
|
83
|
+
// err.code === "PLAY_NON_NULLABLE"
|
|
84
|
+
console.error(`Missing value: ${err.message}`);
|
|
85
|
+
} else if (err instanceof PlayError) {
|
|
86
|
+
// Any other @xmachines/* error
|
|
69
87
|
console.error(`[${err.scope}:${err.code}] ${err.message}`);
|
|
88
|
+
} else {
|
|
89
|
+
throw err;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Extend `PlayError` in your own `@xmachines/*`-compatible packages:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { PlayError } from "@xmachines/play";
|
|
98
|
+
|
|
99
|
+
export class MyPackageError extends PlayError {
|
|
100
|
+
constructor(message: string, options?: ErrorOptions) {
|
|
101
|
+
super("MyScope", "MY_PACKAGE_ERROR_CODE", message, options);
|
|
102
|
+
this.name = "MyPackageError";
|
|
70
103
|
}
|
|
71
104
|
}
|
|
72
105
|
```
|
|
73
106
|
|
|
74
|
-
|
|
107
|
+
### `assertNonNullable(value, name?)`
|
|
108
|
+
|
|
109
|
+
Assertion utility that returns `value` typed as `NonNullable<V>` or throws `NonNullableError`. Eliminates unsafe `!` non-null assertions.
|
|
75
110
|
|
|
76
111
|
```typescript
|
|
77
|
-
import {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
import { MissingCatalogError, MissingComponentError } from "@xmachines/play-solid/errors";
|
|
85
|
-
import { VueRouterCorrectionError } from "@xmachines/play-vue-router/errors";
|
|
112
|
+
import { assertNonNullable } from "@xmachines/play";
|
|
113
|
+
|
|
114
|
+
// Inject + assert in one line — no intermediate variable or `!` needed:
|
|
115
|
+
const actor = assertNonNullable(inject<AuthActor>("actor"), "actor");
|
|
116
|
+
|
|
117
|
+
// DOM element lookup:
|
|
118
|
+
const el = assertNonNullable(document.getElementById("app"), "#app");
|
|
86
119
|
```
|
|
87
120
|
|
|
88
|
-
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## API Summary
|
|
124
|
+
|
|
125
|
+
### Exported from `@xmachines/play`
|
|
126
|
+
|
|
127
|
+
| Export | Kind | Description |
|
|
128
|
+
| --------------------- | ---------- | ---------------------------------------------------------------- |
|
|
129
|
+
| `PlayEvent<TPayload>` | `type` | Universal event contract — `{ type: string } & TPayload` |
|
|
130
|
+
| `PlayError` | `class` | Base class for all `@xmachines/*` typed errors |
|
|
131
|
+
| `NonNullableError` | `class` | Thrown by `assertNonNullable` when a value is `null`/`undefined` |
|
|
132
|
+
| `assertNonNullable` | `function` | Asserts non-null, returns narrowed value |
|
|
133
|
+
|
|
134
|
+
### Exported from `@xmachines/play/errors`
|
|
135
|
+
|
|
136
|
+
| Export | Kind | Description |
|
|
137
|
+
| ------------------ | ------- | --------------------------------------------------------- |
|
|
138
|
+
| `PlayError` | `class` | Re-exported base error class |
|
|
139
|
+
| `NonNullableError` | `class` | `scope: "assertNonNullable"`, `code: "PLAY_NON_NULLABLE"` |
|
|
140
|
+
|
|
141
|
+
---
|
|
89
142
|
|
|
90
|
-
##
|
|
143
|
+
## Error Codes
|
|
91
144
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
145
|
+
| Code | Class | Thrown When |
|
|
146
|
+
| ------------------- | ------------------ | ---------------------------------------------------- |
|
|
147
|
+
| `PLAY_NON_NULLABLE` | `NonNullableError` | `assertNonNullable()` receives `null` or `undefined` |
|
|
148
|
+
|
|
149
|
+
Other `@xmachines/*` packages export their own error subclasses from their respective `./errors` subpath:
|
|
150
|
+
|
|
151
|
+
| Package | Import path |
|
|
152
|
+
| ---------------------------- | ----------------------------------- |
|
|
153
|
+
| `@xmachines/play` | `@xmachines/play/errors` |
|
|
154
|
+
| `@xmachines/play-router` | `@xmachines/play-router/errors` |
|
|
155
|
+
| `@xmachines/play-xstate` | `@xmachines/play-xstate/errors` |
|
|
156
|
+
| `@xmachines/play-react` | `@xmachines/play-react/errors` |
|
|
157
|
+
| `@xmachines/play-solid` | `@xmachines/play-solid/errors` |
|
|
158
|
+
| `@xmachines/play-vue-router` | `@xmachines/play-vue-router/errors` |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Testing
|
|
163
|
+
|
|
164
|
+
Run tests for this package in isolation:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npm test -w @xmachines/play
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Or from the package directory:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
npm test
|
|
174
|
+
```
|
|
95
175
|
|
|
96
|
-
|
|
176
|
+
Tests use **Vitest** and cover the `PlayError` class construction, inheritance, `cause` support, and subclassing patterns.
|
|
97
177
|
|
|
98
|
-
|
|
99
|
-
- [@xmachines/play-xstate](../play-xstate/README.md)
|
|
100
|
-
- [@xmachines/play-router](../play-router/README.md)
|
|
178
|
+
---
|
|
101
179
|
|
|
102
180
|
## License
|
|
103
181
|
|
|
104
|
-
|
|
182
|
+
MIT © [Mikael Karon](mailto:mikael@karon.se)
|
|
105
183
|
|
|
106
|
-
|
|
107
|
-
For a copy, see <https://opensource.org/licenses/MIT>.
|
|
184
|
+
See [LICENSE](./LICENSE) for details.
|
|
108
185
|
|
|
109
186
|
@xmachines/play - Core Protocol Layer
|
|
110
187
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: NonNullableError
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play/src/errors.ts:111](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play/src/errors.ts:111](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L111)
|
|
6
6
|
|
|
7
7
|
Thrown by [assertNonNullable](../functions/assertNonNullable.md) when a value is `null` or `undefined`.
|
|
8
8
|
|
|
@@ -35,7 +35,7 @@ try {
|
|
|
35
35
|
new NonNullableError(message, options?): NonNullableError;
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Defined in: [packages/play/src/errors.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
38
|
+
Defined in: [packages/play/src/errors.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L112)
|
|
39
39
|
|
|
40
40
|
#### Parameters
|
|
41
41
|
|
|
@@ -57,10 +57,10 @@ Defined in: [packages/play/src/errors.ts:112](https://gitlab.com/xmachin-es/xmac
|
|
|
57
57
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
58
58
|
| ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
59
|
| <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | [`PlayError`](PlayError.md).[`cause`](PlayError.md#property-cause) | - |
|
|
60
|
-
| <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` — always match on `.code` or the subclass. | [`PlayError`](PlayError.md).[`code`](PlayError.md#property-code) | [packages/play/src/errors.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
60
|
+
| <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` — always match on `.code` or the subclass. | [`PlayError`](PlayError.md).[`code`](PlayError.md#property-code) | [packages/play/src/errors.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L75) |
|
|
61
61
|
| <a id="property-message"></a> `message` | `public` | `string` | - | [`PlayError`](PlayError.md).[`message`](PlayError.md#property-message) | - |
|
|
62
62
|
| <a id="property-name"></a> `name` | `public` | `string` | - | [`PlayError`](PlayError.md).[`name`](PlayError.md#property-name) | - |
|
|
63
|
-
| <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | [`PlayError`](PlayError.md).[`scope`](PlayError.md#property-scope) | [packages/play/src/errors.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
63
|
+
| <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | [`PlayError`](PlayError.md).[`scope`](PlayError.md#property-scope) | [packages/play/src/errors.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L66) |
|
|
64
64
|
| <a id="property-stack"></a> `stack?` | `public` | `string` | - | [`PlayError`](PlayError.md).[`stack`](PlayError.md#property-stack) | - |
|
|
65
65
|
| <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | [`PlayError`](PlayError.md).[`stackTraceLimit`](PlayError.md#property-stacktracelimit) | - |
|
|
66
66
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayError
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play/src/errors.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play/src/errors.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L64)
|
|
6
6
|
|
|
7
7
|
Base class for all typed runtime errors thrown by `@xmachines/*` packages.
|
|
8
8
|
|
|
@@ -87,7 +87,7 @@ new PlayError(
|
|
|
87
87
|
options?): PlayError;
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
Defined in: [packages/play/src/errors.ts:83](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
90
|
+
Defined in: [packages/play/src/errors.ts:83](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L83)
|
|
91
91
|
|
|
92
92
|
#### Parameters
|
|
93
93
|
|
|
@@ -113,10 +113,10 @@ Error.constructor;
|
|
|
113
113
|
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
114
114
|
| ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
115
115
|
| <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | - |
|
|
116
|
-
| <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` — always match on `.code` or the subclass. | - | [packages/play/src/errors.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
116
|
+
| <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` — always match on `.code` or the subclass. | - | [packages/play/src/errors.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L75) |
|
|
117
117
|
| <a id="property-message"></a> `message` | `public` | `string` | - | `Error.message` | - |
|
|
118
118
|
| <a id="property-name"></a> `name` | `public` | `string` | - | `Error.name` | - |
|
|
119
|
-
| <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | - | [packages/play/src/errors.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
119
|
+
| <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | - | [packages/play/src/errors.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/errors.ts#L66) |
|
|
120
120
|
| <a id="property-stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | - |
|
|
121
121
|
| <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | - |
|
|
122
122
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function assertNonNullable<V>(value, name?): NonNullable<V>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play/src/utils.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play/src/utils.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/utils.ts#L39)
|
|
10
10
|
|
|
11
11
|
Assert that `value` is neither `null` nor `undefined`, and return it typed
|
|
12
12
|
as `NonNullable<V>` — combining the guard and the narrowed value in a single
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type PlayEvent<TPayload> = object & TPayload;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play/src/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play/src/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/types.ts#L69)
|
|
10
10
|
|
|
11
11
|
Generic event type for Play Architecture
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ Robot, and other state machine libraries.
|
|
|
34
34
|
|
|
35
35
|
| Name | Type | Defined in |
|
|
36
36
|
| ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
-
| `type` | `string` | [packages/play/src/types.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
37
|
+
| `type` | `string` | [packages/play/src/types.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play/src/types.ts#L70) |
|
|
38
38
|
|
|
39
39
|
## Type Parameters
|
|
40
40
|
|