Skip to content

fix(cli): sqlite without turso doesn't need db:local, added missing task db:local in turbo.json - #739

Merged
AmanVarshney01 merged 5 commits into
AmanVarshney01:mainfrom
coderaja8:feat/fix-sqlite-db-integration
Dec 24, 2025
Merged

AmanVarshney01 merged 5 commits into
AmanVarshney01:mainfrom
coderaja8:feat/fix-sqlite-db-integration

Conversation

@coderaja8

@coderaja8 coderaja8 commented Dec 20, 2025 •

Copy link
Copy Markdown
Contributor

ORM(Prisma and Drizzle) creates the local file automatically.

db:local is dependent on turso cli. So, I removed it when turso is not selected by user.

Summary by CodeRabbit

  • New Features

    • CLI now inserts a direct local DB command in generated setup instructions for SQLite projects when local DB setup is enabled, regardless of ORM choice.
    • Turborepo task templates include the local DB task for applicable SQLite setups.
  • Bug Fixes / Improvements

    • Post-installation messaging marks starting the local SQLite DB as optional and clarifies the instruction wording.

✏️ Tip: You can customize this high-level summary in your review settings.


Note

SQLite local DB flow updated

  • README: marks starting SQLite as optional; simplifies command to db:local; passes dbSetup to script generation
  • Scripts: adds db:local when database=sqlite and dbSetup ≠ d1; updates script text to run from root
  • Post-install: includes optional db:local step under the same condition
  • Turborepo template: adds db:local task for applicable SQLite setups

Written by Cursor Bugbot for commit 4ce40e7. This will update automatically on new commits. Configure here.

…ript, Turborepo task, and updating README instructions.
@vercel

vercel Bot commented Dec 20, 2025

Copy link
Copy Markdown

@coderaja8 is attempting to deploy a commit to the Better T Stack Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Dec 20, 2025 •

Copy link
Copy Markdown
Contributor

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Pass dbSetup through README/script generation, gate SQLite local-db script and Turbo task on dbSetup !== "d1", change README/local-db instructions to use a direct db:local invocation and mark starting local SQLite as optional; adjust templates and post-install messaging.

Changes

Cohort / File(s) Summary
README & script generation
apps/cli/src/helpers/core/create-readme.ts
Adds optional dbSetup parameter to generateScriptsList, passes options.dbSetup when generating README scripts, switches SQLite script generation to check dbSetup !== "d1", replaces a two-line local-db start snippet with a single-line db:local invocation, and marks starting the local DB as optional.
Project config / package.json scripts
apps/cli/src/helpers/core/project-config.ts
Alters root package.json script logic: adds db:local when database === "sqlite" and dbSetup !== "d1" (removed prior orm !== "none" constraint).
Turbo task template
apps/cli/templates/addons/turborepo/turbo.json.hbs
Restructures conditional blocks around dev:setup and DB tasks; renders a db:local task when database is sqlite and dbSetup !== "d1", updating surrounding conditionals.
Post-installation messages
apps/cli/src/helpers/core/post-installation.ts
Broadens SQLite post-installation condition to database === "sqlite" and dbSetup !== "d1", and updates the db:local step text to be optional and describe starting a local SQLite DB.

Sequence Diagram(s)

(Skipped — changes are template/conditional and messaging updates without a new multi-component control flow requiring visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

canary

Poem

🐇 I nibbled lines of script and prose,
Made local DB steps gentler as it goes.
One tidy command to start the show,
Optional now — hop in when you’re ready to grow. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main changes: fixing SQLite configuration to not require db:local with Turso and adding the db:local task to turbo.json.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6596c1f and 4ce40e7.

📒 Files selected for processing (4)
  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/src/helpers/core/project-config.ts
  • apps/cli/templates/addons/turborepo/turbo.json.hbs
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/templates/addons/turborepo/turbo.json.hbs
  • apps/cli/src/helpers/core/project-config.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/create-readme.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`

Applied to files:

  • apps/cli/src/helpers/core/create-readme.ts
🧬 Code graph analysis (1)
apps/cli/src/helpers/core/create-readme.ts (3)
packages/types/src/types.ts (1)
  • DatabaseSetup (37-37)
apps/cli/src/types.ts (1)
  • DatabaseSetup (55-55)
apps/cli/src/index.ts (1)
  • DatabaseSetup (242-242)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test Suite
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (3)
apps/cli/src/helpers/core/create-readme.ts (3)

98-98: LGTM! Correctly threading dbSetup parameter.

The dbSetup value is now properly passed to both generateDatabaseSetup and generateScriptsList, enabling conditional logic for D1 vs other SQLite setups.

Also applies to: 130-130


499-505: Unable to fully verify this review comment due to repository access limitations. The root package.json does not contain a db:local script—only Turbo-based commands. The original review claims the simplified command (removing cd packages/db) aligns with making the script "callable from the project root," but this cannot be confirmed without accessing the actual file and verifying whether db:local exists in a workspace package's package.json (likely packages/db). The verification requested in the original comment remains incomplete.


601-603: No action required—script generation logic is consistent.

The db:local script condition in project-config.ts (line 84) matches the updated condition in create-readme.ts: both use database === "sqlite" && dbSetup !== "d1" without ORM restrictions. The db:local command is a general SQLite operation and not ORM-dependent, so generating it regardless of ORM choice is appropriate.


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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/cli/src/helpers/core/create-readme.ts (1)

603-606: Change line 603 to check for Turso setup: if (database === "sqlite" && dbSetup === "turso")

Line 603 documents db:local for any SQLite + Drizzle setup, but the script is only created when dbSetup === "turso" (as shown in project-config.ts lines 84 and 190). This inconsistency causes the README to document unavailable scripts for non-Turso setups.

-  if (database === "sqlite" && orm === "drizzle") {
+  if (database === "sqlite" && dbSetup === "turso") {
     scripts += `
 - \`cd packages/db && ${packageManagerRunCmd} db:local\`: Start the local SQLite database`;
   }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27b1bdd and fa8c280.

📒 Files selected for processing (3)
  • apps/cli/src/helpers/core/create-readme.ts (1 hunks)
  • apps/cli/src/helpers/core/project-config.ts (2 hunks)
  • apps/cli/templates/addons/turborepo/turbo.json.hbs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/addons/turborepo/turbo.json.hbs
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/project-config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/project-config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/project-config.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/project-config.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/project-config.ts
🧠 Learnings (1)
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`

Applied to files:

  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/project-config.ts
🔇 Additional comments (2)
apps/cli/templates/addons/turborepo/turbo.json.hbs (1)

60-65: LGTM! Turbo task configuration is correct.

The conditional db:local task is properly guarded by the explicit dbSetup === "turso" check and follows the same pattern as the docker setup above. The task configuration with cache: false and persistent: true is appropriate for a local database development task.

apps/cli/src/helpers/core/create-readme.ts (1)

504-509: LGTM! Turso-specific README instructions are clear.

The explicit dbSetup === "turso" condition correctly generates a bash code block with navigation to the db package and execution of the db:local command. The fallback message for non-Turso, non-D1 SQLite setups is also appropriate.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa8c280 and fc1a1cb.

📒 Files selected for processing (1)
  • apps/cli/src/helpers/core/project-config.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/project-config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/project-config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/project-config.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/project-config.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/project-config.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `Bun.sql` for Postgres instead of `pg` or `postgres.js`
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`

Applied to files:

  • apps/cli/src/helpers/core/project-config.ts

@cursor cursor 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.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3e4bfa and 6596c1f.

📒 Files selected for processing (4)
  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/src/helpers/core/project-config.ts
  • apps/cli/templates/addons/turborepo/turbo.json.hbs
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/cli/src/helpers/core/project-config.ts
  • apps/cli/src/helpers/core/create-readme.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/post-installation.ts
**/*.hbs

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.hbs: In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle
Escape the '{{' in Handlebars templates like '{{'

Files:

  • apps/cli/templates/addons/turborepo/turbo.json.hbs
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`

Applied to files:

  • apps/cli/src/helpers/core/post-installation.ts
📚 Learning: 2025-12-03T07:47:42.038Z
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/better-t-stack-repo.mdc:0-0
Timestamp: 2025-12-03T07:47:42.038Z
Learning: Applies to **/*.hbs : In Handlebars templates, avoid generic if/else blocks. Write explicit conditions, such as: use if (eq orm "prisma") for Prisma, and else if (eq orm "drizzle") for Drizzle

Applied to files:

  • apps/cli/templates/addons/turborepo/turbo.json.hbs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (1)
apps/cli/templates/addons/turborepo/turbo.json.hbs (1)

57-62: The db:local task condition is correct and consistent across all files.

The Handlebars condition in turbo.json.hbs matches the TypeScript conditions in post-installation.ts, project-config.ts, and create-readme.ts: database === "sqlite" && dbSetup !== "d1". Script generation in project-config.ts uses the same condition. The absence of an ORM constraint in this task is intentional—it applies to any ORM choice as long as SQLite is used without D1 setup.

@AmanVarshney01
AmanVarshney01 force-pushed the feat/fix-sqlite-db-integration branch from 6596c1f to 4ce40e7 Compare December 24, 2025 12:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/cli/src/helpers/core/create-readme.ts (1)

481-481: Make dbSetup parameter required in generateScriptsList.

The parameter typing is inconsistent:

  • generateDatabaseSetup expects dbSetup: DatabaseSetup (required)
  • generateScriptsList expects dbSetup?: DatabaseSetup (optional)

Both functions receive the same value options.dbSetup from ProjectConfig, where dbSetup is a required property. The second function should declare dbSetup: DatabaseSetup without the optional modifier for consistency.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6596c1f and 4ce40e7.

📒 Files selected for processing (4)
  • apps/cli/src/helpers/core/create-readme.ts
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/src/helpers/core/project-config.ts
  • apps/cli/templates/addons/turborepo/turbo.json.hbs
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/cli/src/helpers/core/post-installation.ts
  • apps/cli/templates/addons/turborepo/turbo.json.hbs
  • apps/cli/src/helpers/core/project-config.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/cli/src/helpers/core/create-readme.ts
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/cli/src/helpers/core/create-readme.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`
📚 Learning: 2025-12-03T07:48:26.419Z
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-12-03T07:48:26.419Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `bun:sqlite` module for SQLite instead of `better-sqlite3`

Applied to files:

  • apps/cli/src/helpers/core/create-readme.ts
🧬 Code graph analysis (1)
apps/cli/src/helpers/core/create-readme.ts (3)
packages/types/src/types.ts (1)
  • DatabaseSetup (37-37)
apps/cli/src/types.ts (1)
  • DatabaseSetup (55-55)
apps/cli/src/index.ts (1)
  • DatabaseSetup (242-242)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test Suite
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (3)
apps/cli/src/helpers/core/create-readme.ts (3)

98-98: LGTM! Correctly threading dbSetup parameter.

The dbSetup value is now properly passed to both generateDatabaseSetup and generateScriptsList, enabling conditional logic for D1 vs other SQLite setups.

Also applies to: 130-130


499-505: Unable to fully verify this review comment due to repository access limitations. The root package.json does not contain a db:local script—only Turbo-based commands. The original review claims the simplified command (removing cd packages/db) aligns with making the script "callable from the project root," but this cannot be confirmed without accessing the actual file and verifying whether db:local exists in a workspace package's package.json (likely packages/db). The verification requested in the original comment remains incomplete.


601-603: No action required—script generation logic is consistent.

The db:local script condition in project-config.ts (line 84) matches the updated condition in create-readme.ts: both use database === "sqlite" && dbSetup !== "d1" without ORM restrictions. The db:local command is a general SQLite operation and not ORM-dependent, so generating it regardless of ORM choice is appropriate.

@AmanVarshney01
AmanVarshney01 merged commit dcbbbda into AmanVarshney01:main Dec 24, 2025
3 of 5 checks passed
@AmanVarshney01

Copy link
Copy Markdown
Owner

Thanks @coderaja8 ❤️

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.

2 participants