chore: clean up bun dev startup warnings - #30
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used🧠 Learnings (5)📓 Common learnings📚 Learning: 2026-04-01T13:22:06.563ZApplied to files:
📚 Learning: 2026-04-01T13:22:06.563ZApplied to files:
📚 Learning: 2026-04-01T13:22:06.563ZApplied to files:
📚 Learning: 2026-04-01T13:22:06.563ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughReplace direct Bun Changes
Sequence Diagram(s)sequenceDiagram
participant DevCLI as Developer CLI
participant WatchTS as watch-from-root.ts
participant BunChild as Bun (child)
participant RepoFS as Repository FS
DevCLI->>WatchTS: bun ../../scripts/watch-from-root.ts src/index.ts
WatchTS->>RepoFS: resolve script dir -> determine repo root
WatchTS->>RepoFS: validate & resolve EntryPath (src/index.ts)
WatchTS->>BunChild: spawn bun --cwd=<repoRoot> --env-file=<repoRoot>/.env --watch <entry>
BunChild->>RepoFS: read .env and workspace files
Note right of BunChild: On file change -> Bun restarts/updates
BunChild-->>WatchTS: exit / error code
WatchTS-->>DevCLI: exit with Bun's exit code
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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
🤖 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/worker/package.json`:
- Line 7: The dev script in package.json currently shells out to a PowerShell
wrapper (watch-from-root.ps1) which prevents non-Windows contributors from
running it; replace that with a cross-platform invocation that runs the same bun
--watch behavior without PowerShell. Update the "dev" script to call bun --watch
(or a small Node/posix shell wrapper) with correct path resolution to the repo
root instead of using watch-from-root.ps1, and remove the PowerShell dependency;
look for the "dev" script entry in package.json and the helper script
watch-from-root.ps1 to replicate its path-resolution logic in a shell/Node
approach so linux/mac users can run the dev script.
In `@scripts/watch-from-root.ps1`:
- Line 7: The script currently calls Resolve-Path on $EntryPath which will throw
a terminating error if the path does not exist; add an explicit existence check
using Test-Path on $EntryPath before calling Resolve-Path, and if it returns
false emit a clear error via Write-Error or Write-Host with a descriptive
message and exit/return (so $resolvedEntry is never assigned from a failing
Resolve-Path); then only call $resolvedEntry = (Resolve-Path $EntryPath).Path
when the Test-Path check succeeds to provide deterministic, user-friendly error
handling.
🪄 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: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 132233cb-07d7-4926-bb93-e9a6d1ad0d0f
📒 Files selected for processing (6)
AGENTS.mdapps/api/package.jsonapps/worker/package.jsonpackage.jsonscripts/root-package.test.tsscripts/watch-from-root.ps1
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use the
@cs/*path aliases fromtsconfig.base.jsonfor cross-package imports
Files:
scripts/root-package.test.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: After each mini-step, run the applicable repo-root `bun` commands before committing
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: Run all repo scripts from the repository root with `bun`
📚 Learning: 2026-04-01T13:22:06.563Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: Run `bun dev` after code changes
Applied to files:
apps/api/package.json
📚 Learning: 2026-04-01T13:22:06.563Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: Run all repo scripts from the repository root with `bun`
Applied to files:
scripts/watch-from-root.ps1
📚 Learning: 2026-04-01T13:22:06.563Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: After each mini-step, run the applicable repo-root `bun` commands before committing
Applied to files:
scripts/watch-from-root.ps1
📚 Learning: 2026-04-01T13:22:06.563Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: If you encounter something surprising, tell the developer and add it to this file so future agents do not repeat the same mistake
Applied to files:
AGENTS.md
📚 Learning: 2026-04-01T13:22:06.563Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: Applies to convex/**/*.ts : Convex runtime files must not import the broad `cs/ai` barrel. In Convex runtime code, import the specific `packages/ai/src/*` module you need instead
Applied to files:
AGENTS.md
📚 Learning: 2026-04-01T13:22:06.563Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: Applies to convex/tsconfig.json : Convex package typecheck uses `convex/tsconfig.json`, not just `tsconfig.base.json`. When adding a safe Convex `cs/ai/*` subpath alias, mirror it in `convex/tsconfig.json` or `bun check` will fail in `cs/convex`
Applied to files:
AGENTS.md
📚 Learning: 2026-04-01T13:22:06.563Z
Learnt from: CR
Repo: HusseinBaraja/CS PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-01T13:22:06.563Z
Learning: Applies to convex/schema.ts : Run `bun generate` after any Convex schema change
Applied to files:
AGENTS.md
🔇 Additional comments (6)
scripts/watch-from-root.ps1 (1)
1-11: Script logic is correct for the intended purpose.The script properly:
- Resolves the repo root relative to the script location
- Converts the entry path to absolute (required since
--cwdchanges the working directory)- Passes the
.envfile and enables watch mode- Propagates
bun's exit codeThis addresses the limitation where
bun --watchinside workspace apps doesn't observe changes in siblingpackages/*directories.apps/api/package.json (1)
7-7: Consistent withapps/worker/package.jsonchange.The same PowerShell wrapper approach is applied here. The cross-platform concern raised for
apps/worker/package.jsonapplies equally to this file.scripts/root-package.test.ts (2)
30-30: Test expectations correctly updated for--parallelremoval.The assertions now match the updated root
package.jsonscripts without the deprecated--parallelflag.Also applies to: 33-33
84-84: Test coverage added for new PowerShell watcher scripts.The assertions verify that
apiandworkerdev scripts invoke the newwatch-from-root.ps1script with the correct entry path.Also applies to: 93-93
package.json (1)
12-12: Correct removal of deprecated--parallelflag.In Turbo 2.x, tasks without
dependsOnalready run concurrently by default. Theturbo.jsonshows thedevtask has no dependencies, so removing--paralleleliminates the deprecation warning without changing runtime behavior.Also applies to: 15-15
AGENTS.md (1)
63-64: Useful documentation of known behaviors and workarounds.Line 63 clearly explains the
bun --watchworkspace limitation that motivated the PowerShell wrapper changes. Line 64 provides actionable triage guidance for a common Baileys startup warning, distinguishing it from actual errors.
Summary
--parallelusage from the root dev scriptsapiandworkerdev watch roots so shared workspace edits trigger restartsValidation
bun test ./scripts/root-package.test.tsbun checkbun devdev:apiNotes
bun devon this machine still shows environment/runtime noise such as occupied ports and normal Baileys startup logsOut of scope
conflict type="replaced"Summary by CodeRabbit
Documentation
Chores
Tests