Skip to content

Publish as @jimhoyd/urlcode and release 0.3.0 - #38

Merged
jimhoyd merged 1 commit into
mainfrom
claude/tender-gates-13ovkk
Sep 17, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/tender-gates-13ovkk

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

The npm token is fixed — run 7 attempt 2 got past authentication to a registry policy rejection:

npm error code E403
npm error 403 Forbidden - PUT https://registry.npmjs.org/urlcode
  Package name too similar to existing packages urlencode,qrcode;
  try renaming your package to '@jimhoyd/urlcode'

urlencode and qrcode both exist, so npm's typosquatting policy blocks urlcode permanently. 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 pack filename jimhoyd-urlcode-0.3.0.tgz — scope folded in with a dash
registry tarball URL /@jimhoyd/urlcode/-/urlcode-0.3.0.tgz — scope in the directory, not in the file

Both are now derived from package.json instead of spelled out, so the next rename can't leave a stale literal behind:

  • render-homebrew.ts computes 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.
  • The workflow computes the packed filename for npm publish, render-homebrew and the release notes.
  • package-smoke.ts splits the packed name into the directories npm actually creates, so a scope lands as its own directory.

The CLI is untouched. The bin key is still urlcode, 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

npm run verify        # 275 tests, 0 fail, 29 skipped
npm run test:package  # packed install, starter, cookbook, prerender recipe

End-to-end on the real artifacts:

$ node scripts/build-candidate.ts   →  candidate/jimhoyd-urlcode-0.3.0.tgz
$ node -p "…derived path…"          →  candidate/jimhoyd-urlcode-0.3.0.tgz   ← workflow agrees
$ node scripts/render-homebrew.ts --tarball <that>
  url    "https://registry.npmjs.org/@jimhoyd/urlcode/-/urlcode-0.3.0.tgz"
  sha256 "52504b56…"                ← matches SHA256SUMS for the packed file

The repaired guard still fails when the ./ is removed, now naming the whole argument. The inner sh -ec string of the container step passes sh -n — it isn't covered by the outer bash -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: PackageJson types missing name, the installer's download name, the installed CLI path, node_modules/urlcode/examples/* in the smoke test, and .mjs example 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 @jimhoyd resolves.

  • --access public is already in the publish command, which scoped packages require.

  • Provenance, signing, attestation and the PUBLISH_NPM/NPM_TOKEN guard 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

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
@jimhoyd
jimhoyd merged commit feae90c into main Sep 17, 2026
26 checks passed
@jimhoyd
jimhoyd deleted the claude/tender-gates-13ovkk branch September 17, 2026 17:16
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.

2 participants