diff --git a/docs/src/Electron How To/preload-script.md b/docs/src/Electron How To/preload-script.md index 698facf0..dd41dd40 100644 --- a/docs/src/Electron How To/preload-script.md +++ b/docs/src/Electron How To/preload-script.md @@ -8,13 +8,13 @@ For compatibility and security with the latest version of Electron, we do not re Vutron's preload script is located in the `src/preload` folder. To create a new IPC communication channel, add the channel name to the following variable to whitelist it for communication. -* `mainAvailChannels`: Send an event from main to renderer. (`window.mainApi.send('channelName'')`) -* `rendererAvailChannels`: Send an event from renderer to main. (`mainWindow.webContents.send('channelName')`) +- `mainAvailChannels`: Send an event from main to renderer. (`window.mainApi.send('channelName'')`) +- `rendererAvailChannels`: Send an event from renderer to main. (`mainWindow.webContents.send('channelName')`) When sending events from renderer to main, you access the `window.mainApi` object instead of `ipcRenderer.send`. The `mainApi` is the name you set in your Vutron template and can be changed. Here are the supported functions for mainApi: (To change and modify this, you need to modify `exposeInMainWorld` in `src/preload/index.ts`). -* `send`: Send an event to main. -* `receive`: A listener to receive events sent by main. -* `invoke`: Functions that can send events to main and receive data asynchronously. +- `send`: Send an event to main. +- `receive`: A listener to receive events sent by main. +- `invoke`: Functions that can send events to main and receive data asynchronously. diff --git a/docs/src/Installation and Build/npm-scripts.md b/docs/src/Installation and Build/npm-scripts.md index 026e580d..b0578d4e 100644 --- a/docs/src/Installation and Build/npm-scripts.md +++ b/docs/src/Installation and Build/npm-scripts.md @@ -9,22 +9,23 @@ order: 3 ## General -| Script Name | Description | -| --- | --- | -| `dev` | Start Electron as a development environment | -| `dev:debug` | Start Electron as a development environment (with vite debug) | -| `dev:debug:force` | Start Electron as a development environment (with vite debug + clean vite cache) | -| `build` | Build a specified package for the entire operating system (Requires cross-platform build configuration) | -| `build:pre` | Commands commonly run at build time. This script does not need to be run separately. | -| `build:dir` | `electron-builder` directory build | -| `build:mac` | Build preconfigured packages for macOS | -| `build:linux` | Build preconfigured packages for Linux | -| `build:win` | Build preconfigured packages for Windows | -| `lint` | ESLint code inspection. It does not modify the code. | -| `lint:fix` | ESLint code inspection. Use auto-fix to fix your code. | -| `format` | Prettier code inspection. It does not modify the code. | -| `format:fix` | Prettier code inspection. Use auto-fix to fix your code. | -| `test` | Build a package for testing and run tests against the test specification file. | +| Script Name | Description | +|-------------------|---------------------------------------------------------------------------------------------------------| +| `dev` | Start Electron as a development environment | +| `dev:debug` | Start Electron as a development environment (with vite debug) | +| `dev:debug:force` | Start Electron as a development environment (with vite debug + clean vite cache) | +| `build:pre` | Commands commonly run at build time. This script does not need to be run separately. | +| `build` | Build the package for the current operating system. | +| `build:all` | Build a specified package for the entire operating system (Requires cross-platform build configuration) | +| `build:dir` | `electron-builder` directory build | +| `build:mac` | Build preconfigured packages for macOS | +| `build:linux` | Build preconfigured packages for Linux | +| `build:win` | Build preconfigured packages for Windows | +| `lint` | ESLint code inspection. It does not modify the code. | +| `lint:fix` | ESLint code inspection. Use auto-fix to fix your code. | +| `format` | Prettier code inspection. It does not modify the code. | +| `format:fix` | Prettier code inspection. Use auto-fix to fix your code. | +| `test` | Build a package for testing and run tests against the test specification file. | ## For Documentation diff --git a/package.json b/package.json index 41f41c5f..ac533de8 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "dev": "cross-env ELECTRON_ENABLE_LOGGING=true vite", "dev:debug": "vite -d", "dev:debug:force": "vite -d --force", + "build": "npm run build:pre && electron-builder --config=buildAssets/builder/config.ts", "build:pre": "npm run format:fix && vue-tsc --noEmit && vite build", "build:all": "npm run build:pre && electron-builder --config=buildAssets/builder/config.ts -wml", "build:dir": "npm run build:pre && electron-builder --config=buildAssets/builder/config.ts --dir",