chore: Upgrade Turborepo from 2.5.0 to 2.9.0#874
Conversation
🦋 Changeset detectedLatest commit: 934e750 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughUpgraded Turborepo from 2.5.0 to 2.9.0 across the monorepo (root, examples, and CORE_PACKAGES) and added a changeset documenting the patch-level bump. Also modified example-run scripts to unset npm_/pnpm_ environment variables when running example commands. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 86: The example projects' lockfiles are still pinned to turbo@2.5.0 while
the root package.json was bumped to turbo@2.9.0; regenerate the two example pnpm
lockfiles so they match the manifest bump by running pnpm install
--lockfile-only (or pnpm install) inside examples/blog-with-auth and
examples/todo-with-better-auth and commit the updated pnpm-lock.yaml files
(examples/blog-with-auth/pnpm-lock.yaml and
examples/todo-with-better-auth/pnpm-lock.yaml) so pnpm install --frozen-lockfile
succeeds.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 18a0a1e0-4327-409b-8f3e-59bb629b2079
⛔ Files ignored due to path filters (3)
examples/blog-with-auth/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/todo-with-better-auth/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.changeset/upgrade-turborepo.mdexamples/blog-with-auth/package.jsonexamples/todo-with-better-auth/package.jsonpackage.jsonpackages/core-generators/src/constants/core-packages.ts
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/run-all.sh`:
- Line 37: After shifting past the `--` separator you must validate that at
least one argument remains to avoid silent failures; add a check right after the
shift in scripts/run-all.sh to test the positional parameter count ($#) and, if
zero, print an error like "Error: no command provided after --" to stderr and
exit non‑zero. Place this check before the loop that uses UNSET_ARGS and before
the line invoking env "${UNSET_ARGS[@]}" "$@" so callers invoking the script
with only `--` fail early and clearly.
In `@scripts/run-example.sh`:
- Line 46: The current invocation (cd "$EXAMPLE_DIR" && env "${UNSET_ARGS[@]}"
"$@") can call env with no command when "${UNSET_ARGS[@]}" and "$@" are both
empty; add a guard before that line to detect an empty command (check that
either UNSET_ARGS or "$@" contains at least one token) and fail with a non-zero
exit and explanatory message if none exist. Locate the run-example.sh snippet
using the EXAMPLE_DIR, UNSET_ARGS, and "$@" variables and implement the
pre-check to ensure we never run env with no command (returning an error/usage
message instead).
In `@scripts/run-examples.sh`:
- Line 34: The script currently runs (cd "$dir" && env "${UNSET_ARGS[@]}" "$@")
which will silently succeed if the caller passed only the `--` separator because
the initial pre-shift check sees one arg, then the `shift` removes it and "$@"
becomes empty; add a post-shift validation immediately after the code that
removes `--` to check that "$@" is non-empty and exit with a non-zero status
(and an error message) if it is empty so that env is never invoked without a
command; reference the removal/shift logic and the invocation line using
UNSET_ARGS, dir and the env "${UNSET_ARGS[@]}" "$@" call when making this
change.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c08405b0-0bff-4e37-873c-26127d6af4a0
⛔ Files ignored due to path filters (2)
examples/blog-with-auth/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlexamples/todo-with-better-auth/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
scripts/run-all.shscripts/run-example.shscripts/run-examples.sh
| fi | ||
| echo ">>> Running in $name: $*" | ||
| (cd "$dir" && "$@") | ||
| (cd "$dir" && env "${UNSET_ARGS[@]}" "$@") |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat -n scripts/run-all.shRepository: halfdomelabs/baseplate
Length of output: 1184
🏁 Script executed:
cat -n scripts/run-examples.shRepository: halfdomelabs/baseplate
Length of output: 1105
Add post--- validation to prevent silent failures when no command is provided.
After shifting out the -- separator (line 12-13), the script should validate that at least one argument remains. Currently, callers can invoke pnpm run:all -- with no command, which passes the initial check and only fails when env is executed at line 37, resulting in unclear error messages. Add a check immediately after the shift:
if [ $# -eq 0 ]; then
echo "Error: no command provided after --" >&2
exit 1
fiThis pattern should match the explicit validation expected in scripts/run-examples.sh as well.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/run-all.sh` at line 37, After shifting past the `--` separator you
must validate that at least one argument remains to avoid silent failures; add a
check right after the shift in scripts/run-all.sh to test the positional
parameter count ($#) and, if zero, print an error like "Error: no command
provided after --" to stderr and exit non‑zero. Place this check before the loop
that uses UNSET_ARGS and before the line invoking env "${UNSET_ARGS[@]}" "$@" so
callers invoking the script with only `--` fail early and clearly.
|
|
||
| echo ">>> Running in examples/$EXAMPLE_NAME: $*" | ||
| (cd "$EXAMPLE_DIR" && "$@") | ||
| (cd "$EXAMPLE_DIR" && env "${UNSET_ARGS[@]}" "$@") |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat scripts/run-example.shRepository: halfdomelabs/baseplate
Length of output: 1280
🏁 Script executed:
# Test env behavior with only -u flags and no command
env -u TEST_VAR 2>&1 | head -20
echo "Exit code: $?"Repository: halfdomelabs/baseplate
Length of output: 664
Guard against empty command after parsing arguments.
At Line 46, this can execute env with no command when called as run:example <name> --, which exits successfully and masks invalid usage.
Suggested fix
# Skip the -- separator if present
if [ "${1:-}" = "--" ]; then
shift
fi
+
+if [ $# -eq 0 ]; then
+ echo "Usage: pnpm run:example <example-name> -- <command...>"
+ echo "Example: pnpm run:example todo-with-better-auth -- pnpm install"
+ exit 1
+fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/run-example.sh` at line 46, The current invocation (cd "$EXAMPLE_DIR"
&& env "${UNSET_ARGS[@]}" "$@") can call env with no command when
"${UNSET_ARGS[@]}" and "$@" are both empty; add a guard before that line to
detect an empty command (check that either UNSET_ARGS or "$@" contains at least
one token) and fail with a non-zero exit and explanatory message if none exist.
Locate the run-example.sh snippet using the EXAMPLE_DIR, UNSET_ARGS, and "$@"
variables and implement the pre-check to ensure we never run env with no command
(returning an error/usage message instead).
| name="${dir#"$ROOT_DIR"/}" | ||
| echo ">>> Running in $name: $*" | ||
| (cd "$dir" && "$@") | ||
| (cd "$dir" && env "${UNSET_ARGS[@]}" "$@") |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat scripts/run-examples.shRepository: halfdomelabs/baseplate
Length of output: 860
🏁 Script executed:
# Test env behavior with no command
env | head -1 && echo "exit code: $?"Repository: halfdomelabs/baseplate
Length of output: 88
Add a post--- command check to prevent silent success on empty arguments.
The script includes a pre-shift validation at line 4, but it only ensures at least one argument is provided before the -- separator. When invoked as pnpm run:examples -- (with no command after --), the check passes (since $# = 1), but after line 12 removes the --, $@ becomes empty. Line 34 then runs env without a command argument, which prints environment variables and exits 0 instead of failing.
The validation must occur after the shift to catch this case:
Suggested fix
# Skip the -- separator if present
if [ "$1" = "--" ]; then
shift
fi
+
+if [ $# -eq 0 ]; then
+ echo "Usage: pnpm run:examples -- <command...>"
+ echo "Example: pnpm run:examples -- pnpm install"
+ exit 1
+fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| (cd "$dir" && env "${UNSET_ARGS[@]}" "$@") | |
| # Skip the -- separator if present | |
| if [ "$1" = "--" ]; then | |
| shift | |
| fi | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: pnpm run:examples -- <command...>" | |
| echo "Example: pnpm run:examples -- pnpm install" | |
| exit 1 | |
| fi |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/run-examples.sh` at line 34, The script currently runs (cd "$dir" &&
env "${UNSET_ARGS[@]}" "$@") which will silently succeed if the caller passed
only the `--` separator because the initial pre-shift check sees one arg, then
the `shift` removes it and "$@" becomes empty; add a post-shift validation
immediately after the code that removes `--` to check that "$@" is non-empty and
exit with a non-zero status (and an error message) if it is empty so that env is
never invoked without a command; reference the removal/shift logic and the
invocation line using UNSET_ARGS, dir and the env "${UNSET_ARGS[@]}" "$@" call
when making this change.
Summary by CodeRabbit