diff --git a/desktop/docs/dependencies.md b/desktop/docs/dependencies.md index 314ddcc5a..502ea6ea9 100644 --- a/desktop/docs/dependencies.md +++ b/desktop/docs/dependencies.md @@ -32,8 +32,30 @@ There is also a third environment that gets temporarily created: [Electron Builder](https://www.electron.build) is used for packaging the app for distribution. +During the build it uses +[electron-builder-notarize](https://github.com/karaggeorge/electron-builder-notarize) +to notarize the macOS binary. + ### next-electron-server This spins up a server for serving files using a protocol handler inside our Electron process. This allows us to directly use the output produced by `next build` for loading into our renderer process. + +### electron-reload + +Reloads contents of the BrowserWindow (renderer process) when source files are +changed. + +* TODO (MR): Do we need this? Isn't the next-electron-server HMR covering this? + +## DX + +See [web/docs/dependencies#DX](../../web/docs/dependencies.md#dx) for the +general development experience related dependencies like TypeScript etc, which +are similar to that in the web code. + +Some extra ones specific to the code here are: + +* [concurrently](https://github.com/open-cli-tools/concurrently) for spawning + parallel tasks when we do `yarn dev`. diff --git a/desktop/docs/dev.md b/desktop/docs/dev.md index 1e7d65cdf..a175f9b81 100644 --- a/desktop/docs/dev.md +++ b/desktop/docs/dev.md @@ -26,7 +26,7 @@ During development, you might find `yarn build:quick` helpful. It is a variant of `yarn build` that omits some steps to build a binary quicker, something that can be useful during development. -## postinstall +### postinstall When using native node modules (those written in C/C++), we need to ensure they are built against `electron`'s packaged `node` version. We use @@ -34,7 +34,7 @@ are built against `electron`'s packaged `node` version. We use to rebuild those modules automatically after each `yarn install` by invoking it in as the `postinstall` step in our package.json. -## lint and lint-fix +### lint and lint-fix Use `yarn lint` to check that your code formatting is as expected, and that there are no linter errors. Use `yarn lint-fix` to try and automatically fix the diff --git a/desktop/electron-builder.yml b/desktop/electron-builder.yml new file mode 100644 index 000000000..fb147b572 --- /dev/null +++ b/desktop/electron-builder.yml @@ -0,0 +1,43 @@ +appId: io.ente.bhari-frame +artifactName: ${productName}-${version}-${arch}.${ext} +nsis: + deleteAppDataOnUninstall: true +linux: + target: + - target: AppImage + arch: + - x64 + - arm64 + - target: deb + arch: + - x64 + - arm64 + - target: rpm + arch: + - x64 + - arm64 + - target: pacman + arch: + - x64 + - arm64 + icon: ./resources/icon.icns + category: Photography +mac: + target: + target: default + arch: + - universal + category: public.app-category.photography + hardenedRuntime: true + x64ArchFiles: Contents/Resources/ggmlclip-mac +afterSign: electron-builder-notarize +asarUnpack: + - node_modules/ffmpeg-static/bin/${os}/${arch}/ffmpeg + - node_modules/ffmpeg-static/index.js + - node_modules/ffmpeg-static/package.json +extraFiles: + - from: build + to: resources +files: + - app/**/* + - out diff --git a/desktop/package.json b/desktop/package.json index 25bf9d66f..3dafdce33 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -56,73 +56,5 @@ "prettier-plugin-packagejson": "^2.4", "typescript": "^5" }, - "build": { - "appId": "io.ente.bhari-frame", - "artifactName": "${productName}-${version}-${arch}.${ext}", - "nsis": { - "deleteAppDataOnUninstall": true - }, - "linux": { - "target": [ - { - "target": "AppImage", - "arch": [ - "x64", - "arm64" - ] - }, - { - "target": "deb", - "arch": [ - "x64", - "arm64" - ] - }, - { - "target": "rpm", - "arch": [ - "x64", - "arm64" - ] - }, - { - "target": "pacman", - "arch": [ - "x64", - "arm64" - ] - } - ], - "icon": "./resources/icon.icns", - "category": "Photography" - }, - "mac": { - "target": { - "target": "default", - "arch": [ - "universal" - ] - }, - "category": "public.app-category.photography", - "hardenedRuntime": true, - "x64ArchFiles": "Contents/Resources/ggmlclip-mac" - }, - "afterSign": "electron-builder-notarize", - "asarUnpack": [ - "node_modules/ffmpeg-static/bin/${os}/${arch}/ffmpeg", - "node_modules/ffmpeg-static/index.js", - "node_modules/ffmpeg-static/package.json" - ], - "extraFiles": [ - { - "from": "build", - "to": "resources" - } - ], - "files": [ - "app/**/*", - "out" - ] - }, "productName": "ente" } diff --git a/web/docs/dependencies.md b/web/docs/dependencies.md index 8f5ace071..14cb61417 100644 --- a/web/docs/dependencies.md +++ b/web/docs/dependencies.md @@ -1,18 +1,25 @@ # Dependencies -## Global +## DX These are some global dev dependencies in the root `package.json`. These set the -baseline for how our code be in all the workspaces in the monorepo. +baseline for how our code be in all the workspaces in this (yarn) monorepo. * "prettier" - Formatter * "eslint" - Linter * "typescript" - Type checker -They also need some support packages: +They also need some support packages, which come from the leaf `@/build-config` +package: * "@typescript-eslint/parser" - Tells ESLint how to read TypeScript syntax * "@typescript-eslint/eslint-plugin" - Provides TypeScript rules and presets +* "eslint-plugin-react-hooks", "eslint-plugin-react-namespace-import" - Some + React specific ESLint rules and configurations that are used by the workspaces + that have React code. +* "prettier-plugin-organize-imports" - A Prettier plugin to sort imports. +* "prettier-plugin-packagejson" - A Prettier plugin to also prettify + `package.json`. ## Utils