Skip to content

[NA] Publish the SDK to npm as @comet-ml/javascript-sdk 2.0.0 - #1

Merged
dsblank merged 6 commits into
masterfrom
npm-package
Oct 27, 2026
Merged

dsblank merged 6 commits into
masterfrom
npm-package

Conversation

@dsblank

@dsblank dsblank commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Re-opened from comet-ml/comet-javascript-sdk-archive#59; this repository starts a fresh history.

What

Makes the SDK publishable to npm as @comet-ml/javascript-sdk, version 2.0.0. Nothing is published by merging this: publishing starts only when a 2.0.0 tag is pushed on master, and it waits for approval in the npm environment.

  • package.json: name @comet-ml/javascript-sdk, version 2.0.0. The package now includes the browser bundle build/comet-javascript-sdk.js, and jsDelivr/unpkg serve it for the bare package URL. Also fixes the repository URL and keywords, and sets publishConfig.access: public.

  • LICENSE: the MIT license package.json already declared (wording as comet-llm).

  • .github/workflows/release.yml: on a MAJOR.MINOR.PATCH tag it checks that:

    • the tagged commit is on master;
    • the tag matches package.json;
    • build/ and docs/ are up to date.

    It then runs the tests and npm publish, using trusted publishing or an NPM_TOKEN secret. Actions are pinned to commit SHAs.

  • scripts/check-package.js (npm run test:package, run in CI): packs the package without publishing, checks which files it contains, installs the tarball into an empty project, and loads both require() and the bundle.

  • README: npm and jsDelivr installation, and the release steps.

  • No more CDN release: npm is the only release. Removed are scripts/Jenkinsfile, plus scripts/release-tag.sh and its test, which only Jenkins used. Also dropped are the README's cdn.comet.ml release steps and the on-prem CDN version list. The Comet app embeds the bundle via npm run sync-frontend. Releases up to 1.1.24 stay on cdn.comet.ml.

The bundle filename stays comet-javascript-sdk.js, so the frontend's sync-frontend copy is unaffected.

Why 2.0.0

No methods were removed, but some behavior changed since 1.1.24:

  • get('ws/proj/key') now rejects an unknown key (it used to resolve undefined) and finds archived experiments.
  • experimentsByProjectName requires a workspace.
  • Server errors are an Error with .status.
  • The browser bundle no longer includes core-js polyfills.

It also adds 13 new API methods and Comet.ProjectPanel (see comet-ml/comet-javascript-sdk-archive#58).

Before the first publish (repo/npm settings, not code)

  1. Add a second owner to the comet-ml npm org, and turn on 2FA.
  2. Add an NPM_TOKEN secret with publish rights to @comet-ml, then switch to npm trusted publishing after the first release.
  3. Create the npm environment with required reviewers.

Testing

  • npm run lint, npm run format:check, npm test (68 passing), npm run test:bundle, npm run test:package (comet-ml-javascript-sdk-2.0.0.tgz, 28 files, 33 KB).

🤖 Generated with Claude Code

Douglas Blank and others added 4 commits October 27, 2026 12:53
Nothing is published by this commit; publishing starts when a
MAJOR.MINOR.PATCH tag is pushed and the npm side is set up.

- package.json: version 1.2.0 (the latest tag is 1.1.24), ship the
  browser bundle (build/comet-javascript-sdk.js) and point jsDelivr and
  unpkg at it, fix the repository URL and keywords, publish publicly with
  provenance; prepublishOnly also runs the bundle test
- .npmrc: `npm version` tags plain 1.2.0, the format Jenkins expects
- Add the MIT LICENSE that package.json declares (wording as comet-llm)
- .github/workflows/release.yml: on a version tag, check the tag matches
  package.json and build/ and docs/ are current, then npm publish (trusted
  publishing or an NPM_TOKEN secret), in the `npm` environment
- scripts/check-package.js (npm run test:package, run in CI): packs the
  package, checks its files, installs the tarball, and loads it
- README: npm and npm-CDN installation, and the release steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under the new comet-ml npm org, matching the GitHub org. Only the
package name changes: the bundle is still build/comet-javascript-sdk.js,
the file name Jenkins, the CDN, and the frontend use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…token

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Version 2.0.0: behavior changes since 1.1.24 (get(ws/proj/key) rejects
  an unknown key and finds archived experiments; experimentsByProjectName
  requires a workspace; errors carry .status; the browser bundle has no
  polyfills) plus 13 new methods, ProjectPanel, and the npm package
- Release workflow refuses a tag whose commit is not on master
- No npm provenance: npm can't generate it for a private repository
- README: release by bumping the version in a PR, then tagging master

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dsblank
dsblank deployed to integration October 27, 2026 19:55 — with GitHub Actions Active
@dsblank
dsblank deployed to integration October 27, 2026 19:57 — with GitHub Actions Active
From 2.0.0 the SDK is released to npm only; the Comet app embeds the
bundle (npm run sync-frontend), so nothing needs cdn.comet.ml any more.

- Remove scripts/Jenkinsfile, and scripts/release-tag.sh with its test
  (only Jenkins used it; release.yml takes the tag from the push itself)
- README: one release path; panels embed the SDK rather than loading
  /js/comet-javascript-sdk-latest.js; drop the on-prem CDN version list;
  note that 1.1.x releases were on cdn.comet.ml only
- Comments in ci.yml, release.yml, .npmrc, and the webpack config

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dsblank
dsblank deployed to integration October 27, 2026 20:01 — with GitHub Actions Active
@dsblank
dsblank deployed to integration October 27, 2026 20:03 — with GitHub Actions Active
@dsblank

dsblank commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

BAZ review

The publish job had id-token: write (npm trusted publishing) while it
ran `npm ci` and the tests, so any dependency's code ran with the
right to mint a publish token. Now:

- build (no credentials): checks the tag is on master and matches
  package.json, that build/ and docs/ are current; installs with
  --ignore-scripts; lints, tests, runs the package check; packs the
  tarball as an artifact
- publish (npm environment, id-token): downloads that tarball and runs
  `npm publish --ignore-scripts` on it; no checkout, no dependencies,
  no package scripts

check-package.js installs with --ignore-scripts too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dsblank
dsblank deployed to integration October 27, 2026 20:10 — with GitHub Actions Active
@dsblank
dsblank merged commit cbef641 into master Oct 27, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
integration — 51143f16 Deployed Oct 27, 2026 by dsblank via Integration (comet.com) #3
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