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 attempts a new sort of spin on the Yarn workspaces concept.
Currently
jspm install x -p ./project/path
can be used to run a jspm command from a project that is not the currentcwd
.So the idea is quite simple - allow the
-p
flag to accept multiple projects, and that way we can operate on many projects at once, effectively getting the monorepo tools out of a simple primitive.For example, consider having
packages/[pkgname]
containing a bunch of packages in a monorepo pattern. Then the following workflows would apply:jspm install -p packages/*
would install dependencies in all packages.jspm publish -p packages/*
would publish all packages. Some kind of publish flag to only publish new versions could be used to get a proper monorepo workflow out of this.jspm run test -p packages/*
would run the package.json "scripts" for"test"
in each of the packages.It could be good to work towards a documentation section covering these techniques comprehensively as we polish the various workflows.
The current limitation with linking the packages together is the following -
In order to link the packages between eachother, we can use:
What this does, is updates the
jspm_packages
symlinks in each of the packages to reflect the local versions.This works fine, but unfortunately has two issues:
"dependencies": { "dep": "link:../dep" }
, which is not what we would want - rather we would just want the linked package to be represented in the package lock file. I've created a tracking issue for this in jspm link workflow polishing, resolution to be lockfile-specific #2489.-i
flag #2490.Rather than trying to do everything at once in this PR, will tackle the above in separate follow-ups.
This is very much an initial PR to demonstrate the concepts - would be interested to hear what people think further about it too.