Migrate to pnpm workspaces with automated npm publishing#89
Migrate to pnpm workspaces with automated npm publishing#89
Conversation
davelopez
left a comment
There was a problem hiding this comment.
This is very helpful! Thank you!
Scope webr as @galaxyproject/webr and remove private:true for consistency with all other packages. Replace hardcoded yarn calls in alignmentviewer and annotateimage build scripts with generic equivalents that work under any package manager.
pnpm workspaces will manage all dependencies from the root lockfile, so these per-package lock files are no longer needed.
Replace lerna.json and yarn.lock with pnpm-workspace.yaml and pnpm-lock.yaml. Root package.json now has pnpm convenience scripts (build:all, test:all, lint:all, clean) and the packageManager field set to pnpm@10.12.1. All 48 workspace packages resolve successfully.
All 30 per-package prettier.config.js files were byte-identical. Moved the shared config to root and added a .prettierignore. Removed the explicit --config flags from 7 package prettier scripts since prettier will find the root config automatically.
Switch from per-package npm install to root-level pnpm install with frozen lockfile. Replace npm/npx commands with pnpm equivalents. Update cache strategy to use pnpm store instead of per-package node_modules. Bump to Node 22.
publish-packages.yml triggers on push to main, detects package.json version changes, and publishes updated packages to npm under the @galaxyproject scope. manual-publish.yml provides a workflow_dispatch for publishing individual packages with dry-run support.
Add repository structure, pnpm development setup commands, publishing workflow documentation, and contributing guidelines.
setup-node@v5 tries to detect and cache the package manager on setup, so pnpm needs to be installed first. Also bumped pnpm/action-setup from v4 to v5 (latest).
|
TODO: Set up npm trusted publishing (OIDC) The publish workflows currently reference an Setup steps:
Caveat: Initial version of any never-published package can't use OIDC -- needs a one-time token-based publish first. Ref: https://docs.npmjs.com/trusted-publishers/ / https://docs.npmjs.com/cli/v11/commands/npm-trust/ |
Summary
build:all,test:all,lint:all,clean).publish-packages.ymlworkflow detects version bumps on merge to main and publishes changed packages to npm under@galaxyproject. Manual publish workflow with dry-run support also included.pnpm install --frozen-lockfilefrom root, Node 22). Kept the dynamic discovery, Playwright separation, and Python dependency support.prettier.config.jsfiles to a single root config. Added.prettierignore.webras@galaxyproject/webr, replaced hardcodedyarncalls in build scripts, removed 12 stale per-package yarn.lock files.Build/test verification
pnpm install— all 48 workspace packages resolveNotes
NPM_TOKENsecret in repo settings for publishing to workTest plan
pnpm install && pnpm build:allworks locally