Skip to content

Fix frontend typecheck, lint and high security alerts - #162

Open
LZylstra wants to merge 8 commits into
mainfrom
fix/frontend-typecheck-lint
Open

LZylstra wants to merge 8 commits into
mainfrom
fix/frontend-typecheck-lint

Conversation

@LZylstra

@LZylstra LZylstra commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

  • Fix the typecheck and lint errors in the Nuxt (cms and cms-i18n) and SvelteKit frontends. These were already failing on main.
  • Nuxt: the header and footer now use types that match the site data they get, instead of their own types that didn't match.
  • Nuxt: allow console.warn and console.error, but keep blocking console.log. The warnings added in Patch frontend dependency security advisories #154 were breaking lint.
  • SvelteKit: update the dropdown menu components to the current Svelte and bits-ui versions. They were written for older versions and caused most of the errors.
  • Fix the high security alerts that have a fix available:
    • Remove the unused shadcn CLI from the Next.js dependencies. It brought in an old, vulnerable copy of Zod.
    • Update the SvelteKit Vercel adapter.
    • Turn off SvelteKit's experimental remote functions. We don't use them, and they're where the open SvelteKit alert applies.

Potential Risks / Drawbacks

  • I haven't clicked through the SvelteKit dropdowns in a browser yet. The pages render the same as main, but the menus are worth a quick check on desktop and mobile.
  • The SvelteKit alert stays open on GitHub until we move to SvelteKit 3, which I'd like to do in its own PR.
  • The Astro path-to-regexp alert stays open. Vercel's routing package pins that version, it only runs at build time, and the only workaround is an override.

Tested Scenarios

  • Nuxt and SvelteKit typecheck, lint and build cleanly.
  • Next.js lint, tests and build still pass after removing shadcn.
  • The Nuxt and SvelteKit CMS frontends render the same pages as main against Directus 12.7.
  • Not tested: cms-i18n Nuxt at runtime (needs a licensed instance).

Review Notes

Both components declared their own prop types that didn't match /api/site-data (missing id, non-nullable logo and social links), so nuxt typecheck failed. A SiteData type now describes the fields the endpoint requests, and the endpoint asserts it once because the SDK can't narrow nested fields on items.
Count posts with aggregate() like the other frontends (readItems is typed as returning posts), type the search input handler the way cms-i18n already does, and give the 404 messages a typed fallback.
no-console blocked the intentional warnings and errors added in #154, so lint failed. It still blocks console.log, and the eslint-disable comment it needed is gone.
They were written for Svelte 4 and bits-ui 0.x while bits-ui 2.9.4 is installed, which accounted for all 54 svelte-check errors. Content still renders inline so it stays above the sticky header.
Drop unused superForm values, read props through $derived or untrack where the initial value is intended, and run prettier on files that never got formatted because eslint failed first.
Nothing imports it, and it pulled in Zod 3, flagged by GHSA-mrhx-c7xc-m3w5. Use npx shadcn@latest add to add components.
adapter-vercel 6.3.5 fixes the prerendered-path advisory. The starter uses no remote functions (getRequestEvent doesn't need the flag), so turning it off removes the surface for GHSA-3r8g-jcqq-3p5j until the SvelteKit 3 migration.
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cms-nextjs Ready Ready Preview Nov 18, 2026 11:53pm UTC
cms-nuxt Ready Ready Preview Nov 18, 2026 11:53pm UTC
cms-svelte Ready Ready Preview Nov 18, 2026 11:53pm UTC
pizza-frontend Ready Ready Preview Nov 18, 2026 11:53pm UTC
starters-nuxt-new Error Error Nov 18, 2026 11:53pm UTC
visual-editor-demo Ready Ready Preview Nov 18, 2026 11:53pm UTC

Request Review

This branch had an error being deployed

1 failed and 5 active deployments
Preview – visual-editor-demo — bda0792d Deployed Nov 18, 2026 by vercel[bot]
Preview – starters-nuxt-new — bda0792d Deployed Nov 18, 2026 by vercel[bot]
Preview – cms-nextjs — bda0792d Deployed Nov 18, 2026 by vercel[bot]
Preview – cms-nuxt — bda0792d Deployed Nov 18, 2026 by vercel[bot]
Preview – pizza-frontend — bda0792d Deployed Nov 18, 2026 by vercel[bot]
Preview – cms-svelte — bda0792d Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant