-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR changes build script's `ide watch` and `ide start` commands, so they don't use `electron-builder` to package. Instead, they invoke `electron` directly, significantly reducing time overhead. `ide watch` will now start Electron process, while continuously rebuilding gui and the client in the background. Changes can be puilled by reloading within the electron, or closing the electron and letting it start once again. To stop, the script should be interrupted with `Ctrl+C`.
- Loading branch information
Showing
46 changed files
with
915 additions
and
448 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,26 @@ | ||
/** Helper module for running esbuild in watch mode. */ | ||
|
||
import * as esbuild from 'esbuild' | ||
|
||
/** Transform a given esbuild bundle option configuration into a watch configuration. | ||
* @param config - Configuration for the esbuild command. | ||
* @param onRebuild - Callback to be called after each rebuild. | ||
* @param inject - See [esbuild docs](https://esbuild.github.io/api/#inject). | ||
* | ||
**/ | ||
export function toWatchOptions( | ||
config: esbuild.BuildOptions, | ||
onRebuild?: () => void, | ||
inject?: esbuild.BuildOptions['inject'] | ||
): esbuild.BuildOptions { | ||
return { | ||
...config, | ||
inject: [...(config.inject ?? []), ...(inject ?? [])], | ||
watch: { | ||
onRebuild(error, result) { | ||
if (error) console.error('watch build failed:', error) | ||
else onRebuild?.() | ||
}, | ||
}, | ||
} | ||
} |
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,9 @@ | ||
/** This script creates a packaged IDE distribution using electron-builder. | ||
* | ||
* Behaviour details are controlled by the environment variables or CLI arguments. | ||
* @see Arguments | ||
**/ | ||
|
||
import { args, buildPackage } from './electron-builder-config.js' | ||
|
||
await buildPackage(args) |
Oops, something went wrong.