From b1cafc4573be70a003c1228e5cf3873442048e52 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 14 Jun 2023 11:30:13 -0400 Subject: [PATCH] update type generation script (#8712) * chore: playground (#8648) * initialize playground * pnpm up * tidy up git ignore * remove fluff * format * rm readme * fix jsconfig error * add skip-worktree instructions * reload hack * simplify * use rollup * ughh * add flag for SSR * ... * simplify further * configure launch.json * add debugger info to readme * remove vm modules flag * use replaceAll instead of replace * tidy up * fix: make it run * add watch to launch config * Generate type declarations with `dts-buddy` (#8702) * use dts-buddy * remove debug output * remove existing type generation script * fix package.json * update gitignore * bump dts-buddy * remove unused action entry point * add svelte/compiler and svelte/types/compiler/preprocess modules * bump dts-buddy * annoying * changeset * bump dts-buddy * get rid of .d.ts files * another one * Update packages/svelte/package.json Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> --------- Co-authored-by: Rich Harris Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> * fix: export ComponentType (#8694) * fix: export ComponentType * ughh * changeset * fix: derived types (#8700) * fix: derived store types * changeset * Version Packages (next) (#8709) Co-authored-by: github-actions[bot] * update type generation script * remove unused stuff * fix: changeset publish script isn't called release anymore (#8711) * chore: remove prepare script (#8713) * chore: fix release workflow (#8716) * More readable, Fix $$_attributes * Fix types (#8727) * put comment in right place * bump dts-buddy --------- Co-authored-by: Rich Harris * build types * add svelte/compiler types * remove prepare script * fix * typo * squelch errors * Add svelte and kit to twoslash's types field * squelch more stuff * Add errors to account for new types * Remove deps * formatting tweak * fix linting, maybe * the hell * gah * Fix types a bit * bump dts-buddy * pnpm generate in dev mode * Cache again * reduce index * bump dts-buddy * remove comment --------- Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> Co-authored-by: Rich Harris Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] Co-authored-by: Dominik G Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Puru Vijay --- .../docs/03-runtime/02-svelte-store.md | 2 +- .../docs/03-runtime/07-svelte-action.md | 3 +- .../04-compiler-and-api/01-svelte-compiler.md | 5 + .../02-client-side-component-api.md | 31 ++-- package.json | 4 +- packages/svelte/package.json | 4 +- .../svelte/src/runtime/action/public.d.ts | 12 +- packages/svelte/src/runtime/internal/dev.js | 2 +- packages/svelte/src/runtime/internal/utils.js | 1 + packages/svelte/src/runtime/store/index.js | 6 - pnpm-lock.yaml | 70 ++------ sites/svelte.dev/package.json | 8 +- .../scripts/type-gen/compile-types.js | 127 -------------- .../scripts/type-gen/dts-sources/action.d.ts | 1 - .../scripts/type-gen/dts-sources/animate.d.ts | 1 - .../type-gen/dts-sources/compiler.d.ts | 1 - .../scripts/type-gen/dts-sources/easing.d.ts | 1 - .../scripts/type-gen/dts-sources/index.d.ts | 1 - .../type-gen/dts-sources/internal.d.ts | 1 - .../scripts/type-gen/dts-sources/motion.d.ts | 1 - .../scripts/type-gen/dts-sources/store.d.ts | 1 - .../type-gen/dts-sources/transition.d.ts | 1 - sites/svelte.dev/scripts/type-gen/index.js | 163 +++++------------- .../src/lib/server/markdown/renderer.js | 5 +- sites/svelte.dev/vercel.json | 5 +- 25 files changed, 104 insertions(+), 353 deletions(-) delete mode 100644 sites/svelte.dev/scripts/type-gen/compile-types.js delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/action.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/animate.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/compiler.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/easing.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/index.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/internal.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/motion.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/store.d.ts delete mode 100644 sites/svelte.dev/scripts/type-gen/dts-sources/transition.d.ts diff --git a/documentation/docs/03-runtime/02-svelte-store.md b/documentation/docs/03-runtime/02-svelte-store.md index 35ca93e1839b..203f040fba09 100644 --- a/documentation/docs/03-runtime/02-svelte-store.md +++ b/documentation/docs/03-runtime/02-svelte-store.md @@ -124,7 +124,7 @@ declare global { export {}; // @filename: index.ts -// @errors: 18046 +// @errors: 18046 2769 7006 // ---cut--- import { derived } from 'svelte/store'; diff --git a/documentation/docs/03-runtime/07-svelte-action.md b/documentation/docs/03-runtime/07-svelte-action.md index 77d2d83e0e2b..d7e8d0b4e063 100644 --- a/documentation/docs/03-runtime/07-svelte-action.md +++ b/documentation/docs/03-runtime/07-svelte-action.md @@ -58,7 +58,8 @@ Sometimes actions emit custom events and apply custom attributes to the element