fix(registry): accept the -- separator in the validate CLI - #826
Merged
Conversation
The registry PR workflow invokes `pnpm registry:validate -- --registry-root <path>`, and pnpm forwards the `--` separator to the script verbatim. parseArguments treated it as a flag whose value was missing and threw `Missing value for --`, so the job failed before validating anything. This is the first PR touching registry/** since the workflow landed, which is why it went unnoticed. Skip a bare `--` and cover the CLI form with a regression test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm registry:validate -- --registry-root <path>fails withTypeError: Missing value for --.pnpm runforwards the--separator to the script verbatim, soparseArgumentssees--as an option name and then treats the following--registry-rootas its missing value..github/workflows/registry-pr.ymlinvokes the validator exactly this way, so theValidate registry sourcescheck fails on every registry PR before any manifest is even read.Changes
registry/scripts/validate.mjs: skip a bare--argument while parsing.tests/registry/scripts/validate.test.mjs: regression test that spawns the CLI with the separator and asserts exit code 0.Verification
pnpm test— 285 passedpnpm lint:check,pnpm format:check,pnpm typecheckThis PR intentionally touches no files under
registry/sites,registry/patches,registry/schemaorregistry/examples, so the registry workflow does not run on it. It must land onmainfirst, becauseregistry-pr.ymlexecutes the base-branch copy of the validator.