Skip to content

Repository files navigation

@mano8/astro-ui-m8

CI/CD codecov Codacy Badge

Canonical shared UI foundation for the M8 astro-*-m8 plugin fleet. It is not a business plugin and not an Astro integration — it registers no routes, injects no integration, and fronts no backend service.

It owns:

  • the canonical shadcn registrydata-table and its parts, state components (loading/empty/error/unauthorized), and the dialog-form / table-page recipes;
  • the design-token bridge (src/lib/tokens.css);
  • generic list-params helpers (src/lib/list-params.ts);
  • the typed kit label-map contract for i18n (src/lib/labels.ts);
  • the shared test harness (@mano8/astro-ui-m8/testing), including an axe-based accessibility baseline.

Delivery model — registry-copy first

Shared UI is consumed via shadcn add against ./node_modules/@mano8/astro-ui-m8/registry/r/{name}.json; the files are copied into the consumer app. This package is a build/registry source, not a runtime import of those components. Runtime exports (., ./testing) are minimal by design.

Business plugins list @mano8/astro-ui-m8 in dependencies (not devDependencies) and declare their registryDependencies on its registry items. Prerequisite runtime packages for copied blocks are declared as peerDependencies and documented in registry/README.md.

Frozen Phase 1 contract

Phase 1 Step 2 freezes the shared naming and host import assumptions before any consumer depends on the generated registry output.

Frozen registry item names:

  • data-table
  • data-table-column-header
  • data-table-pagination
  • data-table-view-options
  • data-table-server-toolbar
  • data-table-server-faceted-filter
  • toast-notification
  • state-loading
  • state-empty
  • state-error
  • state-unauthorized
  • dialog-form
  • table-page

Host alias/import contract for copied registry blocks:

  • shadcn primitives resolve from @/components/ui/*
  • utility helpers resolve from @/lib/utils
  • hosts import the canonical token bridge from @mano8/astro-ui-m8/src/lib/tokens.css

These names are frozen. As of 1.0.0 the package follows strict semver: breaking changes to registry item names, copied-file structure, or required host aliases are major-version changes.

Commands

  • npm run buildtscdist/, then build:registry.
  • npm run build:registry — generate registry/r/*.json from registry.json, stamping every copied .ts/.tsx file with the package version it was built from (A-C6).
  • npm run typechecktsc --noEmit.
  • npm test — Vitest with coverage.
  • npm run test:unit — Vitest without coverage.
  • npx astro-ui-m8-skin-lock [dir] — published bin (A-C6); run in a consumer app to warn when its copied skins predate the installed @mano8/astro-ui-m8. See registry/README.md.

Status: stable (1.0.0). Registry blocks, recipes, token bridge, list-params, and the test harness are in place and follow strict semver.

About

Astro plugins shared registry

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages