Skip to content

Rename to unscoped otper-cli + use trusted publishing + fix build - #1

Merged
sambhav-aggarwal merged 3 commits into
mainfrom
chore/trusted-publishing
May 3, 2026
Merged

Rename to unscoped otper-cli + use trusted publishing + fix build#1
sambhav-aggarwal merged 3 commits into
mainfrom
chore/trusted-publishing

Conversation

@sambhav-aggarwal

@sambhav-aggarwal sambhav-aggarwal commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

Three related changes that together get the package publishable end-to-end.

1. Rename @ssntpl/otper-cliotper-cli

  • Unscoped packages are public by default and don't trigger the @ssntpl org's 2FA-on-publish enforcement.
  • Friendlier npm install -g otper-cli.
  • Bin name remains otper.

2. Switch CI to npm trusted publishing (OIDC)

  • Drops NODE_AUTH_TOKEN env from publish.yml.
  • Workflow already has permissions: id-token: write and --provenance — that is everything OIDC needs.
  • Configure the trusted publisher on https://www.npmjs.com/package/otper-cli/access after the first publish.

3. Fix the build so dist/ ships

  • Stale tsconfig.tsbuildinfo at the repo root made tsc -b skip emit after rm -rf dist. The 0.1.0 attempt would have published a 6-file tarball with no commands.
  • Move tsBuildInfoFile inside dist/ so it gets nuked together; drop -b (no project references in use).
  • Drop oclif readme from prepack (manual README is curated).
  • Tighten files allowlist: only bin/run.js (not bin/dev.ts), dist, and oclif.manifest.json.

Test plan

  • Local npm run build produces 100+ files in dist/commands/
  • npm pack --dry-run shows ~206 files, ~60 kB
  • Merge then run npm publish locally to bootstrap 0.1.0
  • Configure trusted publisher on npm
  • Push v0.1.1 tag — CI publishes via OIDC, no token

SSNTPL added 3 commits May 2, 2026 12:44
Trusted publishers authenticate via the GitHub Actions OIDC token
(id-token: write is already set), so no long-lived NODE_AUTH_TOKEN
secret is needed. --provenance is required and already in place.
- Move tsBuildInfoFile inside dist/ so 'rm -rf dist' clears it.
  Without this, tsc -b sees an up-to-date tsbuildinfo and emits nothing,
  resulting in a published tarball with no compiled commands.
- Drop -b flag from build (no project references in use).
- Drop oclif readme from prepack (manual README is curated).
- Tighten files allowlist: only ship bin/run.js (not bin/dev.ts), dist,
  and the oclif manifest.
Switching from @ssntpl/otper-cli to otper-cli so:
- npm install -g otper-cli works (no scope to remember)
- Publish doesn't require an org with 2FA enforcement
- Bin name remains 'otper'

Updates package.json name, README install/library examples, src/index.ts
header comment, and drops --access public from publish workflow (unscoped
packages are public by default).
@sambhav-aggarwal sambhav-aggarwal changed the title Use npm trusted publishing (drop NPM_TOKEN env) Rename to unscoped otper-cli + use trusted publishing + fix build May 3, 2026
@sambhav-aggarwal
sambhav-aggarwal merged commit 0cb1d4f into main May 3, 2026
3 checks passed
@sambhav-aggarwal
sambhav-aggarwal deleted the chore/trusted-publishing branch May 3, 2026 09:06
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.

1 participant