Skip to content

fix: escape @ in authors so nuspec XML stays valid (#389) - #603

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix/authors-at-sign-389
Jun 29, 2026
Merged

fix: escape @ in authors so nuspec XML stays valid (#389)#603
MarshallOfSound merged 1 commit into
mainfrom
fix/authors-at-sign-389

Conversation

@claude

@claude claude Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Requested by Samuel Attard · Slack thread

Before / After

Before: Generating an installer where the authors field (or the author from package.json) contains an @ character — most commonly an email address — fails the build. NuGet rejects the @ in the nuspec <authors> element with The '@' character, hexadecimal value 0x40, cannot be included in a name, so the resulting nuspec XML is invalid and nuget pack errors out.

After: The @ is stripped from the authors value before the nuspec is generated, so the XML stays valid and the build succeeds. The owners and copyright fields are unaffected — NuGet does not restrict @ there, so they keep their original value.

How

Added an exported sanitizeAuthors helper in src/index.ts that removes @ characters, and call it on metadata.authors in createWindowsInstaller after owners and copyright have defaulted to the original authors value. This keeps the diff minimal and leaves the unaffected defaults intact. A focused unit test in spec/sanitize-authors-spec.ts covers the @-in-authors case (mirroring the existing convert-version-spec.ts style), so it verifies the sanitized value without running the full installer.

Fixes #389


Generated by Claude Code

NuGet rejects an `@` character in the nuspec `<authors>` element (commonly
present when the author is an email address), failing the build with
"The '@' character ... cannot be included in a name".

Strip `@` from `metadata.authors` before generating the nuspec, via a new
exported `sanitizeAuthors` helper. The sanitization runs after `owners` and
`copyright` default to `authors`, so those fields keep their original value
since NuGet does not restrict them.

Fixes #389
@MarshallOfSound
MarshallOfSound marked this pull request as ready for review June 28, 2026 17:16
@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner June 28, 2026 17:16
@MarshallOfSound
MarshallOfSound merged commit b969434 into main Jun 29, 2026
14 checks passed
@MarshallOfSound
MarshallOfSound deleted the fix/authors-at-sign-389 branch June 29, 2026 18:06
@electron-npm-package-publisher

Copy link
Copy Markdown

🎉 This PR is included in version 5.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants