Skip to content

Conversation

jamesdaniels
Copy link
Collaborator

@jamesdaniels jamesdaniels commented Sep 12, 2024

Seeing failures since the changes to @apphosting/common. It turns out that in lerna, for the dependency graph to pick up dependents / dependencies the version in the package.json dependencies needs to be in the form of *

  • Change monorepo dependencies to *, that's the easy part
  • Now we don't want to allow any version of @apphosting/common as a dependency of @apphosting/adapter-*, so let's pin before we publish to the registry
    • Do two passes on the scopedLernaList (fka filteredLernaList)
      1. make a new package.json—set the new version and publishConfig
      2. pin dependencies to any versions from the first pass, write to disk, publish
    • Topo sort the lerna list, so packages are published in the correct order
  • We should be building dependencies but only publishing dependents, move --include-dependencies into build.js
    • As build/test use the same scopedLernaList as publish, which has --include-dependents, changes to @apphosting/common will still trigger @apphosting/adapter-* tests to ensure we haven't introduced breaking changes
    • This went unnoticed before as dep tracking wasn't functioning
  • Readability pass

Lerna publish would do much of this all for us, if we were using that... but I don't like the loss of control we'd suffer there, seems too magic.

@MC-MAGA

This comment was marked as off-topic.

Copy link
Collaborator

@blidd-google blidd-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this - the publish flow has been slightly broken since we set up the @apphosting/common package, this will be a nice QOL improvement!

@jamesdaniels jamesdaniels merged commit a4c33c9 into main Sep 19, 2024
9 checks passed
@jamesdaniels jamesdaniels deleted the jamesdaniels_fixCommonDeps branch September 19, 2024 01:03
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.

3 participants