Skip to content

Add turbo build orchestration and dist manifest tooling#6

Merged
gentamura merged 12 commits intomainfrom
chore/build-tooling
Oct 19, 2025
Merged

Add turbo build orchestration and dist manifest tooling#6
gentamura merged 12 commits intomainfrom
chore/build-tooling

Conversation

@gentamura
Copy link
Member

@gentamura gentamura commented Oct 19, 2025

Summary

  • add turbo as the workspace build and clean orchestrator
  • align package build scripts to emit normalized dist manifests after TypeScript builds
  • expose Drizzle utilities from @listee/db so API packages no longer import drizzle-orm directly
  • normalize cursor decoding to handle base64url safely and bump the repo-wide TypeScript toolchain to 5.6

Testing

  • bun x tsc -b

Summary by CodeRabbit

  • Chores

    • Integrated Turbo for build system management and caching optimization.
    • Standardized TypeScript configuration and build scripts across packages.
    • Updated build tooling to use modern utilities for cleaner, more maintainable builds.
    • Added automated distribution manifest generation.
  • Tests

    • Enhanced test mocks for database query operations.

@gentamura gentamura self-assigned this Oct 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 19, 2025

Walkthrough

This PR establishes a Turbo-based monorepo build system with TypeScript configuration refactoring. It introduces separate build configs, cross-platform clean scripts using rimraf, automated dist package manifest generation, and consolidates module exports through @listee/db with updated import paths.

Changes

Cohort / File(s) Summary
Turbo & Build Orchestration
turbo.json, package.json
Adds turbo.json with build task configuration (caching, dependency specs). Root package.json includes turbo build/clean scripts and new devDependencies (turbo, rimraf, typescript).
TypeScript Configuration (Root)
tsconfig.json
Updates path mappings from specific index.ts files to package directories (e.g., @listee/authpackages/auth/src).
TypeScript Configuration (packages/api)
packages/api/tsconfig.json, packages/api/tsconfig.build.json
Introduces tsconfig.build.json enabling declaration generation; base tsconfig.json removes declarations, adds moduleResolution Bundler, and path mappings for internal packages.
TypeScript Configuration (packages/auth)
packages/auth/tsconfig.json, packages/auth/tsconfig.build.json
Introduces tsconfig.build.json with declaration generation; base tsconfig.json removes declarations, adds moduleResolution Bundler, and @listee/types path alias.
TypeScript Configuration (packages/db)
packages/db/tsconfig.json, packages/db/tsconfig.build.json
Introduces tsconfig.build.json enabling declaration generation; base tsconfig.json removes declarations, adds moduleResolution Bundler, and expands test exclusions.
TypeScript Configuration (packages/types)
packages/types/tsconfig.json, packages/types/tsconfig.build.json
Introduces new tsconfig.build.json with declaration generation; base tsconfig.json removes declarations, adds moduleResolution Bundler and @listee/db path alias.
Package Metadata Updates
packages/api/package.json, packages/auth/package.json, packages/db/package.json, packages/types/package.json
Removes module field, consolidates files to single-line ["dist"], replaces rm -rf with rimraf clean scripts, adds postbuild script running write-dist-manifest.mjs.
Exports Consolidation
packages/db/src/index.ts
Expands drizzle-orm re-exports to include and, desc, eq, lt, or (previously only sql). Adds new export schemaPath derived from module URL.
Distribution Manifest Generation
scripts/write-dist-manifest.mjs
New script that reads root package.json, normalizes entry point paths to dist/, recursively normalizes exports map, strips scripts/files, and writes normalized manifest to dist/package.json.
Import Consolidation
packages/api/src/repositories/category-repository.ts, packages/api/src/repositories/task-repository.ts
Consolidates imports of drizzle-orm predicates (eq, and, or, lt) and ordering (desc) from @listee/db instead of direct drizzle-orm imports. Adds decodeBase64Url helper for cursor parsing in category-repository.
Test Mocks
packages/db/src/index.test.ts
Expands mocked drizzle-orm API surface with eq, and, or, lt predicate builders and desc ordering builder, each with structured return objects.
Build Configuration
.gitignore
Adds .turbo ignore pattern.
Changeset
.changeset/loud-heads-sip.md
Documents patch version bumps for @listee/types, @listee/auth, @listee/api, @listee/db and tooling updates (Turbo, TypeScript 5.6, rimraf, dist manifest generation).

Sequence Diagram(s)

sequenceDiagram
    participant npm as NPM Build
    participant turbo as Turbo
    participant tsc as TypeScript (build)
    participant script as write-dist-manifest.mjs
    participant dist as dist/package.json

    npm->>turbo: turbo run build
    turbo->>tsc: compile with tsconfig.build.json
    tsc->>tsc: emit declarations & .js
    turbo->>script: postbuild hook
    script->>script: read root package.json
    script->>script: normalize entry points to dist/
    script->>script: normalize exports recursively
    script->>script: strip scripts & files fields
    script->>dist: write normalized manifest
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The changes span many files across a monorepo restructure, but large cohorts follow repetitive patterns (e.g., identical tsconfig.build.json additions, consistent package.json field removals). Core logic is concentrated in the new write-dist-manifest.mjs script and import consolidation in repositories; both moderate complexity. TypeScript and Turbo configuration changes are consistent but require verification across packages for coherence.

Possibly related PRs

  • Refine auth, database, and CI scaffolding #2: Directly related—updates @listee/db exports to include predicates and ordering helpers (and, desc, eq, lt, or) and schemaPath, which are consumed by the repository imports consolidated in this PR.

Poem

🐰 Hop, hop, the build's now fast,
Turbo speeds through tasks so vast,
TypeScript configs clean and split,
Manifests written—what a fit!
Exports bundled, paths align,
Monorepo magic, bundler design!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Add turbo build orchestration and dist manifest tooling" accurately reflects significant changes present in the changeset. The addition of Turbo configuration (turbo.json), root-level build/clean scripts, and the new dist manifest generation script (write-dist-manifest.mjs) are clearly documented in the raw summary and align directly with the title's claims. The title is concise, specific, and avoids vague terminology. While the PR also includes supporting changes such as TypeScript configuration updates, Drizzle utility refactoring, and a TypeScript version bump, these are secondary to the primary orchestration and tooling focus captured by the title.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/build-tooling

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f41a1d3 and b5c3a8f.

📒 Files selected for processing (1)
  • .changeset/loud-heads-sip.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**

📄 CodeRabbit inference engine (AGENTS.md)

.changeset/**: Attach the latest Changeset entry when a release is required
Declare breaking changes and follow SemVer in Changesets

Files:

  • .changeset/loud-heads-sip.md
🔇 Additional comments (1)
.changeset/loud-heads-sip.md (1)

1-8: Verify SemVer bump levels against actual breaking changes.

The changeset declares patch version bumps for all four packages, but the PR description mentions consolidating module exports and updating import paths, particularly for Drizzle utilities exposed from @listee/db. Per the coding guidelines, breaking changes must be explicitly declared.

If downstream consumers need to update their import statements (e.g., changing direct drizzle-orm imports to @listee/db imports), this constitutes a breaking change and should be declared as major bumps instead of patch.

Verify:

  • Whether the public API of any package has changed in a backward-incompatible way
  • Whether consumers must update their import statements
  • If breaking changes exist, update the changeset to use major version bumps and document them clearly

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
turbo.json (1)

4-8: Consider adding inputs for finer cache invalidation.

The build task configuration is correct, but without explicit inputs, Turbo will track all files in each package. Consider adding an inputs array to improve cache hit rates:

 "build": {
   "dependsOn": ["^build"],
+  "inputs": ["src/**", "tsconfig*.json", "package.json"],
   "outputs": ["dist/**"],
   "cache": true
 },

This ensures builds only invalidate when source files or config changes, not from unrelated file modifications.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcb475d and 2a7780d.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • .gitignore (1 hunks)
  • package.json (1 hunks)
  • packages/api/package.json (1 hunks)
  • packages/api/tsconfig.build.json (1 hunks)
  • packages/api/tsconfig.json (1 hunks)
  • packages/auth/package.json (1 hunks)
  • packages/auth/tsconfig.build.json (1 hunks)
  • packages/auth/tsconfig.json (1 hunks)
  • packages/db/package.json (1 hunks)
  • packages/db/src/index.ts (1 hunks)
  • packages/db/tsconfig.build.json (1 hunks)
  • packages/db/tsconfig.json (1 hunks)
  • packages/types/package.json (1 hunks)
  • packages/types/tsconfig.build.json (1 hunks)
  • packages/types/tsconfig.json (1 hunks)
  • scripts/write-dist-manifest.mjs (1 hunks)
  • tsconfig.json (1 hunks)
  • turbo.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
packages/*/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Reference shared dependencies via the "catalog:" protocol in package manifests

Files:

  • packages/db/package.json
  • packages/api/package.json
  • packages/types/package.json
  • packages/auth/package.json
packages/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/*/src/**/*.{ts,tsx}: Avoid implicit any; TypeScript is run with strict enabled
Prefer type guards or the satisfies operator over as casts where appropriate
Prefer unknown for external inputs
Use PascalCase for types and enums
Use camelCase for variables and functions
Ensure source comments are written in English

Files:

  • packages/db/src/index.ts
package.json

📄 CodeRabbit inference engine (AGENTS.md)

package.json: Pin shared dependency versions in the root package.json catalog
Add new shared dependencies to the root catalog before consuming them in packages

Files:

  • package.json
{tsconfig.json,biome.json,vitest.config.ts,bun.lock}

📄 CodeRabbit inference engine (AGENTS.md)

Review cross-package impact before changing root tooling files: tsconfig.json, biome.json, vitest.config.ts, bun.lock

Files:

  • tsconfig.json
🧠 Learnings (4)
📚 Learning: 2025-10-02T12:40:33.718Z
Learnt from: CR
PR: listee-dev/listee-libs#0
File: AGENTS.md:0-0
Timestamp: 2025-10-02T12:40:33.718Z
Learning: Applies to packages/*/src/**/{*.test.ts,__tests__/**/*.ts} : Co-locate tests as *.test.ts or under __tests__/ using Bun’s test runner

Applied to files:

  • packages/db/tsconfig.json
📚 Learning: 2025-10-02T12:40:33.718Z
Learnt from: CR
PR: listee-dev/listee-libs#0
File: AGENTS.md:0-0
Timestamp: 2025-10-02T12:40:33.718Z
Learning: Applies to packages/auth/src/authorization/**/*.{ts,tsx} : Place domain authorization policies under packages/auth/src/authorization/ (e.g., policies/chat.ts exporting canAccessChat)

Applied to files:

  • tsconfig.json
📚 Learning: 2025-10-02T12:40:33.718Z
Learnt from: CR
PR: listee-dev/listee-libs#0
File: AGENTS.md:0-0
Timestamp: 2025-10-02T12:40:33.718Z
Learning: Applies to packages/auth/src/authentication/**/*.{ts,tsx} : Place runtime-specific authentication adapters under packages/auth/src/authentication/ (e.g., header.ts, supabase.ts, shared utilities, errors.ts)

Applied to files:

  • tsconfig.json
📚 Learning: 2025-10-02T12:40:33.718Z
Learnt from: CR
PR: listee-dev/listee-libs#0
File: AGENTS.md:0-0
Timestamp: 2025-10-02T12:40:33.718Z
Learning: Applies to {tsconfig.json,biome.json,vitest.config.ts,bun.lock} : Review cross-package impact before changing root tooling files: tsconfig.json, biome.json, vitest.config.ts, bun.lock

Applied to files:

  • packages/api/tsconfig.json
  • packages/auth/tsconfig.json
  • packages/types/tsconfig.json
🔇 Additional comments (20)
.gitignore (1)

140-142: LGTM!

The .turbo directory ignore is correctly placed and aligns with TurboRepo's caching strategy.

packages/db/src/index.ts (1)

220-222: LGTM! Note that schemaPath references the built output location.

The schemaPath export correctly uses import.meta.url to compute the schema module path. This will resolve to the location in the built dist directory (e.g., dist/schema/index.js), which is appropriate for consumers importing from node_modules.

packages/db/tsconfig.json (1)

7-11: LGTM! Build/dev config separation is well-structured.

The changes appropriately:

  • Use Bundler module resolution for modern tooling
  • Exclude test files from compilation (aligning with the co-located test pattern)
  • Separate declaration generation to tsconfig.build.json

Based on learnings

packages/db/tsconfig.build.json (1)

3-7: Declaration generation setup is correct.

The build configuration appropriately enables type declaration emission. Unlike packages/api/tsconfig.build.json, this file doesn't include path mappings, which is correct since the db package doesn't import other internal @listee/* packages.

Note: The AI summary mentions "Adds path mappings for internal modules: @listee/auth, @listee/db, and @listee/types" but these are not present in the actual code shown.

packages/auth/tsconfig.build.json (1)

3-10: LGTM! Path mapping assumes types package is built first.

The configuration correctly enables declaration generation and maps @listee/types to its build output. This assumes the types package is built before the auth package.

tsconfig.json (1)

13-16: LGTM! Path mappings correctly target source directories for development.

The updated mappings point to package src directories (rather than specific index files), enabling flexible submodule imports during development. This complements the build-time configs (tsconfig.build.json) that map to dist directories, creating a clean separation between dev and build resolution.

package.json (1)

22-23: ✓ Turbo configuration verified and correctly configured.

The turbo.json file properly defines both build and clean tasks:

  • build task includes monorepo dependencies (dependsOn: ["^build"]), output caching (outputs: ["dist/**"]), and cache enabled
  • clean task is defined and ready for turbo orchestration

The added scripts in package.json correctly delegate to turbo for monorepo task orchestration.

packages/api/tsconfig.build.json (1)

3-11: Build order in turbo.json is correctly configured.

The turbo.json build task uses dependsOn: ["^build"], which tells turbo to wait for tasks in the package's dependencies to complete first. This ensures that @listee/auth, @listee/db, and @listee/types are built before the api package, which aligns perfectly with the path mappings in tsconfig.build.json. The configuration is correct and requires no changes.

packages/types/tsconfig.build.json (1)

1-11: LGTM! Build configuration correctly set up.

The build-specific config appropriately enables declaration generation and points path aliases to built artifacts (../db/dist) rather than source files, which is correct for consuming downstream compiled outputs.

packages/types/tsconfig.json (1)

5-10: LGTM! Development config correctly references source files.

The path mapping points to ../db/src for development (vs ../db/dist in tsconfig.build.json), which correctly allows TypeScript to provide rich IDE feedback and navigate to source during development.

packages/auth/package.json (1)

14-17: LGTM! Dependencies use correct protocols.

The dependencies correctly use workspace:^ for internal packages and catalog: for external shared dependencies, adhering to the coding guidelines.

packages/auth/tsconfig.json (1)

5-13: LGTM! Configuration is consistent across packages.

The TypeScript configuration follows the same pattern as other packages: Bundler resolution, rootDir constraint, source path mappings, and comprehensive test exclusions.

packages/api/tsconfig.json (1)

9-13: LGTM! Path mappings correctly set up for API dependencies.

The API package appropriately maps all three internal dependencies (@listee/auth, @listee/db, @listee/types) to their source directories, enabling proper IDE support and type checking during development.

scripts/write-dist-manifest.mjs (1)

59-62: Verify default main entry point assumption.

The script defaults main to "./index.js" when undefined, but doesn't verify that dist/index.js will exist after the TypeScript build. If a package uses a different entry point name, this could create an invalid manifest.

Consider either:

  • Documenting that packages must output dist/index.js
  • Failing if main is undefined rather than assuming a default
  • Detecting the actual entry file from TypeScript config
packages/db/package.json (1)

12-12: Factual error in review comment – reverse claim about package approaches.

The review comment incorrectly states that @listee/db uses cp package.json dist/, but verification shows it actually uses node ../../scripts/write-dist-manifest.mjs. While there is a real inconsistency (packages/types and packages/api use cp while packages/db and packages/auth use write-dist-manifest.mjs), the review comment misidentified which packages employ which approach.

Likely an incorrect or invalid review comment.

packages/api/package.json (2)

8-12: Verify dist manifest generation is complete in postbuild step.

The postbuild script currently only copies package.json to dist. Per the PR objectives, build scripts should "emit dist manifests after TypeScript builds." The AI summary references a new scripts/write-dist-manifest.mjs utility, but this doesn't appear to be invoked in the postbuild script.

Is the manifest generation handled by a separate tool in the build orchestration, or should the postbuild script also invoke write-dist-manifest.mjs? Please clarify whether this postbuild implementation aligns with the intended dist manifest workflow.


18-18: Good: catalog protocol usage.

The hono dependency correctly uses the "catalog:" protocol per coding guidelines, enabling shared dependency management.

packages/types/package.json (3)

11-11: Build script correctly updated to use separate build tsconfig.

The build script now references tsconfig.build.json instead of tsconfig.json, aligning with the PR objective to separate build-time and development TypeScript configurations. This enables declaration generation for the types package.


12-12: Verify dist manifest generation is complete in postbuild step.

Like packages/api/package.json, the postbuild script here only copies package.json to dist. Per the PR objectives, build scripts should "emit dist manifests after TypeScript builds." The AI summary references a new scripts/write-dist-manifest.mjs utility that doesn't appear to be invoked.

Clarify whether the manifest generation is part of the separate Turbo orchestration or if the postbuild script should also call write-dist-manifest.mjs here.


15-15: Note: Inconsistent workspace version specifiers across packages.

This package uses "workspace:^" for @listee/db, while packages/api/package.json uses "workspace:*" for its workspace dependencies. Verify this inconsistency is intentional and documents the rationale if there's a meaningful distinction.

],
"files": ["dist"],
"scripts": {
"clean": "rm -rf dist",
Copy link

@coderabbitai coderabbitai bot Oct 19, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clean script is not cross-platform.

The rm -rf dist command will fail on Windows without WSL or Git Bash. Consider using a cross-platform alternative:

-    "clean": "rm -rf dist",
+    "clean": "rimraf dist",

Then add rimraf as a dev dependency, or use Node.js directly:

-    "clean": "rm -rf dist",
+    "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In packages/auth/package.json at line 10, the "clean" script uses the
Unix-specific command "rm -rf dist" which breaks on Windows; update the script
to a cross-platform form (e.g., "rimraf dist" or "node -e
\"require('fs').rmSync('dist', { recursive: true, force: true })\"") and add
rimraf as a devDependency if you choose rimraf (npm install --save-dev rimraf)
or implement the Node.js one-liner so the clean script works on all platforms.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the commit 1f6a2309c3d8 and check what changed in packages/auth/package.json
git show 1f6a2309c3d8 --stat
echo "---"
git show 1f6a2309c3d8 -- packages/auth/package.json

Length of output: 1072


@gentamura Perfect! ✅ I can confirm that commit 1f6a2309c3d8 successfully replaced rm -rf dist with rimraf dist in packages/auth/package.json and consistently applied the same fix across all other packages (api, db, types). The addition of rimraf as a dependency ensures the clean script now works cross-platform. Great work!


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

],
"files": ["dist"],
"scripts": {
"clean": "rm -rf dist",
Copy link

@coderabbitai coderabbitai bot Oct 19, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clean script is not cross-platform.

Same as in packages/auth/package.json, the rm -rf dist command will fail on Windows. Consider using a cross-platform alternative like rimraf or Node.js built-in APIs.

🤖 Prompt for AI Agents
In packages/db/package.json around line 10, the "clean": "rm -rf dist" script is
not cross-platform and will fail on Windows; replace it with a cross-platform
command (for example change the script to "rimraf dist") and add rimraf as a
devDependency (or alternatively implement a small Node script using
fs.rmSync/recursive to remove the dist folder and update the script to call it).
Ensure you run npm/yarn install to add the new devDependency if you choose
rimraf.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the commit to verify the fix
git show 1f6a2309c3d8 --stat
echo "---"
# Show the specific changes to packages/db/package.json
git show 1f6a2309c3d8 -- packages/db/package.json

Length of output: 1064


🏁 Script executed:

#!/bin/bash
# Check if rimraf was added to package.json
git show 1f6a2309c3d8 -- package.json

Length of output: 466


@gentamura Perfect! ✨ I can confirm that commit 1f6a230 properly addresses the cross-platform issue:

  • Changed the clean script from "rm -rf dist" to "rimraf dist" in packages/db/package.json
  • Added rimraf 6.0.1 as a devDependency in the root package.json
  • Applied the same fix consistently across all packages

The clean script will now work correctly on Windows and other platforms. Great fix! 🎉


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
package.json (1)

29-29: Pin turbo version per the coding guidelines (duplicate of prior review).

The turbo dependency is still using "^2.5.8" instead of the exact pinned version. Per the coding guidelines ("Pin shared dependency versions in the root package.json catalog") and the prior review, shared devDependencies in the root should be pinned exactly, not as ranges. The latest stable version is 2.5.8 (Sept 24, 2025).

Apply this diff to pin the turbo version exactly:

-    "turbo": "^2.5.8",
+    "turbo": "2.5.8",
🧹 Nitpick comments (1)
packages/api/src/repositories/category-repository.ts (1)

22-35: Consider using native base64url decoding for consistency.

The manual base64url-to-base64 conversion works correctly but is unnecessary. Line 117 already uses Node's native "base64url" encoding via Buffer.toString("base64url"), so the decoder should use Buffer.from(value, "base64url") for symmetry and simplicity.

Apply this diff to use native base64url decoding:

-function decodeBase64Url(value: string): Buffer | null {
-  const base64Characters = value.replace(/-/g, "+").replace(/_/g, "/");
-  const remainder = base64Characters.length % 4;
-  const normalized =
-    remainder === 0
-      ? base64Characters
-      : `${base64Characters}${"====".slice(remainder)}`;
-
-  try {
-    return Buffer.from(normalized, "base64");
-  } catch {
-    return null;
-  }
-}
+function decodeBase64Url(value: string): Buffer | null {
+  try {
+    return Buffer.from(value, "base64url");
+  } catch {
+    return null;
+  }
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a7780d and aa96ec5.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • package.json (1 hunks)
  • packages/api/src/repositories/category-repository.ts (2 hunks)
  • packages/api/src/repositories/task-repository.ts (1 hunks)
  • packages/db/src/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
packages/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/*/src/**/*.{ts,tsx}: Avoid implicit any; TypeScript is run with strict enabled
Prefer type guards or the satisfies operator over as casts where appropriate
Prefer unknown for external inputs
Use PascalCase for types and enums
Use camelCase for variables and functions
Ensure source comments are written in English

Files:

  • packages/api/src/repositories/category-repository.ts
  • packages/api/src/repositories/task-repository.ts
  • packages/db/src/index.ts
packages/*/src/{routes,queries,services,repositories}/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Maintain dependency direction routes → queries → services → repositories

Files:

  • packages/api/src/repositories/category-repository.ts
  • packages/api/src/repositories/task-repository.ts
packages/*/src/repositories/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Repositories must not depend on services and should encapsulate external access, returning plain or domain-specific types

Files:

  • packages/api/src/repositories/category-repository.ts
  • packages/api/src/repositories/task-repository.ts
package.json

📄 CodeRabbit inference engine (AGENTS.md)

package.json: Pin shared dependency versions in the root package.json catalog
Add new shared dependencies to the root catalog before consuming them in packages

Files:

  • package.json
🔇 Additional comments (4)
packages/api/src/repositories/task-repository.ts (1)

2-2: LGTM! Import consolidation improves organization.

Centralizing the eq operator import from @listee/db (instead of drizzle-orm) aligns with the updated exports in the db package and improves maintainability.

packages/api/src/repositories/category-repository.ts (1)

3-3: LGTM! Import consolidation improves organization.

Consolidating drizzle-orm operators through @listee/db aligns with the updated db package exports and improves maintainability.

packages/db/src/index.ts (2)

216-216: LGTM! Re-exporting drizzle-orm operators improves encapsulation.

Centralizing these operator exports allows repository code to depend solely on @listee/db rather than importing directly from drizzle-orm, which improves maintainability and layer separation.


220-222: Verify portability and intended use case for schemaPath.

The schemaPath export computes a file path using import.meta.url, which may behave differently in bundled or deployed environments. The resulting pathname could also be platform-specific (absolute paths differ on Windows vs. Unix).

Please confirm:

  1. Is this intended for build-time tooling (e.g., migrations, code generation) or runtime usage?
  2. Will this code run in environments where the source file structure is preserved (not bundled)?

If schemaPath is for build-time tooling that runs against source files, the current implementation is acceptable. If it needs to work in production or bundled environments, consider providing the path through configuration or environment variables instead.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/db/src/index.test.ts (1)

75-99: Consider adding explicit types with satisfies for consistency.

The new mock builders follow a clear structure but could benefit from explicit type definitions to match the pattern used by sqlTag and sqlTag.raw (lines 49, 57). This would improve type safety and maintainability.

For example, you could define interfaces and apply them:

+interface PredicateBuilder {
+  kind: "predicate";
+  operator: string;
+  values: Array<unknown>;
+}
+
+interface OrderBuilder {
+  kind: "order";
+  direction: string;
+  value: unknown;
+}
+
 mock.module("drizzle-orm", () => ({
   sql: sqlTag,
   eq: (...values: Array<unknown>) => ({
     kind: "predicate",
     operator: "eq",
     values,
-  }),
+  }) satisfies PredicateBuilder,
   and: (...values: Array<unknown>) => ({
     kind: "predicate",
     operator: "and",
     values,
-  }),
+  }) satisfies PredicateBuilder,
   or: (...values: Array<unknown>) => ({
     kind: "predicate",
     operator: "or",
     values,
-  }),
+  }) satisfies PredicateBuilder,
   lt: (...values: Array<unknown>) => ({
     kind: "predicate",
     operator: "lt",
     values,
-  }),
+  }) satisfies PredicateBuilder,
   desc: (value: unknown) => ({
     kind: "order",
     direction: "desc",
     value,
-  }),
+  }) satisfies OrderBuilder,
 }));

As per coding guidelines.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa96ec5 and 7b9d301.

📒 Files selected for processing (1)
  • packages/db/src/index.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
packages/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/*/src/**/*.{ts,tsx}: Avoid implicit any; TypeScript is run with strict enabled
Prefer type guards or the satisfies operator over as casts where appropriate
Prefer unknown for external inputs
Use PascalCase for types and enums
Use camelCase for variables and functions
Ensure source comments are written in English

Files:

  • packages/db/src/index.test.ts
packages/*/src/**/{*.test.ts,__tests__/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

packages/*/src/**/{*.test.ts,__tests__/**/*.ts}: Write test names and descriptions in English
Co-locate tests as *.test.ts or under tests/ using Bun’s test runner

Files:

  • packages/db/src/index.test.ts

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bf25fe and 2e46e66.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • package.json (1 hunks)
  • packages/api/package.json (1 hunks)
  • packages/auth/package.json (1 hunks)
  • packages/db/package.json (1 hunks)
  • packages/types/package.json (1 hunks)
  • scripts/write-dist-manifest.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/write-dist-manifest.mjs
🧰 Additional context used
📓 Path-based instructions (2)
packages/*/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Reference shared dependencies via the "catalog:" protocol in package manifests

Files:

  • packages/db/package.json
  • packages/api/package.json
  • packages/types/package.json
  • packages/auth/package.json
package.json

📄 CodeRabbit inference engine (AGENTS.md)

package.json: Pin shared dependency versions in the root package.json catalog
Add new shared dependencies to the root catalog before consuming them in packages

Files:

  • package.json
🔇 Additional comments (5)
packages/db/package.json (1)

1-18: Package structure aligns with build tooling objectives.

The catalog references and files simplification follow the documented guidelines. The postbuild manifest generation complements the Turbo orchestration.

package.json (1)

15-31: Turbo orchestration and dependency pinning correctly implemented.

All shared dependencies in the catalog are pinned to exact versions. Root devDependencies follow the pinning requirement. The Turbo scripts (turbo run build and turbo run clean) properly orchestrate workspace tasks across packages.

packages/auth/package.json (1)

1-18: Package structure and build workflow align with Turbo integration.

Catalog references are correct, postbuild manifest generation is consistent with the db package, and cross-platform script handling is in place.

packages/api/package.json (1)

1-8: Catalog references and files configuration are correct.

The dependency declarations properly use the catalog and workspace protocols per the coding guidelines.

packages/types/package.json (1)

11-11: Build configuration correctly updated to use dedicated tsconfig.build.json.

This aligns with the per-package build config strategy noted in the PR objectives.

@gentamura gentamura merged commit 381cb50 into main Oct 19, 2025
4 checks passed
@gentamura gentamura deleted the chore/build-tooling branch October 19, 2025 13:36
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