@xmachines/docs 1.0.0-beta.46 → 1.0.0-beta.50
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 +3 -3
- 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/contributing/README.md +10 -0
- package/contributing/configuration.md +540 -0
- package/contributing/deployment.md +314 -0
- package/contributing/development.md +617 -0
- package/contributing/testing.md +460 -0
- 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 +11 -7
- package/guides/actor-model.md +18 -18
- package/guides/architecture.md +500 -0
- package/guides/getting-started.md +351 -142
- package/guides/signals.md +19 -19
- package/guides/state-machines.md +16 -16
- package/package.json +7 -5
- package/guides/installation.md +0 -257
|
@@ -1,38 +1,46 @@
|
|
|
1
1
|
[API](../../README.md) / @xmachines/shared
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# `@xmachines/shared`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Shared configurations for XMachines packages — TypeScript, linting, formatting, and Vitest setup used across the monorepo.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`@xmachines/shared` provides shared configuration files for all XMachines packages, establishing consistent TypeScript compilation, linting rules, formatting, and Vitest setup across the monorepo.
|
|
12
|
-
|
|
13
|
-
**Enhancement:** Added TypeScript composite build system with project references enabling correct build order, incremental compilation, and IDE source navigation via declaration maps.
|
|
9
|
+
Part of the [xmachines-js monorepo](../../README.md).
|
|
14
10
|
|
|
15
11
|
## Installation
|
|
16
12
|
|
|
17
|
-
This package is
|
|
13
|
+
This package is an internal monorepo dependency. It is **not intended for installation by external consumers**.
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
Within the monorepo it is referenced by package name:
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@xmachines/shared": "*"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
25
|
+
## Exports
|
|
26
|
+
|
|
27
|
+
| Export | File | Description |
|
|
28
|
+
| ------------------------------------------- | ----------------------------------- | ----------------------------------------------------------------------- |
|
|
29
|
+
| `@xmachines/shared/tsconfig` | `config/tsconfig.json` | Base TypeScript configuration for all packages |
|
|
30
|
+
| `@xmachines/shared/tsconfig-test` | `config/tsconfig.test.json` | TypeScript configuration for test files |
|
|
31
|
+
| `@xmachines/shared/oxlint` | `config/oxlint.config.ts` | Shared oxlint configuration |
|
|
32
|
+
| `@xmachines/shared/oxfmt` | `config/oxfmt.config.ts` | Shared oxfmt formatter configuration |
|
|
33
|
+
| `@xmachines/shared/vite-aliases` | `config/vite-aliases.ts` | Vite resolve aliases for all `@xmachines/*` workspace packages |
|
|
34
|
+
| `@xmachines/shared/vitest` | `config/vitest.ts` | `defineXmVitestConfig` helper for per-package Vitest configs |
|
|
35
|
+
| `@xmachines/shared/vitest-setup` | `config/vitest.setup.ts` | Shared Vitest setup — extends matchers with `@testing-library/jest-dom` |
|
|
36
|
+
| `@xmachines/shared/vitest-node-setup` | `config/vitest.node.setup.ts` | Node.js runtime guard — asserts `Node.js >= 22` |
|
|
37
|
+
| `@xmachines/shared/vitest-urlpattern-setup` | `config/vitest.urlpattern.setup.ts` | Optional URLPattern polyfill setup for route-matching tests |
|
|
30
38
|
|
|
31
39
|
## Usage
|
|
32
40
|
|
|
33
41
|
### TypeScript Configuration
|
|
34
42
|
|
|
35
|
-
|
|
43
|
+
Extend the base TypeScript config in any package:
|
|
36
44
|
|
|
37
45
|
```json
|
|
38
46
|
{
|
|
@@ -45,333 +53,112 @@ Configuration files in `config/` directory:
|
|
|
45
53
|
}
|
|
46
54
|
```
|
|
47
55
|
|
|
48
|
-
|
|
56
|
+
For test-specific TypeScript settings (no emit, Vitest globals), extend:
|
|
49
57
|
|
|
50
58
|
```json
|
|
51
59
|
{
|
|
52
|
-
"extends": "@xmachines/shared/
|
|
53
|
-
"
|
|
54
|
-
"composite": true,
|
|
55
|
-
"rootDir": "./src",
|
|
56
|
-
"outDir": "./dist"
|
|
57
|
-
}
|
|
60
|
+
"extends": "@xmachines/shared/tsconfig-test",
|
|
61
|
+
"include": ["src/**/*", "test/**/*"]
|
|
58
62
|
}
|
|
59
63
|
```
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
### Linting (`oxlint`)
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
Reference the shared oxlint config from a package's `oxlint.config.ts`:
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
"extends": ["@xmachines/shared/oxlint"]
|
|
70
|
-
}
|
|
69
|
+
```typescript
|
|
70
|
+
import sharedConfig from "@xmachines/shared/oxlint";
|
|
71
|
+
export default sharedConfig;
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
**Recommended:**
|
|
74
|
+
The shared config enables the `typescript`, `unicorn`, and `import` plugins with:
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Vite Alias Configuration
|
|
76
|
+
- `correctness` rules as errors
|
|
77
|
+
- `suspicious` and `perf` rules as warnings
|
|
78
|
+
- `import/no-cycle` and `typescript/no-explicit-any` as errors
|
|
84
79
|
|
|
85
|
-
|
|
80
|
+
### Formatting (`oxfmt`)
|
|
86
81
|
|
|
87
|
-
|
|
88
|
-
import { defineConfig } from "vite";
|
|
89
|
-
import { xmAliases } from "@xmachines/shared/vite-aliases";
|
|
82
|
+
Reference the shared oxfmt config from a package's `oxfmt.config.ts`:
|
|
90
83
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
});
|
|
84
|
+
```typescript
|
|
85
|
+
import sharedConfig from "@xmachines/shared/oxfmt";
|
|
86
|
+
export default sharedConfig;
|
|
96
87
|
```
|
|
97
88
|
|
|
98
|
-
|
|
89
|
+
Key formatting rules: 4-space tab width using actual tabs, 100-character print width, double quotes, trailing commas, final newline. JSON/YAML files use 2-space indentation.
|
|
99
90
|
|
|
100
91
|
### Vitest Configuration
|
|
101
92
|
|
|
102
|
-
Use
|
|
93
|
+
Use `defineXmVitestConfig` for per-package Vitest configs. It automatically injects shared setup files and wires `@xmachines/*` source aliases:
|
|
103
94
|
|
|
104
|
-
```
|
|
95
|
+
```typescript
|
|
96
|
+
// vitest.config.ts
|
|
105
97
|
import { defineXmVitestConfig } from "@xmachines/shared/vitest";
|
|
106
98
|
|
|
107
99
|
export default defineXmVitestConfig(import.meta.url, {
|
|
108
100
|
test: {
|
|
109
|
-
|
|
110
|
-
include: ["test/**/*.test.ts"],
|
|
111
|
-
exclude: ["node_modules/**"],
|
|
101
|
+
globals: true,
|
|
112
102
|
},
|
|
113
103
|
});
|
|
114
104
|
```
|
|
115
105
|
|
|
116
|
-
**
|
|
106
|
+
**What `defineXmVitestConfig` applies automatically:**
|
|
117
107
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
108
|
+
- `resolve.alias` from `xmAliases(import.meta.url)` — resolves `@xmachines/*` to TypeScript source
|
|
109
|
+
- `config/vitest.node.setup.ts` — Node.js runtime guard (skipped in browser mode)
|
|
110
|
+
- `config/vitest.setup.ts` — `@testing-library/jest-dom` matcher extensions
|
|
111
|
+
|
|
112
|
+
For packages that test URL routing, add the URLPattern polyfill setup:
|
|
121
113
|
|
|
114
|
+
```typescript
|
|
122
115
|
export default defineXmVitestConfig(import.meta.url, {
|
|
123
116
|
test: {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
enabled: true,
|
|
127
|
-
provider: playwright(),
|
|
128
|
-
headless: true,
|
|
129
|
-
instances: [{ browser: "chromium" }],
|
|
130
|
-
},
|
|
131
|
-
include: ["test/browser/**/*.browser.test.ts"],
|
|
132
|
-
exclude: ["node_modules/**"],
|
|
117
|
+
globals: true,
|
|
118
|
+
setupFiles: ["@xmachines/shared/vitest-urlpattern-setup"],
|
|
133
119
|
},
|
|
134
120
|
});
|
|
135
121
|
```
|
|
136
122
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- `resolve.alias` for all `@xmachines/*` packages via `xmAliases(...)`
|
|
140
|
-
- Shared setup injection (`config/vitest.setup.ts`) unless already present
|
|
141
|
-
- Node setup injection (`config/vitest.node.setup.ts`) for non-browser projects
|
|
142
|
-
- Runtime preflight:
|
|
143
|
-
- Node.js runtime/version check (`>=22`) in node setup
|
|
144
|
-
- DOM matcher extension via `@testing-library/jest-dom/vitest`
|
|
145
|
-
|
|
146
|
-
### Vitest Setup Injection Rules
|
|
147
|
-
|
|
148
|
-
`defineXmVitestConfig(...)` applies setup files predictably:
|
|
149
|
-
|
|
150
|
-
1. It normalizes `test.setupFiles` into an array.
|
|
151
|
-
2. It injects `config/vitest.setup.ts` if missing.
|
|
152
|
-
3. It injects `config/vitest.node.setup.ts` only when `test.browser.enabled !== true`.
|
|
153
|
-
4. It avoids duplicates by checking filenames (suffix match).
|
|
154
|
-
5. Injected setup files run before user-provided setup files.
|
|
155
|
-
|
|
156
|
-
This gives a safe default for Node package tests while keeping browser projects compatible.
|
|
123
|
+
### Vite Aliases
|
|
157
124
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
`@xmachines/shared` exports these Vitest entry points:
|
|
161
|
-
|
|
162
|
-
- `@xmachines/shared/vitest` → `config/vitest.ts`
|
|
163
|
-
- `@xmachines/shared/vitest-setup` → `config/vitest.setup.ts`
|
|
164
|
-
- `@xmachines/shared/vitest-node-setup` → `config/vitest.node.setup.ts`
|
|
165
|
-
- `@xmachines/shared/vitest-urlpattern-setup` → `config/vitest.urlpattern.setup.ts`
|
|
166
|
-
|
|
167
|
-
Use `@xmachines/shared/vitest` for package config files; direct setup exports are for advanced customization only.
|
|
168
|
-
|
|
169
|
-
`vitest-urlpattern-setup` must be added explicitly to `setupFiles` in packages that exercise URLPattern-based route matching (e.g. `play-router` and its adapter packages). It mirrors what consumers must do in production on Node < 24 or older browsers.
|
|
170
|
-
|
|
171
|
-
## Configuration Details
|
|
172
|
-
|
|
173
|
-
### TypeScript (`config/tsconfig.json`)
|
|
174
|
-
|
|
175
|
-
- **Target:** ESNext (Node.js 22+)
|
|
176
|
-
- **Module:** NodeNext (ESM with `.js` extensions required)
|
|
177
|
-
- **Strict:** Full strict mode enabled
|
|
178
|
-
- **Output:** Colocated `.d.ts` files with source maps
|
|
179
|
-
- **Composite:** Enabled for project references ()
|
|
180
|
-
|
|
181
|
-
**Important:** You must use `.js` extensions in imports:
|
|
125
|
+
For Vite-based demo or app packages, resolve all `@xmachines/*` packages to TypeScript source (no prior build required):
|
|
182
126
|
|
|
183
127
|
```typescript
|
|
184
|
-
|
|
185
|
-
import {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
### Oxlint (`config/oxlint.json`)
|
|
189
|
-
|
|
190
|
-
- **Plugins:** TypeScript, Unicorn, Import
|
|
191
|
-
- **Categories:** Correctness (error), Suspicious (warn), Performance (warn)
|
|
192
|
-
- **Key Rules:**
|
|
193
|
-
- Circular dependency detection (`import/no-cycle`)
|
|
194
|
-
- Unused variables (allow `_` prefix)
|
|
195
|
-
- TypeScript-specific checks
|
|
196
|
-
|
|
197
|
-
### Oxfmt (`config/oxfmt.json`)
|
|
198
|
-
|
|
199
|
-
- **Line Width:** 100 characters
|
|
200
|
-
- **Indentation:** Tabs (4 spaces)
|
|
201
|
-
- **Style:** Double quotes, semicolons, trailing commas
|
|
202
|
-
- **Final Newline:** Always insert
|
|
203
|
-
|
|
204
|
-
### Vitest (`config/vitest.ts`, `config/vitest.setup.ts`, `config/vitest.node.setup.ts`, `config/vitest.urlpattern.setup.ts`)
|
|
205
|
-
|
|
206
|
-
- **Helper API:** `defineXmVitestConfig(importMetaUrl, overrides)` merges shared defaults with package-specific Vitest config
|
|
207
|
-
- **Auto-aliasing:** `resolve.alias` is wired to `xmAliases(importMetaUrl)` so workspace packages resolve to source
|
|
208
|
-
- **Cross-runtime setup (`config/vitest.setup.ts`):**
|
|
209
|
-
- extends `expect` with `@testing-library/jest-dom/vitest`
|
|
210
|
-
- **URLPattern setup (`config/vitest.urlpattern.setup.ts`):**
|
|
211
|
-
- loads `urlpattern-polyfill` — opt-in per package via `setupFiles: ["@xmachines/shared/vitest-urlpattern-setup"]`
|
|
212
|
-
- required for packages exercising URLPattern-based route matching (play-router and adapters)
|
|
213
|
-
- mirrors what consumers must do in production on Node < 24 or older browsers
|
|
214
|
-
- **Node-only setup (`config/vitest.node.setup.ts`):**
|
|
215
|
-
- asserts Node runtime (`process.release.name === "node"`)
|
|
216
|
-
- enforces Node version `>=22`
|
|
217
|
-
- **Browser behavior:** Browser projects do not receive node-only setup injection
|
|
218
|
-
- **Override model:** Package-level config still controls test environment, includes/excludes, plugins, coverage, and browser provider
|
|
219
|
-
|
|
220
|
-
### Vite Aliases (`config/vite-aliases.ts`)
|
|
221
|
-
|
|
222
|
-
- **Helper API:** `xmAliases(importMetaUrl)` returns a complete `resolve.alias` map for all `@xmachines/*` workspace packages
|
|
223
|
-
- **Root discovery:** Walks upward from `import.meta.url` until it finds the workspace root (`package.json` with `workspaces`)
|
|
224
|
-
- **Source-first resolution:** Maps package imports to `packages/*/src/index.ts` for fast local dev without prebuild
|
|
225
|
-
- **Extra aliases:** Includes `@xmachines/play-router-shared` and `@xmachines/play-router-shared/index.css` for demo shared assets
|
|
226
|
-
- **Primary use cases:** `vite.config.ts`, `vitest` browser configs, and any local tooling relying on Vite resolver semantics
|
|
227
|
-
|
|
228
|
-
### Vite Alias Troubleshooting
|
|
229
|
-
|
|
230
|
-
- **`[xmAliases] Could not find workspace root`**
|
|
231
|
-
- Ensure `xmAliases` receives `import.meta.url` from the calling config file.
|
|
232
|
-
- Ensure the config file lives somewhere under the monorepo root.
|
|
233
|
-
- **Workspace package import resolves to missing `dist/` files**
|
|
234
|
-
- Ensure config includes `resolve.alias: xmAliases(import.meta.url)`.
|
|
235
|
-
- Re-run after cleaning caches when lockfile/deps changed.
|
|
236
|
-
|
|
237
|
-
### Vitest Troubleshooting
|
|
238
|
-
|
|
239
|
-
- **`URLPattern is unavailable after setup`**
|
|
240
|
-
- Ensure `test.setupFiles` is not replacing shared setup unexpectedly.
|
|
241
|
-
- Ensure config is created via `defineXmVitestConfig(...)`.
|
|
242
|
-
- **`Node runtime is required for this Vitest configuration`**
|
|
243
|
-
- This indicates node-only setup loaded in a browser project.
|
|
244
|
-
- Set `test.browser.enabled: true` in that project config.
|
|
245
|
-
- **Workspace import resolution failures (e.g. `@xmachines/play-signals`)**
|
|
246
|
-
- Confirm config uses `defineXmVitestConfig(import.meta.url, ...)` so aliases are injected.
|
|
247
|
-
|
|
248
|
-
## TypeScript Composite Build System
|
|
249
|
-
|
|
250
|
-
This package introduced TypeScript project references for proper build-order management in the monorepo.
|
|
251
|
-
|
|
252
|
-
### What This Means
|
|
253
|
-
|
|
254
|
-
- **Root `tsconfig.json`** coordinates all packages via `references` array
|
|
255
|
-
- **Each package** has `composite: true` enabling incremental builds
|
|
256
|
-
- **Packages with dependencies** declare `references` to their deps
|
|
257
|
-
- **TypeScript builds in correct order automatically** (no manual sequencing needed)
|
|
258
|
-
|
|
259
|
-
### Building
|
|
128
|
+
// vite.config.ts
|
|
129
|
+
import { defineConfig } from "vite";
|
|
130
|
+
import { xmResolve } from "@xmachines/shared/vite-aliases";
|
|
260
131
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
132
|
+
export default defineConfig({
|
|
133
|
+
resolve: xmResolve(import.meta.url),
|
|
134
|
+
});
|
|
264
135
|
```
|
|
265
136
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
- Understands the dependency graph
|
|
269
|
-
- Builds packages in correct order
|
|
270
|
-
- Only rebuilds changed packages (incremental)
|
|
271
|
-
- Produces `.d.ts.map` files for IDE navigation
|
|
137
|
+
Use `xmAliases` for alias-only setup, or `xmResolve` for the full resolve config including `conditions: ["source"]` and `preserveSymlinks: true`.
|
|
272
138
|
|
|
273
|
-
|
|
139
|
+
## Key TypeScript Settings
|
|
274
140
|
|
|
275
|
-
The base config
|
|
141
|
+
The base `config/tsconfig.json` configures:
|
|
276
142
|
|
|
277
|
-
|
|
143
|
+
- **Target:** `ESNext`, **Module:** `NodeNext` with `moduleResolution: NodeNext`
|
|
144
|
+
- **Strict mode:** full strict, `noUnusedLocals`, `noUnusedParameters`, `exactOptionalPropertyTypes`, `noImplicitReturns`, `noImplicitOverride`
|
|
145
|
+
- **Emit:** `declaration`, `declarationMap`, `sourceMap` enabled
|
|
146
|
+
- **Interop:** `verbatimModuleSyntax`, `isolatedModules`
|
|
147
|
+
- **Custom condition:** `"source"` — used by `xmAliases` to resolve packages to TypeScript source in dev/test
|
|
278
148
|
|
|
279
|
-
|
|
280
|
-
- **Rename refactoring** works across package boundaries
|
|
281
|
-
- **Error messages** reference source locations
|
|
149
|
+
## Testing
|
|
282
150
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
### Project References
|
|
287
|
-
|
|
288
|
-
Packages with internal dependencies should declare `references` in their `tsconfig.json`:
|
|
151
|
+
```bash
|
|
152
|
+
# Run tests for this package
|
|
153
|
+
npm test -w packages/shared
|
|
289
154
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
"extends": "@xmachines/shared/tsconfig",
|
|
293
|
-
"compilerOptions": {
|
|
294
|
-
"composite": true,
|
|
295
|
-
"rootDir": "./src",
|
|
296
|
-
"outDir": "./dist"
|
|
297
|
-
},
|
|
298
|
-
"references": [{ "path": "../dependency-package" }]
|
|
299
|
-
}
|
|
155
|
+
# Or from the package directory
|
|
156
|
+
npm test
|
|
300
157
|
```
|
|
301
158
|
|
|
302
|
-
The root `tsconfig.json` maintains the full package reference graph, enabling TypeScript to:
|
|
303
|
-
|
|
304
|
-
- Build packages in correct dependency order
|
|
305
|
-
- Support incremental builds (only rebuild what changed)
|
|
306
|
-
- Enable cross-package type checking and navigation
|
|
307
|
-
|
|
308
|
-
### Adding New Packages
|
|
309
|
-
|
|
310
|
-
When creating a new package:
|
|
311
|
-
|
|
312
|
-
1. **Add to root tsconfig.json references:**
|
|
313
|
-
|
|
314
|
-
```json
|
|
315
|
-
{
|
|
316
|
-
"references": [{ "path": "./packages/your-new-package" }]
|
|
317
|
-
}
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
2. **Enable composite in package tsconfig.json:**
|
|
321
|
-
|
|
322
|
-
```json
|
|
323
|
-
{
|
|
324
|
-
"extends": "@xmachines/shared/tsconfig",
|
|
325
|
-
"compilerOptions": {
|
|
326
|
-
"composite": true,
|
|
327
|
-
"rootDir": "./src",
|
|
328
|
-
"outDir": "./dist"
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
3. **Declare dependencies (if any):**
|
|
334
|
-
```json
|
|
335
|
-
{
|
|
336
|
-
"references": [{ "path": "../dependency-package" }]
|
|
337
|
-
}
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
### IDE Benefits
|
|
341
|
-
|
|
342
|
-
With `declarationMap: true` in the base config:
|
|
343
|
-
|
|
344
|
-
- **Go to Definition** jumps to source files (not compiled `.d.ts`)
|
|
345
|
-
- **Real-time errors** across package boundaries
|
|
346
|
-
- **Refactoring works** across the entire monorepo
|
|
347
|
-
|
|
348
|
-
No build required for IDE features - TypeScript understands the source graph directly.
|
|
349
|
-
|
|
350
|
-
See `AGENTS.md` (section: TypeScript Composite Build System) for complete composite build documentation.
|
|
351
|
-
|
|
352
|
-
## Adding New Configurations
|
|
353
|
-
|
|
354
|
-
To add a new shared configuration (e.g., for Jest, Vitest, etc.):
|
|
355
|
-
|
|
356
|
-
1. Create `config/<tool>.json` (or `.js`, `.ts` as appropriate)
|
|
357
|
-
2. Add exports to `package.json` exports field:
|
|
358
|
-
```json
|
|
359
|
-
{
|
|
360
|
-
"exports": {
|
|
361
|
-
"./<tool>": "./config/<tool>.json",
|
|
362
|
-
"./config/<tool>.json": "./config/<tool>.json"
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
```
|
|
366
|
-
3. Document in this README with usage examples
|
|
367
|
-
4. Note whether the tool supports package exports or requires relative paths
|
|
368
|
-
|
|
369
159
|
## License
|
|
370
160
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
This work is licensed under the terms of the MIT license.
|
|
374
|
-
For a copy, see <https://opensource.org/licenses/MIT>.
|
|
161
|
+
MIT — see [LICENSE](LICENSE).
|
|
375
162
|
|
|
376
163
|
## Modules
|
|
377
164
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function xmAliases(importMetaUrl): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [vite-aliases.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [vite-aliases.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.50/packages/shared/config/vite-aliases.ts#L24)
|
|
10
10
|
|
|
11
11
|
Vite resolve.alias entries for all @xmachines/\* workspace packages.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function xmCacheDir(importMetaUrl, name): string;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [vite-aliases.ts:196](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [vite-aliases.ts:196](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.50/packages/shared/config/vite-aliases.ts#L196)
|
|
10
10
|
|
|
11
11
|
Returns the shared Vite `cacheDir` for this workspace package.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function xmOptimizeDeps(extra?): DepOptimizationOptions;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [vite-aliases.ts:179](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [vite-aliases.ts:179](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.50/packages/shared/config/vite-aliases.ts#L179)
|
|
10
10
|
|
|
11
11
|
Returns the standard Vite `optimizeDeps` config for browser test projects.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function xmResolve(importMetaUrl, extra?): ResolveOptions & object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [vite-aliases.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [vite-aliases.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.50/packages/shared/config/vite-aliases.ts#L151)
|
|
10
10
|
|
|
11
11
|
Full Vite `resolve` config for @xmachines/\* workspace packages.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineXmVitestConfig(importMetaUrl, overrides): UserConfig;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [vitest.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [vitest.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.50/packages/shared/config/vitest.ts#L55)
|
|
10
10
|
|
|
11
11
|
Create a Vitest config with XMachines workspace defaults.
|
|
12
12
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# XMachines Development
|
|
2
|
+
|
|
3
|
+
Reference documentation for contributors and maintainers of the `@xmachines/xmachines-js` monorepo.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- **[Development](development.md)** — Monorepo setup, build system, adding packages, code conventions
|
|
8
|
+
- **[Configuration](configuration.md)** — TypeScript, linting, formatting, Vitest, CI/CD, and release configuration
|
|
9
|
+
- **[Testing](testing.md)** — Vitest setup, node vs browser modes, test patterns, coverage requirements
|
|
10
|
+
- **[Deployment](deployment.md)** — npm publishing, semantic-release process, GitLab CI pipeline
|