From 849b61c5cf9ff4924bb5f010dcb362df26d9431d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 11 Mar 2024 17:28:01 +0530 Subject: [PATCH] Document some and fix the path --- desktop/docs/README.md | 11 +++++++++++ desktop/docs/dependencies.md | 6 ++++++ desktop/docs/electron.md | 20 ++++++++++++++++++++ desktop/package.json | 10 +++++----- web/docs/README.md | 7 ++++--- 5 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 desktop/docs/README.md create mode 100644 desktop/docs/dependencies.md create mode 100644 desktop/docs/electron.md diff --git a/desktop/docs/README.md b/desktop/docs/README.md new file mode 100644 index 000000000..412e7f61c --- /dev/null +++ b/desktop/docs/README.md @@ -0,0 +1,11 @@ +# Developer docs + +If you just want to run the Ente Photos desktop app locally or develop it, you +can do: + + yarn install + yarn dev + +The docs in this directory provide more details that some developers might find +useful. You might also find the developer docs for +[web](../../web/docs/README.md) useful. diff --git a/desktop/docs/dependencies.md b/desktop/docs/dependencies.md new file mode 100644 index 000000000..8703331a2 --- /dev/null +++ b/desktop/docs/dependencies.md @@ -0,0 +1,6 @@ +# Dependencies + +See [web/docs/dependencies.md](../../web/docs/dependencies.md) for general web +specific dependencies. See [electron.md](electron.md) for our main dependency, +Electron. The rest of this document describes the remaining, desktop specific +dependencies that are used by the Photos desktop app. diff --git a/desktop/docs/electron.md b/desktop/docs/electron.md new file mode 100644 index 000000000..901da8be0 --- /dev/null +++ b/desktop/docs/electron.md @@ -0,0 +1,20 @@ +# Electron + +[Electron](https://www.electronjs.org) is a cross-platform (Linux, Windows, +macOS) way for creating desktop apps using TypeScript. + +Electron embeds Chromium and Node.js in the generated app's binary. The +generated app thus consists of two separate processes - the _main_ process, and +a _renderer_ process. + +* The _renderer_ process is a regular web app that gets loaded into the embedded + Chromium. In our case, we build a static export of the [Photos web + app](../web/README.md) and bundle it in the generated app's binary - at + runtime, the embedded Chromium loads this. + +* The _main_ process is runs the embedded Node.js. This code can deal with the + host OS - it is conceptually like a `node` repl running on your machine. In our + case, the TypeScript code (in the `src/` directory) gets transpiled by `tsc` + into JavaScript in the `app/` directory, which gets bundled in the generated + app's binary and is loaded by the `node` (main) process when it starts. +y diff --git a/desktop/package.json b/desktop/package.json index 8c8b51bfb..0c66b6e89 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -2,18 +2,18 @@ "name": "ente", "version": "1.6.63", "private": true, - "description": "Desktop client for ente.io", - "author": "ente ", + "description": "Desktop client for Ente Photos", + "author": "Ente ", "main": "app/main.js", "scripts": { "build": "yarn build-renderer && yarn build-main", - "build-main": "yarn install && tsc", + "build-main": "tsc", "build-renderer": "cd ../web && yarn install && yarn build:photos", "dev": "concurrently \"yarn dev-main\" \"yarn dev-renderer\"", "dev-main": "yarn build-main && electron app/main.js", "dev-renderer": "cd ../web && yarn install && yarn dev:photos", "postinstall": "electron-builder install-app-deps", - "lint": "yarn prettier --check . && eslint \"src/**/*.{js,jsx,ts,tsx}\"", + "lint": "yarn prettier --check . && eslint \"src/**/*.ts\"", "lint-fix": "yarn prettier --write . && eslint --fix .", "test-release": "cross-env IS_TEST_RELEASE=true yarn build && electron-builder --config.compression=store", "watch": "tsc -w" @@ -131,7 +131,7 @@ "files": [ "app/**/*", { - "from": "ui/apps/photos", + "from": "../web/apps/photos", "to": "ui", "filter": [ "!**/*", diff --git a/web/docs/README.md b/web/docs/README.md index fa2ab6f71..365d3bea0 100644 --- a/web/docs/README.md +++ b/web/docs/README.md @@ -1,8 +1,9 @@ # Developer docs -If you just want to run ente locally or develop on it, you can do +If you just want to run Ente's web apps locally or develop them, you can do - yarn + yarn install yarn dev -The docs in this directory are for more advanced or infrequently needed details. +The docs in this directory provide more details that some developers might find +useful.