[PR #6696] [CLOSED] refactor(server): drop module aliases #11299

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

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/6696
Author: @jrasm91
Created: 1/28/2024
Status: Closed

Base: mainHead: refactor/tsconfig-paths


📝 Commits (1)

  • 5b2c5eb refactor: remove use of tsconfig.paths and moduleNameMapper

📊 Changes

255 files changed (+537 additions, -563 deletions)

View changed files

📝 server/e2e/api/jest-e2e.json (+1 -7)
📝 server/e2e/api/specs/activity.e2e-spec.ts (+5 -5)
📝 server/e2e/api/specs/album.e2e-spec.ts (+5 -5)
📝 server/e2e/api/specs/asset.e2e-spec.ts (+7 -7)
📝 server/e2e/api/specs/auth.e2e-spec.ts (+3 -3)
📝 server/e2e/api/specs/library.e2e-spec.ts (+4 -4)
📝 server/e2e/api/specs/oauth.e2e-spec.ts (+2 -2)
📝 server/e2e/api/specs/partner.e2e-spec.ts (+3 -3)
📝 server/e2e/api/specs/person.e2e-spec.ts (+4 -4)
📝 server/e2e/api/specs/search.e2e-spec.ts (+4 -4)
📝 server/e2e/api/specs/server-info.e2e-spec.ts (+3 -3)
📝 server/e2e/api/specs/shared-link.e2e-spec.ts (+6 -6)
📝 server/e2e/api/specs/system-config.e2e-spec.ts (+3 -3)
📝 server/e2e/api/specs/user.e2e-spec.ts (+4 -4)
📝 server/e2e/api/utils.ts (+4 -4)
📝 server/e2e/client/activity-api.ts (+1 -1)
📝 server/e2e/client/album-api.ts (+1 -1)
📝 server/e2e/client/api-key-api.ts (+2 -2)
📝 server/e2e/client/asset-api.ts (+3 -3)
📝 server/e2e/client/auth-api.ts (+2 -2)

...and 80 more files

📄 Description

Using modules aliases can be convenient, but also make the build more complex and often frustrating to deal with. This PR replaces modules aliases with root path imports. This has several benefits, including:

  • More transparency around where imports are coming from
  • Less required configuration to integrate with other tools (like jest)
  • Simpler migration path to ESM

Essentially the changeset comes down to removing tsconfig.paths settings and jestConfig.moduleNameMapper configuration by updating the following imports:

Before:

import {} from '@app/domain';
import {} from '@app/infra';
import {} from '@app/immich';
import {} from '@test';

After:

import {} from 'src/domain';
import {} from 'src/infra';
import {} from 'src/immich';
import {} from 'test';

TLDR is this is simpler and looks almost the same as before.


🔄 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/6696 **Author:** [@jrasm91](https://github.com/jrasm91) **Created:** 1/28/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/tsconfig-paths` --- ### 📝 Commits (1) - [`5b2c5eb`](https://github.com/immich-app/immich/commit/5b2c5ebeece18c9fe356a03214b8c333e2c0efc1) refactor: remove use of tsconfig.paths and moduleNameMapper ### 📊 Changes **255 files changed** (+537 additions, -563 deletions) <details> <summary>View changed files</summary> 📝 `server/e2e/api/jest-e2e.json` (+1 -7) 📝 `server/e2e/api/specs/activity.e2e-spec.ts` (+5 -5) 📝 `server/e2e/api/specs/album.e2e-spec.ts` (+5 -5) 📝 `server/e2e/api/specs/asset.e2e-spec.ts` (+7 -7) 📝 `server/e2e/api/specs/auth.e2e-spec.ts` (+3 -3) 📝 `server/e2e/api/specs/library.e2e-spec.ts` (+4 -4) 📝 `server/e2e/api/specs/oauth.e2e-spec.ts` (+2 -2) 📝 `server/e2e/api/specs/partner.e2e-spec.ts` (+3 -3) 📝 `server/e2e/api/specs/person.e2e-spec.ts` (+4 -4) 📝 `server/e2e/api/specs/search.e2e-spec.ts` (+4 -4) 📝 `server/e2e/api/specs/server-info.e2e-spec.ts` (+3 -3) 📝 `server/e2e/api/specs/shared-link.e2e-spec.ts` (+6 -6) 📝 `server/e2e/api/specs/system-config.e2e-spec.ts` (+3 -3) 📝 `server/e2e/api/specs/user.e2e-spec.ts` (+4 -4) 📝 `server/e2e/api/utils.ts` (+4 -4) 📝 `server/e2e/client/activity-api.ts` (+1 -1) 📝 `server/e2e/client/album-api.ts` (+1 -1) 📝 `server/e2e/client/api-key-api.ts` (+2 -2) 📝 `server/e2e/client/asset-api.ts` (+3 -3) 📝 `server/e2e/client/auth-api.ts` (+2 -2) _...and 80 more files_ </details> ### 📄 Description Using modules aliases can be convenient, but also make the build more complex and often frustrating to deal with. This PR replaces modules aliases with root path imports. This has several benefits, including: - More transparency around where imports are coming from - Less required configuration to integrate with other tools (like jest) - Simpler migration path to ESM Essentially the changeset comes down to removing `tsconfig.paths` settings and `jestConfig.moduleNameMapper` configuration by updating the following imports: Before: ```typescript import {} from '@app/domain'; import {} from '@app/infra'; import {} from '@app/immich'; import {} from '@test'; ``` After: ```typescript import {} from 'src/domain'; import {} from 'src/infra'; import {} from 'src/immich'; import {} from 'test'; ``` TLDR is this is simpler and looks almost the same as before. --- <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:01 +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#11299