mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
8d00797ada
* refactor(cache): extract Cloudflare cache adapters into @vinext/cloudflare Move the Cloudflare KV data cache and edge CDN cache adapters out of vinext into a new publishable @vinext/cloudflare package: - cache/kv-data-adapter(.runtime).ts (KVCacheHandler, kvDataAdapter) - cache/cdn-adapter(.runtime).ts (CloudflareCdnCacheAdapter, cdnAdapter) tpr.ts stays in vinext. vinext now depends on @vinext/cloudflare (workspace:*) and the package declares vinext as a peer dep; both build from source via tsconfig paths so there is no build-order cycle. The vinext/cloudflare barrel still re-exports KVCacheHandler for back-compat. Wires up tsconfig paths, a vitest source alias, root build/postinstall, and the preview/publish workflows for the new package. Updates internal consumers (apps/web, examples/workers-cache), docs, and tests. * ci(create-next-app): install @vinext/cloudflare from local tarball vinext now depends on @vinext/cloudflare, which isn't published to npm yet. The create-next-app smoke test packs vinext locally and resolves its deps from the registry, so the install (and dev server) failed with ERR_PNPM_FETCH_404 for @vinext/cloudflare. Pack @vinext/cloudflare alongside vinext and add a pnpm override in the scaffolded project pointing at the local tarball so the dependency resolves offline. * refactor(cloudflare): address review feedback - Remove the root barrel export from @vinext/cloudflare; expose only the ./cache/* subpaths via a wildcard export (no root main/types). - vinext/cloudflare re-exports KVCacheHandler from the full subpath. - Drop the redundant .npmignore (the package.json "files" allowlist already restricts the publish to dist). - Remove the unsupported imperative setCacheHandler/KVCacheHandler usage from both READMEs; the cache plugin config is the supported approach. - Simplify test wiring: drop the now-unused @vinext/cloudflare tsconfig path and dedupe the vitest source alias into a shared constant. * chore(cloudflare): drop unused vite devDependency The @vinext/cloudflare config uses vite-plus and nothing imports vite, so the vite devDependency was unused. build/check/knip stay green without it. * Apply suggestion from @james-elicx
48 lines
1.4 KiB
JSON
48 lines
1.4 KiB
JSON
{
|
|
"name": "vinext-monorepo",
|
|
"private": true,
|
|
"scripts": {
|
|
"build": "vp run @vinext/cloudflare#build && vp run vinext#build",
|
|
"check": "vp check",
|
|
"test": "vp test run",
|
|
"test:unit": "vp test run --project unit",
|
|
"test:integration": "vp test run --project integration",
|
|
"test:watch": "vp test",
|
|
"generate:google-fonts": "node scripts/generate-google-fonts.js",
|
|
"fmt": "vp fmt",
|
|
"fmt:check": "vp fmt --check",
|
|
"lint": "vp lint",
|
|
"test:e2e": "playwright test",
|
|
"knip": "knip",
|
|
"changeset": "changeset",
|
|
"prepare": "vp config",
|
|
"postinstall": "vp run @vinext/cloudflare#build && vp run vinext#build"
|
|
},
|
|
"dependencies": {
|
|
"@mdx-js/react": "catalog:",
|
|
"@mdx-js/rollup": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@changesets/cli": "2.31.0",
|
|
"@mswjs/interceptors": "catalog:",
|
|
"@playwright/test": "catalog:",
|
|
"@types/node": "catalog:",
|
|
"@types/react": "catalog:",
|
|
"@types/react-dom": "catalog:",
|
|
"@typescript/native-preview": "catalog:",
|
|
"@vitejs/plugin-rsc": "catalog:",
|
|
"@vitest/coverage-istanbul": "catalog:",
|
|
"knip": "catalog:",
|
|
"msw": "catalog:",
|
|
"next": "catalog:",
|
|
"playwright": "catalog:",
|
|
"react": "catalog:",
|
|
"react-dom": "catalog:",
|
|
"typescript": "catalog:",
|
|
"vite": "catalog:",
|
|
"vite-plus": "catalog:",
|
|
"vitest": "catalog:"
|
|
},
|
|
"packageManager": "pnpm@11.1.1"
|
|
}
|