-
Notifications
You must be signed in to change notification settings - Fork 509
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
enforces that contributors use yarn not npm #439
Conversation
…ning when running yarn
…can do that with confidence now that we have a good yarn.lock file
Check this PR out @HoldYourWaffle & @WoH. I'm going to merge it so you guys can try out how it behaves. Note that you will have to either install yarn or upgrade it to the version specified in the |
Are you sure you want to enforce yarn instead of npm? Npm is a lot more widespread (and included with node.js), so I don't think it's contributor friendly to outright prohibit it. Yarn can cooperate with npm's By the way I locked the Typescript version because even minor (or sometimes even patch) versions can (and have done so in the past) break the compiler api. Even with a functioning lockfile this could lead to issues by careless updating. It's more an insurance than an actual solution for a problem though, so if you want to leave it unlocked that's totally fine by me. |
Yes. tsoa always did use yarn. That's what is run in CodeShip. The fact that a package-lock.json was committed was a mistake that should have been caught in a PR review. Now that I have a script in there that throw if one is found, we no longer have to worry about a developer making that mistake again.
If we're using yarn (which tsoa always has been), then we should use the file that yarn expects.
Unless I'm mistaken, I believe we will only have breaks in the compiler api if we go backwards. And the lockfile will ensure that that doesn't happen. As far as moving forward, tsoa should continue to use the latest typescript so that we're not out of sync with what our users are getting with VSCode (which automatically upgrades TypeScript). |
I disagree with your "hard logic" (English is not my first language...) here. Although yarn doesn't specifically "expect"
I have unfortunately seen it break even when moving forward :( Again if you want to leave it unlocked that's perfectly fine by me, it's just a suggestion on my end. |
The project uses yarn and it should make sure the issues we both noticed do not impact anyone else? I don't see how that's really banning. It's like the linting, in order to make sure the code is consistent, you need to make decisions that every person working on it may not always agree on. I don't think you'd say linter rules are a ban even if they equally are. |
I don't see how enforcing a certain "visual style" for the code is the same as "you have to use this specific piece of software, that does exactly the same as the one you're familiar with (and is probably already installed on your system) for no reason other than a little warning for those that use our choice". The issues we experienced shouldn't happen anymore because |
-> you have to use this specific type of code format, that does exactly the same as the one you're familiar with (and is probably already what you understand more easily) for no reason other than a little warning for those that use our choice. |
Yes, thank you @WoH. I did not take this decision lightly. I did it for one pragmatic reason: I have no ability to modify the CodeShip configuration since that is owned by Luke (who I am purposely not tagging). I've already asked him to give me access to modify the CodeShip build steps. But since I can not do that yet, we are have no choice but to use yarn.
You're making an assumption that yarn works perfectly fine. I would wager that the majority of yarn's automated unit tests verify their interoperability with their first party item (yarn.lock). As the primary maintainer of this library and the npm module, I take a lot of responsibility with ensuring quality of the product. For me, I rest easier at night using yarn in it's intended manner. If I'm reading an instruction manual and it says, "Please only use the authorized batteries" then I do not put batteries off of ebay into the device. Some are comfortable with that-- I am not.
Benefits of yarn:
|
This will be the true fix to #438 which recognized that some contributors were getting different errors based on if they were using
package-lock.json
oryarn.lock
. This is what was changed:package-lock.json
was removed and if it comes back thenensureYarn.js
will throw and fail the tests (and the commit thanks to Husky)package.json
now enforces a specific version of yarn