Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web] Prettier upgrade

Manav Rathi17aa1b67c196
diff --git a/web/README.md b/web/README.md
index ca1a76228d..794de5298e 100644
--- a/web/README.md
+++ b/web/README.md
@@ -4,8 +4,8 @@ Source code for Ente's various web apps and supporting websites.
Live versions are at:
-- Ente Photos: [web.ente.io](https://web.ente.io)
-- Ente Auth: [auth.ente.io](https://auth.ente.io)
+- Ente Photos: [web.ente.io](https://web.ente.io)
+- Ente Auth: [auth.ente.io](https://auth.ente.io)
To know more about Ente, see [our main README](../README.md) or visit
[ente.io](https://ente.io).
@@ -52,18 +52,18 @@ For more details about development workflows, see [docs/dev](docs/dev.md).
As a brief overview, this directory contains the following apps:
-- `apps/photos`: A fully functional web client for Ente Photos.
-- `apps/auth`: A view only client for Ente Auth. Currently you can only view
- your 2FA codes using this web app. For adding and editing your 2FA codes,
- please use the Ente Auth [mobile/desktop app](../auth/README.md) instead.
+- `apps/photos`: A fully functional web client for Ente Photos.
+- `apps/auth`: A view only client for Ente Auth. Currently you can only view
+ your 2FA codes using this web app. For adding and editing your 2FA codes,
+ please use the Ente Auth [mobile/desktop app](../auth/README.md) instead.
These are the public facing apps. There are other part of the code which are
accessed as features within the main apps, but in terms of code are
independently maintained and deployed:
-- `apps/accounts`: Passkey support.
-- `apps/cast`: Browser and Chromecast casting support.
-- `apps/payments`: Handle subscription payments.
+- `apps/accounts`: Passkey support.
+- `apps/cast`: Browser and Chromecast casting support.
+- `apps/payments`: Handle subscription payments.
> Apart from these, we also have the manage family portal whose code is
> currently in a separate repository (https://github.com/ente-io/families) and
diff --git a/web/apps/payments/README.md b/web/apps/payments/README.md
index 4b0f99402a..e8b3cf40ab 100644
--- a/web/apps/payments/README.md
+++ b/web/apps/payments/README.md
@@ -7,9 +7,9 @@ Stripe's API for payments.
There are three pieces that need to be connected to have a working local setup:
-- A client app
-- This web app
-- Museum
+- A client app
+- This web app
+- Museum
### Client app
diff --git a/web/docs/dependencies.md b/web/docs/dependencies.md
index 11937b95c7..85bface438 100644
--- a/web/docs/dependencies.md
+++ b/web/docs/dependencies.md
@@ -5,46 +5,46 @@
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 this (yarn) monorepo.
-- [prettier](https://prettier.io) - Formatter
+- [prettier](https://prettier.io) - Formatter
-- [eslint](https://eslint.org) - Linter
+- [eslint](https://eslint.org) - Linter
-- [typescript](https://www.typescriptlang.org/) - Type checker
+- [typescript](https://www.typescriptlang.org/) - Type checker
They also need some support packages, which come from the leaf `@/build-config`
package:
-- [@eslint/js](https://eslint.org/) provides JavaScript ESLint functionality,
- and provides the configuration recommended the by ESLint team.
+- [@eslint/js](https://eslint.org/) provides JavaScript ESLint functionality,
+ and provides the configuration recommended the by ESLint team.
-- [typescript-eslint](https://typescript-eslint.io/packages/typescript-eslint/)
- \- provides TypeScript ESLint functionality and provides a set of
- recommended configurations (`typescript-eslint` is the new entry point, our
- yet-unmigrated packages use the older method of separately including
- [@typescript-eslint/parser](https://typescript-eslint.io/packages/eslint-plugin/)
- \- which tells ESLint how to read TypeScript syntax - and
- [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/packages/eslint-plugin/)
- \- which provides the TypeScript rules and presets).
+- [typescript-eslint](https://typescript-eslint.io/packages/typescript-eslint/)
+ \- provides TypeScript ESLint functionality and provides a set of recommended
+ configurations (`typescript-eslint` is the new entry point, our yet-unmigrated
+ packages use the older method of separately including
+ [@typescript-eslint/parser](https://typescript-eslint.io/packages/eslint-plugin/)
+ \- which tells ESLint how to read TypeScript syntax - and
+ [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/packages/eslint-plugin/)
+ \- which provides the TypeScript rules and presets).
-- [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react),
- [eslint-plugin-react-hooks](https://reactjs.org/) \- Some React specific
- ESLint rules and configurations that are used by the workspaces that have
- React code.
+- [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react),
+ [eslint-plugin-react-hooks](https://reactjs.org/) \- Some React specific
+ ESLint rules and configurations that are used by the workspaces that have
+ React code.
-- [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh)
- \- A plugin to ensure that React components are exported in a way that they
- can be HMR-ed.
+- [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh)
+ \- A plugin to ensure that React components are exported in a way that they
+ can be HMR-ed.
-- [prettier-plugin-organize-imports](https://github.com/simonhaenisch/prettier-plugin-organize-imports)
- \- A Prettier plugin to sort imports.
+- [prettier-plugin-organize-imports](https://github.com/simonhaenisch/prettier-plugin-organize-imports)
+ \- A Prettier plugin to sort imports.
-- [prettier-plugin-packagejson](https://github.com/matzkoh/prettier-plugin-packagejson)
- \- A Prettier plugin to also prettify `package.json`.
+- [prettier-plugin-packagejson](https://github.com/matzkoh/prettier-plugin-packagejson)
+ \- A Prettier plugin to also prettify `package.json`.
The root `package.json` also has a convenience dev dependency:
-- [concurrently](https://github.com/open-cli-tools/concurrently) for spawning
- parallel tasks when we invoke various yarn scripts.
+- [concurrently](https://github.com/open-cli-tools/concurrently) for spawning
+ parallel tasks when we invoke various yarn scripts.
## Cryptography
@@ -120,12 +120,12 @@ DateTimePicker component provided by MUI.
For showing the app's UI in multiple languages, we use the
[i18next](https://www.i18next.com), specifically its three components
-- [i18next](https://github.com/i18next/i18next): The core `i18next` library.
-- [react-i18next](https://github.com/i18next/react-i18next): React specific
- support in `i18next`.
-- [i18next-http-backend](https://github.com/i18next/i18next-http-backend):
- Adds support for initializing `i18next` with JSON file containing the
- translation in a particular language, fetched at runtime.
+- [i18next](https://github.com/i18next/i18next): The core `i18next` library.
+- [react-i18next](https://github.com/i18next/react-i18next): React specific
+ support in `i18next`.
+- [i18next-http-backend](https://github.com/i18next/i18next-http-backend): Adds
+ support for initializing `i18next` with JSON file containing the translation
+ in a particular language, fetched at runtime.
Note that inspite of the "next" in the name of the library, it has nothing to do
with Next.js.
@@ -134,97 +134,96 @@ For more details, see [translations.md](translations.md).
### Other UI components
-- [formik](https://github.com/jaredpalmer/formik) provides an easier to use
- abstraction for dealing with form state, validation and submission states
- when using React.
+- [formik](https://github.com/jaredpalmer/formik) provides an easier to use
+ abstraction for dealing with form state, validation and submission states when
+ using React.
-- [react-select](https://react-select.com/) is used for search dropdowns.
+- [react-select](https://react-select.com/) is used for search dropdowns.
-- [react-otp-input](https://github.com/devfolioco/react-otp-input) is used to
- render a segmented OTP input field for 2FA authentication.
+- [react-otp-input](https://github.com/devfolioco/react-otp-input) is used to
+ render a segmented OTP input field for 2FA authentication.
## Utilities
-- [comlink](https://github.com/GoogleChromeLabs/comlink) provides a minimal
- layer on top of web workers to make them more easier to use.
+- [comlink](https://github.com/GoogleChromeLabs/comlink) provides a minimal
+ layer on top of web workers to make them more easier to use.
-- [idb](https://github.com/jakearchibald/idb) provides a promise API over the
- browser-native IndexedDB APIs.
+- [idb](https://github.com/jakearchibald/idb) provides a promise API over the
+ browser-native IndexedDB APIs.
> For more details about IDB and its role, see [storage.md](storage.md).
-- [zod](https://github.com/colinhacks/zod) is used for runtime typechecking
- (e.g. verifying that API responses match the expected TypeScript shape).
+- [zod](https://github.com/colinhacks/zod) is used for runtime typechecking
+ (e.g. verifying that API responses match the expected TypeScript shape).
-- [nanoid](https://github.com/ai/nanoid) is used for generating unique
- identifiers. For one particular use case, we also need
- [uuid](https://github.com/uuidjs/uuid) for UUID v4 generation.
+- [nanoid](https://github.com/ai/nanoid) is used for generating unique
+ identifiers. For one particular use case, we also need
+ [uuid](https://github.com/uuidjs/uuid) for UUID v4 generation.
-- [bs58](https://github.com/cryptocoinjs/bs58) is used for base-58 conversion
- (used for encoding the collection key to use as the hash in the share URL).
+- [bs58](https://github.com/cryptocoinjs/bs58) is used for base-58 conversion
+ (used for encoding the collection key to use as the hash in the share URL).
-- [debounce](https://github.com/sindresorhus/debounce) and its
- promise-supporting sibling
- [pDebounce](https://github.com/sindresorhus/p-debounce) are used for
- debouncing operations (See also: `[Note: Throttle and debounce]`).
+- [debounce](https://github.com/sindresorhus/debounce) and its
+ promise-supporting sibling
+ [pDebounce](https://github.com/sindresorhus/p-debounce) are used for
+ debouncing operations (See also: `[Note: Throttle and debounce]`).
-- [zxcvbn](https://github.com/dropbox/zxcvbn) is used for password strength
- estimation.
+- [zxcvbn](https://github.com/dropbox/zxcvbn) is used for password strength
+ estimation.
## Media
-- [ffmpeg.wasm](https://github.com/ffmpegwasm/ffmpeg.wasm) is used to run
- FFmpeg in the browser using WASM. Note that this is substantially slower
- than native ffmpeg (the desktop app can, and does, bundle the faster native
- ffmpeg implementation too).
+- [ffmpeg.wasm](https://github.com/ffmpegwasm/ffmpeg.wasm) is used to run FFmpeg
+ in the browser using WASM. Note that this is substantially slower than native
+ ffmpeg (the desktop app can, and does, bundle the faster native ffmpeg
+ implementation too).
-- [ExifReader](https://github.com/mattiasw/ExifReader) is used for Exif
- parsing.
+- [ExifReader](https://github.com/mattiasw/ExifReader) is used for Exif parsing.
-- [jszip](https://github.com/Stuk/jszip) is used for reading zip files in the
- web code (Live photos are zip files under the hood). Note that the desktop
- app uses also has a ZIP parser (that one supports streaming).
+- [jszip](https://github.com/Stuk/jszip) is used for reading zip files in the
+ web code (Live photos are zip files under the hood). Note that the desktop app
+ uses also has a ZIP parser (that one supports streaming).
-- [file-type](https://github.com/sindresorhus/file-type) is used for MIME type
- detection. We are at an old version 16.5.4 because v17 onwards the package
- became ESM only - for our limited use case, the custom Webpack configuration
- that it'd entail is not worth the upgrade.
+- [file-type](https://github.com/sindresorhus/file-type) is used for MIME type
+ detection. We are at an old version 16.5.4 because v17 onwards the package
+ became ESM only - for our limited use case, the custom Webpack configuration
+ that it'd entail is not worth the upgrade.
-- [heic-convert](https://github.com/catdad-experiments/heic-convert) is used
- for converting HEIC files (which browsers don't natively support) into JPEG.
+- [heic-convert](https://github.com/catdad-experiments/heic-convert) is used for
+ converting HEIC files (which browsers don't natively support) into JPEG.
## Photos app specific
-- [react-dropzone](https://github.com/react-dropzone/react-dropzone/) is a
- React hook to create a drag-and-drop input zone.
+- [react-dropzone](https://github.com/react-dropzone/react-dropzone/) is a React
+ hook to create a drag-and-drop input zone.
-- [sanitize-filename](https://github.com/parshap/node-sanitize-filename) is
- for converting arbitrary strings into strings that are suitable for being
- used as filenames.
+- [sanitize-filename](https://github.com/parshap/node-sanitize-filename) is for
+ converting arbitrary strings into strings that are suitable for being used as
+ filenames.
-- [chrono-node](https://github.com/wanasit/chrono) is used for parsing natural
- language queries into dates for showing search results.
+- [chrono-node](https://github.com/wanasit/chrono) is used for parsing natural
+ language queries into dates for showing search results.
-- [matrix](https://github.com/mljs/matrix) is mathematical matrix abstraction
- by the machine learning code. It is used alongwith
- [similarity-transformation](https://github.com/shaileshpandit/similarity-transformation-js)
- during face alignment.
+- [matrix](https://github.com/mljs/matrix) is mathematical matrix abstraction by
+ the machine learning code. It is used alongwith
+ [similarity-transformation](https://github.com/shaileshpandit/similarity-transformation-js)
+ during face alignment.
### UI
-- [react-top-loading-bar](https://github.com/klendi/react-top-loading-bar) is
- used for showing a progress indicator for global actions (This shouldn't be
- used always, it is only meant as a fallback when there isn't an otherwise
- suitable place for showing a local activity indicator).
+- [react-top-loading-bar](https://github.com/klendi/react-top-loading-bar) is
+ used for showing a progress indicator for global actions (This shouldn't be
+ used always, it is only meant as a fallback when there isn't an otherwise
+ suitable place for showing a local activity indicator).
-- [pure-react-carousel](https://github.com/express-labs/pure-react-carousel)
- is used for the feature carousel on the welcome (login / signup) screen.
+- [pure-react-carousel](https://github.com/express-labs/pure-react-carousel) is
+ used for the feature carousel on the welcome (login / signup) screen.
## Auth app specific
-- [otpauth](https://github.com/hectorm/otpauth) is used for the generation of
- the actual OTP from the user's TOTP/HOTP secret.
+- [otpauth](https://github.com/hectorm/otpauth) is used for the generation of
+ the actual OTP from the user's TOTP/HOTP secret.
-- However, otpauth doesn't support steam OTPs. For these, we need to compute
- the SHA-1, and we use the same library, `jssha` that `otpauth` uses since it
- is already part of our bundle (transitively).
+- However, otpauth doesn't support steam OTPs. For these, we need to compute the
+ SHA-1, and we use the same library, `jssha` that `otpauth` uses since it is
+ already part of our bundle (transitively).
diff --git a/web/docs/deploy.md b/web/docs/deploy.md
index 74c3f25b4d..2b2d59890c 100644
--- a/web/docs/deploy.md
+++ b/web/docs/deploy.md
@@ -3,17 +3,17 @@
The various web apps and static sites in this repository are deployed on
Cloudflare Pages using GitHub workflows.
-- Automated production deployments of `main` daily 8:00 AM IST.
+- Automated production deployments of `main` daily 8:00 AM IST.
-- Automated staging deployments `*.ente.sh` of `main` daily 3:00 PM IST.
+- Automated staging deployments `*.ente.sh` of `main` daily 3:00 PM IST.
-- [help.ente.io](https://help.ente.io) gets deployed whenever a PR that
- changes anything inside `docs/` gets merged to `main`.
+- [help.ente.io](https://help.ente.io) gets deployed whenever a PR that changes
+ anything inside `docs/` gets merged to `main`.
-- Production or staging deployments can made manually by triggering the
- corresponding workflow. There is variant to deploy a single app to
- production using the `web-deploy-one.yml` workflow, and a variant to deploy
- any one of the apps to `preview.ente.sh` (see below).
+- Production or staging deployments can made manually by triggering the
+ corresponding workflow. There is variant to deploy a single app to production
+ using the `web-deploy-one.yml` workflow, and a variant to deploy any one of
+ the apps to `preview.ente.sh` (see below).
These GitHub workflows use the various `yarn deploy:*` commands. For example,
`yarn deploy:photos` will open a PR to merge the current `main` onto
@@ -46,13 +46,13 @@ deployments, and the action that triggers them:
Apart from this, there are also some other deployments:
-- `albums.ente.io` is a CNAME alias to the production deployment
- (`web.ente.io`). However, when the code detects that it is being served from
- `albums.ente.io`, it redirects to the `/shared-albums` page (Enhancement:
- serve it as a separate app with a smaller bundle size).
+- `albums.ente.io` is a CNAME alias to the production deployment
+ (`web.ente.io`). However, when the code detects that it is being served from
+ `albums.ente.io`, it redirects to the `/shared-albums` page (Enhancement:
+ serve it as a separate app with a smaller bundle size).
-- `family.ente.io` is currently in a separate repository (Enhancement: bring
- it in here).
+- `family.ente.io` is currently in a separate repository (Enhancement: bring it
+ in here).
### Preview deployments
@@ -101,9 +101,9 @@ The remaining steps are documented in
[Cloudflare's guide for using Direct Upload with CI](https://developers.cloudflare.com/pages/how-to/use-direct-upload-with-continuous-integration/).
As a checklist,
-- Generate `CLOUDFLARE_API_TOKEN`
-- Add `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` to the GitHub secrets
-- Add your workflow. e.g. see `docs-deploy.yml`.
+- Generate `CLOUDFLARE_API_TOKEN`
+- Add `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` to the GitHub secrets
+- Add your workflow. e.g. see `docs-deploy.yml`.
This is the basic setup, and should already work.
diff --git a/web/docs/dev.md b/web/docs/dev.md
index 953aa005e4..a719c678f1 100644
--- a/web/docs/dev.md
+++ b/web/docs/dev.md
@@ -4,8 +4,8 @@
We recommend VS Code, with the following extensions:
-- Prettier - reformats your code automatically (enable format on save),
-- ESLint - warns you about issues
+- Prettier - reformats your code automatically (enable format on save),
+- ESLint - warns you about issues
Optionally, if you're going to make many changes to the CSS in JS, you might
also find it useful to install the _vscode-styled-components_ extension.
diff --git a/web/docs/storage.md b/web/docs/storage.md
index 8be709f222..0a1ed94d68 100644
--- a/web/docs/storage.md
+++ b/web/docs/storage.md
@@ -17,10 +17,10 @@ The data in local storage is tied to the Document's origin (scheme + host).
Some things that get stored here are:
-- Details about the logged in user, in particular their user id and a auth
- token we can use to make API calls on their behalf.
+- Details about the logged in user, in particular their user id and a auth token
+ we can use to make API calls on their behalf.
-- Various user preferences
+- Various user preferences
## IndexedDB
@@ -39,8 +39,8 @@ but otherwise does not introduce any new abstractions.
For more details, see:
-- https://web.dev/articles/indexeddb
-- https://github.com/jakearchibald/idb
+- https://web.dev/articles/indexeddb
+- https://github.com/jakearchibald/idb
## OPFS
diff --git a/web/docs/translations.md b/web/docs/translations.md
index aec15da07c..285138a0e1 100644
--- a/web/docs/translations.md
+++ b/web/docs/translations.md
@@ -13,34 +13,33 @@ such source key-value to our
Everyday, we run a [GitHub workflow](../../.github/workflows/web-crowdin.yml)
that
-- Uploads sources to Crowdin - So any new key value pair we add in the source
- `translation.json` becomes available to translators to translate.
+- Uploads sources to Crowdin - So any new key value pair we add in the source
+ `translation.json` becomes available to translators to translate.
-- Downloads translations from Crowdin - So any new translations that
- translators have made on the Crowdin dashboard (for existing sources) will
- be added to the corresponding `lang/translation.json`.
+- Downloads translations from Crowdin - So any new translations that translators
+ have made on the Crowdin dashboard (for existing sources) will be added to the
+ corresponding `lang/translation.json`.
The workflow also uploads existing translations and also downloads new sources
from Crowdin, but these two should be no-ops.
## Adding a new string
-- Add a new entry in `packages/base/locales/en-US/translation.json` (the
- **source `translation.json`**).
-- Use the new key in code with the `t` function
- (`import { t } from "i18next"`).
-- During the next sync, the workflow will upload this source item to Crowdin's
- dashboard, allowing translators to translate it.
+- Add a new entry in `packages/base/locales/en-US/translation.json` (the
+ **source `translation.json`**).
+- Use the new key in code with the `t` function (`import { t } from "i18next"`).
+- During the next sync, the workflow will upload this source item to Crowdin's
+ dashboard, allowing translators to translate it.
## Updating an existing string
-- Update the existing value for the key in the source `translation.json`.
-- During the next sync, the workflow will clear out all the existing
- translations so that they can be translated afresh.
+- Update the existing value for the key in the source `translation.json`.
+- During the next sync, the workflow will clear out all the existing
+ translations so that they can be translated afresh.
## Deleting an existing string
-- Remove the key value pair from the source `translation.json`.
-- During the next sync, the workflow will delete that source item from all
- existing translations (both in the Crowdin project and also from the he
- other `lang/translation.json` files in the repository).
+- Remove the key value pair from the source `translation.json`.
+- During the next sync, the workflow will delete that source item from all
+ existing translations (both in the Crowdin project and also from the he other
+ `lang/translation.json` files in the repository).
diff --git a/web/package.json b/web/package.json
index 8fed07bf19..28c2efbb73 100644
--- a/web/package.json
+++ b/web/package.json
@@ -37,7 +37,7 @@
"devDependencies": {
"concurrently": "^9.1.0",
"eslint": "^9.15.0",
- "prettier": "^3.3.3",
+ "prettier": "^3.4.2",
"typescript": "^5.6.3"
},
"packageManager": "[email protected]"
diff --git a/web/yarn.lock b/web/yarn.lock
index 793f1ba0cf..de81cea4e5 100644
--- a/web/yarn.lock
+++ b/web/yarn.lock
@@ -3171,10 +3171,10 @@ prettier-plugin-packagejson@^2.5.3:
sort-package-json "2.10.1"
synckit "0.9.2"
-prettier@^3.3.3:
- version "3.3.3"
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
- integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
+prettier@^3.4.2:
+ version "3.4.2"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f"
+ integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==
process-nextick-args@~2.0.0:
version "2.0.1"