Skip to content

fix: baseUrl - #129

Merged
Friedrich482 merged 2 commits into
mainfrom
features
Apr 19, 2026
Merged

fix: baseUrl#129
Friedrich482 merged 2 commits into
mainfrom
features

Conversation

@Friedrich482

@Friedrich482 Friedrich482 commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Commits

  • fix: baseUrl
    • removed the deprecated baseUrl from tsconfig file of the api, the dashboard and the @repo/ui package
    • updated the imports statements in the api to match the path alias introduced to replace it

Summary by CodeRabbit

Refactor

  • Standardized internal module import paths and updated TypeScript configuration throughout the backend codebase to improve code organization and consistency. Enhanced dependency resolution patterns across services, modules, utilities, and configuration files. These infrastructure improvements ensure maintainability with no visible impact on application functionality or user experience.

- removed the deprecated baseUrl from tsconfig file of the api, the dashboard and the @repo/ui package
- updated the imports statements in the api to match the path alias introduced to replace it
@coderabbitai

coderabbitai Bot commented Apr 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Friedrich482 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 30 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 30 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ded21b61-10ba-484d-a490-9372b5a125fb

📥 Commits

Reviewing files that changed from the base of the PR and between 764a344 and 25e59fa.

📒 Files selected for processing (1)
  • apps/vscode-extension/package.json
📝 Walkthrough

Walkthrough

This pull request performs a comprehensive refactoring of module import paths across the API codebase, replacing relative src/... aliases with a centralized @/... path alias system. TypeScript compiler configurations are updated to support the new alias resolution pattern.

Changes

Cohort / File(s) Summary
Analytics Module
apps/api/src/analytics/analytics.module.ts, apps/api/src/analytics/dto/common.ts, apps/api/src/analytics/dto/general-analytics.dto.ts, apps/api/src/analytics/dto/projects-analytics.dto.ts, apps/api/src/analytics/routers/general-analytics.router.ts, apps/api/src/analytics/routers/projects-analytics.router.ts, apps/api/src/analytics/services/general-analytics.service.ts, apps/api/src/analytics/services/projects-analytics.service.ts
Updated all import paths from src/... to @/... aliases for dependencies, DTOs, and services. No functional logic or exported entity signatures changed.
Analytics Utils
apps/api/src/analytics/utils/general/*, apps/api/src/analytics/utils/projects/*
Updated import paths from src/... to @/... for utility functions and service dependencies across all general and project analytics utility files. No logic or exported signatures modified.
Auth Module
apps/api/src/auth/auth.controller.ts, apps/api/src/auth/auth.dto.ts, apps/api/src/auth/auth.guard.ts, apps/api/src/auth/auth.module.ts, apps/api/src/auth/auth.router.ts, apps/api/src/auth/auth.service.ts, apps/api/src/auth/utils/validate-state-query-param.ts
Converted all imports to use @/... aliases for services, modules, and utilities. Minor formatting adjustments (trailing commas) applied. No behavioral changes.
Daily Data & Drizzle Modules
apps/api/src/daily-data/daily-data.dto.ts, apps/api/src/daily-data/daily-data.module.ts, apps/api/src/daily-data/daily-data.service.ts, apps/api/src/drizzle/drizzle.module.ts, apps/api/src/drizzle/drizzle.provider.ts
Updated import paths for database provider and DTOs from src/... to @/.... Module configuration and provider logic remain unchanged.
Email & Email Verification Modules
apps/api/src/email-verifications/email-verifications.module.ts, apps/api/src/email-verifications/email-verifications.service.ts, apps/api/src/email/email.module.ts, apps/api/src/email/email.service.ts
Switched imports to @/... aliases for modules, services, and schemas. No runtime behavior modifications.
Env Module
apps/api/src/env/env.service.ts, apps/api/src/app.module.ts
Updated EnvService and envSchema import paths to use @/env/... aliases across module bootstrap and service definitions.
Extension Module
apps/api/src/extension/extension.dto.ts, apps/api/src/extension/extension.module.ts, apps/api/src/extension/extension.router.ts, apps/api/src/extension/extension.service.ts
Converted all dependency imports to @/... aliases for modules, routers, and injected services. No functional changes.
Files & Languages Modules
apps/api/src/files/files.module.ts, apps/api/src/files/files.service.ts, apps/api/src/languages/languages.module.ts, apps/api/src/languages/languages.service.ts
Updated imports for Drizzle provider and schema references to use @/... aliases. Formatting adjustments (trailing commas) applied to function calls. No logic modifications.
Password Resets & Projects Modules
apps/api/src/password-resets/password-resets.module.ts, apps/api/src/password-resets/password-resets.service.ts, apps/api/src/projects/projects.dto.ts, apps/api/src/projects/projects.module.ts, apps/api/src/projects/projects.service.ts
Standardized imports to @/... aliases for utilities, providers, and schema modules. No changes to service methods or DTO definitions.
TRPC Module
apps/api/src/trpc/filters/error-formatter.ts, apps/api/src/trpc/trpc.module.ts, apps/api/src/trpc/trpc.router.ts, apps/api/src/trpc/trpc.service.ts
Updated all router, filter, and service imports to use @/... aliases. Module wiring and error handling logic remain unchanged.
Users Module
apps/api/src/users/users.dto.ts, apps/api/src/users/users.module.ts, apps/api/src/users/users.service.ts
Converted imports for schema, providers, and DTOs from src/... to @/... aliases. No DTO schemas or service logic altered.
TypeScript Configuration
apps/api/tsconfig.json, apps/dashboard/tsconfig.json, apps/dashboard/tsconfig.app.json, packages/ui/tsconfig.json
Added or refined paths mapping to support @/*./src/* alias resolution. Removed baseUrl: "." entries where applicable. Compilation and build behavior unaffected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

This refactoring consists of highly repetitive, homogeneous changes (import path replacements following a single pattern) applied consistently across 50+ files. While the volume is large, the lack of logic modifications, functional changes, or new features significantly reduces the cognitive load per file. Review effort focuses on verifying path correctness and consistency rather than evaluating complex logic.

Possibly related PRs

Poem

Hop along, dear paths so clear,
From src/ to @/ without fear!
Aliases dance, imports align,
With trailing commas—oh so fine! 🐰
A tidy hop through every file,
Organization's made worthwhile! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: baseUrl' is clear and concise, accurately describing the primary change of removing the deprecated baseUrl configuration and updating related imports across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch features

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/api/src/analytics/services/projects-analytics.service.ts (1)

42-46: Incomplete alias migration — mix of @/ and ../ imports.

Lines 1–36 were migrated to @/..., but ../constants, ../dto/common, and the three ../utils/projects/... imports below remain relative. For consistency with the PR's stated goal, consider migrating these too.

♻️ Proposed diff
-import { NUMBER_OF_FILES_PER_PAGE } from "../constants";
-import { NAString } from "../dto/common";
-import { getProjectGeneralStatsOnPeriodGroupedByMonths } from "../utils/projects/get-project-general-stats-on-period-grouped-by-months";
-import { getProjectGeneralStatsOnPeriodGroupedByWeeks } from "../utils/projects/get-project-general-stats-on-period-grouped-by-weeks";
-import { getProjectMostUsedLanguageOnPeriod } from "../utils/projects/get-project-most-used-language-on-period";
+import { NUMBER_OF_FILES_PER_PAGE } from "@/analytics/constants";
+import { NAString } from "@/analytics/dto/common";
+import { getProjectGeneralStatsOnPeriodGroupedByMonths } from "@/analytics/utils/projects/get-project-general-stats-on-period-grouped-by-months";
+import { getProjectGeneralStatsOnPeriodGroupedByWeeks } from "@/analytics/utils/projects/get-project-general-stats-on-period-grouped-by-weeks";
+import { getProjectMostUsedLanguageOnPeriod } from "@/analytics/utils/projects/get-project-most-used-language-on-period";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/api/src/analytics/services/projects-analytics.service.ts` around lines
42 - 46, The file mixes alias and relative imports; change the remaining
relative imports to use the project alias so imports are consistent: replace
imports for NUMBER_OF_FILES_PER_PAGE, NAString,
getProjectGeneralStatsOnPeriodGroupedByMonths,
getProjectGeneralStatsOnPeriodGroupedByWeeks, and
getProjectMostUsedLanguageOnPeriod to their corresponding "@/..." paths (keeping
the same exported identifiers and paths under the alias) so that
NUMBER_OF_FILES_PER_PAGE, NAString,
getProjectGeneralStatsOnPeriodGroupedByMonths,
getProjectGeneralStatsOnPeriodGroupedByWeeks, and
getProjectMostUsedLanguageOnPeriod are imported via the alias style.
apps/api/src/projects/projects.service.ts (1)

4-6: LGTM — minor note on schema import style.

Alias migration is correct. Note that projects-analytics.service.ts imports from the @/drizzle/schema barrel while this file uses the per-file subpaths (@/drizzle/schema/daily-data, @/drizzle/schema/projects). Not a bug, but worth aligning on a single convention across the API for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/api/src/projects/projects.service.ts` around lines 4 - 6, The imports in
projects.service.ts use per-file schema paths (dailyData, projects) while
projects-analytics.service.ts uses the "@/drizzle/schema" barrel; update
projects.service.ts to import dailyData and projects from the barrel (import {
dailyData, projects } from "@/drizzle/schema") so both services share the same
import convention and remain consistent with DrizzleAsyncProvider usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/api/src/password-resets/password-resets.module.ts`:
- Around line 1-2: Add a Jest moduleNameMapper entry to the apps/api package's
jest config so imports like "@/..." used in files that import DrizzleModule or
EmailModule (see imports of DrizzleModule and EmailModule in
password-resets.module.ts) resolve in tests; specifically, add a
"moduleNameMapper" mapping with pattern "^@/(.*)$" -> "<rootDir>/$1" under the
"jest" section of apps/api/package.json.

In `@apps/api/tsconfig.json`:
- Around line 16-18: The tsconfig.json uses "paths": { "@/*": ["./src/*"] } but
lacks "baseUrl" so the alias is ignored at compile time and will also break at
runtime because emitted JS still contains "@/..." imports; add "baseUrl": "."
under compilerOptions and ensure runtime alias resolution by either adding a
postbuild step to run tsc-alias, or loading "tsconfig-paths/register" from your
application entry (main.ts) before other imports, or using your bundler to
rewrite paths; also verify the production start (start:prod -> node
dist/main.js) uses the rewritten imports or the runtime loader so Node can
resolve "@/..." imports.

---

Nitpick comments:
In `@apps/api/src/analytics/services/projects-analytics.service.ts`:
- Around line 42-46: The file mixes alias and relative imports; change the
remaining relative imports to use the project alias so imports are consistent:
replace imports for NUMBER_OF_FILES_PER_PAGE, NAString,
getProjectGeneralStatsOnPeriodGroupedByMonths,
getProjectGeneralStatsOnPeriodGroupedByWeeks, and
getProjectMostUsedLanguageOnPeriod to their corresponding "@/..." paths (keeping
the same exported identifiers and paths under the alias) so that
NUMBER_OF_FILES_PER_PAGE, NAString,
getProjectGeneralStatsOnPeriodGroupedByMonths,
getProjectGeneralStatsOnPeriodGroupedByWeeks, and
getProjectMostUsedLanguageOnPeriod are imported via the alias style.

In `@apps/api/src/projects/projects.service.ts`:
- Around line 4-6: The imports in projects.service.ts use per-file schema paths
(dailyData, projects) while projects-analytics.service.ts uses the
"@/drizzle/schema" barrel; update projects.service.ts to import dailyData and
projects from the barrel (import { dailyData, projects } from
"@/drizzle/schema") so both services share the same import convention and remain
consistent with DrizzleAsyncProvider usage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16230c9f-cef9-4fc9-99a0-08f78c0f5458

📥 Commits

Reviewing files that changed from the base of the PR and between db99ff4 and 764a344.

📒 Files selected for processing (64)
  • apps/api/src/analytics/analytics.module.ts
  • apps/api/src/analytics/dto/common.ts
  • apps/api/src/analytics/dto/general-analytics.dto.ts
  • apps/api/src/analytics/dto/projects-analytics.dto.ts
  • apps/api/src/analytics/routers/general-analytics.router.ts
  • apps/api/src/analytics/routers/projects-analytics.router.ts
  • apps/api/src/analytics/services/general-analytics.service.ts
  • apps/api/src/analytics/services/projects-analytics.service.ts
  • apps/api/src/analytics/utils/general/get-days-of-period-stats-grouped-by-months.ts
  • apps/api/src/analytics/utils/general/get-days-of-period-stats-grouped-by-weeks.ts
  • apps/api/src/analytics/utils/general/get-general-stats-on-period-grouped-by-months.ts
  • apps/api/src/analytics/utils/general/get-general-stats-on-period-grouped-by-weeks.ts
  • apps/api/src/analytics/utils/general/get-most-used-language-on-period.ts
  • apps/api/src/analytics/utils/general/get-period-languages-grouped-by-months.ts
  • apps/api/src/analytics/utils/general/get-period-languages-grouped-by-weeks.ts
  • apps/api/src/analytics/utils/projects/get-project-general-stats-on-period-grouped-by-months.ts
  • apps/api/src/analytics/utils/projects/get-project-general-stats-on-period-grouped-by-weeks.ts
  • apps/api/src/analytics/utils/projects/get-project-languages-grouped-by-months.ts
  • apps/api/src/analytics/utils/projects/get-project-languages-grouped-by-weeks.ts
  • apps/api/src/analytics/utils/projects/get-project-most-used-language-on-period.ts
  • apps/api/src/analytics/utils/projects/get-project-per-day-of-period-grouped-by-months.ts
  • apps/api/src/analytics/utils/projects/get-project-per-day-of-period-grouped-by-weeks.ts
  • apps/api/src/app.module.ts
  • apps/api/src/auth/auth.controller.ts
  • apps/api/src/auth/auth.dto.ts
  • apps/api/src/auth/auth.guard.ts
  • apps/api/src/auth/auth.module.ts
  • apps/api/src/auth/auth.router.ts
  • apps/api/src/auth/auth.service.ts
  • apps/api/src/auth/utils/validate-state-query-param.ts
  • apps/api/src/daily-data/daily-data.dto.ts
  • apps/api/src/daily-data/daily-data.module.ts
  • apps/api/src/daily-data/daily-data.service.ts
  • apps/api/src/drizzle/drizzle.module.ts
  • apps/api/src/drizzle/drizzle.provider.ts
  • apps/api/src/email-verifications/email-verifications.module.ts
  • apps/api/src/email-verifications/email-verifications.service.ts
  • apps/api/src/email/email.module.ts
  • apps/api/src/email/email.service.ts
  • apps/api/src/env/env.service.ts
  • apps/api/src/extension/extension.dto.ts
  • apps/api/src/extension/extension.module.ts
  • apps/api/src/extension/extension.router.ts
  • apps/api/src/extension/extension.service.ts
  • apps/api/src/files/files.module.ts
  • apps/api/src/files/files.service.ts
  • apps/api/src/languages/languages.module.ts
  • apps/api/src/languages/languages.service.ts
  • apps/api/src/password-resets/password-resets.module.ts
  • apps/api/src/password-resets/password-resets.service.ts
  • apps/api/src/projects/projects.dto.ts
  • apps/api/src/projects/projects.module.ts
  • apps/api/src/projects/projects.service.ts
  • apps/api/src/trpc/filters/error-formatter.ts
  • apps/api/src/trpc/trpc.module.ts
  • apps/api/src/trpc/trpc.router.ts
  • apps/api/src/trpc/trpc.service.ts
  • apps/api/src/users/users.dto.ts
  • apps/api/src/users/users.module.ts
  • apps/api/src/users/users.service.ts
  • apps/api/tsconfig.json
  • apps/dashboard/tsconfig.app.json
  • apps/dashboard/tsconfig.json
  • packages/ui/tsconfig.json
💤 Files with no reviewable changes (2)
  • apps/dashboard/tsconfig.json
  • apps/dashboard/tsconfig.app.json

Comment thread apps/api/src/password-resets/password-resets.module.ts
Comment thread apps/api/tsconfig.json
- bumped the extension version to `v0.0.61`
@Friedrich482
Friedrich482 merged commit 01ddd43 into main Apr 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant