-
-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(template-vite): patch types (#3494)
- Loading branch information
1 parent
df984cb
commit 05ced0e
Showing
13 changed files
with
78 additions
and
29 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
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 |
---|---|---|
|
@@ -11,6 +11,5 @@ | |
"outDir": "dist", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["src"] | ||
} | ||
} |
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
6 changes: 4 additions & 2 deletions
6
packages/template/vite-typescript/tmpl/vite.renderer.config.ts
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export {}; // Make this a module | ||
|
||
declare global { | ||
// This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Vite | ||
// plugin that tells the Electron app where to look for the Vite-bundled app code (depending on | ||
// whether you're running in development or production). | ||
const MAIN_WINDOW_VITE_DEV_SERVER_URL: string; | ||
const MAIN_WINDOW_VITE_NAME: string; | ||
|
||
namespace NodeJS { | ||
interface Process { | ||
// Used for hot reload after preload scripts. | ||
viteDevServers: Record<string, import('vite').ViteDevServer>; | ||
} | ||
} | ||
|
||
type VitePluginConfig = ConstructorParameters<typeof import('@electron-forge/plugin-vite').VitePlugin>[0]; | ||
|
||
interface VitePluginRuntimeKeys { | ||
VITE_DEV_SERVER_URL: `${string}_VITE_DEV_SERVER_URL`; | ||
VITE_NAME: `${string}_VITE_NAME`; | ||
} | ||
} | ||
|
||
declare module 'vite' { | ||
interface ConfigEnv<K extends keyof VitePluginConfig = keyof VitePluginConfig> { | ||
root: string; | ||
forgeConfig: VitePluginConfig; | ||
forgeConfigSelf: VitePluginConfig[K][number]; | ||
} | ||
} |
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