Skip to content

feat(npm): publish pup to npm - #879

Closed
tedkahwaji wants to merge 1 commit into
DataDog:mainfrom
tedkahwaji:teddy.kahwaji/npm-distribution
Closed

tedkahwaji wants to merge 1 commit into
DataDog:mainfrom
tedkahwaji:teddy.kahwaji/npm-distribution

Conversation

@tedkahwaji

@tedkahwaji tedkahwaji commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

This PR is #5 in a 5-part stack that moves Datadog's AI Setup CLI behind pup setup. Publishing pup to npm lets new users run npx @datadog/pup setup in one command, without Homebrew or a manual binary install.

Design doc (Datadog internal): Consolidating the AI Setup CLI with Pup

Related PRs (5-stack)

  1. Signup service (Datadog internal): https://github.com/ddoghq/dd-source/pull/120923
  2. AI Setup headless token (Datadog internal): https://github.com/ddoghq/ai-setup-cli/pull/497
  3. AI Setup JSON help and pup login reuse (Datadog internal): https://github.com/ddoghq/ai-setup-cli/pull/501
  4. pup setup command: feat(setup): Add AI-CLI Pup Setup command #881
  5. pup on npm: feat(npm): publish pup to npm #879 <- Current PR

Changes

  • @datadog/pup launcher package plus per-platform packages built from the signed GitHub release archives.
  • Every archive must be listed in the signed release checksums and match them before it's packaged, and each platform package keeps the archive's third-party notices.
  • Manual publish workflow that is a dry run by default. Nothing is published yet. It uses the packaging code from the workflow's own revision, so older releases can be published, skips packages already published with the same contents so a failed run can be retried, and runs one publish at a time.
  • Only a newer stable release moves the latest dist-tag. Prereleases go to next and older releases to backfill.
  • The launcher exits non-zero when pup is killed by a signal Node ignores, such as SIGPIPE.

Testing

  • node --test for the launcher and package builder, including checksum, notices and SIGPIPE cases. Publish decisions checked with a fake npm (not published, already published, registry errors).
  • Local tarballs from this script were used for the end-to-end pup setup testing.

🤖 Generated with Claude Code

@@ -0,0 +1,92 @@
name: Publish to npm

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll probably want to hook release.yml to trigger this automatically

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 I don't intend to merge this PR in, creating this PR draft for a POC i'm working on for migrating my team's AI-CLI into pup

@tedkahwaji tedkahwaji changed the title POC: publish pup to npm feat(npm): publish pup to npm Oct 5, 2026
@tedkahwaji
tedkahwaji force-pushed the teddy.kahwaji/npm-distribution branch 5 times, most recently from 85a68cc to 0021e3d Compare October 13, 2026 18:09
@tedkahwaji
tedkahwaji force-pushed the teddy.kahwaji/npm-distribution branch from 0021e3d to f36620b Compare October 14, 2026 13:59
Publish pup as @datadog/pup so it can run with `npx @datadog/pup` on any
machine with Node.js, without Homebrew or a manual download. The root
package is a small launcher; each release binary ships in its own
optionalDependencies package (@datadog/pup-<platform>) so npm installs
only the one matching the host.

- npm/pup: launcher that resolves the platform package, passes arguments
  and exit codes through, forwards SIGINT/SIGTERM/SIGHUP, and exits
  nonzero when the binary is killed by a signal Node ignores (SIGPIPE)
- npm/scripts/build-packages.js: builds the platform and root packages
  from GitHub release archives and stamps the version. Every archive must
  be listed in the release checksums and match them, and each platform
  package keeps the archive's third-party notices
- npm-publish.yml: manual-only publish of an existing release, dry run by
  default. It verifies the cosign-signed checksums, builds with the
  packaging code from the workflow's own revision so older releases can
  be published, and skips packages already published with matching
  contents so a failed run can be retried. Only a newer stable release
  moves the `latest` dist-tag; prereleases go to `next` and older
  releases to `backfill`. Runs are serialized, and a registry lookup
  error other than not-found stops the publish
- ci.yml: runs the launcher and builder tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tedkahwaji
tedkahwaji force-pushed the teddy.kahwaji/npm-distribution branch from f36620b to 5d3397f Compare October 14, 2026 14:31
@datadog-official

datadog-official Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed. Datadog automation helped this PR pass.

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5d3397f | Docs | View more details | Give us feedback!

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