-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(types): use dts-buddy to generate types with map #751
Conversation
…pe definitions and tsconfig
@Rich-Harris in #658 you did an export of index.js from a d.ts files which I didn't use here. Was that something that has changed in dts-buddy or is this one here holding it wrong? |
example of the script that validates types are in sync https://github.com/sveltejs/vite-plugin-svelte/actions/runs/6207076288/job/16851955290?pr=751#step:12:18 |
hmm, dts-buddy pulling in an older version of ts isn't optimal... |
…n after release merge
Bumped dts-buddy, so that it now consumes TypeScript as a peer dependency.
The reason for that is that people should be able to do this... import type { CompileOptions } from '@sveltejs/vite-plugin-svelte'; ...which isn't possible if the |
hmm, i think this works. Not for CompileOptions as that is now imported from svelte-4 and only part of the Options type of vite-plugin-svelte, but here is the type in the namespace and at least in my local tests import {svelte} from '@sveltejs/vite-plugin-svelte';
import {defineConfig} from 'vite';
export default defineConfig({
plugins: [
svelte({
// yay for autocomplete
})
]
}) note that in this repo the output of dts-buddy is commited, so /types/index.d.ts is what is going to get published. a mismatch is prevented by calling a script that ensures the output is in sync with the current repo content. |
…nctions are properly exported through module declaration generated by dts-buddy; move dynamicCompileOptions to PluginOptions, rename SvelteOptions to SvelteConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not a fan of dts-buddy 😬 But I won't block the PR if you want to merge it.
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
and cleanup type definitions and tsconfig
This introduces a
types:generate
script that has to be called every time you change a type to update types/index.d.ts which is commited.Having the generated file in the repo ensures that we are able to review changes in public types and can prevent unintended drift or breaking changes