-
Notifications
You must be signed in to change notification settings - Fork 148
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
feat: add support for yarn installations #560
Conversation
Yeah, CI fails since |
Wow this is really cool! Hope that this will get accepted. Is there anything I can do to help? :) |
I'll review this when I get back in to work tomorrow.
We will need to work with @nodejs/build to get yarn into our ci as well
…On Sun, Apr 15, 2018, 12:13 PM Christoph Nakazawa ***@***.***> wrote:
Wow this is really cool! Hope that this will get accepted. Is there
anything I can do to help? :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#560 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAecV8RN795NsPIc0Zao84pnsvbONlxPks5to3G7gaJpZM4TVci2>
.
|
Looking at the yarn installation docs it looks like it's just a case of extracting a tarball and adding to the path. I'd rather not install EDIT: Realised I already said this in #415 |
This PR LGTM once it has tests. |
Opened up #561 installing yarn on CI (separate as I expect this PR to take a bit of time, while yarn installed on CI is standalone) |
I don't have a huge issue with doing that, but what's the benefit to having that land sooner? Presumably it's not usable before this PR lands. |
To unblock #478 |
@MylesBorins no objections beyond missing tests? If so, I'll try to get some written this weekend or early next week 🙂 |
Thanks for the review! Seeing as Jest uncovered nodejs/node#20157 as well, I'll try to prioritise work on this PR so we can get Jest into CITGM. |
If you want to pair on a refactor of this pr lmk 😁
…On Thu, Apr 19, 2018, 6:31 PM Simen Bekkhus ***@***.***> wrote:
Thanks for the review! Seeing as Jest uncovered nodejs/node#20157
<nodejs/node#20157> as well, I'll try to
prioritise work on this PR so we can get Jest into CITGM.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#560 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAecV1Yoyvj6UoqwgblDpmSqZ0gNIHAMks5tqRBTgaJpZM4TVci2>
.
|
Feel free to work on it! I'll be travelling for work this weekend, so I won't have any time until next week anyways 🙂 |
@SimenB would you be so kind and have another loop at the comments? :-) having yarn support would IMO be really helpful. |
Jest has actually passed Mocha now as the most downloaded test framework from npm, so I'll try to find the time to get this up to speed within the next few days. |
Rebased and pushed changes based on feedback (except for template strings and the I'll open up a separate PR adding Prettier and template strings to avoid the style nits 🙂 |
This comment has been minimized.
This comment has been minimized.
Is this ready for review? |
Yes, except for a missing test this is good to go. I'll add a test today or tomorrow |
I've added tests now. However, I hit a snag. On mac, of you install yarn through the officially recommended way (brew), the I skipped the failing tests in the last commit. Results in the following #!/bin/bash
PREFIX="/usr/local" NPM_CONFIG_PYTHON="/usr/bin/python" exec "/usr/local/Cellar/yarn/1.10.1/libexec/bin/yarn.js" "$@" |
This LGTM, but we have to make sure that the CI machines used for CITGM jobs have yarn installed and in the PATH before we merge the PR. |
Are we able to include yarn in the package.json and use that version?
…On Wed, Oct 24, 2018, 7:31 AM Michaël Zasso ***@***.*** wrote:
This LGTM, but we have to make sure that the CI machines used for CITGM
jobs have yarn installed and in the PATH before we merge the PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#560 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAecV4Jr9I9h_reRcEVPZqU8J7MpPWOAks5uoE-VgaJpZM4TVci2>
.
|
That should work, yeah! |
@MylesBorins thanks for the thorough review! I think I've addressed your points now (and rebased) |
test('npm-install: setup', function (t) { | ||
t.plan(7); | ||
t.plan(8); | ||
packageManager.getPackageManagers((e, res) => { |
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.
not super clean, but allows me to reuse the implementation.
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.
Some small nits in line but nothing I'd block over
Thanks for all the hard work!
edit: this LGTM is dependent on the test suite being green
module.exports = function getExecutable(binaryName, next) { | ||
if (binaryName === 'yarn') { | ||
// Use `npm-which` for yarn to get the locally version | ||
npmWhich(binaryName, next); |
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.
is there a reason we can't use npmWhich for both npm
and yarn
?. If that's the case and it is pass through could we not remove this script altogether?
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.
is there a reason we can't use npmWhich for both
npm
andyarn
?
npm-which
is just for binaries installed in node_modules
. Not sure if it finds globally installed stuff?
Could potentially add npm
as a dep as well, then it won't rely on any globals beyond node. Maybe not worth it?
If that's the case and it is pass through could we not remove this script altogether?
IDK about the windows thing below. Would that just work ™️? I don't have access to a windows machine to test
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.
Let's keep it just how it is for now, this makes sense. I was more confused by the usage above
Fixed the failing test and addressed the last feedback except for one open question |
BTW, might make sense to activate auto-cancellation of redundant builds: https://travis-ci.com/nodejs/citgm/pull_requests. Currently my last 2 commits are both queued, the second to last could (should) be cancelled |
@SimenB done. I also cancelled the second to last job. |
CI is green and feedback addressed. Is this good to go? 🙂 |
I'm not really following this, sorry, but if this needs |
I've added |
Failures seem unrelated. I opened nodejs/build#1601 |
I scheduled https://ci.nodejs.org/job/citgm-continuous-integration/144/ to check if it also fails for the same reason on master. Edit: confirmed |
I'd really like to add Jest to CITGM, but the hard requirement on
npm
means that's a no-go (Jest uses yarn workspaces). I think I read somewhere that npm was going to add workspaces support, but seeing as I can't find a reference to it, I might have imagined it.This is a first go at adding support for Yarn as package manager instead of npm in CITGM.
While doing this I realized that #415 just covers adding it to
$PATH
, not necessarily using it (and that should probably still be done). I've already done the work here though, so why not open up a PR? 🙂 I've held off on adding tests as there's a chance this is rejected, though.2 times Jest has had failing tests on Node master, with one of them being caught before node 9 was released, and one making it into the release. See nodejs/node#16322 and nodejs/node#19607.
/cc @cpojer
Checklist
npm test
passes