Skip to content

fix(db): generate schema types during prepare#795

Merged
RihanArfan merged 1 commit intonuxt-hub:mainfrom
onmax:fix/db-prepare-types
Jan 23, 2026
Merged

fix(db): generate schema types during prepare#795
RihanArfan merged 1 commit intonuxt-hub:mainfrom
onmax:fix/db-prepare-types

Conversation

@onmax
Copy link
Contributor

@onmax onmax commented Jan 23, 2026

Closes #792

Summary

PR #779 re-introduced if (!nuxt.options._prepare) guard around buildDatabaseSchema(), regressing PR #758 fix. This moves buildDatabaseSchema() outside the guard while keeping node_modules copying inside.

StackBlitz

Link Expected
Bug nuxthub-792 ❌ No schema.d.mts
Fix nuxthub-792-fixed ✅ schema.d.mts generated

CLI Reproduction

git clone --depth 1 --filter=blob:none --sparse https://github.com/onmax/repros.git
cd repros && git sparse-checkout set nuxthub-792
cd nuxthub-792 && pnpm i && pnpm prepare && ls .nuxt/hub/db/

Verify fix

git sparse-checkout add nuxthub-792-fixed
cd ../nuxthub-792-fixed && pnpm i && pnpm prepare && ls .nuxt/hub/db/

The -fixed folder uses pnpm patch to apply the fix locally.

@vercel
Copy link

vercel bot commented Jan 23, 2026

@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@onmax onmax force-pushed the fix/db-prepare-types branch from 83f0d7e to 5e06986 Compare January 23, 2026 06:18
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 23, 2026

npm i https://pkg.pr.new/@nuxthub/core@795

commit: 5e06986

@RihanArfan RihanArfan merged commit 7b96651 into nuxt-hub:main Jan 23, 2026
8 of 9 checks passed
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.

hub:db (and @nuxthub/db) does not provide TypeScript definition on nuxt db generate

2 participants