Thanks for helping! This adapter aims for parity with Zag's official framework adapters — Zag's framework-adapter guide is the reference for what an adapter must provide.
Open a bug report.
The most useful reproduction is a minimal .marko component plus the Zag
machine package and version it drives.
Open a feature request. If the feature exists in an official Zag adapter (react/vue/solid/svelte/ preact/vanilla), link the corresponding source — parity requests are the easiest to accept.
Uses bun. npm is not used in this repo.
git clone https://github.com/svallory/marko-zag.git
cd marko-zag
bun install
bun run check # marko-type-check (TS + .marko templates)
bun run test # unit/integration suite (jsdom + node)
bun run test:browser # real-Chromium suite (needs: bunx playwright install chromium)
bun run docs:dev # docs site (docmd)There is no build step: the package ships raw TypeScript and .marko
sources (tags cannot be pre-compiled by a library; consumers use a
Marko-aware bundler).
src/machine.ts— the machine interpreter (createService/ssrService), ported from@zag-js/solid. Every Zag-version-specific call lives here.src/normalize-props.ts— React-dialect → Marko attribute translation.src/prop-types.ts—PropTypesmap binding prop getters to Marko's native-tag input types.src/tags/— the Marko tags (<zag>,<zag-machine>,<zag-portal>,<zag-store>), auto-discovered viamarko.json. File names are tag names.tests/— vitest;tests/browser/runs in real Chromium,tests/ssr/server-renders real.markotemplates with no DOM, andtests/type-assertions.tsholds compile-time regression pins.
- Prettier (with
prettier-plugin-marko) formats everything; a husky pre-commit hook runs the type check. - Comments state constraints the code can't show — see the existing files for the expected density.
- Type-level behavior changes need a matching assertion in
tests/type-assertions.ts.
- Conventional commits (
feat:,fix:,docs:,test:,chore:…). bun run checkandbun run testmust pass; add tests with behavior changes.- Update
CHANGELOG.mdunder[Unreleased]for user-visible changes. - Publishing to npm is maintainer-only and manual.
Open a discussion or an issue.