test: change example/workspace to use glob based projects setup#1585
test: change example/workspace to use glob based projects setup#1585yamachi4416 wants to merge 10 commits intonuxt:mainfrom
Conversation
commit: |
cfd69bf to
b4e637b
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Vitest workspace example with two Nuxt apps (app1, app2). Each app gains Nuxt/Vitest config files, app-local tsconfig project references, and multiple test suites (nuxt/unit patterns). The root workspace vitest config was replaced with a glob-based projects loader and the workspace tsconfig.json was removed. Several new test files were added under each app and one root test file was deleted. package.json scripts were changed to run Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
b4e637b to
f002d54
Compare
src/config.ts
Outdated
| const startNuxtAndGetViteConfig: typeof _startNuxtAndGetViteConfig = (() => { | ||
| let _lock = Promise.resolve() | ||
|
|
||
| return async (...args) => { | ||
| const acquire = _lock | ||
| let release = () => {} | ||
| _lock = new Promise(resolve => release = resolve) | ||
| try { | ||
| await acquire | ||
| return await _startNuxtAndGetViteConfig(...args) | ||
| } | ||
| finally { | ||
| release() | ||
| } | ||
| } | ||
| })() |
There was a problem hiding this comment.
ideally Nuxt's default asyncContext should mean this isn't necessary:
I wonder what's going wrong, that this isn't working?
There was a problem hiding this comment.
thank you for the review
agreed, investigation will follow to find why
There was a problem hiding this comment.
loadNuxt and buildNuxt run successfully in parallel.
however, when modules use different versions of @nuxt/kit, asyncContext appears to be undefined in those using the secondary version, causing a fallback to nuxtCtx and resulting in a reference to an incorrect Nuxt instance.
There was a problem hiding this comment.
I've attempted to fix the cause of the issue
I would appreciate your review
nuxt/nuxt#34492
f002d54 to
bcb0ee7
Compare
…-project-setup # Conflicts: # examples/app-vitest-workspace/package.json
🔗 Linked issue
the reproduction tests are confirmed to pass following the nuxt update. (nuxt/kit: v4.4.2 and v3.21.2)
resolves #1583
❓ Type of change
📚 Description
avoided concurrent nuxt starts to prevent configuration retrieval failuresReproduction
issue 1583
run
pnpm update nuxt@4.4.2 -randpnpm update @nuxt/kit -rthenpnpm test