Skip to content

feat: add npm publish workflow and rename package to @ecmwf.int/tensogram - #62

Merged
sametd merged 14 commits into
mainfrom
feature/publish-npm
Apr 22, 2026
Merged

feat: add npm publish workflow and rename package to @ecmwf.int/tensogram#62
sametd merged 14 commits into
mainfrom
feature/publish-npm

Conversation

@HCookie

@HCookie HCookie commented Apr 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Renames the TypeScript package from @ecmwf/tensogram to @ecmwf.int/tensogram across 40 files (source imports, package.json manifests, lock files, docs)
  • Adds publishConfig: { "access": "public" } to typescript/package.json
  • Adds .github/workflows/publish-npm.yml — manual workflow_dispatch workflow that publishes @ecmwf.int/tensogram to npmjs.com, matching the style of publish-crates.yml and publish-pypi-tensogram.yml

Key workflow design decisions:

  • Runs on the ECMWF self-hosted runner with the existing CI Docker image (Rust + wasm-pack already installed)
  • Idempotent: checks npmjs.com registry before publishing, skips if version already exists
  • Auth via NPMJS_API_TOKEN secret in a npm GitHub Environment
  • Copies root LICENSE into typescript/ before publish (npm doesn't walk up to repo root)
  • Cleans up .npmrc (contains auth token) on exit with if: always()

Test plan

  • Verify @ecmwf.int scope is registered and owned on npmjs.com
  • Create a npm GitHub Environment in repo settings
  • Add NPMJS_API_TOKEN (publish-scoped npm token for @ecmwf.int) to that environment's secrets
  • Run release-preflight workflow to confirm version consistency passes
  • Trigger publish-npm workflow manually and confirm it publishes successfully
  • Trigger again on the same version and confirm it skips (idempotency)

🤖 Generated with Claude Code

Docs Preview
https://sites.ecmwf.int/docs/tensogram/pull-requests/PR-62

@HCookie
HCookie force-pushed the feature/publish-npm branch from 3e96397 to a7ac3ed Compare April 21, 2026 12:36
HCookie and others added 14 commits April 22, 2026 03:40
Rename all occurrences of @ecmwf/tensogram to @ecmwf.int/tensogram
across 41 files including source, docs, plans, and package manifests.
Regenerate package-lock.json for typescript/, tensoscope/, and
examples/typescript/.
npm does not walk up to the repo root when packaging a subdirectory,
so typescript/package.json's "files": ["LICENSE"] entry would produce
an empty-license tarball without this step.
Replace inlined wasm-pack + tsc with npm run build so typescript/package.json stays the single source of truth for how to build the npm distributable. No behaviour change — same commands, same outputs.
Plans and specs under docs/superpowers/ were not meant to ship with the public docs. Main already removed its copy in 9fe6856; align this branch by deleting the whole directory (including this PR's just-added publish-npm plan/spec).
Renaming the package from @ecmwf/tensogram to @ecmwf.int/tensogram added 4 chars to the middle box's first content line without adjusting its surrounding whitespace, so the interior width became 38 cols while the box borders stayed at 34. Trim padding from 3+4 to 1+2 (matching the 'TS Application' line's pattern) so all 8 interior lines are 34 cols.
Previously Node was curl'd + extracted per-job (~10 s overhead each, 4 workflows). Pre-baking in the CI image removes that overhead, consolidates the version pin to the Dockerfile, and drops the nodejs.org runtime dependency. deploy-tensoscope.yml still installs Node inline — it runs on bare Ubuntu with no container, so it cannot use the image.
Main adopted Makefile delegation in PR #61 for the typescript/wasm CI jobs. Align publish-npm.yml with that pattern so the build commands, step names, and Makefile targets are consistent across both workflows. Supersedes 92aea32's npm-run-build approach.
@sametd
sametd force-pushed the feature/publish-npm branch from f501c82 to e82da28 Compare April 22, 2026 01:41
@sametd
sametd merged commit e70d07c into main Apr 22, 2026
18 checks passed
@sametd
sametd deleted the feature/publish-npm branch April 22, 2026 01:47
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