-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(types): use dts-buddy to generate types with map (#751)
* refactor(types): use dts-buddy to generate types with map, cleanup type definitions and tsconfig * chore: update generated types * fix: use .d.ts for type imports * fix: ignore .changesets/pre.json to prevent format check fails on main after release merge * fix: move types inside import condition to avoid masquerading as cjs warning * fix: types * bump dts-buddy * fix: regenerate types * fix: use correct type Options for plugin function arg * fix(types): reexport index.js from public.d.ts to ensure types and functions are properly exported through module declaration generated by dts-buddy; move dynamicCompileOptions to PluginOptions, rename SvelteOptions to SvelteConfig * fix: update lockfile * Update .changeset/metal-olives-wait.md Co-authored-by: Bjorn Lu <[email protected]> * fix: update types --------- Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Bjorn Lu <[email protected]>
- Loading branch information
1 parent
efd571f
commit 62afd80
Showing
33 changed files
with
475 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/vite-plugin-svelte': patch | ||
--- | ||
|
||
fix(types): use correct type Options for svelte function arg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/vite-plugin-svelte': major | ||
--- | ||
|
||
breaking: remove package.json export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@sveltejs/vite-plugin-svelte-inspector': major | ||
'@sveltejs/vite-plugin-svelte': major | ||
--- | ||
|
||
breaking(types): emit types with dts-buddy to include type map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/vite-plugin-svelte': major | ||
--- | ||
|
||
breaking(types): rename SvelteOptions to SvelteConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
{ | ||
"include": ["src"], | ||
"exclude": ["**/*.spec.ts"], | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"target": "ES2020", | ||
"module": "ES2020", | ||
"module": "ES2022", | ||
"moduleResolution": "node", | ||
"strict": true, | ||
"declaration": true, | ||
"sourceMap": true, | ||
"noUnusedLocals": true, | ||
"esModuleInterop": true, | ||
"baseUrl": ".", | ||
"resolveJsonModule": true, | ||
// see https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta/#use-unknown-catch-variables | ||
"useUnknownInCatchVariables": false, | ||
"allowJs": true, | ||
"checkJs": true | ||
"checkJs": true, | ||
"allowSyntheticDefaultImports": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
declare module '@sveltejs/vite-plugin-svelte-inspector' { | ||
export interface Options { | ||
/** | ||
* define a key combo to toggle inspector, | ||
* @default 'meta-shift' on mac, 'control-shift' on other os | ||
* | ||
* any number of modifiers `control` `shift` `alt` `meta` followed by zero or one regular key, separated by - | ||
* examples: control-shift, control-o, control-alt-s meta-x control-meta | ||
* Some keys have native behavior (e.g. alt-s opens history menu on firefox). | ||
* To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended. | ||
*/ | ||
toggleKeyCombo?: string; | ||
|
||
/** | ||
* define keys to select elements with via keyboard | ||
* @default {parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' } | ||
* | ||
* improves accessibility and also helps when you want to select elements that do not have a hoverable surface area | ||
* due to tight wrapping | ||
* | ||
* A note for users of screen-readers: | ||
* If you are using arrow keys to navigate the page itself, change the navKeys to avoid conflicts. | ||
* e.g. navKeys: {parent: 'w', prev: 'a', child: 's', next: 'd'} | ||
* | ||
* | ||
* parent: select closest parent | ||
* child: select first child (or grandchild) | ||
* next: next sibling (or parent if no next sibling exists) | ||
* prev: previous sibling (or parent if no prev sibling exists) | ||
*/ | ||
navKeys?: { parent: string; child: string; next: string; prev: string }; | ||
|
||
/** | ||
* define key to open the editor for the currently selected dom node | ||
* | ||
* @default 'Enter' | ||
*/ | ||
openKey?: string; | ||
|
||
/** | ||
* inspector is automatically disabled when releasing toggleKeyCombo after holding it for a longpress | ||
* @default true | ||
*/ | ||
holdMode?: boolean; | ||
|
||
/** | ||
* when to show the toggle button | ||
* @default 'active' | ||
*/ | ||
showToggleButton?: 'always' | 'active' | 'never'; | ||
|
||
/** | ||
* where to display the toggle button | ||
* @default top-right | ||
*/ | ||
toggleButtonPos?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; | ||
|
||
/** | ||
* inject custom styles when inspector is active | ||
*/ | ||
customStyles?: boolean; | ||
|
||
/** | ||
* internal options that are automatically set, not to be set or used by users | ||
* */ | ||
__internal?: { | ||
// vite base url | ||
base: string; | ||
}; | ||
} | ||
export function svelteInspector(options?: Partial<Options> | undefined): import('vite').Plugin; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
17 changes: 17 additions & 0 deletions
17
packages/vite-plugin-svelte-inspector/types/index.d.ts.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"version": 3, | ||
"file": "index.d.ts", | ||
"names": [ | ||
"Options", | ||
"svelteInspector" | ||
], | ||
"sources": [ | ||
"../src/public.d.ts", | ||
"../src/index.js" | ||
], | ||
"sourcesContent": [ | ||
null, | ||
null | ||
], | ||
"mappings": ";kBAAiBA,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCoBRC,eAAeA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.