mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
Add zod
zod required strict mode, which is why creating this "@/new" package was a prereq.
This commit is contained in:
parent
3f3a63d8da
commit
f663c436cb
@ -154,6 +154,19 @@ It is more lower level than Next, but the bells and whistles it doesn't have are
|
||||
the bells and whistles (and the accompanying complexity) that we don't need in
|
||||
some cases.
|
||||
|
||||
## General
|
||||
|
||||
- [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.
|
||||
|
||||
> 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).
|
||||
|
||||
## Media
|
||||
|
||||
- [jszip](https://github.com/Stuk/jszip) is used for reading zip files in
|
||||
@ -167,16 +180,6 @@ some cases.
|
||||
- [heic-convert](https://github.com/catdad-experiments/heic-convert) is used
|
||||
for converting HEIC files (which browsers don't natively support) into JPEG.
|
||||
|
||||
## General
|
||||
|
||||
- [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.
|
||||
|
||||
> For more details about IDB and its role, see [storage.md](storage.md).
|
||||
|
||||
## Photos app specific
|
||||
|
||||
- [react-dropzone](https://github.com/react-dropzone/react-dropzone/) is a
|
||||
|
@ -5,7 +5,8 @@
|
||||
"dependencies": {
|
||||
"@/next": "*",
|
||||
"@/utils": "*",
|
||||
"@ente/shared": "*"
|
||||
"@ente/shared": "*",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { apiOrigin } from "@ente/shared/network/api";
|
||||
import { getToken } from "@ente/shared/storage/localStorage/helpers";
|
||||
import { z } from "zod";
|
||||
|
||||
let _fetchTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||
let _haveFetched = false;
|
||||
@ -64,6 +65,19 @@ const remoteFeatureFlags = () => {
|
||||
return JSON.parse(s);
|
||||
};
|
||||
|
||||
const FeatureFlags = z.object({
|
||||
internalUser: z
|
||||
.boolean()
|
||||
.nullish()
|
||||
.transform((v) => (v === null ? undefined : v)),
|
||||
betaUser: z
|
||||
.boolean()
|
||||
.nullish()
|
||||
.transform((v) => (v === null ? undefined : v)),
|
||||
});
|
||||
|
||||
type FeatureFlags =
|
||||
|
||||
const remoteFeatureFlagsFetchingIfNeeded = async () => {
|
||||
let ff = await remoteFeatureFlags();
|
||||
if (!ff) {
|
||||
|
@ -3355,7 +3355,7 @@ libsodium-wrappers@0.7.9:
|
||||
dependencies:
|
||||
libsodium "^0.7.0"
|
||||
|
||||
libsodium@0.7.9, libsodium@^0.7.0:
|
||||
libsodium@^0.7.0:
|
||||
version "0.7.9"
|
||||
resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.9.tgz#4bb7bcbf662ddd920d8795c227ae25bbbfa3821b"
|
||||
integrity sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A==
|
||||
@ -4992,6 +4992,11 @@ yup@^1.4:
|
||||
toposort "^2.0.2"
|
||||
type-fest "^2.19.0"
|
||||
|
||||
zod@^3.23.8:
|
||||
version "3.23.8"
|
||||
resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d"
|
||||
integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==
|
||||
|
||||
zxcvbn@^4.4.2:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/zxcvbn/-/zxcvbn-4.4.2.tgz#28ec17cf09743edcab056ddd8b1b06262cc73c30"
|
||||
|
Loading…
x
Reference in New Issue
Block a user