Skip to content

Share root scaffolding between the two monorepo builders - #27

Merged
DanMat merged 1 commit into
mainfrom
refactor/unify-monorepo
Jul 26, 2026
Merged

Share root scaffolding between the two monorepo builders#27
DanMat merged 1 commit into
mainfrom
refactor/unify-monorepo

Conversation

@DanMat

@DanMat DanMat commented Jul 26, 2026

Copy link
Copy Markdown
Owner

The last of the architecture-review refactors. buildMonorepo (libraries) and buildFullstack duplicated their entire root scaffolding — the community/agents/gitfiles reuse, eslint.config.js, .prettierrc.json, tsconfig.base.json, pnpm-workspace.yaml, ci.yml, and packkit.json were copy-pasted between them. That's the "features implemented twice" the review flagged, and 2.9's fullstack layout made it a second copy.

Change

Extracted into one workspaceScaffold(cfg, { workspaceGlobs, tsconfigLib }) that both builders call. Each still supplies its own root package.json, turbo tasks, and packages on top. −40 lines, and that scaffolding is now maintained once.

Verified byte-identical

An order-insensitive file-content snapshot across all 48 monorepo/fullstack configs (pm × license × scoped-name) captured from pre-refactor main: zero differences. fullstack still generates 37 files.

Scope — deliberately bounded

This does not merge the monorepo path into the single-package feature pipeline (the "every project is a set of workspaces, a plain package is a project with one" graph rewrite). The reviewer themselves framed that as longer-term, and it would change monorepo output rather than refactor it — not a byte-safe change. This removes the real, concrete duplication safely; the deeper structural merge stays a separate, larger effort if it's ever worth it.

99 tests pass, lint clean, web configurator verified.

🤖 Generated with Claude Code

buildMonorepo (libraries) and buildFullstack duplicated their entire root
scaffolding — the community/agents/gitfiles reuse, eslint.config.js,
.prettierrc.json, tsconfig.base.json, pnpm-workspace.yaml, ci.yml, and
packkit.json were copy-pasted between them. That's the "implemented twice"
the review flagged, and 2.9's fullstack addition made it a second copy.

Extracted into one workspaceScaffold(cfg, { workspaceGlobs, tsconfigLib })
that both builders call; each still supplies its own root package.json,
turbo tasks, and packages. −40 lines, and that scaffolding is now
maintained once.

Verified byte-identical across all 48 monorepo/fullstack configs (pm ×
license × scoped-name), via an order-insensitive file-content snapshot
against pre-refactor main.

Scoped deliberately: this does NOT merge the monorepo path into the
single-package feature pipeline (the "every project is a set of
workspaces" graph rewrite). The reviewer framed that as longer-term, and
it would change monorepo output rather than refactor it. This removes the
real duplication safely; the deeper merge stays a separate effort.

99 tests pass, lint clean, web configurator verified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit a4a291c into main Jul 26, 2026
37 checks passed
@DanMat
DanMat deleted the refactor/unify-monorepo branch July 26, 2026 22:41
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