Repository navigation
Publish as @jimhoyd/urlcode and release 0.3.0 - #38
Merged
Merged
Conversation
npm refuses the name outright: npm error 403 Forbidden - PUT https://registry.npmjs.org/urlcode Package name too similar to existing packages urlencode,qrcode urlencode and qrcode both exist, so the typosquatting policy blocks urlcode permanently. A scoped name is exempt from that check, and npm suggested this one itself, derived from the authenticated account. An earlier note in this history said the name was unclaimed because the registry returned 404. That was wrong where it mattered: 404 means not published, not publishable, and the similarity check only runs at publish time. The version moves to 0.3.0 because the rename has to be in the commit that gets tagged, and the tag has to be an ancestor of main, which now carries the TypeScript conversion. Publishing 0.2.0 from before the conversion is no longer reachable without weakening the check that a release only ships commits already on main. The scope changes two derived names in opposite directions, verified against npm rather than assumed: - npm packs the scope into the filename: jimhoyd-urlcode-0.3.0.tgz - the registry serves it with the scope in the directory and not in the file: /@jimhoyd/urlcode/-/urlcode-0.3.0.tgz Both are now derived from package.json instead of spelled out, so the next rename cannot leave a stale literal behind: the formula URL comes from the manifest, the workflow computes the packed filename, and the smoke test splits the packed name into the directories npm installs. render-homebrew now validates the name against npm's grammar first, because that string becomes a URL and Ruby a formula executes. The CLI is untouched. The bin key is still urlcode, so the command, the Homebrew formula's installed binary and every documented invocation stay as they were. Also repaired the publish-path guard added earlier: the derived filename introduced nested quotes, so its "..." capture read a fragment of the substitution instead of the argument. It now matches the start of the argument, and still fails, naming the whole argument, when the ./ is removed. Not verified: the release workflow only runs on a tag push. A candidate build here produces the expected filename and a formula whose checksum matches SHA256SUMS, but the publish itself is proven only by the tag. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WrwFcAcntyBBSk21irvgAV
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.
Problem and change
The npm token is fixed — run 7 attempt 2 got past authentication to a registry policy rejection:
urlencodeandqrcodeboth exist, so npm's typosquatting policy blocksurlcodepermanently. Scoped names are exempt from that check, and npm generated this suggestion itself from the authenticated account.A correction to this repository's own history: an earlier PR said the name was unclaimed because the registry returned 404. That was wrong where it mattered — 404 means not published, not publishable, and the similarity check only runs at publish time.
Why 0.3.0 rather than 0.2.0. The rename has to be in the commit that gets tagged, and the release job requires the tagged commit to be an ancestor of
main, which now carries the TypeScript conversion. Publishing 0.2.0 from before the conversion is no longer reachable without weakening that ancestor check, which is a safety property I won't relax to save a version number.The scope changes two derived names in opposite directions. Verified against npm rather than assumed:
npm packfilenamejimhoyd-urlcode-0.3.0.tgz— scope folded in with a dash/@jimhoyd/urlcode/-/urlcode-0.3.0.tgz— scope in the directory, not in the fileBoth are now derived from
package.jsoninstead of spelled out, so the next rename can't leave a stale literal behind:render-homebrew.tscomputes the registry URL from the manifest (new__URL__placeholder), and validates the name against npm's grammar first — that string becomes both a URL and Ruby that Homebrew executes.npm publish,render-homebrewand the release notes.package-smoke.tssplits the packed name into the directories npm actually creates, so a scope lands as its own directory.The CLI is untouched. The
binkey is stillurlcode, so the command, the formula's installed binary, and every documented invocation are unchanged.I also repaired the publish-path guard from #35: the derived filename introduced nested quotes, so its
"..."capture was reading a fragment of the substitution rather than the argument. It now matches the start of the argument.Verification
End-to-end on the real artifacts:
The repaired guard still fails when the
./is removed, now naming the whole argument. The innersh -ecstring of the container step passessh -n— it isn't covered by the outerbash -n, and a syntax error there would only surface on a tag push.Five failures the type checker and tests caught along the way, each a real scoped-path assumption:
PackageJsontypes missingname, the installer's download name, the installed CLI path,node_modules/urlcode/examples/*in the smoke test, and.mjsexample files my first sweep didn't cover.Not verified: the release workflow only runs on a tag push, so the publish itself is proven only by the tag.
Compatibility and security
Breaking for anyone installing from npm — which is nobody, because nothing has ever published. No existing install can break.
The scope must match the npm account. npm derived the suggestion from the authenticated user, so
@jimhoydresolves.--access publicis already in the publish command, which scoped packages require.Provenance, signing, attestation and the
PUBLISH_NPM/NPM_TOKENguard are untouched.Changes match the documented portable contract; docs/examples are updated where needed.
Relevant tests and package checks pass, or limitations are explained above.
No credentials, customer data or private project material are included.
Runtime/starter changes remain aligned where applicable.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WrwFcAcntyBBSk21irvgAV
Generated by Claude Code