Repository navigation
fix(cli): sqlite without turso doesn't need db:local, added missing task db:local in turbo.json - #739
Conversation
…ript, Turborepo task, and updating README instructions.
|
@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. |
|
Note Other AI code review bot(s) detectedCodeRabbit 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. 📝 WalkthroughWalkthroughPass Changes
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
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used📓 Path-based instructions (5)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Files:
**/*.{ts,tsx,js,jsx,css}📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Files:
**/*.{html,tsx,ts,jsx,js}📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-12-03T07:48:26.419ZApplied to files:
🧬 Code graph analysis (1)apps/cli/src/helpers/core/create-readme.ts (3)
⏰ 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)
🔇 Additional comments (3)
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: 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:localfor any SQLite + Drizzle setup, but the script is only created whendbSetup === "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
📒 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.tsapps/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.tsapps/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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --hot <file>to enable hot reloading during development
Files:
apps/cli/src/helpers/core/create-readme.tsapps/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 ofwebpackoresbuildfor bundling TypeScript, JavaScript, and CSS files
Files:
apps/cli/src/helpers/core/create-readme.tsapps/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.tsapps/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.tsapps/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:localtask is properly guarded by the explicitdbSetup === "turso"check and follows the same pattern as thedockersetup above. The task configuration withcache: falseandpersistent: trueis 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 thedb:localcommand. The fallback message for non-Turso, non-D1 SQLite setups is also appropriate.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --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 ofwebpackoresbuildfor 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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/cli/src/helpers/core/create-readme.tsapps/cli/src/helpers/core/post-installation.tsapps/cli/src/helpers/core/project-config.tsapps/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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --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 ofwebpackoresbuildfor 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: Thedb:localtask 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.
6596c1f to
4ce40e7
Compare
There was a problem hiding this comment.
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: MakedbSetupparameter required ingenerateScriptsList.The parameter typing is inconsistent:
generateDatabaseSetupexpectsdbSetup: DatabaseSetup(required)generateScriptsListexpectsdbSetup?: DatabaseSetup(optional)Both functions receive the same value
options.dbSetupfromProjectConfig, wheredbSetupis a required property. The second function should declaredbSetup: DatabaseSetupwithout the optional modifier for consistency.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/cli/src/helpers/core/create-readme.tsapps/cli/src/helpers/core/post-installation.tsapps/cli/src/helpers/core/project-config.tsapps/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}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
UseBun.serve()which supports WebSockets, HTTPS, and routes instead ofexpress
Usebun:sqlitemodule for SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead of thewspackage
PreferBun.fileovernode:fsreadFile/writeFile methods
UseBun.$template literal syntax instead ofexecafor shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server withbun --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 ofwebpackoresbuildfor 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
dbSetupvalue is now properly passed to bothgenerateDatabaseSetupandgenerateScriptsList, 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 rootpackage.jsondoes not contain adb:localscript—only Turbo-based commands. The original review claims the simplified command (removingcd packages/db) aligns with making the script "callable from the project root," but this cannot be confirmed without accessing the actual file and verifying whetherdb:localexists in a workspace package'spackage.json(likelypackages/db). The verification requested in the original comment remains incomplete.
601-603: No action required—script generation logic is consistent.The
db:localscript condition inproject-config.ts(line 84) matches the updated condition increate-readme.ts: both usedatabase === "sqlite" && dbSetup !== "d1"without ORM restrictions. Thedb:localcommand is a general SQLite operation and not ORM-dependent, so generating it regardless of ORM choice is appropriate.
|
Thanks @coderaja8 ❤️ |
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
Bug Fixes / Improvements
✏️ Tip: You can customize this high-level summary in your review settings.
Note
SQLite local DB flow updated
db:local; passesdbSetupto script generationdb:localwhendatabase=sqliteanddbSetup ≠ d1; updates script text to run from rootdb:localstep under the same conditiondb:localtask for applicable SQLite setupsWritten by Cursor Bugbot for commit 4ce40e7. This will update automatically on new commits. Configure here.