Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Document better

Manav Rathic8b9b4cd8f87
diff --git a/desktop/README.md b/desktop/README.md
index 9d637de04f..e947e2a70a 100644
--- a/desktop/README.md
+++ b/desktop/README.md
@@ -10,12 +10,6 @@ To know more about Ente, see [our main README](../README.md) or visit
## Building from source
-> [!CAUTION]
->
-> We moved a few things around when switching to a monorepo recently, and the
-> desktop app is not currently building with these instructions below. Hang
-> tight, we're on it, and will fix soon.
-
Fetch submodules
```sh
@@ -28,22 +22,32 @@ Install dependencies
yarn install
```
-Run the app
+Create a binary for your platform
```sh
-yarn dev
+yarn build
```
-To recompile automatically using electron-reload, run this in a separate
-terminal:
+## Developing
-```bash
-yarn watch
+Instead of building, you can run the app in development mode
+
+```sh
+yarn dev
```
-`yarn dev` is handy during development, but if you wish, you can also create a
-binary for your platform by using
+> [!CAUTION]
+>
+> `yarn dev` is currently not working (we'll fix soon). If you just want to
+> build from source and use the generated binary, use `yarn build` as described
+> above.
+
+This'll launch a development server to serve the pages loaded by the renderer
+process, and will hot reload on changes.
+
+If you also want hot reload for the main process, run this in a separate
+terminal:
```sh
-yarn build
+yarn watch
```
diff --git a/desktop/docs/dev.md b/desktop/docs/dev.md
new file mode 100644
index 0000000000..4575188fd4
--- /dev/null
+++ b/desktop/docs/dev.md
@@ -0,0 +1,4 @@
+# Development tips
+
+* `yarn build:quick` is a variant of `yarn build` that uses the
+ `--config.compression=store` flag to (slightly) speed up electron-builder.
diff --git a/desktop/package.json b/desktop/package.json
index b3db86f735..a835b81c6c 100644
--- a/desktop/package.json
+++ b/desktop/package.json
@@ -7,10 +7,10 @@
"main": "app/main.js",
"scripts": {
"build": "yarn build-renderer && yarn build-main",
- "build-local": "yarn build-renderer && yarn build-main-local",
"build-main": "tsc && electron-builder",
- "build-main-local": "tsc && electron-builder --config.compression=store",
+ "build-main:quick": "tsc && electron-builder --config.compression=store",
"build-renderer": "cd ../web && yarn install && yarn build:photos && cd ../desktop && rm -f out && ln -sf ../web/apps/photos/out",
+ "build:quick": "yarn build-renderer && yarn build-main:quick",
"dev": "concurrently \"yarn dev-main\" \"yarn dev-renderer\"",
"dev-main": "tsc && electron build/app/main.js",
"dev-renderer": "cd ../web && yarn install && yarn dev:photos",
diff --git a/desktop/src/utils/main.ts b/desktop/src/utils/main.ts
index 21bb3b9e7b..417e5cc483 100644
--- a/desktop/src/utils/main.ts
+++ b/desktop/src/utils/main.ts
@@ -79,6 +79,10 @@ export async function setupMainMenu(mainWindow: BrowserWindow) {
}
export function setupMainHotReload() {
+ // Hot reload the main process if anything changes in the source directory
+ // that we're running from. In particular, this gets triggered when `yarn
+ // watch` rebuilds JS files in the `app/` directory when we change the TS
+ // files in the `src/` directory.
if (isDev) {
electronReload(__dirname, {});
}