fix(publish): release packages in dependency order #49
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
qa:preview
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quatrain/core!49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/48-publish-dependency-order"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
bin/publish_all.jsbuilds in dependency order (Turborepo) but released packages in alphabetical order. A package was packed before its dependencies received their new version, so itsworkspace:*ranges became the previous version:@quatrain/backend@1.2.23-beta.1declares@quatrain/core ^1.2.20, while the code it needs is incore 1.2.21-beta.1.A
^1.2.20range does not accept a1.2.21beta, so a consumer of the beta gets acorewithout that code.Change
bin/dependencyOrder.js:sortByDependencies()orders workspace packages dependencies first, from their runtime dependencies and peers; independent packages stay in alphabetical order; a cycle stops the release with the packages involved.bin/publish_all.jsuses that order for hashing and releasing.develop(beta) may declare beta dependencies. A release frommain(stable) that would declare a prerelease runtime dependency now stops the job. In dependency order this cannot happen in a normal release, since betas are finalised before their dependents; the check is a safeguard.Effect on the next run on
developThe changed packages are released again, each declaring the beta of its changed dependencies (
backend->core ^1.2.21-beta.N, and so on).Not covered
A package whose own code did not change is not released again when only a dependency changed. Its published range still accepts the last stable version of that dependency, which is correct as long as it does not need the new code.
Checks
types<core<backend<backend-postgres,identifiersandbackend<tenancy.developandmain; the script has no automated test.Closes #48
🤖 Generated with Claude Code