[PR #705] [MERGED] refactor: extract font plugins into src/plugins/fonts.ts #790

Closed
opened 2026-05-06 13:10:07 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/705
Author: @james-elicx
Created: 3/28/2026
Status: Merged
Merged: 3/28/2026
Merged by: @james-elicx

Base: mainHead: refactor/split-font-plugin


📝 Commits (1)

  • 38e710f refactor: extract font plugins into src/plugins/fonts.ts

📊 Changes

2 files changed (+738 additions, -673 deletions)

View changed files

📝 packages/vinext/src/index.ts (+13 -673)
packages/vinext/src/plugins/fonts.ts (+725 -0)

📄 Description

Summary

  • Extracts all Google Fonts and local fonts plugin logic out of the 4,600-line `index.ts` into a single focused file: `packages/vinext/src/plugins/fonts.ts`
  • `fonts.ts` exports two factory functions (`createGoogleFontsPlugin`, `createLocalFontsPlugin`) plus the shared helpers needed by `index.ts`'s `resolveId`/`load` hooks (`VIRTUAL_GOOGLE_FONTS`, `RESOLVED_VIRTUAL_GOOGLE_FONTS`, `generateGoogleFontsVirtualModule`, `parseStaticObjectLiteral`)
  • `index.ts` imports from `fonts.ts` and delegates to the factories, removing ~340 lines of inline plugin code

Testing

  • `vp check` passes on both changed files (no type errors, no lint errors, no format issues)
  • `pnpm test tests/shims.test.ts` — 758/758 pass
  • `pnpm test tests/features.test.ts` — 264/264 pass

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/705 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/28/2026 **Status:** ✅ Merged **Merged:** 3/28/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `refactor/split-font-plugin` --- ### 📝 Commits (1) - [`38e710f`](https://github.com/cloudflare/vinext/commit/38e710fdd02267a58230d8384087174c7b86183f) refactor: extract font plugins into src/plugins/fonts.ts ### 📊 Changes **2 files changed** (+738 additions, -673 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/index.ts` (+13 -673) ➕ `packages/vinext/src/plugins/fonts.ts` (+725 -0) </details> ### 📄 Description ## Summary - Extracts all Google Fonts and local fonts plugin logic out of the 4,600-line \`index.ts\` into a single focused file: \`packages/vinext/src/plugins/fonts.ts\` - \`fonts.ts\` exports two factory functions (\`createGoogleFontsPlugin\`, \`createLocalFontsPlugin\`) plus the shared helpers needed by \`index.ts\`'s \`resolveId\`/\`load\` hooks (\`VIRTUAL_GOOGLE_FONTS\`, \`RESOLVED_VIRTUAL_GOOGLE_FONTS\`, \`generateGoogleFontsVirtualModule\`, \`parseStaticObjectLiteral\`) - \`index.ts\` imports from \`fonts.ts\` and delegates to the factories, removing ~340 lines of inline plugin code ## Testing - \`vp check\` passes on both changed files (no type errors, no lint errors, no format issues) - \`pnpm test tests/shims.test.ts\` — 758/758 pass - \`pnpm test tests/features.test.ts\` — 264/264 pass --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:10:07 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#790
No description provided.