Skip to content
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

fix(husky): stdin is not a tty in git bash #766

Merged
merged 4 commits into from Apr 15, 2021
Merged

Conversation

clarkdo
Copy link
Member

@clarkdo clarkdo commented Apr 2, 2021

@clarkdo clarkdo requested review from a team and danielroe and removed request for a team April 2, 2021 09:29
@clarkdo clarkdo merged commit 807546d into master Apr 15, 2021
@clarkdo clarkdo deleted the fix/husky-windows branch April 15, 2021 18:58
@scscgit
Copy link
Contributor

scscgit commented Jul 15, 2021

Isn't this only relevant for Yarn? The code is generated even if the user has selected Npm.

Also what's the purpose of isWindows === true, does it mean that if the user who generated a project used Linux, then nobody who uses Windows will be able to clone and use it? Is it really a good idea to make this implicit?

@clarkdo
Copy link
Member Author

clarkdo commented Jul 15, 2021

Fair point, pr is always welcome or I’ll make a fix within this week.

scscgit added a commit to scscgit/create-nuxt-app that referenced this pull request Jul 15, 2021
Git Bash workaround for using tty, which is officially recommended by
husky in their documentation, is only relevant for yarn, not for npm.
Removed isWindows condition make sure projects made by Linux devs are
fully accessible to Windows users. Updated husky in a parent project.
scscgit added a commit to scscgit/create-nuxt-app that referenced this pull request Jul 15, 2021
Git Bash workaround for using tty, which is officially recommended by
husky in their documentation, is only relevant for yarn, not for npm.
Removed isWindows condition make sure projects made by Linux devs are
fully accessible to Windows users. Updated husky in a parent project.
Added --no-install to npx to avoid accidental installation by default
if a project uses different than latest version, but isn't installed.
@scscgit
Copy link
Contributor

scscgit commented Jul 15, 2021

PR sent. I was considering whether it'd be better to keep an empty common.sh for any future use when npm is selected, but as this is a workaround created by husky it'd be most likely redundant, so I just removed it. I also included one suggestion of an improvement based on zkat/npx#220.

I wasn't really used to the codebase of this generator, so I hope I tested it correctly. By the way, is there any contributor guide to this project? New users currently have to figure out how to run the project by running cac as .js via node, which most likely requires bootstrapping lerna, and also to assume what's supposed to be covered by the snapshot tests, considering that this husky change seems to have passed all the tests which should fail. I most likely plan to make some other PR in a near future, as there's plenty of things that new Nuxt users still must figure out by themselves, so having any officially maintained contributors guide available would be helpful to avoid having to waste a few days researching it from scratch by trial & error :)

@clarkdo
Copy link
Member Author

clarkdo commented Jul 15, 2021

Thanks for the pr.

Regarding contributor guide, we’ll add to this repo shortly.

@scscgit
Copy link
Contributor

scscgit commented Jul 17, 2021

[Off-topic] Not related to PR, but regarding the contributor guide, I'll just mention that the SAO will most likely need some explicit guidelines and workarounds in addition to their official docs, as it seems it lacks basic things like file copy and doesn't support EJS features. Here is my today's experience: saojs/sao#176. (And I guess escaping quotes of constants via ESL in package.js isn't straightforward either. Maybe the package.js could be excluded from the translation, as it's removed from template anyway? Or the EJS-Lint could be integrated? And the refusal of ESL accepting <%=_ PR keeps raising the learning curve...) Plus there are no hints whether we should rebase our PRs each time test snapshots cause a conflict, or if the CI handles it for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants