docs: add PowerSync DevTools guides for Vite, Nuxt, and Node.js - #672
khawarizmus wants to merge 4 commits into
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
| Nuxt DevTools 4 is in beta. It runs on Vite DevTools and needs Vite 8.1.5 or later. Nuxt 4.5 includes a compatible Vite version. | ||
|
|
||
| Nuxt 4 depends on Nuxt DevTools 3. To use version 4, install it and override the version that Nuxt uses. For example, with pnpm, add this to `pnpm-workspace.yaml`: | ||
|
|
||
| ```yaml | ||
| overrides: | ||
| '@nuxt/devtools': 4.0.0-beta.2 |
There was a problem hiding this comment.
The Nuxt DevTools 4 beta status, the "Vite 8.1.5 or later" floor, and the 4.0.0-beta.2 override pin aren't backed by anything in the cited implementation PR (powersync-js#1094) — that PR's own testing notes and lockfile only reference @nuxt/devtools@3.4.1. Since this is a third-party prerelease version that can go stale quickly, either verify it against the actual @nuxt/devtools release history before publishing, or add a verification TODO like the ones already used elsewhere in this PR for unconfirmed version numbers.
|
|
||
| ## Requirements | ||
|
|
||
| - `@powersync/node`. {/* TODO: Add the minimum version after the release. It needs the `diagnostics` sync option and the `connector` accessor from `@powersync/common`. */} |
There was a problem hiding this comment.
Unlike the equivalent requirement bullets on the Vite and Nuxt pages (which give a placeholder version before the TODO), this one has no version qualifier at all, so once the MDX comment is stripped the rendered bullet just reads "@powersync/node." with no information. Consider adding a placeholder like the other two pages do, e.g. "@powersync/node (version TBC)." so the list item isn't empty of content.
|
Couldn't run Vale or the link checker in this environment (CI check results and |
|
|
||
| ```typescript | ||
| import { PowerSyncDatabase } from '@powersync/node'; | ||
| import { enablePowerSyncDiagnostics } from '@powersync/diagnostics/node'; |
There was a problem hiding this comment.
This was pointed out by Claude locally, from what I can see it may be valid feedback:
@powersync/diagnostics is installed with -D, but the example imports it statically at the top of the file. A production install that skips dev dependencies (npm ci --omit=dev) will fail on startup, even though the call is behind the NODE_ENV check. Can we switch to a dynamic import inside the check, and add one sentence saying why?
if (process.env.NODE_ENV !== 'production') {
const { enablePowerSyncDiagnostics } = await import('@powersync/diagnostics/node');
const devtools = await enablePowerSyncDiagnostics(db);
console.log(`PowerSync DevTools: ${devtools.signInUrl}`);
}
There was a problem hiding this comment.
This was fixed in both repos.
| PowerSync currently provides DevTools integrations for Dart/Flutter and Nuxt. These embed a diagnostics panel into your existing IDE or framework tooling, so you can inspect your app's local database, Sync Stream state, and JWT credentials without launching a separate tool. They are available in development builds only. | ||
| PowerSync DevTools shows the sync status, buckets, Sync Stream subscriptions, local SQLite data, schema, and logs of the PowerSync client in your app. You can also run SQL queries and sync actions. Coding agents can read the same data through [MCP tools](/tools/devtools/mcp) when you use Vite, Nuxt DevTools 4, or Node.js. | ||
|
|
||
| DevTools runs in development only and adds nothing to a production build. |
There was a problem hiding this comment.
adds nothing to a production build. is this really true for Node.js, where it seems the tools have to explicitly be enabled for dev only?
There was a problem hiding this comment.
Yes with the changes you suggested above this becomes true even for Node js apps where a production install doesn't include the package, and the app never loads it.
| ## Requirements | ||
|
|
||
| - `@powersync/web` 2.5.0 or later. {/* TODO: Confirm the version after the release. */} | ||
| - Vite 7, or Vite 8.3 or later. |
There was a problem hiding this comment.
Vite 8.3 is inconsistent with Vite 8.1.5 mentioned on the Nuxt page - seems a bit odd since we say the Nuxt version runs on this one. Just want to confirm.
There was a problem hiding this comment.
Both numbers were correct, but they meant different things. Vite 8.3 is the first version with the devtools config option that plain Vite apps use. Nuxt DevTools 4 needs Vite 8.1.5 or later, and on versions before 8.3 it adds Vite DevTools itself, so Nuxt users never touch that option. To avoid the confusion, we now say "needs Nuxt 4.5 or later" and we give no Vite version.
| |---|---| | ||
| | Database list | Selects the database to show. It appears only when more than one database is attached, for example when your app is open in two browser tabs. | | ||
| | **Sync now** | Requests a checkpoint and waits until the client is up to date. Your app must connect with `checkpointMode: 'requests'`. Read [Sync Catch-Up](/client-sdks/advanced/checkpoint-requests). | | ||
| | **Clear & re-sync** | Deletes the local data and downloads it again. Hold the button for one second to start it. | |
There was a problem hiding this comment.
I think we should point out that this will also clear data still in the upload Queue in case they made writes (e.g. while offline) that they expect to still sync
There was a problem hiding this comment.
Same goes for the corresponding command on the MCP page
There was a problem hiding this comment.
Agreed, added a warning under the header table.
| The tables in your schema are SQLite views. The client's sync state is in internal `ps_*` tables, such as `ps_buckets`, `ps_oplog`, and `ps_crud`. | ||
|
|
||
| <Warning> | ||
| Writes in the SQL editor change your local data. A write to one of your schema tables goes into the upload queue, like a write from your app. |
There was a problem hiding this comment.
| Writes in the SQL editor change your local data. A write to one of your schema tables goes into the upload queue, like a write from your app. | |
| Writes in the SQL editor change your local data. A write to one of your schema tables goes into the upload queue, and your connector's `uploadData()` sends it to your backend, like a write from your app. |
There was a problem hiding this comment.
There was a problem hiding this comment.
Used your wording here
| --- | ||
|
|
||
| PowerSync currently provides DevTools integrations for Dart/Flutter and Nuxt. These embed a diagnostics panel into your existing IDE or framework tooling, so you can inspect your app's local database, Sync Stream state, and JWT credentials without launching a separate tool. They are available in development builds only. | ||
| PowerSync DevTools shows the sync status, buckets, Sync Stream subscriptions, local SQLite data, schema, and logs of the PowerSync client in your app. You can also run SQL queries and sync actions. Coding agents can read the same data through [MCP tools](/tools/devtools/mcp) when you use Vite, Nuxt DevTools 4, or Node.js. |
There was a problem hiding this comment.
Nit: Rather than describing what the devtools show, it would be more useful to readers to describe what the devtools help with - i.e. explain the use cases behind these things. So as an example, rather than just saying "they show local data" explain what that means for a user, e.g. they allow you to inspect the live local data of a client (I'm not sure if this is the best summary). Then a reader can more easily grok if they'd be useful for their use case or not.
…warning, Nuxt 4.5 requirement # Conflicts: # tools/devtools/node.mdx # tools/devtools/using-devtools.mdx
Summary
Adds docs for the new PowerSync DevTools.
Changes
tools/devtools-overview. It explains what DevTools is and how it works, and links to one setup page per environment.tools/devtools/vite: Vite 7 and Vite 8, in tabs.tools/devtools/nuxt: Nuxt DevTools 3 and 4, in tabs, with a migration guide from@powersync/nuxt0.x.tools/devtools/node: Node.js apps.tools/devtools/using-devtools: what each DevTools tab shows.tools/devtools/mcp: how coding agents connect to DevTools with MCP.tools/nuxt-inspectorpage. Its URL now redirects totools/devtools/nuxt.PowerSyncDatabase, becauseNuxtPowerSyncDatabaseis removed.tools/overviewandtools/ai-tools.This PR should be merged after powersync-ja/powersync-js#1094 is released, so we can add minimum versions of
@powersync/web,@powersync/nuxtand@powersync/node.AI Disclosure
The docs were generated with the help of Claude. Modified and reviewed manually.