feat: add script to install packages locally in a DXP checkout #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a crude script that will almost certainly have to be evolved as the shape and structure of the monorepo evolves, but it works for now with the set of packages that we currently have.
It addresses a bunch of "gotchas" that come with trying to test out packages with local changes in a liferay-portal checkout. Depending on which packages you want to test and the dependency graph between them, you may find that
yarn link
(or evenyarn add
) doesn't do what you want. Even if you manually copy files (cp
), things still might not work because Gradle may decide to re-run a task that ends up blowing away any changes you make locally undernode_modules
.At least for the simple case, this script was good enough to allow me to test #97, even though it involved changes to both
eslint-config
andnpm-scripts
.As you can see, it does three things:
node_modules
folders inside the monorepo, becauseyarn add
can end up copying these over in ways that cause confusion (brokenbin
links and so on).Like I said at the start, this is a hack (and not even trying to make it work on Windows), but it's a useful hack.