Skip to content

fix(cli): include config file in invalid workspace version error#34835

Open
puneetdixit200 wants to merge 2 commits into
denoland:mainfrom
puneetdixit200:fix-workspace-version-error-context
Open

fix(cli): include config file in invalid workspace version error#34835
puneetdixit200 wants to merge 2 commits into
denoland:mainfrom
puneetdixit200:fix-workspace-version-error-context

Conversation

@puneetdixit200

Copy link
Copy Markdown

Closes #27226.

This adds config-file context when a workspace member version fails semver parsing. For the reported version: "1.0" case, deno lint now reports which member deno.jsonc contains the invalid version instead of only showing the semver parser error.

A focused unit test covers the workspace-member conversion error text and preserves the underlying semver diagnostic.

Testing:

  • PATH="$PWD/target/debug:$PATH" ./x fmt
  • git diff --check
  • PATH="$PWD/target/debug:$PATH" ./x lint-js
  • cargo fmt -p deno --check
  • cargo test --manifest-path /Users/deepakkudi23/ai-contrib-new-105/work/deno/Cargo.toml -p deno args::test::config_to_deno_graph_workspace_member_invalid_version_error (run from /tmp to avoid repo-local macOS linker flags)
  • Manual repro with target/debug/deno lint on a workspace member using version: "1.0"; it now includes the member config file URL in the error.

Notes:

  • ./x lint did not complete locally. One run exhausted local disk while growing target/; after freeing incremental build artifacts, the repo-root clippy path failed before reaching this patch because this local Apple clang rejects the repo-local -fuse-ld=lld macOS rustflag.
  • A package-scoped clippy workaround from /tmp avoided that linker flag, but failed on the existing runtime/tokio_util.rs metrics_enabled unused-variable warning under -D warnings, outside this patch.

AI/LLM assistance disclosure:

  • LLM assistance was used to inspect the code path and draft the patch/test. I reviewed the final change and verified it locally with the commands above.

@deno-cla-assistant

deno-cla-assistant Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deno Individual Contributor License Agreement

The following contributors need to sign the CLA before this PR can be merged:

Click here to review and sign the CLA | Re-run CLA check


This is an automated message from CLA Assistant

@CLAassistant

This comment was marked as off-topic.

@bartlomieju

Copy link
Copy Markdown
Member

Please sign the CLA

@bartlomieju

bartlomieju commented Jun 9, 2026

Copy link
Copy Markdown
Member

Update: the upstream improvement is now in too.

When I first looked at this, the Invalid version: Unexpected character. text came entirely from the external deno_semver crate, which was pinned here as deno_semver = "=0.10.0" with no path/patch override, so the message lived outside this repo. Improving it required a PR to denoland/deno_semver, a new release, and a Cargo.toml bump here.

All three have now happened:

  1. denoland/deno_semver#54 makes the parser name the missing component instead of emitting the generic "Unexpected character." error.
  2. That shipped in deno_semver 0.10.1.
  3. This PR now bumps deno_semver to =0.10.1.

So for the reported version: "1.0" case, the diagnostic is now Missing patch version. Versions must be in the form MAJOR.MINOR.PATCH (ex. 1.0.0)., and the workspace-member test asserts that message. Together with the config-file context added at the call site, both halves of #27226 (including the stretch goal) are now addressed here.

deno_semver 0.10.1 (denoland/deno_semver#54) replaces the generic
"Unexpected character." parse error with a descriptive message naming
the missing component (e.g. "Missing patch version. Versions must be in
the form MAJOR.MINOR.PATCH (ex. 1.0.0)."). This delivers the upstream
diagnostic improvement that was the stretch goal of denoland#27226.

Updates the workspace-member test to assert the new message.
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.

bad error message in deno lint when workspace member version is missing patch component

4 participants