Skip to content

Add a test to prevent README framework list drift - #991

Merged
2chanhaeng merged 5 commits into
fedify-dev:mainfrom
yerpark:issue-888-webframework-list-sync
Aug 12, 2026
Merged

Add a test to prevent README framework list drift#991
2chanhaeng merged 5 commits into
fedify-dev:mainfrom
yerpark:issue-888-webframework-list-sync

Conversation

@yerpark

@yerpark yerpark commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

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 label values 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: its label was "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 init prompt 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.ts key label before label after README.md
bare-bones Bare-bones Bare-bones
astro Astro Astro
elysia ElysiaJS Elysia Elysia
express Express Express
hono Hono Hono
next Next.js Next.js
nitro Nitro Nitro
nuxt Nuxt Nuxt
solidstart SolidStart SolidStart
sveltekit SvelteKit SvelteKit

Impact of the label change

I searched the codebase for other uses of "ElysiaJS" and of the label field. label is only used for display text: the fedify init framework prompt, a package-manager compatibility message, and test:init's console output. No test or snapshot depends on the exact string, and the generated project files are unaffected. I have ran fedify init interactively to see the new prompt, and checked it.

How I tested this

  • mise run test:deno packages/init/src/webframeworks.test.ts
  • mise run check-each init

AI 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.values versus Object.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.

yerpark added 4 commits August 9, 2026 20:05
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
@netlify

netlify Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema canceled.

Name Link
🔨 Latest commit 56ab5c0
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a7c60b06fe3f8000827e0e7

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a47db555-68ed-4936-b4da-82d442b35a71

📥 Commits

Reviewing files that changed from the base of the PR and between db1c60f and 56ab5c0.

📒 Files selected for processing (1)
  • packages/init/src/webframeworks.test.ts

📝 Walkthrough

Walkthrough

The Elysia framework label changes from ElysiaJS to Elysia across the registry and tutorials. A test now checks that README framework labels match the registered framework list.

Changes

Elysia label consistency

Layer / File(s) Summary
Update Elysia framework labels
packages/init/src/webframeworks/elysia.ts, packages/init/src/types.ts, docs/tutorial/astro-blog.md, docs/tutorial/microblog.md
The registry label, type documentation, and tutorial examples now use Elysia instead of ElysiaJS.
Validate README framework labels
packages/init/src/webframeworks.test.ts
The test reads the README framework list and compares its labels with the registered framework labels.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

Suggested labels: type/documentation

Suggested reviewers: 2chanhaeng, dahlia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a test to detect drift between the README and framework registry.
Description check ✅ Passed The description directly explains the drift test, the Elysia label correction, related documentation updates, and validation steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dahlia dahlia added the component/cli CLI tools related label Aug 12, 2026
@dahlia dahlia added this to the Fedify 2.4 milestone Aug 12, 2026
dahlia
dahlia previously approved these changes Aug 12, 2026

@dahlia dahlia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine in general to me. @2chanhaeng Could you take a look?

sij411
sij411 previously approved these changes Aug 12, 2026
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
packages/init/src/webframeworks/elysia.ts 86.07% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@2chanhaeng 2chanhaeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Could you consider applying this comment? Thanks!

Comment thread packages/init/src/webframeworks.test.ts Outdated
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
@yerpark
yerpark dismissed stale reviews from sij411 and dahlia via 56ab5c0 August 12, 2026 12:01
@yerpark
yerpark requested a review from 2chanhaeng August 12, 2026 12:06
@2chanhaeng

Copy link
Copy Markdown
Member

Great work! Thanks for your contribution!

@2chanhaeng
2chanhaeng merged commit c392379 into fedify-dev:main Aug 12, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/cli CLI tools related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants