Skip to content

OPS-10: no tag for a moved, already-published package - #202

Merged
securedeveloper merged 1 commit into
mainfrom
ops-10-no-tag-moved-package
Nov 16, 2026
Merged

securedeveloper merged 1 commit into
mainfrom
ops-10-no-tag-moved-package

Conversation

@securedeveloper

Copy link
Copy Markdown
Owner

OPS-10: a moved package that is already on npm is no longer tagged.

The problem

scripts/release-check.mjs sets tag (which runs release.yml's "Tag and GitHub Release" step) whenever the version differs from HEAD~1. When a package moves, for example from the repository root to packages/<name> as the react-data-import and react-xlsx-viewer scaffolds do, HEAD~1 has no package.json at the new path. The previous version is then null, so tag was true. Nothing was published, because 0.0.1 is already on npm, but merging would have created a v0.0.1 tag and GitHub Release on the scaffold commit.

The change

tag: manual || (previousVersion !== version && (previousVersion !== null || !publishedVersion)),

A package.json that is new at its path and whose version is already on npm is a moved package, not a release, so it gets no tag. The verdict line says so: … is already on npm (package.json is new at this path: moved, not released; no tag). Everything else is unchanged:

Case release tag
Moved package: new path, version already on npm no no (was yes)
New path, unpublished (a real first release) yes yes
Re-run after a publish whose tag step failed (previous version known) no yes
Manual run (workflow_dispatch) as before yes, as before
  • Tests. Four new cases in release-check.test.mjs, one per row above. All 40 tests pass.
  • Byte-identical. release-check.mjs and release-check.test.mjs are identical in javascript-excel, react-data-export, react-data-import and react-xlsx-viewer: sha1 2d5e497ebeaf… and 3a6e4d3e6f9a…, one PR per repository.
  • Docs. RELEASING.md gains one bullet saying that moving a package is not a release.

Checked on the react-xlsx-viewer scaffold (XLV-1, packages/react-xlsx-viewer, HEAD~1 = main)

  • The old script gives tag=true.
  • The new script gives release=false, version-changed=true, tag=false.

No package change and no changeset.

@securedeveloper
securedeveloper merged commit 00d88a8 into main Nov 16, 2026
34 checks passed
@securedeveloper
securedeveloper deleted the ops-10-no-tag-moved-package branch November 16, 2026 13:52
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