Skip to content

Foundations: TypeScript build, dist, examples, CI and coverage #1

Closed

Description

@n4ff4h

Bring the repo up to the next-gen JS standards (see orchestration/STANDARDS.md, reference: ../i18n).

  • All work on the next-gen branch, created from main. Never commit to main; at the end open one PR from next-gen into main for the user to merge
  • TypeScript (strict), pnpm, Vite library build, Vitest, ESLint + Prettier
  • dist with ESM, CJS, .d.ts (and IIFE where it makes sense) for instant use; prepare script builds it
  • examples/ with a runnable page per integration
  • Changesets
  • CI: lint, format, typecheck, tests with coverage uploaded to Codecov, build, examples
  • README badges: tests, Codecov, npm, licence

Activity

  1. added
    next-genNext-gen Javaabu packages
    foundationsSkeleton, CI, codestyle, versions
    on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
    6a24455
  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on next-gen (6a24455).

    • Toolchain: TypeScript (strict), pnpm, a Vite library build, Vitest, and ESLint + Prettier as in ../i18n. ESLint also rejects physical Tailwind utilities.
    • dist: ESM .js, CJS .cjs and .d.ts, one file per module, each marked "use client". There are 8 entry points: ., /html, /onu, /onu/editor, /onu/maps, /shadcn, /inertia and /testing. prepare builds it on Git installs.
      • Decision: there's no IIFE build. This is a React component library with peer dependencies, so a <script> build isn't useful.
    • Examples: examples/ has a page per integration: Onu, shadcn/ui, plain HTML, Inertia and fetch. The Inertia and fetch pages run against a mock Laravel endpoint in the Vite server. Every page also comes in Dhivehi (?dv). I loaded all pages in headless Chromium and submitted them: Inertia and fetch errors show and the invalid field gets focus. This turned up a real bug, loading buttons that didn't submit, which is now fixed.
    • Changesets: one per user-facing change, in .changeset/.
    • CI runs on pushes to next-gen and on PRs: lint, format, typecheck, tests with coverage (thresholds at lines 85%, currently ~89%), the Codecov upload, the build and the examples build.
    • Badges: tests, Codecov, npm and licence, pointing at ?branch=next-gen.

    For dependents: with pnpm 10, apps that install github:Javaabu/react-forms#next-gen need onlyBuiltDependencies: ["@javaabu/forms", "@javaabu/i18n"]. This is documented in the installation page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    foundationsSkeleton, CI, codestyle, versionsnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions