Add Marko framework support (marko-virtual) to the site#1019
Conversation
📝 WalkthroughWalkthroughAdds Marko as a supported framework: extends the Framework type union, framework metadata maps (labels, colors, logos), file icon detection, code block language fallback to HTML, and updates library descriptions/framework lists to include Marko. Separately, updates repo path segment regex to allow the ChangesMarko Framework Addition
Repo Path Segment Validation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/repo-path.ts (1)
3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd test coverage for the
+character.The regex change enabling
+in path segments (for+page.marko) isn't covered bytests/repo-path.test.ts. Consider adding an assertion likeisValidRepoPath('examples/marko/dynamic/src/routes/+page.marko')to lock in this behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/utils/repo-path.ts` at line 3, Add test coverage for the repo path segment regex change by updating tests/repo-path.test.ts to assert that a path containing a leading + segment is accepted, using isValidRepoPath with a case like examples/marko/dynamic/src/routes/+page.marko. This will lock in the behavior introduced by REPO_PATH_SEGMENT_PATTERN and ensure the + character remains valid in repo path segments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/utils/repo-path.ts`:
- Line 3: Add test coverage for the repo path segment regex change by updating
tests/repo-path.test.ts to assert that a path containing a leading + segment is
accepted, using isValidRepoPath with a case like
examples/marko/dynamic/src/routes/+page.marko. This will lock in the behavior
introduced by REPO_PATH_SEGMENT_PATTERN and ensure the + character remains valid
in repo path segments.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5804b446-becd-4c4b-9f0e-cd60b1ca94b0
⛔ Files ignored due to path filters (2)
src/images/file-icons/marko.svgis excluded by!**/*.svgsrc/images/marko-logo.svgis excluded by!**/*.svg
📒 Files selected for processing (9)
src/components/FileExplorer.tsxsrc/components/markdown/codeBlock.shared.tsxsrc/libraries/frameworks.tsxsrc/libraries/libraries.tssrc/libraries/types.tssrc/libraries/virtual.tsxsrc/utils/llms.tssrc/utils/npm-packages.tssrc/utils/repo-path.ts
Summary
Registers Marko as a supported framework on tanstack.com so the new TanStack Virtual Marko adapter (
@tanstack/marko-virtual) is surfaced across the site: the framework picker, per-framework docs routing, the libraries-by-framework pages, and the Virtual landing/branding.The Marko docs, sidebar config, and example apps already live in the Virtual repo (TanStack/virtual#1156, merged). This PR is the website-side work that makes them reachable, plus a couple of small fixes for Marko's file conventions that surfaced while testing.
Changes
Framework registration + branding
src/libraries/types.ts— add'marko'to theFrameworkunion (the single source of truth every other spot keys off).src/libraries/frameworks.tsx— add the Marko entry toframeworkOptions(logo, label, cyan accent matching the Marko mark).src/libraries/libraries.ts— add'marko'to the Virtual library'sframeworksand mention it in the description.src/libraries/virtual.tsx— mention Marko in the landing description.src/utils/npm-packages.ts— add amarkoentry toframeworkMeta(required by the exhaustiveRecord<Framework, …>).src/utils/llms.ts— add amarkoentry toframeworkLabels(same reason).src/images/marko-logo.svg— the official Marko mark (icon-only, frommarko-js/branding), matching the other framework logos in the picker.Fixes for Marko's conventions (found while testing)
src/utils/repo-path.ts— allow+in repo path segments. Marko Run names files with a leading+(+page.marko,+layout.marko,+handler.js); without this, every Marko example failed path validation with "invalid path" in the example source viewer.src/components/FileExplorer.tsx+src/images/file-icons/marko.svg— show a Marko icon for.markofiles in the Code Explorer tree (previously the generic text icon).src/components/markdown/codeBlock.shared.tsx— map.marko→htmlfor syntax highlighting.@tanstack/highlightships no Marko grammar, so html gives reasonable coloring for the tag/attribute-heavy example files. Partial by design: Marko-specific syntax such as<let/>, tag parameters|{ }|, and${}interpolation isn't tokenized specially.How to test
With the Virtual repo available (sibling checkout in dev, or remote docs), on the Virtual section:
/libraries/markolists Virtual..markofiles show the Marko icon in the Code Explorer tree and are syntax-highlighted.Notes / follow-ups (not in this repo)
@tanstack/marko-virtualisn't published to npm yet, so the interactive CodeSandbox/StackBlitz sandboxes for the Marko examples don't boot (the examplepackage.jsons useworkspace:*, and there's nothing on npm to install). Once the package is published, the Marko examples should be pinned to that version like the other frameworks. Tracked in the Virtual repo.docs/installation.mdin the Virtual repo has no Marko section, soinstallation#marko(the framework tile target) lands with no anchor to scroll to. A one-section addition there closes that gap.Screenshots
Summary by CodeRabbit
New Features
Bug Fixes
+characters in individual path segments.