Skip to content
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

fix: backwards compatibility for types #8721

Merged
merged 19 commits into from
Jun 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
this maybe?
  • Loading branch information
gtm-nayan committed Jun 12, 2023
commit e9d9decb53a2fc1f04408a4e060bba1a13de5cc6
3 changes: 2 additions & 1 deletion packages/svelte/scripts/generate-dts.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
import { createBundle } from 'dts-buddy';

fs.readdirSync('src/runtime', { withFileTypes: true })
.filter((dirent) => dirent.isDirectory() && !dirent.name.includes('internal'))
.filter((dirent) => dirent.isDirectory())
.forEach((dirent) => fs.writeFileSync(`${dirent.name}.d.ts`, `import 'types/index.d.ts';`));
gtm-nayan marked this conversation as resolved.
Show resolved Hide resolved

fs.writeFileSync('index.d.ts', `import 'types/index.d.ts';`);
@@ -23,6 +23,7 @@ await createBundle({
'svelte/action': 'src/runtime/action/public.d.ts',
'svelte/animate': 'src/runtime/animate/public.d.ts',
'svelte/easing': 'src/runtime/easing/index.js',
'svelte/internal': 'src/runtime/internal/public.d.ts',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was deliberately excluded — if someone is importing svelte/internal in their app, their typechecking should fail

'svelte/motion': 'src/runtime/motion/public.d.ts',
'svelte/store': 'src/runtime/store/public.d.ts',
'svelte/transition': 'src/runtime/transition/public.d.ts'
2 changes: 1 addition & 1 deletion packages/svelte/src/runtime/internal/public.d.ts
Original file line number Diff line number Diff line change
@@ -92,4 +92,4 @@ export interface EventDispatcher<EventMap extends Record<string, any>> {
): boolean;
}

export * from './index.js';
export { SvelteComponent, SvelteComponentDev };