Skip to content

refactor: pass nuxt to bundle transformer#830

Merged
harlan-zw merged 1 commit into
mainfrom
fix/usenuxt
Jul 18, 2026
Merged

refactor: pass nuxt to bundle transformer#830
harlan-zw merged 1 commit into
mainfrom
fix/usenuxt

Conversation

@danielroe

@danielroe danielroe commented Jul 17, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

noticed ecosystem-ci was failing (likely due to some new packaging of nuxt, the mock of @nuxt/kit wasn't working).

this changes the approach so we can pass a 'mock nuxt' rather than relying on mocking useNuxt itself

@danielroe
danielroe requested a review from harlan-zw July 17, 2026 23:07
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scripts-playground Ready Ready Preview, Comment Jul 17, 2026 11:09pm

Request Review

@danielroe
danielroe requested a review from huang-julien July 17, 2026 23:07
@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@830

commit: a211725

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aaf3cc75-7f0f-4c12-9d81-2d9fafa58a12

📥 Commits

Reviewing files that changed from the base of the PR and between 36a345e and a211725.

📒 Files selected for processing (5)
  • packages/script/src/module.ts
  • packages/script/src/plugins/transform.ts
  • test/unit/bundle-sdk-patches.test.ts
  • test/unit/bundle-two-deploy-repro.test.ts
  • test/unit/transform.test.ts

📝 Walkthrough

Walkthrough

The script module now passes its active Nuxt instance to NuxtScriptBundleTransformer. The transformer accepts an optional Nuxt context, falls back to useNuxt() when absent, and writes generated scripts through the computed cache directory. Unit tests now provide local Nuxt mocks directly instead of mocking Nuxt kit helpers.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main refactor: passing Nuxt into the bundle transformer.
Description check ✅ Passed The description is directly related to the change and explains the mock Nuxt refactor and ecosystem-ci issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/usenuxt

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.

@harlan-zw
harlan-zw merged commit f32cfb8 into main Jul 18, 2026
18 checks passed
@harlan-zw
harlan-zw deleted the fix/usenuxt branch July 18, 2026 03:04
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