This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
docs(create-plugin): record that in-repo scaffolding is already refused by named pins - #8042
Merged
Merged
Conversation
…ed by named pins Measured on a9e6f04: running the generator into `packages/` and re-running `pnpm exec vitest run scripts/__tests__/` turns 11 assertions red across 7 files, every one naming the generated package. Four are about the emitted test shape specifically -- three in `vitest-invocation-guard.test.ts` (#3240/#5406) and one in `runner-package-test-entry-3746.test.ts` (#3746, which reads the generated `"test": "vitest run"`). So the emitted output needs no change: it is correct for the generator's actual audience -- a plugin in its own repo, where the emitted config is the only config -- and the in-repo case that would be wrong is caught by pins rather than by a reviewer. The docblock records the measurement and the two pin names so the next reader does not re-derive it, and says explicitly not to teach the templates in-repo target detection. Comment-only; an empty-frontmatter changeset declares that nothing publishes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contributor
Author
|
Standing down on Generated by Claude Code |
baozhoutao
marked this pull request as ready for review
September 6, 2026 12:44
baozhoutao
deleted the
claude/issue-7524-create-plugin-in-repo-scaffold
branch
September 6, 2026 12:59
baozhoutao
pushed a commit
that referenced
this pull request
Sep 6, 2026
Brings in #8046, #8042, #8039. Neither of this branch's two paths is touched by that range; plugin-view source moved, so the forced build and every gate are re-run on the merged head. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7524
This was a measurement-first card. The measurement came back LOUD, so the route is 2(b): no gate change, a docblock note in
packages/create-plugin/src/templates.tsnaming the pins that already refuse an in-repo scaffold, plus an empty-frontmatter changeset. The scaffolder's published output is byte-identical tomain.All readings below are pinned to
121147911(the branch head) except the Step-1 planted/removed legs, which were taken on the same tree with the scratch package added and then removed; the scratch package was never committed.Step 1 — the measurement (mandatory, and it chose the route)
Ran the real scaffolder, not a hand-written imitation:
pnpm --filter @object-ui/create-plugin build, thennode packages/create-plugin/dist/index.js scaffold-probe-7524 -d ... -a ...from the worktree root, which writespackages/plugin-scaffold-probe-7524/.pnpm-workspace.yamlalready globspackages/*, so it became a workspace package with no edit;pnpm installlinked it.Emitted shape, verified on disk before running anything:
"test": "vitest run"in the manifest; atestblock invite.config.tscarryingglobals: true,environment: 'jsdom',setupFiles: ['./vitest.setup.ts']; novitest.config.*; and zero occurrences ofassertCanonicalVitestInvocationin the generated config. Exactly the hazardous shape the card describes.Test Files 5 passed (5),Tests 112 passed (112)vitest-invocation-guard.test.ts>calls the guard from every one of thempackages/plugin-scaffold-probe-7524/vite.config.tsvitest-invocation-guard.test.ts>declares no `test` block — a build config must not carry test semanticsvitest-invocation-guard.test.ts>derives the repo root instead of counting `..`packages/plugin-scaffold-probe-7524/vite.config.ts calls the guard with a hand-counted repo rootrunner-package-test-entry-3746.test.ts>admits no package beyond the recorded baseline["packages/plugin-scaffold-probe-7524"], expected[]package-scripts-vitest-projects.test.tsturbo-test-inputs.test.tsunit-registry-absence-collision.test.tspnpm exec vitest run scripts/__tests__/, clean tree (control)Test Files 110 passed (110),Tests 3323 passed (3323)pnpm exec vitest run scripts/__tests__/, scaffold plantedquick-reference-commands-4149going from38 publishedto39 publishedpnpm --filter @object-ui/plugin-scaffold-probe-7524 test(beforepnpm install)Could not resolve 'vite-plugin-dts'/Cannot find package '@vitejs/plugin-react'pnpm --filter @object-ui/plugin-scaffold-probe-7524 test(afterpnpm install)RUN v4.1.10 /…/packages/plugin-scaffold-probe-7524,Test Files 1 passed (1), no guard output at allnode scripts/vitest-invocation-guard.mjsvitest.config.mtsand the package vite configs importcheck:unreferenced-sources,check:phantom-deps,check:self-import,check:side-effects-array,check:published-dist,check:readme-exportsReading. The two halves point opposite ways, and that is the whole answer:
pnpm testinside a scaffolded in-repo package runs with the package as vitest's root, under the generatedvite.config.tsas its test config, and the guard never fires because that config never calls it;So the card's premise splits. "The scaffolder emits the shape #3240 removed" is true. "…with nothing to refuse it" is false — objectui#3240 / objectui#5406 / objectui#3746 already built the refusal, on the repo side rather than in the scaffolder, and it fires on the first CI run. The one thing that was genuinely missing is the record of that, which is what this PR adds.
Removal proof. The scratch package is a measurement, never a commit: after
rm -rf packages/plugin-scaffold-probe-7524and restoringpnpm-lock.yamlfrom the base commit,git status --porcelainis empty and the lockfile md5 is back to its base value (85895a3d7f8051c61b1f4803ea1b3cf7). The control run of the wholescripts/__tests__/directory above was taken after that removal, which is what makes the 11 failures attributable.Step 2(b) — what changed
One docblock paragraph on
buildViteConfiginpackages/create-plugin/src/templates.ts. It records the measurement, names the two pins and their assertion texts, explains why the emitted shape is nevertheless right for the generator's actual audience (a plugin in its own repo, where the emitted config is the only config and thetestblock is the only thing giving the example test a DOM), and says explicitly not to teach the templates in-repo target detection.No generated file changes —
buildPackageJson,buildViteConfig's returned string,buildVitestSetupand the rest are byte-identical. The changeset therefore has empty frontmatter:node scripts/check-changeset-presence.mjsrequires a declaration becausesrc/of a released package moved, and "this releases nothing" is the explicit exemption it names.Zone-2 assumptions: one falsified
templates.ts:150emitstest: 'vitest run'; thetestblock andVITEST_SETUP_FILEare where the dispatch said.scripts/__tests__/package-scripts-vitest-projects.test.tsdoes not walk workspace packages'testscripts. It reads the rootpackage.jsonfor--projectvalues and checks each is declared invitest.config.mts(objectui#7096). It stayed green with the scaffold planted. The loudness comes fromvitest-invocation-guard.test.tsandrunner-package-test-entry-3746.test.tsinstead — the answer is still (b), by a different route than the dispatch predicted.vite.config.tscontains zero occurrences ofassertCanonicalVitestInvocation, so the guard cannot fire from it. Every red is repo-side.a9e6f04b4.Gates on
121147911Exit codes captured by redirect-then-capture, never through a pipe.
pnpm exec vitest run scripts/__tests__/(whole directory)pnpm type-check:scriptspnpm lint:rootpnpm check:entry-guardpnpm check:control-bytesOK (scanned 6449 tracked text file(s); skipped 85 binary)grep -naPcontrol-byte self-scan of both changed filesnode scripts/check-changeset-presence.mjsnode scripts/check-changeset-no-major.mjsnode scripts/check-governed-queue-guard.mjs --test packages/create-plugin/src/templates.tsNOT GOVERNEDpnpm --filter @object-ui/create-plugin testTest Files 1 passed (1),Tests 19 passed (19)pnpm --filter @object-ui/create-plugin type-checkpnpm --filter @object-ui/create-plugin lintcheck:unreferenced-sources,check:phantom-deps,check:self-import,check:published-distFlake, not a regression. The first whole-directory run exited 1 on two cases in
check-doc-links.test.ts(agrees with the real renderers on every heading in the scan surface,has no setext headings…), both withError: Test timed out in 15000ms— timeouts, not assertion failures, in a run whose total duration was 145s under container contention. Re-run alone on the same HEAD: exit 0,Test Files 1 passed (1),Tests 121 passed (121), 10.36s. This diff touches no markdown that gate scans; the AGENTS.md flaky-test section describes this signature exactly.pnpm check:skill-exampleswas not run and is not owed: the diff touches nothing underskills/, and the only skill mentions of this generator are a prose line and abashfence (pnpm create-plugin my-widget) — that gate judges markedts/tsx/jsonfences.Live E2E (informational)is red on every branch today for an upstream reason (objectui#7990); not from this change.Out of scope, filed separately
objectui#8041 — the scaffolded
package.jsondeclareslicense: "MIT"whilebuildPluginFileswrites no LICENSE file, so a published scaffolded plugin ships a tarball claiming a licence whose text is absent. Surfaced by the same measurement (package-files-exist.test.tsreds on it), deliberately not touched here because this card's ruling holds the scaffolder's published output constant. Filed unassigned, no labels, for triage.🤖 Generated with Claude Code
https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Generated by Claude Code