[PR #6777] [MERGED] chore: migrate CLI to ESM and vitest #11347

Closed
opened 2026-02-05 14:37:50 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/6777
Author: @benmccann
Created: 1/30/2024
Status: Merged
Merged: 1/31/2024
Merged by: @jrasm91

Base: mainHead: vitest2


📝 Commits (4)

📊 Changes

21 files changed (+2926 additions, -5222 deletions)

View changed files

📝 .github/workflows/test.yml (+1 -1)
📝 cli/.eslintrc.cjs (+0 -0)
📝 cli/package-lock.json (+2844 -5127)
📝 cli/package.json (+8 -35)
📝 cli/src/services/session.service.spec.ts (+14 -19)
📝 cli/test/cli-test-utils.ts (+1 -1)
cli/test/e2e/jest-e2e.json (+0 -24)
📝 cli/test/e2e/login-key.e2e-spec.ts (+1 -1)
📝 cli/test/e2e/server-info.e2e-spec.ts (+1 -1)
📝 cli/test/e2e/upload.e2e-spec.ts (+1 -1)
cli/test/e2e/vitest.config.ts (+22 -0)
📝 cli/tsconfig.json (+5 -2)
cli/vitest.config.ts (+7 -0)
📝 server/e2e/jobs/specs/formats.e2e-spec.ts (+1 -1)
📝 server/e2e/jobs/specs/library.e2e-spec.ts (+6 -1)
📝 server/e2e/jobs/specs/metadata.e2e-spec.ts (+7 -1)
📝 server/src/immich/api-v1/asset/asset-repository.ts (+2 -2)
📝 server/src/infra/database.config.ts (+1 -1)
📝 server/src/infra/entities/exif.entity.ts (+2 -2)
📝 server/src/infra/repositories/library.repository.ts (+1 -1)

...and 1 more files

📄 Description

Followup from the last attempt in https://github.com/immich-app/immich/pull/6740

It's nice to switch to vitest for a few reasons:

  • it's already used in the web project so would standardize things
  • it supports ESM much better, so we could get rid of having to dual package the API, etc. and just use standard ESM everywhere
  • I find it to be much simpler. It doesn't require understanding how multiple tools like jest, ts-node, babel, etc. work together. This PR removes thousands of lines of code from the lockfile, which demonstrates that

To support ESM, three changes were needed:

  • migrate to vitest
  • update tsconfig.json to output ESM
  • update package.json to specify "type": "module"

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/6777 **Author:** [@benmccann](https://github.com/benmccann) **Created:** 1/30/2024 **Status:** ✅ Merged **Merged:** 1/31/2024 **Merged by:** [@jrasm91](https://github.com/jrasm91) **Base:** `main` ← **Head:** `vitest2` --- ### 📝 Commits (4) - [`73f4d4d`](https://github.com/immich-app/immich/commit/73f4d4d040d20c39e6ae16b407d07337532496fe) chore: migrate CLI to ESM and vitest - [`d30eeb8`](https://github.com/immich-app/immich/commit/d30eeb81e85c573be7db46f9c3d8ae3cd85f46dc) fix lint - [`fd8a7e5`](https://github.com/immich-app/immich/commit/fd8a7e5122555497598faae980d6e37d4e531ac1) update github workflow - [`728fc31`](https://github.com/immich-app/immich/commit/728fc315f03e995f3248bdb3cf33d67e65d47bb4) format ### 📊 Changes **21 files changed** (+2926 additions, -5222 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yml` (+1 -1) 📝 `cli/.eslintrc.cjs` (+0 -0) 📝 `cli/package-lock.json` (+2844 -5127) 📝 `cli/package.json` (+8 -35) 📝 `cli/src/services/session.service.spec.ts` (+14 -19) 📝 `cli/test/cli-test-utils.ts` (+1 -1) ➖ `cli/test/e2e/jest-e2e.json` (+0 -24) 📝 `cli/test/e2e/login-key.e2e-spec.ts` (+1 -1) 📝 `cli/test/e2e/server-info.e2e-spec.ts` (+1 -1) 📝 `cli/test/e2e/upload.e2e-spec.ts` (+1 -1) ➕ `cli/test/e2e/vitest.config.ts` (+22 -0) 📝 `cli/tsconfig.json` (+5 -2) ➕ `cli/vitest.config.ts` (+7 -0) 📝 `server/e2e/jobs/specs/formats.e2e-spec.ts` (+1 -1) 📝 `server/e2e/jobs/specs/library.e2e-spec.ts` (+6 -1) 📝 `server/e2e/jobs/specs/metadata.e2e-spec.ts` (+7 -1) 📝 `server/src/immich/api-v1/asset/asset-repository.ts` (+2 -2) 📝 `server/src/infra/database.config.ts` (+1 -1) 📝 `server/src/infra/entities/exif.entity.ts` (+2 -2) 📝 `server/src/infra/repositories/library.repository.ts` (+1 -1) _...and 1 more files_ </details> ### 📄 Description Followup from the last attempt in https://github.com/immich-app/immich/pull/6740 It's nice to switch to vitest for a few reasons: - it's already used in the `web` project so would standardize things - it supports ESM much better, so we could get rid of having to dual package the API, etc. and just use standard ESM everywhere - I find it to be much simpler. It doesn't require understanding how multiple tools like jest, ts-node, babel, etc. work together. This PR removes thousands of lines of code from the lockfile, which demonstrates that To support ESM, three changes were needed: - migrate to vitest - update `tsconfig.json` to output ESM - update `package.json` to specify `"type": "module"` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 14:37:50 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#11347