Skip to content

feat: build cli types during docs sync#1882

Merged
Rich-Harris merged 6 commits intomainfrom
sv-utils
Mar 22, 2026
Merged

feat: build cli types during docs sync#1882
Rich-Harris merged 6 commits intomainfrom
sv-utils

Conversation

@jycouet
Copy link
Copy Markdown
Contributor

@jycouet jycouet commented Mar 21, 2026

Adds @sveltejs/sv-utils types support for twoslash hover info in cli docs.

  • Post-clone hook runs pnpm install && pnpm build on the cli repo so .d.mts types are generated
  • Symlinks sv and @sveltejs/sv-utils in node_modules to the cloned repo so twoslash resolves PR branch types
  • Adds @sveltejs/sv-utils to twoslash compiler types

Related: sveltejs/cli#997

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 21, 2026

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

Project Deployment Actions Updated (UTC)
svelte-dev Ready Ready Preview Mar 22, 2026 5:08pm

Request Review

@Rich-Harris
Copy link
Copy Markdown
Member

I wonder if we should generalise this, so that we use the PR for Svelte and Kit types as well? This is a frequent nuisance on those repos

@jycouet
Copy link
Copy Markdown
Contributor Author

jycouet commented Mar 22, 2026

I wonder if we should generalise this, so that we use the PR for Svelte and Kit types as well? This is a frequent nuisance on those repos

Good idea! Done.
Added post_clone for svelte and kit that patches node_modules/<pkg>/types/ with the cloned repo's types dir. Since both repos commit types/index.d.ts -> no build is needed. Just copying the types/ folder is enough for twoslash to resolve mports against the PR branch. right?

WDYT?

@Rich-Harris
Copy link
Copy Markdown
Member

sounds great! let's try it

@Rich-Harris Rich-Harris merged commit a765841 into main Mar 22, 2026
2 checks passed
@Rich-Harris Rich-Harris deleted the sv-utils branch March 22, 2026 17:30
@teemingc
Copy link
Copy Markdown
Member

Thank you! Been thinking about how to do this and thought about making CI run pnpm i with overrides on workspace repos. This is better

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.

3 participants