Skip to content

fix(module): validate required registry fields after runtime merge#762

Open
tsukiyama-3 wants to merge 1 commit into
nuxt:mainfrom
tsukiyama-3:fix/registry-required-fields-runtime-config
Open

fix(module): validate required registry fields after runtime merge#762
tsukiyama-3 wants to merge 1 commit into
nuxt:mainfrom
tsukiyama-3:fix/registry-required-fields-runtime-config

Conversation

@tsukiyama-3
Copy link
Copy Markdown
Contributor

🔗 Linked issue

#761

📚 Description

Required-field validation during module setup compared the Valibot schema to the normalized [input] from scripts.registry only.

IDs and similar fields are often supplied only through runtimeConfig.public.scripts and/or NUXT_PUBLIC_SCRIPTS_*, merged into public.scripts earlier in this module (registryWithDefaults + defu). After that merge, the effective config already includes id, but the check still complained.

The WARN now inspects each script’s merged object in runtimeConfig.public.scripts, dropping scriptOptions keys that aren’t part of script input schema. Behaviour at runtime is unchanged; this only aligns dev warnings with documented env/runtime configuration.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 10, 2026

@tsukiyama-3 is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 10, 2026

Open in StackBlitz

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

commit: 4d34141

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

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: 509f28b1-f3d1-45ea-8ec2-a73acdd42eb1

📥 Commits

Reviewing files that changed from the base of the PR and between 727e025 and 4d34141.

📒 Files selected for processing (1)
  • packages/script/src/module.ts

📝 Walkthrough

Walkthrough

The change modifies required-field validation for auto-loading registry scripts in the Nuxt scripts module. Instead of checking the raw registry input, the validation now derives an "effective input" from the runtime configuration's public scripts entry (excluding scriptOptions), and falls back to the normalized registry input when unavailable. This ensures that defaults provided via environment variables or runtime configuration are considered when determining whether required schema fields are satisfied.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing required field validation to occur after runtime config merging, which aligns with the changeset.
Description check ✅ Passed The description provides relevant context about the validation issue and the fix applied, directly relating to the changeset modifications.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

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.

1 participant