-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: backwards compatibility for types #8721
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
Changes from 5 commits
64e7987
94522ee
26c5568
c3730b8
d6b7b24
ba3140d
e9d9dec
b52339b
fbe3ba5
46c6c77
d8a1bec
a6c6fc5
e828216
edc2ded
734bdd7
0ad3db3
d067e2e
d8570c2
0195883
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,28 @@ | ||
| import * as fs from 'fs'; | ||
| import { createBundle } from 'dts-buddy'; | ||
|
|
||
| fs.mkdirSync('types/faux', { recursive: true }); | ||
| fs.readdirSync('src/runtime', { withFileTypes: true }) | ||
| .filter((dirent) => dirent.isDirectory()) | ||
| .forEach((dirent) => | ||
| fs.writeFileSync(`types/faux/${dirent.name}.d.ts`, `import '../index.d.ts';`) | ||
| ); | ||
|
|
||
| fs.writeFileSync('types/faux/index.d.ts', `import '../index.d.ts';`); | ||
| fs.writeFileSync('types/faux/compiler.d.ts', `import '../index.d.ts';`); | ||
|
|
||
| // TODO: some way to mark these as deprecated | ||
| fs.mkdirSync('types/faux/types/compiler', { recursive: true }); | ||
| fs.writeFileSync('types/faux/types/compiler/preprocess.d.ts', `import '../index.d.ts';`); | ||
| fs.writeFileSync('types/faux/types/compiler/interfaces.d.ts', `import '../index.d.ts';`); | ||
|
|
||
| await createBundle({ | ||
| output: 'types/index.d.ts', | ||
| modules: { | ||
| svelte: 'src/runtime/public.d.ts', | ||
| 'svelte/compiler': 'src/compiler/public.d.ts', | ||
| 'svelte/types/compiler/preprocess': 'src/compiler/preprocess/public.d.ts', | ||
| 'svelte/types/compiler/interfaces': 'src/compiler/interfaces.d.ts', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What uses this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vite plugin svelte and at least one other thing on the CI list
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should update them to use |
||
| 'svelte/action': 'src/runtime/action/public.d.ts', | ||
| 'svelte/animate': 'src/runtime/animate/public.d.ts', | ||
| 'svelte/easing': 'src/runtime/easing/index.js', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| declare module '*.svelte' { | ||
| export { SvelteComponentDev as default } from 'svelte/internal'; | ||
| export { SvelteComponent as default } from 'svelte'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
|
|
||
| "baseUrl": ".", | ||
| "paths": { | ||
| "svelte": ["."], | ||
| "svelte/*": ["*"] | ||
| }, | ||
| "allowJs": true, | ||
|
|
||
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.
Does this include internal? Should be filtered out probably