-
Notifications
You must be signed in to change notification settings - Fork 9
Linting: Ensure the validateLinks.js script is built #227
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
Linting: Ensure the validateLinks.js script is built #227
Conversation
shpomp
left a comment
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.
⭐
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.
I think it's a great idea to make this less of a confusing issue for new contributors, especially.
I'm thinking though, rather than coupling/duplicating the build command to this script, instead we do the same check but print a more useful error instead, like "It looks like you haven't built the project yet. Try running npm install and npm run build and try again."
That way, the build command isn't defined in more than one place, but it still helps resolve the issue more transparently. What do you think?
|
-- sorry for the wall of text -- I initially didn't check the I thought it was building more than just the I've added a new commit that changes this and outputs a message:
However, It's still coupled to the build script, but:
A longer term downside can be:
What are your thoughts? I personally think the benefits outweigh the negatives, but I'm also open to changing this to just output message and the note in the contributors README.md |
|
Ah right, yeah this is also a good suggestion to use the build command directly :D I think this is useful change, and is hardly a big commitment, so let's do it! Thanks for explaining your thought processes so transparently - it's really nice with the contributions 🙌 |
Linting currently depends on multiple tasks:
validate-links(): A JS script that needs to be built in thesupport/distdirectory before being able to run./lintlocallyThis means, if
./lintis run before building the program, it fails due to a missing script, and contributors upon a clean install, would have to build the program at least once (npm run build) to be able to run./lintOtherwise, they'd get this error:
Error: Cannot find module '.../hyf/program/support/dist/validateLinks.js'This PR fixes that:
This change ensures the
supportproject is built with the local version oftscbefore running the linter. Only if it doesn't exist already.