Skip to content

feat(npm): Publish pup as npm package - #915

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

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

Conversation

@tedkahwaji

@tedkahwaji tedkahwaji commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

The following change publishes pup to npm as @datadog/pup, so users can run npx @datadog/pup setup.

We're migrating the AI Setup CLI into pup, and today users run AI Setup with npx @datadog/ai-setup-cli, so pup needs to support the same npx path. The package follows the standard npm pattern for native binaries: a small launcher plus one package per platform, so npm installs only the matching binary. The binaries are the same ones attached to each GitHub release.

PR 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 as npm package #915 <- Current PR

You can find implementation details in the design doc (Datadog internal) and test cases in the test plan (Datadog internal).

Changes

  • Launcher and per-platform packages, built from the signed release archives. Each archive must match the signed checksums before it's packaged.
  • Manual publish workflow, dry run by default. It's manual for now because the npm packages and NPM_TOKEN aren't set up yet, and we want to watch the first real publish. release.yml can call it once a manual publish has worked.
  • The publish can be retried safely: packages already published with the same contents are skipped, and only a "not found" from the registry counts as unpublished.
  • Newer stable releases get the latest dist-tag, prereleases next, and older releases backfill.
  • The launcher passes exit codes and signals through, including exiting non-zero when pup is killed by a signal Node ignores, such as SIGPIPE.

@datadog-datadog-prod-us1-2

This comment has been minimized.

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 changed the title feat(npm): publish pup to npm feat(npm): Publish pup as npm package Oct 14, 2026
@tedkahwaji
tedkahwaji force-pushed the teddy.kahwaji/npm-distribution branch from 7ae0684 to ed29e2e Compare October 14, 2026 16:44

This branch has not been deployed

No deployments
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