feat(wbfy): unify generated command forms by target kind - #1217
Conversation
Canonicalize every generated command to one form per target kind: package scripts as `bun run <script>`, node_modules bins as `bun <bin>`, and tools outside node_modules bare. This removes the remaining deviations: `bun run playwright install…` in self-contained workflows and the bare `lefthook install` in the generated `prepare` script. Document the rule (including the no-script-shadowing-a-bin constraint) in docs/expected-repository-rules.md. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a unified command execution strategy for the wbfy generator. By canonicalizing how commands are invoked across package scripts, CI workflows, and build hooks, it ensures predictable behavior and avoids conflicts between package scripts and installed binaries. The changes improve consistency across the repository's tooling infrastructure. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Commands aligned in a row, From scripts to bins they flow. With Bun as the guide, No conflicts inside, And tools now have room to grow. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request standardizes command execution formats across package scripts, workflows, and documentation. It updates docs/expected-repository-rules.md to specify that package scripts should be run via bun run <script> and node_modules binaries via bun <bin>. Accordingly, the prepare script now uses bun lefthook install, and Playwright commands in workflows are simplified from bun run playwright to bun playwright. Unit tests have been updated to match these changes. There are no review comments, and I have no feedback to provide.
Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Review found three generator sites still violating the newly documented command-form rule: the bare `wb gen-code` postinstall segment, lefthook's `node node_modules/.bin/*` invocations (oxfmt, prettier, oxlint, sort-package-json, and the post-merge `wb prisma` hooks), and the release workflow's direct `node node_modules/semantic-release/bin/…` call. All now use the canonical `bun <bin>` form; `bun <bin>` respects the bins' Node shebang, so semantic-release still runs under real Node. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Bun strips a `--` appearing as the first argument after the bin name, so the terminator never reached sort-package-json after the `bun <bin>` migration; remove it instead of shipping a token that reads as a guard but does nothing. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
The lefthook cleanup fallback is reached only when the repository has no JS/TS and no Java, so its hasJsOrTs/hasJava blocks (oxfmt, prettier, oxlint) could never be emitted; delete them instead of carrying inert template code. Generated agent instructions invoked the wbfy-generated `verify`/`verify-full` package scripts as bare `bun verify`, violating the documented `bun run <script>` form; switch the generator and the checked-in generated files to `bun run verify`/`bun run verify-full`. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Customer Summary
Technical Summary
docs/expected-repository-rules.md: package scripts are invoked asbun run <script>,node_modulesbins asbun <bin>, and tools outsidenode_modules(mise-managed) bare — plus the operational constraint that no package script may share a bin's name (bun <name>prefers the script).selfContainedWorkflow.ts:bun run playwright install…→bun playwright install…;node node_modules/semantic-release/bin/…→bun semantic-release(Bun respects the bin's Node shebang, so it still runs under real Node).packageJson.ts: generatedprepareusesbun lefthook install || true; the managedpostinstallsegment is nowbun wb gen-codeinstead of barewb gen-code.lefthook.ts: post-merge hooks usebun wb prisma deploy/generate; the cleanup fallback usesbun sort-package-json(dropping a--terminator Bun strips when it is the first argument); deleted the provably unreachable oxfmt/prettier/oxlint blocks in that fallback (reached only when the repo has no JS/TS/Java, so those blocks could never be emitted).agents.ts: generated agent instructions invoke theverify/verify-fullpackage scripts asbun run verify/bun run verify-full; the checked-in generated files (AGENTS.md,CLAUDE.md,GEMINI.md,.cursor/rules/general.mdc) were regenerated to match.package.jsonpreparewas updated to the canonical output.Why
bun wb,bun run playwright, barelefthook,node node_modules/.bin/*), so correctness depended on which context a command ran in and hand-fixed forms were reverted on the next wbfy run. One form per target kind keeps every generated command copy-pasteable and context-independent, and matches wbfy's one-canonical-format philosophy.bun <bin>resolves the bin regardless of PATH, respects#!/usr/bin/env nodeshebangs (semantic-release still sees real Node), and fails cleanly when the bin is absent (|| truestill covers production installs).Testing
bun verify-fullpassed (exit 0) after each change set.bun test packages/wbfy/test/unit— 363 tests, 0 failures.bun <bin>, first-argument--stripping, script-over-bin shadowing, and clean failure for missing bins.🤖 Generated with Claude Code