Skip to content

feat!: modernize tooling and migrate to Standard Schema - #2

Merged
drenther merged 16 commits into
mainfrom
feat/modernize-tooling-standard-schema
May 16, 2026
Merged

feat!: modernize tooling and migrate to Standard Schema#2
drenther merged 16 commits into
mainfrom
feat/modernize-tooling-standard-schema

Conversation

@drenther

Copy link
Copy Markdown
Owner

Summary

  • Standard Schema migration: Replace Zod with Standard Schema interface (@standard-schema/spec) for event data validation, enabling any compliant validator (zod 3.24+, valibot, arktype, effect-schema, etc.)
  • Build modernization: Vite → tsdown with dual ESM+CJS output for both @izod/core and @izod/react
  • Tooling overhaul: eslint+prettier → oxlint+oxfmt (root-level via turbo //# tasks), vitest+happy-dom for testing, commitlint+husky for git hooks, changesets for release management
  • Dependency cleanup: Remove react-use (replaced with inline state), type-fest, vite, eslint and plugins; add pnpm catalog for centralized version management
  • CI/CD: GitHub Actions workflows for CI and release with OIDC NPM provenance
  • Playground removal: Delete old playground apps (to be replaced by TanStack Start example in follow-up)

Breaking Changes

  • EventMap type: Record<string, z.ZodTypeAny>Record<string, StandardSchemaV1>
  • All z.infer<> types replaced with StandardSchemaV1.InferOutput<>
  • zod is no longer a peer dependency — consumers choose their own Standard Schema validator
  • Packages now export both ESM (.js) and CJS (.cjs) instead of ESM-only (.es.js)

Test plan

  • pnpm run typecheck — 3/3 turbo tasks pass
  • pnpm run test — 18/18 tests pass (13 core + 5 react)
  • pnpm run build — dual ESM+CJS output verified in both packages
  • pnpm run lint — oxlint: 0 warnings, 0 errors
  • CI workflow validates on push

drenther added 11 commits April 14, 2026 20:07
Replace Zod with Standard Schema interface for event validation,
enabling any compliant validator (zod 3.24+, valibot, arktype, etc.).

- Build: vite → tsdown with dual ESM+CJS output
- Lint/Format: eslint+prettier → oxlint+oxfmt (root-level via turbo)
- Test: add vitest with happy-dom (18 tests across core + react)
- CI/CD: GitHub Actions with OIDC NPM provenance, changesets
- Deps: remove react-use, type-fest; add pnpm catalog for versions
- Config: tsconfig.base.json, commitlint, husky hooks, .node-version
- Delete playground/ (to be replaced by TanStack Start example)

BREAKING CHANGE: EventMap now uses StandardSchemaV1 instead of
z.ZodTypeAny. All schema validation uses the Standard Schema protocol.
Interactive example showing izod's iframe communication with
Standard Schema validation (zod). Parent and child pages exchange
typed messages through a handshake-based protocol.

- Astro static site in examples/astro-demo/
- GitHub Pages deploy workflow (.github/workflows/deploy.yml)
- Add astro + zod to pnpm catalog
Disable child frame navigation in happy-dom settings to prevent
fetch attempts to iframe URLs during test teardown.
Add @izod/react example using child.useCreate and parent.useConnect
hooks alongside the existing @izod/core example. Restructure pages
into /core and /react paths with a landing page at root.

- Add @astrojs/react integration with semver@7.7.4 override
- Add ReactParent and ReactChild components with client:only directive
- Move core example pages to /core subdirectory
- Add landing page with links to both examples
Parse vitest coverage-summary.json from each package and post a
markdown table as a PR comment, upserting via HTML comment marker
to avoid duplicates. Uses issues:write permission (not pull-requests).
- Add coverage/ to .gitignore
- Rewrite root README for Standard Schema and updated API
- Add @izod/core README with full createChild/connectToParent docs
- Add @izod/react README with child.useCreate/parent.useConnect docs
- Apply oxfmt formatting across touched files
- Add .oxfmtrc.json with singleQuote: true to match old .prettierrc
- Add coverage/ to .gitignore
- Add per-package README badges for bundle size, npm version, types
- Reformat all source files with corrected quote style
Switch from issues:write to pull-requests:write to fix 403 on PR
comments. Guard the coverage comment step with a same-repo check
so fork PRs cannot use the write token.
@github-actions

github-actions Bot commented May 10, 2026

Copy link
Copy Markdown

Coverage Report

Package Statements Branches Functions Lines
@izod/core 93.58% 88.23% 97.29% 96.64%
@izod/react 96.15% 84.61% 100% 96%

Updated by CI — 2026-05-16 11:32 UTC

drenther added 5 commits May 11, 2026 00:21
Core (55% → 93% statements): add connectToParent handshake,
child-side emit, inbound event dispatch, origin filtering,
namespace filtering, destroy cleanup, and validation edge cases.

React (73% → 95% statements): add handshake pending state,
onHandshakeError callback, parent.useConnect handshake and
error flows.
Pin upload-pages-artifact and deploy-pages to their commit SHAs
to match the pinning convention used in the CI workflow.
Replace the inline useAsyncCallback with a proper implementation
matching react-use's useAsyncFn: race condition protection via call ID
tracking, unmount guards, argument forwarding, promise return from
execute, and stale-while-reloading state preservation.
Replace state.loading with a ref in useAsyncCallback's dependency array
so the execute callback stays referentially stable, preventing the React
demo parent from re-initiating the handshake in a loop.

Extract shared demo styles into ParentLayout and ChildLayout Astro
components so core and React examples share identical styling without
duplication. Center-align the base index page.
Model AsyncState as a 4-variant discriminated union (matching react-use)
so value/error are accessible on all variants while preserving narrowing.

Move @standard-schema/spec from devDependencies to dependencies in
@izod/core since it's re-exported in public type declarations.
@drenther
drenther merged commit b9e5256 into main May 16, 2026
1 check passed
@drenther
drenther deleted the feat/modernize-tooling-standard-schema branch May 16, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant