-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use yalc for package link and unlink #6266
chore: use yalc for package link and unlink #6266
Conversation
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🚢
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
Signed-off-by: Mike Murray <[email protected]>
@mpaktiti Need a re-review please! 😄 I added a This allows for bulk linking of api plugins and should be even more of a help when testing multiple changed packages. I also removed the yalc check/install code because it was actually checking your local machine for yalc instead of the container. I made a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Works great with reaction plugins. I am not sure if this is the right place to ask, but is there any way to link custom packages? as i understand, packages are loaded from package.json, i tried to do package-link @reaction/custom-plugin, then added this plugin in package.json. However, it doesn't seem to able to locate it. |
I got it, yalc publish on plugin folder did the trick |
Resolves #6248
Impact: minor
Type: feature|chore
MERGE FIRST (node-dev image updates) = reactioncommerce/docker-base#31
Issue
package-unlink
seems to unlink more packages than it should. This, plus issues withpackage-link
itself linking packages, but not properly resolving dependencies which leads to code & tests passing locally, then failing on CI.Solution
Use yalc instead of
npm link
.Command breakdown
Linking
Link all packages found in
yalc-packages
wherepath/to/package=true
Unlink all packages found in
yalc-packages
wherepath/to/package=false
Link a new package & update an existing package when you've made changes
Unlinking
Unlink a package, run npm install, and re-link previously linked packages
Updating
Update linked packages based on the entries from the
yalc.lock
file. If you stopped and started the API container, this will re-link everything.Breaking changes
None, but...
You should destroy your containers and start fresh. Since this is a dev tool, it won't break dependency management otherwise.
Testing
make init
andmake clone-api-plugin
cd reaction
./bin/package-link @reactioncommerce/api-core
or any api plugin in theapi-plugins
directorypong
src/graphql/resolvers/index.js
and changed ping toping: () => "pong TEST"
./bin/package-link @reactioncommerce/api-core
again to updateping
query and seepong TEST
./bin/package-unlink @reactioncommerce/api-core
ping
query again, and you should only seepong
./bin/package-link
without any argumentsyalc-packages
false
./bin/package-link
again