Skip to content

feat(dev): move @netlify/db-dev to dependency of @netlify/dev#611

Open
paulo wants to merge 3 commits intomainfrom
pa/move-db-dev
Open

feat(dev): move @netlify/db-dev to dependency of @netlify/dev#611
paulo wants to merge 3 commits intomainfrom
pa/move-db-dev

Conversation

@paulo
Copy link

@paulo paulo commented Mar 5, 2026

Make @netlify/db-dev a direct dependency of @netlify/dev so the CLI can use it without requiring an additional install.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb08d988-56f9-42c7-9220-4b6029878f9e

📥 Commits

Reviewing files that changed from the base of the PR and between 734c48c and 5d5fa13.

📒 Files selected for processing (1)
  • packages/dev/src/main.ts
 _______________________________________________
< Your code has more branches than a windstorm. >
 -----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

✏️ Tip: You can disable in-progress messages and the fortune message in your review settings.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

📝 Walkthrough

Walkthrough

Moves "@netlify/db-dev" from devDependencies to dependencies in packages/dev/package.json (version "0.4.0") and removes peerDependencies/peerDependenciesMeta entries for it. Updates packages/dev/src/main.ts to import NetlifyDB at top-level, instantiate and start it directly when the DB feature is enabled, set NETLIFY_DB_URL from the returned connection string, register a stop hook, and replace the previous install-suggestion catch with explicit warning and debug-level error logging.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: moving @netlify/db-dev from peerDependencies to a direct dependency of @netlify/dev.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for making @netlify/db-dev a direct dependency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pa/move-db-dev

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.

@paulo paulo requested a review from eduardoboucas March 5, 2026 10:23
@paulo paulo changed the title feat(db): move @netlify/db-dev to dependency of @netlify/dev feat(dev): move @netlify/db-dev to dependency of @netlify/dev Mar 5, 2026
@paulo paulo marked this pull request as ready for review March 5, 2026 10:24
@paulo paulo requested review from a team as code owners March 5, 2026 10:24
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: 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 `@packages/dev/package.json`:
- Line 62: The catch block in packages/dev/src/main.ts that handles requiring
'@netlify/db-dev' (the block around the startup logic in the main/startDev
function) currently tells users to install the package; update that message to
indicate a runtime/startup failure instead (e.g., "Failed to start dev server:
`@netlify/db-dev` failed to load"), keep the catch in place, and include the
actual error details in the log so operators see the underlying cause; locate
the require/import error handling in the main (or startDev/initDev) function and
replace the install-oriented text with a startup failure message that includes
the error object.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 31aa8f67-c1cd-41ff-8ead-3d1fc7afd071

📥 Commits

Reviewing files that changed from the base of the PR and between 5f9ce9c and 67493c5.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • packages/dev/package.json

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: 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 `@packages/dev/src/main.ts`:
- Around line 486-488: Replace the invalid this.#logger.debug call in the
Netlify DB startup catch block with this.#logger.warn and pass the error
formatted as a string; specifically, update the catch that currently calls
this.#logger.warn('Failed to start Netlify DB locally.') and
this.#logger.debug({ error }, 'Netlify DB startup error') to use
this.#logger.warn('Netlify DB startup error: ' + String(error)) (or template
string) so the Logger interface methods (error/log/warn) are used and the error
is provided as a string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad41c5a5-ec42-42a4-9182-c884fb342007

📥 Commits

Reviewing files that changed from the base of the PR and between 67493c5 and 734c48c.

📒 Files selected for processing (1)
  • packages/dev/src/main.ts

@paulo paulo marked this pull request as draft March 5, 2026 12:39
@paulo paulo marked this pull request as ready for review March 5, 2026 13:07
@paulo
Copy link
Author

paulo commented Mar 5, 2026

@eduardoboucas this is ready for another review

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