fix(sveltekit): repair entgo-sveltekit build and bound the cookie override - #5299
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (4)
📜 Recent review details⏰ Context from checks skipped due to timeout. (5)
📝 WalkthroughWalkthroughThe templates migrate Tailwind CSS from configuration files and directives to the Tailwind Vite plugin. Both Svelte configurations update the ChangesTailwind Vite migration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
Pull request overview
This PR fixes pnpm run build for the entgo-sveltekit/template by updating SvelteKit/Vite preprocess integration, bounding the cookie pnpm override to an API-compatible patched version, and migrating the template’s Tailwind setup to Tailwind v4’s Vite plugin approach.
Changes:
- Explicitly declare
@sveltejs/vite-plugin-svelte@^7.2.0and switchvitePreprocessimports to the new source. - Bound pnpm
cookieoverride from an open-ended range to^0.7.2to avoid breaking majors while staying past the security fix line. - Migrate
entgo-sveltekit/templateTailwind integration to@tailwindcss/vite, removing the v3-style PostCSS/Tailwind config files and updating CSS entrypoint.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sveltekit-embed/template/svelte.config.js | Updates vitePreprocess import to @sveltejs/vite-plugin-svelte. |
| sveltekit-embed/template/package.json | Adds explicit @sveltejs/vite-plugin-svelte and bounds cookie override. |
| sveltekit-embed/template/pnpm-lock.yaml | Locks cookie to 0.7.2 and updates Svelte plugin resolution accordingly. |
| entgo-sveltekit/template/vite.config.ts | Adds @tailwindcss/vite plugin to Vite config. |
| entgo-sveltekit/template/svelte.config.js | Updates vitePreprocess import to @sveltejs/vite-plugin-svelte. |
| entgo-sveltekit/template/src/lib/assets/post.css | Switches Tailwind directives to Tailwind v4-style @import "tailwindcss". |
| entgo-sveltekit/template/postcss.config.cjs | Removes PostCSS plugin configuration no longer used under the v4 Vite plugin setup. |
| entgo-sveltekit/template/tailwind.config.cjs | Removes Tailwind v3-era config file as part of v4 migration. |
| entgo-sveltekit/template/package.json | Adds @sveltejs/vite-plugin-svelte and @tailwindcss/vite, and bounds cookie override. |
| entgo-sveltekit/template/pnpm-lock.yaml | Locks updated dependency graph including bounded cookie and Tailwind v4 Vite plugin stack. |
Files not reviewed (2)
- entgo-sveltekit/template/pnpm-lock.yaml: Generated file
- sveltekit-embed/template/pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.
Files not reviewed (2)
- entgo-sveltekit/template/pnpm-lock.yaml: Generated file
- sveltekit-embed/template/pnpm-lock.yaml: Generated file
Suppressed comments (1)
entgo-sveltekit/template/src/lib/assets/post.css:2
- The header comment still says this file is written in PostCSS syntax, but the Tailwind v4 setup now uses the Vite plugin and a plain CSS
@import "tailwindcss". Update the comment to avoid misleading template users.
/* Write your global styles here, in PostCSS syntax */
@import "tailwindcss";
…rride Follow-up to #5290, which noted that `pnpm run build` fails in entgo-sveltekit/template. Three separate breakages were stacked on top of each other; all reproduce on master without any of these changes. 1. @sveltejs/vite-plugin-svelte stuck at 2.5.3 Same root cause as the esbuild/yaml issue in #5290: the plugin is an auto-installed peer dependency, so pnpm pinned it once and never re-resolved it. 2.5.3 is far outside the `^3 || ^4 || ^5 || ^6 || ^7` range that @sveltejs/kit 2.70.1 requires, which is why importing `vitePreprocess` failed. Declared it explicitly at ^7.2.0 in both templates and moved the import to `@sveltejs/vite-plugin-svelte`, where it now lives. 2. Unbounded cookie override resolving to a breaking major `"cookie": ">=0.7.0"` had resolved to cookie 2.0.1, which no longer exports `parse`/`serialize`, breaking SvelteKit's server runtime at build time. This is exactly the failure mode an open-ended manual override invites. Bounded to `^0.7.2`: still above the GHSA-pxg6-pf52-xh8x fix line, but API-compatible with what SvelteKit expects. The override is still required and is not removed -- @sveltejs/kit depends on `cookie@^0.6.0`, which resolves to a vulnerable version on its own. 3. Tailwind CSS 3 -> 4 bumped without the config migration Dependabot bumped tailwindcss across the major boundary, but the v3-style PostCSS setup was never migrated. Switched entgo-sveltekit to the `@tailwindcss/vite` plugin (the documented v4 + Vite setup), replaced the `@tailwind` directives with `@import "tailwindcss"`, and removed postcss.config.cjs, tailwind.config.cjs, autoprefixer and postcss-load-config, which are all redundant under v4. Going through PostCSS instead does not work here: vite's postcss-import tries to resolve `@import "tailwindcss"` as a file path. `pnpm run build` now completes successfully in entgo-sveltekit/template. sveltekit-embed still does not build Fixes 1 and 2 are applied there as well, since they are correct regardless, but the template remains blocked on a separate issue: @skeletonlabs/skeleton was bumped 2 -> 5, which removed AppShell, AppBar, LightSwitch and storeHighlightJs along with the `tailwind/skeleton.cjs` and `styles/skeleton.css` entry points the recipe imports. Rewriting the demo UI against Skeleton 5 is a recipe change rather than a dependency fix, so it is left to a separate PR and the Tailwind v4 migration is not applied there yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ea7bWcx58vqScAQoerh2Go
Raised by Copilot on review. Neither template declared `engines.node`, so
a Node 18 user gets an opaque install or build failure instead of a clear
requirement.
To be precise about the cause: this is not new to this PR. vite@8
(`^20.19.0 || >=22.12.0`) and eslint@10 (`^20.19.0 || ^22.13.0 || >=24`)
were already in both manifests on master, so the Node 18 floor predates
these changes. `@sveltejs/vite-plugin-svelte@7.2.0`
(`^20.19 || ^22.12 || >=24`) matches what was already required rather than
raising it. The constraint was simply never written down.
The declared range is the intersection of all three, which also excludes
22.0 through 22.12 and the non-LTS 23.x line:
^20.19 || ^22.13 || >=24
`pnpm install --frozen-lockfile` and `pnpm run build` are unaffected.
c83fe09 to
de9e973
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.
Files not reviewed (2)
- entgo-sveltekit/template/pnpm-lock.yaml: Generated file
- sveltekit-embed/template/pnpm-lock.yaml: Generated file
Suppressed comments (1)
entgo-sveltekit/template/src/lib/assets/post.css:1
- The header comment says this file is written "in PostCSS syntax", but it now contains a standard CSS
@import "tailwindcss"(Tailwind v4) and no longer uses Tailwind's PostCSS directives. Updating the comment avoids confusion for template users.
/* Write your global styles here, in PostCSS syntax */
Follow-up to #5290, which noted that
pnpm run buildfails inentgo-sveltekit/template. Three separate breakages turned out to be stacked on top of each other. All of them reproduce onmasterwithout these changes.1.
@sveltejs/vite-plugin-sveltestuck at 2.5.3Same root cause as the
esbuild/yamlissue in #5290: the plugin is an auto-installed peer dependency, so pnpm resolved it once and never revisited it. 2.5.3 is far outside the^3 || ^4 || ^5 || ^6 || ^7range that@sveltejs/kit@2.70.1requires, henceThe requested module '@sveltejs/kit/vite' does not provide an export named 'vitePreprocess'.Declared it explicitly at
^7.2.0in both templates and moved the import to@sveltejs/vite-plugin-svelte, wherevitePreprocessnow lives.2. Unbounded
cookieoverride resolving to a breaking major"cookie": ">=0.7.0"had resolved to cookie 2.0.1, which no longer exportsparse/serialize, breaking SvelteKit's server runtime at build time:This is precisely the failure mode an open-ended manual override invites, the pattern #5290 described, now actually biting. Bounded to
^0.7.2: still above the GHSA-pxg6-pf52-xh8x fix line, but API-compatible with what SvelteKit expects.The override is still required and is not removed:
@sveltejs/kitdepends oncookie@^0.6.0, which resolves to a vulnerable version on its own.3. Tailwind CSS 3 to 4 bumped without the config migration
Dependabot bumped
tailwindcssacross the major boundary, but the v3-style PostCSS setup was never migrated, so the build died on "It looks like you're trying to usetailwindcssdirectly as a PostCSS plugin."Migrated
entgo-sveltekitto the@tailwindcss/viteplugin (the documented v4 plus Vite setup):vite.config.ts, added thetailwindcss()pluginsrc/lib/assets/post.css,@tailwind base/components/utilitiesbecomes@import "tailwindcss"postcss.config.cjs,tailwind.config.cjs,autoprefixerandpostcss-load-config, all redundant under v4 (content is auto-detected, vendor prefixing is built in)Going through
@tailwindcss/postcssinstead does not work here. Vite'spostcss-importtries to resolve@import "tailwindcss"as a file path and fails withENOENT. The Vite plugin sidesteps that pipeline entirely.Result
pnpm run buildcompletes successfully inentgo-sveltekit/template, andpnpm install --frozen-lockfilepasses, so the lockfile matches the manifest.sveltekit-embedstill does not buildFixes 1 and 2 are applied there too, since they are correct regardless. The template remains blocked on a separate problem:
@skeletonlabs/skeletonwas bumped 2 to 5, which removedAppShell,AppBar,LightSwitchandstoreHighlightJs, along with thetailwind/skeleton.cjsandstyles/skeleton.cssentry points the recipe imports. None of these exist in the v5 package, whose only exports are.,./package.jsonand./themes/*.That is handled in #5302, which is stacked on this PR. The Tailwind v4 migration is deliberately not applied to that template here, since it would land half-finished.
Summary by CodeRabbit
New Features
Bug Fixes
Chores