mirror of
https://github.com/LukeHagar/sveltekit-adapters.git
synced 2025-12-10 12:47:49 +00:00
chore: Update package dependencies and configuration for Electron adapter
- Removed package manager and engines from package.json. - Updated pnpm-lock.yaml to reflect new versions of dependencies. - Modified pnpm-workspace.yaml to include only built dependencies for Electron. - Adjusted electron-builder.yaml to exclude unnecessary files and added output directory. - Deleted obsolete electron.vite.config.ts file. - Updated main entry point in examples/electron/package.json to use CommonJS format. - Refactored scripts in examples/electron/package.json for better development experience. - Enhanced error handling and logging in game logic within examples/electron/src/routes/sverdle/+page.server.ts. - Updated adapter-electron to support new protocol handling and build processes.
This commit is contained in:
51
packages/adapter-electron/index.d.ts
vendored
51
packages/adapter-electron/index.d.ts
vendored
@@ -1,10 +1,49 @@
|
||||
import { Adapter } from '@sveltejs/kit';
|
||||
import type { AdapterOptions as NodeAdapterOptions } from '@sveltejs/adapter-node';
|
||||
import './ambient.js';
|
||||
import type { Adapter } from '@sveltejs/kit';
|
||||
|
||||
interface AdapterOptions {
|
||||
export interface AdapterOptions {
|
||||
/**
|
||||
* Output directory for the Electron app
|
||||
* @default 'out'
|
||||
*/
|
||||
out?: string;
|
||||
options?: NodeAdapterOptions;
|
||||
|
||||
/**
|
||||
* Directory name for the protocol handler functions
|
||||
* @default 'functions'
|
||||
*/
|
||||
functions?: string;
|
||||
|
||||
/**
|
||||
* Whether to precompress static assets
|
||||
* @default false
|
||||
*/
|
||||
precompress?: boolean;
|
||||
}
|
||||
|
||||
export default function plugin(options?: AdapterOptions): Adapter;
|
||||
/**
|
||||
* SvelteKit adapter for Electron desktop apps
|
||||
*
|
||||
* This adapter:
|
||||
* 1. Builds the SvelteKit app using the static adapter for client assets
|
||||
* 2. Copies server files for SSR support
|
||||
* 3. Copies prerendered pages
|
||||
* 4. Provides a native Electron protocol handler that bypasses HTTP servers
|
||||
* 5. Outputs a complete Electron app structure ready for packaging
|
||||
*/
|
||||
declare function adapter(options?: AdapterOptions): Adapter;
|
||||
|
||||
export default adapter;
|
||||
|
||||
export interface ElectronPluginOptions {
|
||||
mainEntry?: string;
|
||||
preloadEntry?: string;
|
||||
mainOut?: string;
|
||||
preloadOut?: string;
|
||||
externalMain?: string[];
|
||||
externalPreload?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Vite plugin to build Electron main/preload files
|
||||
*/
|
||||
export declare function electronPlugin(options?: ElectronPluginOptions): any;
|
||||
|
||||
Reference in New Issue
Block a user