Publish allium-lsp to npm on release#54
Conversation
Add a `publish-npm` job to the release-artifacts workflow that builds the WASM parser and the LSP bundle, then runs `npm publish` for packages/allium-lsp on every `v*` tag — mirroring the existing publish-crates job. Gated on tags and on build-and-release (lint + test) passing first. The package was already publish-ready: its build copies allium_wasm.js and allium_wasm_bg.wasm into dist/, and the runtime loader resolves the parser via `require(__dirname + "/allium_wasm.js")` before falling back to the workspace package, so the published tarball is self-contained (Node >= 20). Add publish metadata (repository, homepage, bugs, keywords, engines, publishConfig) plus the README.md and LICENSE the `files` list already referenced but were missing. Document `npm install -g allium-lsp` as the recommended install path in the README and the generic/Emacs editor guides. Requires (maintainer): an NPM_TOKEN repo secret and ownership of the `allium-lsp` name on npm before the first tagged release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Skip the publish step when the version is already on the registry, so re-running a release or pushing a tag without bumping the npm version doesn't fail the workflow on "cannot publish over previously published versions". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Self-reviewReviewed the diff. Docs and 🔴 Fixed in latest commit — idempotent publish. 🟡 Optional — npm provenance. Adding 🟢 Note — CI cost. The job recompiles the WASM parser rather than reusing Reminder of the two maintainer prerequisites before the first tagged release: add the |
Publish with --provenance and grant the job id-token: write so npm mints a signed build attestation linking the package to this workflow run. Set contents: read explicitly since job-level permissions override the workflow default and checkout needs read access. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Note: this is a non-blocking convenience PR. The Claude Code plugin wiring (juxt/allium#48) and all editors already work with the existing release tarball / from-source install, which put It can land on its own timeline once JUXT completes the npm org/token setup described above — #48 does not need to wait for it. |
|
Closing as won't do for now — intentionally deferred, not rejected. The motivation for this PR was to unblock the Claude Code plugin's LSP wiring (juxt/allium#48). That turned out to be unnecessary: the plugin only needs So npm publishing is now a pure convenience (one-command If we want to revisit later, the work is captured here and the cleaner long-term direction is probably the standalone binary (#17) + Nix (#16), which would also give a no-Node-runtime install. Leaving the branch |
What
Makes
allium-lspinstallable withnpm install -g allium-lsp, so editors and the Claude Code plugin (juxt/allium#39) can put the language server onPATHwithout the manual tarball/source dance.Why
The plugin wires
allium-lspvialspServers, but there's currently no one-command way to get the binary ontoPATH— the documentednpm install -g allium-lsppath didn't exist (the name is unpublished). This adds the publish step.Changes
.github/workflows/release-artifacts.yml— newpublish-npmjob: builds the WASM parser + LSP bundle and runsnpm publish --workspace packages/allium-lsponv*tags. Mirrorspublish-crates; gated on tags and onbuild-and-release(lint + test) passing.packages/allium-lsp/package.json— publish metadata (repository,homepage,bugs,keywords,engines: node >=20,publishConfig.access=public).packages/allium-lsp/README.md+LICENSE— added; both were already listed infilesbut missing (npm would otherwise publish a bare page with no licence).npm install -g allium-lspdocumented as the recommended path in the README and the generic/Emacs LSP guides.Why this is safe / self-contained
The package was already publish-ready. Its build copies
allium_wasm.js+allium_wasm_bg.wasmintodist/, and the runtime loader resolves the parser viarequire(__dirname + "/allium_wasm.js")before falling back to theallium-parser-wasmworkspace package — so the externalized dependency is a dev-only fallback and the published tarball is self-contained.npm pack --dry-runconfirms the layout:The publish job builds via the exact same
npm run --workspace packages/allium-lsp buildalready used to produce the release tarball, so it's the proven build path plus a publish step.allium-lspwould be JUXT's first npm package. I verified there is no existing npm token to reuse: across the org, no workflow referencesNPM_TOKEN/NODE_AUTH_TOKENand nothing runsnpm publish(today JUXT ships to crates.io viaCARGO_REGISTRY_TOKENand to the Homebrew tap viaHOMEBREW_TAP_TOKEN; the VS Code extension is distributed as a.vsixon Releases). Theallium-lspname is also still unregistered on npm. So someone from JUXT needs to do a one-time setup before the first tagged release — none of it is a code change:juxtnpm org), or confirm an existing npm account that should ownallium-lsp. There is no JUXT npm org in use yet.allium-lspname — it's first-come-first-served and currently free. Claiming = publishing the first version (the release workflow does this automatically once the token is in place; ornpm publishit once manually to reserve sooner).NPM_TOKENrepo secret onjuxt/allium-tools(or as a shared org-level secret). The workflow already referencessecrets.NPM_TOKEN.Until the token exists, the
publish-npmjob fails only at the final publish step; every other job (crates, Homebrew, GitHub release) is unaffected, and the change is otherwise inert. Once set up, pushing av*tag claims the name and publishes in one go, which then activates the LSP wiring in juxt/allium#48.Refs juxt/allium#39
🤖 Generated with Claude Code