Skip to content

refactor: move to a monorepo layout with packages/ - #2

Open
mdjastrzebski wants to merge 4 commits into
mainfrom
refactor/monorepo-layout
Open

mdjastrzebski wants to merge 4 commits into
mainfrom
refactor/monorepo-layout

Conversation

@mdjastrzebski

Copy link
Copy Markdown
Member

Moves the repo to a Bun workspace monorepo so more packages can be added. There's one package for now. The npm package name stays nitro-ui-testing-library.

What changed

  • Layout: the library, its tests and its build/test configs now live in packages/testing-library. Folders under packages/ drop the nitro-ui- prefix of the npm name. The root package.json is private and keeps only shared tooling (oxfmt, release-it). Build and test tools are declared by each package.
  • Scripts: root scripts (build, typecheck, test, test:jest, test:vitest, test:bun, test:examples, validate) run across workspaces with bun run --filter, so commands and CI workflows stay the same. Plain bun test now only works inside a package's folder (its bunfig.toml sets the preload). From the root, use bun run test:bun.
  • Release: every public package in packages/ is released with one shared version, kept in the root package.json. release-it 21 has no compatible workspaces plugin, so a small local plugin (scripts/release-packages.js) does the work:
    • copies the bumped version to each package and updates bun.lock, so CI's --frozen-lockfile passes
    • stops if a package's version doesn't match the root's
    • publishes with bun publish, which turns workspace: dependency ranges into real versions
    • publishes before the git commit, tag and GitHub release (the same order as the npm plugin before), so a failed publish leaves nothing pushed
    • offers npm login when logged out (warns only on --dry-run)
    • publishes pre-releases under their identifier's dist-tag (beta, or next)
  • Docs: the full README moved into the package so npm still shows it, with absolute GitHub links. The root README is now a short overview with a packages table. LICENSE is copied into the package. AGENTS.md describes the layout and the release flow.
  • scripts/use-latest-nitro-ui.sh now updates the package's dependencies instead of the root's.

Notes for reviewers

  • Checked locally: bun run validate passes, NITRO_UI_VERSION=0.3.0 ./scripts/use-latest-nitro-ui.sh works, and bun run release --dry-run runs the steps in order (version sync, bun install, build, bun publish --dry-run packing 28 files, commit, tag, push, GitHub release). I also ran the plugin's version bump for real and reverted it; the lockfile stayed frozen-clean.
  • No real publish has been tested yet.
  • The root workspace name in bun.lock was edited by hand to nitro-ui-testing-library-monorepo. Bun kept the old name, and --frozen-lockfile accepts the edit.

🤖 Generated with Claude Code

mdjastrzebski and others added 4 commits December 3, 2026 08:51
The repo becomes a Bun workspace monorepo with packages under `packages/`,
ready for more packages. The root is private and keeps the shared tooling
(oxfmt, release-it) and runs each script across the packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A local release-it plugin (`scripts/release-packages.js`) copies the root
version to each public package in `packages/`, updates `bun.lock`, and
publishes the packages with `bun publish` before the git commit, tag and
GitHub release. The private root only holds the version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Folders under `packages/` drop the `nitro-ui-` prefix of the npm name. The
package is still published as `nitro-ui-testing-library`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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