fix: baseUrl - #129
Conversation
- 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
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request performs a comprehensive refactoring of module import paths across the API codebase, replacing relative Changes
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
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.tsimports from the@/drizzle/schemabarrel 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
📒 Files selected for processing (64)
apps/api/src/analytics/analytics.module.tsapps/api/src/analytics/dto/common.tsapps/api/src/analytics/dto/general-analytics.dto.tsapps/api/src/analytics/dto/projects-analytics.dto.tsapps/api/src/analytics/routers/general-analytics.router.tsapps/api/src/analytics/routers/projects-analytics.router.tsapps/api/src/analytics/services/general-analytics.service.tsapps/api/src/analytics/services/projects-analytics.service.tsapps/api/src/analytics/utils/general/get-days-of-period-stats-grouped-by-months.tsapps/api/src/analytics/utils/general/get-days-of-period-stats-grouped-by-weeks.tsapps/api/src/analytics/utils/general/get-general-stats-on-period-grouped-by-months.tsapps/api/src/analytics/utils/general/get-general-stats-on-period-grouped-by-weeks.tsapps/api/src/analytics/utils/general/get-most-used-language-on-period.tsapps/api/src/analytics/utils/general/get-period-languages-grouped-by-months.tsapps/api/src/analytics/utils/general/get-period-languages-grouped-by-weeks.tsapps/api/src/analytics/utils/projects/get-project-general-stats-on-period-grouped-by-months.tsapps/api/src/analytics/utils/projects/get-project-general-stats-on-period-grouped-by-weeks.tsapps/api/src/analytics/utils/projects/get-project-languages-grouped-by-months.tsapps/api/src/analytics/utils/projects/get-project-languages-grouped-by-weeks.tsapps/api/src/analytics/utils/projects/get-project-most-used-language-on-period.tsapps/api/src/analytics/utils/projects/get-project-per-day-of-period-grouped-by-months.tsapps/api/src/analytics/utils/projects/get-project-per-day-of-period-grouped-by-weeks.tsapps/api/src/app.module.tsapps/api/src/auth/auth.controller.tsapps/api/src/auth/auth.dto.tsapps/api/src/auth/auth.guard.tsapps/api/src/auth/auth.module.tsapps/api/src/auth/auth.router.tsapps/api/src/auth/auth.service.tsapps/api/src/auth/utils/validate-state-query-param.tsapps/api/src/daily-data/daily-data.dto.tsapps/api/src/daily-data/daily-data.module.tsapps/api/src/daily-data/daily-data.service.tsapps/api/src/drizzle/drizzle.module.tsapps/api/src/drizzle/drizzle.provider.tsapps/api/src/email-verifications/email-verifications.module.tsapps/api/src/email-verifications/email-verifications.service.tsapps/api/src/email/email.module.tsapps/api/src/email/email.service.tsapps/api/src/env/env.service.tsapps/api/src/extension/extension.dto.tsapps/api/src/extension/extension.module.tsapps/api/src/extension/extension.router.tsapps/api/src/extension/extension.service.tsapps/api/src/files/files.module.tsapps/api/src/files/files.service.tsapps/api/src/languages/languages.module.tsapps/api/src/languages/languages.service.tsapps/api/src/password-resets/password-resets.module.tsapps/api/src/password-resets/password-resets.service.tsapps/api/src/projects/projects.dto.tsapps/api/src/projects/projects.module.tsapps/api/src/projects/projects.service.tsapps/api/src/trpc/filters/error-formatter.tsapps/api/src/trpc/trpc.module.tsapps/api/src/trpc/trpc.router.tsapps/api/src/trpc/trpc.service.tsapps/api/src/users/users.dto.tsapps/api/src/users/users.module.tsapps/api/src/users/users.service.tsapps/api/tsconfig.jsonapps/dashboard/tsconfig.app.jsonapps/dashboard/tsconfig.jsonpackages/ui/tsconfig.json
💤 Files with no reviewable changes (2)
- apps/dashboard/tsconfig.json
- apps/dashboard/tsconfig.app.json
- bumped the extension version to `v0.0.61`
Commits
Summary by CodeRabbit
Refactor