Add a test to prevent README framework list drift - #991
Conversation
Assisted-by: Claude:claude-sonnet-5
Assisted-by: Claude:claude-sonnet-5
Assisted-by: Claude:claude-sonnet-5
These files quoted the fedify init CLI prompt or its JSDoc example before elysia.ts's label changed from "ElysiaJS" to "Elysia", so they no longer matched what the CLI actually shows. Changelog: none Assisted-by: Claude:claude-sonnet-5
✅ Deploy Preview for fedify-json-schema canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Elysia framework label changes from ChangesElysia label consistency
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
dahlia
left a comment
There was a problem hiding this comment.
Looks fine in general to me. @2chanhaeng Could you take a look?
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
2chanhaeng
left a comment
There was a problem hiding this comment.
Great work! Could you consider applying this comment? Thanks!
Sort + index comparison breaks when one entry is missing, because everything after it shifts and the error doesn't point at the real problem. Used Set.difference() in both directions instead, so the error message says exactly which frameworks are missing from each side. Assisted-by: Claude:claude-sonnet-5
|
Great work! Thanks for your contribution! |
Related issue
#888
Summary
fedify init's web framework list lives in two places: the framework registry in packages/init/src/webframeworks/mod.ts and the list in packages/init/README.md. The registry is source code, but the README is maintained by hand, so the two can drift apart without anyone noticing.This PR adds a test to webframeworks.test.ts that extracts both lists — the registry's
labelvalues and the framework names in the README — sorts them, and compares them entry by entry.While writing the test, the two lists did not match at first. The only difference turned out to be
elysia: itslabelwas"ElysiaJS", while the README and the rest of the documentation (docs/cli.md, docs/manual/integration.md) use"Elysia", matching the framework's own homepage branding. I fixed webframeworks/elysia.ts to use"Elysia"so the new test passes.That label change makes two tutorial pages stale, since they embed a literal transcript of the
fedify initprompt showing the old"ElysiaJS"text: I updated docs/tutorial/astro-blog.md, docs/tutorial/microblog.md, and, for consistency, a JSDoc example in packages/init/src/types.ts.Naming mismatch found
mod.tskeylabelbeforelabelafterbare-bonesBare-bonesBare-bonesastroAstroAstroelysiaElysiaJSElysiaElysiaexpressExpressExpresshonoHonoHononextNext.jsNext.jsnitroNitroNitronuxtNuxtNuxtsolidstartSolidStartSolidStartsveltekitSvelteKitSvelteKitImpact of the label change
I searched the codebase for other uses of
"ElysiaJS"and of thelabelfield.labelis only used for display text: thefedify initframework prompt, a package-manager compatibility message, andtest:init's console output. No test or snapshot depends on the exact string, and the generated project files are unaffected. I have ranfedify initinteractively to see the new prompt, and checked it.How I tested this
mise run test:deno packages/init/src/webframeworks.test.tsmise run check-each initAI usage
I used Claude (Sonnet 5) throughout this change: debugging the regex and
split()logic in the test, explaining JavaScript/TypeScript syntax I was unfamiliar with (object shorthand properties, regex anchors,Object.valuesversusObject.keys), researching Elysia's official display name, spotting the two tutorial pages that went stale because of the label change, and reviewing the test for redundant assertions. I wrote and understood the final test and fix myself, and ran the checks above to confirm the result.