chore(scripts/js-packages-release): new deployment pattern#21122
chore(scripts/js-packages-release): new deployment pattern#21122
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## edge #21122 +/- ##
==========================================
- Coverage 57.62% 57.55% -0.07%
==========================================
Files 3924 3922 -2
Lines 321830 321716 -114
Branches 46358 46358
==========================================
- Hits 185441 185163 -278
- Misses 136166 136325 +159
- Partials 223 228 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jerader
left a comment
There was a problem hiding this comment.
CI passes, code changes seem reasonable and easy to follow what you did. nice!
There was a problem hiding this comment.
Pull request overview
Introduces a new unified scripts/npmjs-publish/ toolchain (uv + Typer/Rich) to coordinate versioning, builds, and npm registry preflight checks for the monorepo’s JS packages, plus CI automation for tag-driven runs. It also updates @opentrons/step-generation packaging metadata/targets to support publishing built lib/ artifacts and updates a few Protocol Designer tests to import from the package entrypoint.
Changes:
- Add
scripts/npmjs-publish/Python CLIs (publish.py,build_packages.py) with manifest rewrite helpers, uv/ruff/pytest config, and unit tests. - Add a dedicated GitHub Actions workflow for PR validation and tag-driven preflight/build orchestration.
- Update
step-generationbuild targets andpackage.jsonentrypoints/exports; adjust some Protocol Designer test imports accordingly.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| step-generation/package.json | Switches entrypoints/exports to lib/ outputs to prepare the package for publishing. |
| step-generation/Makefile | Adds build-ts, lib, and pack targets to produce lib/ artifacts. |
| scripts/npmjs-publish/pyproject.toml | Defines uv-managed Python project + ruff configuration for the new tooling. |
| scripts/npmjs-publish/uv.lock | Locks Python dependencies for reproducible runs via uv. |
| scripts/npmjs-publish/publish_core.py | Centralizes package order + semver/tag parsing helpers. |
| scripts/npmjs-publish/publish.py | Implements npm registry preflight CLI with summaries and interactive mode. |
| scripts/npmjs-publish/build_packages.py | Implements ordered monorepo build + optional manifest rewrite CLI. |
| scripts/npmjs-publish/manifests.py | Rewrites package.json versions and internal dependency pins. |
| scripts/npmjs-publish/github_summary.py | Appends markdown output to GITHUB_STEP_SUMMARY in Actions. |
| scripts/npmjs-publish/tests/test_publish.py | Adds unit tests for version/tag parsing + preflight logic. |
| scripts/npmjs-publish/tests/test_manifests.py | Adds unit tests for manifest rewrite behavior. |
| scripts/npmjs-publish/tests/test_build_packages.py | Adds unit tests for build CLI behavior and flags. |
| scripts/npmjs-publish/README.md | Documents local + CI usage for the new release tooling. |
| scripts/npmjs-publish/PLAN.md | Captures roadmap/status notes for the publish workflow migration. |
| scripts/npmjs-publish/Makefile | Adds convenience targets for setup/lint/test/preflight/build flows. |
| .github/workflows/npmjs-publish.yaml | Adds workflow to lint/test on PRs and run tag-based preflight/build. |
| protocol-designer/src/ui/steps/actions/tests/actions.test.ts | Updates a test import to use @opentrons/step-generation package entrypoint. |
| protocol-designer/src/steplist/test/generateSubsteps.test.ts | Updates a test import to use @opentrons/step-generation package entrypoint. |
| protocol-designer/src/file-data/tests/createFile.test.ts | Updates a test import to use @opentrons/step-generation package entrypoint. |
| .cursor/skills/npmjs-publish/SKILL.md | Adds Cursor skill documenting conventions for the new tooling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sfoster1
left a comment
There was a problem hiding this comment.
are we sure that a bunch of python is the right thing to use for preflight tests for npm publishes? is there not a bunch of node stuff that would be a lighter integration burden and maybe some helpful packages that do some of it for us? this will definitely work, but it's a bit eyebrow raising in the same way that adding a bunch of js to process pypi publishes would be.
also, can we strip this down a little? this is a whooole lotta code for this flow because of things like interactive modes, colorized table outputs, etc etc. it makes it really hard to tell what it actually does, and the little table of what each file is for mixes internal detail, external usage information, and semantic intent in a way that makes it pretty unhelpful.
finally i don't really get what the intent of the npm-publish@ tag prefix thing is. is the idea that after we do a big release process - say, 9.0.0, so we've got refs/tags/v9.0.0 - we push an npm-publish@ tag that matches that? or is independent of that? and that has a separate version track that determines what's published, and runs on just whatever git ref is pushed currently? Makes sense, but can we document that?
|
|
||
| import semver | ||
|
|
||
| PACKAGES: tuple[str, ...] = ( |
There was a problem hiding this comment.
this is in a very specific dependency order, right? maybe put that in a comment
There was a problem hiding this comment.
Ya I went a little heavy. Switched it to ts. Tag deployment pattern like everything else. You push js-packages-release@semver tag and all 4 packages are built and released together since they must be in sync. I stuck to semver as we might want it to be meaningful at some point.
Overview
Adds a unified GitHub Packages release-prep workflow under
scripts/js-packages-releasefor coordinated releases of the JS packages in this dependency chain. The implementation is now TypeScript-based (.mts) and covers registry preflight checks, ordered build orchestration, manifest rewriting, GitHub Actions automation forjs-packages-release@*tags, documentation, focused Vitest coverage, and a Cursor skill to support the workflow.This PR also prepares
step-generationto be published by updating its build targets and package metadata so it ships builtlibartifacts with the expected entrypoints and exports for the release flow.Test Plan and Hands on Testing
make -C scripts/js-packages-release cleanmake -C scripts/js-packages-release buildmake -C scripts/js-packages-release formatmake -C scripts/js-packages-release lintmake -C scripts/js-packages-release testmake -C scripts/js-packages-release build-packagesmake -C scripts/js-packages-release build-packages-manifests-only VERSION=9999.0.0-beta.1make -C scripts/js-packages-release publish-currentmake -C scripts/js-packages-release publish-ci VERSION=9999.0.0-beta.1.github/workflows/js-packages-release.yamlis aligned with the TypeScript toolchain and runsOut of scope
npm publishstep to GitHub Packagescomponents-testingparity for all four packagesChangelog
.mtstoolchain underscripts/js-packages-releasejs-packages-releaseGitHub Actions workflow to use the repo's JS setup instead of uvstep-generationso it can be built and published withlib-based package outputs and loader-compatible exportsstep-generationimports in tests where needed for the new package shapeRisk assessment
scripts/js-packages-releaseworkflow, and consumers of@opentrons/shared-data,@opentrons/step-generation,@opentrons/components, and@opentrons/protocol-visualization.