From f4c5bdfa1c6ee269296409a582e45e964ae7af5d Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Tue, 19 Dec 2023 16:40:29 +0100 Subject: [PATCH] fix(cli): don't open too many files (#5841) * Allow building and installing cli * feat: add format fix * docs: remove cli folder * feat: use immich scoped package * feat: rewrite cli readme * docs: add info on running without building * cleanup * chore: remove import functionality from cli * feat: add logout to cli * docs: add todo for file format from server * docs: add compilation step to cli * fix: success message spacing * feat: can create albums * fix: add check step to cli * fix: typos * feat: pull file formats from server * chore: use crawl service from server * chore: fix lint * docs: add cli documentation * chore: rename ignore pattern * chore: add version number to cli * feat: use sdk * fix: cleanup * feat: album name on windows * chore: remove skipped asset field * feat: add more info to server-info command * chore: cleanup * wip * chore: remove unneeded packages * e2e test can start * git ignore for geocode in cli * add cli e2e to github actions * can do e2e tests in the cli * simplify e2e test * cleanup * set matrix strategy in workflow * run npm ci in server * choose different working directory * check out submodules too * increase test timeout * set node version * cli docker e2e tests * fix cli docker file * run cli e2e in correct folder * set docker context * correct docker build * remove cli from dockerignore * chore: fix docs links * feat: add cli v2 milestone * fix: set correct cli date * remove submodule * chore: add npmignore * chore(cli): push to npm * fix: server e2e * run npm ci in server * remove state from e2e * run npm ci in server * reshuffle docker compose files * use new e2e composes in makefile * increase test timeout to 10 minutes * make github actions run makefile e2e tests * cleanup github test names * assert on server version * chore: split cli e2e tests into one file per command * chore: set cli release working dir * chore: add repo url to npmjs * chore: bump node setup to v4 * chore: normalize the github url * check e2e code in lint * fix lint * test key login flow * feat: allow configurable config dir * fix session service tests * create missing dir * cleanup * bump cli version to 2.0.4 * remove form-data * feat: allow single files as argument * add version option * bump dependencies * fix lint * wip use axios as upload * version bump * cApiTALiZaTiON * don't touch package lock * wip: don't use job queues * don't use make for cli e2e * fix server e2e * chore: remove old gha step * add npm ci to server * feat: use graceful-fs --------- Co-authored-by: Alex Co-authored-by: Jason Rasmussen --- cli/package-lock.json | 7 +++---- cli/package.json | 1 + cli/src/cores/models/asset.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/package-lock.json b/cli/package-lock.json index df0cd9eeb3..734721ca5e 100644 --- a/cli/package-lock.json +++ b/cli/package-lock.json @@ -15,6 +15,7 @@ "commander": "^11.0.0", "form-data": "^4.0.0", "glob": "^10.3.1", + "graceful-fs": "^4.2.11", "yaml": "^2.3.1" }, "bin": { @@ -4354,8 +4355,7 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/graphemer": { "version": "1.4.0", @@ -10877,8 +10877,7 @@ "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "graphemer": { "version": "1.4.0", diff --git a/cli/package.json b/cli/package.json index 580fd1c9c6..380a330749 100644 --- a/cli/package.json +++ b/cli/package.json @@ -18,6 +18,7 @@ "commander": "^11.0.0", "form-data": "^4.0.0", "glob": "^10.3.1", + "graceful-fs": "^4.2.11", "yaml": "^2.3.1" }, "devDependencies": { diff --git a/cli/src/cores/models/asset.ts b/cli/src/cores/models/asset.ts index 7bcbf3089a..378945e6d3 100644 --- a/cli/src/cores/models/asset.ts +++ b/cli/src/cores/models/asset.ts @@ -1,4 +1,4 @@ -import * as fs from 'fs'; +import * as fs from 'graceful-fs'; import { basename } from 'node:path'; import crypto from 'crypto'; import Os from 'os';