vercel · GitHub

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/content/blog/studio-oss.md`:
- Line 71: Update the sentence "The modern Notion-like editing experience for
Markdown content is back with a improved version, powered by
[TipTap](https://tiptap.dev/) integrated through the [Nuxt UI
Editor](https://ui.nuxt.com/components/editor) component:" to fix the article
agreement typo by changing "a improved version" to "an improved version" so it
reads "...is back with an improved version..."; locate the exact string in the
document and correct the article.
In `@src/runtime/client.ts`:
- Around line 93-98: The search function can trigger concurrent init() calls
because multiple callers see !db and start initialization; modify search to wait
on a shared initPromise: if db is not ready, ensure you assign/initiate a single
shared initPromise (create/initPromise when missing) and await that promise
before calling queryFTS; use the existing initPromise and init() symbols (and
db) so subsequent concurrent search() callers await the same initialization
instead of starting duplicate adapters/index builds.
- Line 55: The current early-return when collections.length is zero returns
initPromise ?? Promise.resolve(db!), which can resolve to undefined if db isn't
initialized; update the branch so it never resolves to undefined: if initPromise
exists return it, otherwise if db is defined return Promise.resolve(db as
DatabaseAdapter), else return Promise.reject(new Error("DatabaseAdapter not
initialized")) (or trigger the existing initialization path) — adjust references
to collections, initPromise and db to implement this safe behavior.
---
Nitpick comments:
In `@docs/package.json`:
- Line 17: The package.json currently lists "drizzle-kit" in dependencies; move
"drizzle-kit" into devDependencies instead because it's a CLI/build tool not
required at runtime: remove the "drizzle-kit" entry from the top-level
"dependencies" and add the same version string under "devDependencies" (preserve
the version "^0.31.10"), then update your lockfile by running your package
manager (npm/yarn/pnpm install) to reflect the change; verify no runtime imports
reference "drizzle-kit" and commit the modified package.json and updated
lockfile.
In `@src/runtime/client.ts`:
- Line 100: Add a cleanup method to the composable that disposes the
DatabaseAdapter and resets internal state: implement a destroy or cleanup
function that, if the underlying DatabaseAdapter supports a close/closeAsync
method, calls it, then sets db = undefined, initPromise = undefined, indexedFor
= [], and status.value = 'idle'; finally include this method in the returned
object alongside status, search, and init so callers can explicitly release
resources.
- Line 74: The cast `col as T` in the line calling queryCollection(col as T)
bypasses collection key validation; change resolveCollections() (and any path
using toIndex/from toValue) to preserve the narrower T[] type so callers can
pass a properly typed collection key instead of asserting. Concretely, update
resolveCollections() to return T[] (e.g., coerce the result of
toValue(collection) to T[] once and use that typed array wherever
queryCollection is called), and remove the inline `as T` cast in queryCollection
calls so the compiler enforces the correct keyof PageCollections type at call
sites.

Read the original on github.com ↗