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
Use Yarn for dependency management and running tasks #3226
Conversation
Travis CI settings: https://blog.travis-ci.com/2016-11-21-travis-ci-now-supports-yarn Using package.json file to specify build settings allows us to run task more easily from vscode -- just press Cmd+Shift+B to select a build task to run.
`cake` => `yarn cake` `cake test` => `yarn test` `cake build` => `yarn build`
I agree that the current build system is showing its age. However, is this PR really the direction to go? I'm on Debian, so -- on a fresh clone -- I'd like to just say...
That would be pretty easy to do and would work on Mac too, but probably wouldn't be very Windows friendly. |
I cannot say about whether this is "the" direction to go (as I am not a maintainer; just a user that wants to hack on this project and customize it for my own use), but I would say it is a step forward 😄. At the same time I try to make this PR fully backwards-compatible; it should have no impact for existing maintainers, but would improve the experience for new contributors. This is the proposed workflow in this PR:
There are 3 parts in this PR:
Here are my opinions:
It would be great to hear some more second opinions. 😃 |
Indeed. |
Thanks for proposing this. I'm keeping this in mind as we modernize the codebase. Soon the coffeescript dependency and associated cake tasks will be gone. Then, the only other packages required will be whatever we need for running tests. This might make yarn less added value. I'd love to retire cake for a Makefile, but I'm not sure that will happen. There's a decent hunk of logic in the cakefile related to test running and code coverage. |
The cakefile is now gone, as is the transpilation and autobuilding step as of #3459, so we now have very few dependencies and no build steps. As a result, we don't need to add something as capable as Note that I added a package.json as of 1f4f4e6, but I don't think we need this long term given how few dependencies we have, and I may remove it. |
This PR aims to modernize the build system a little bit, to make it easier for new contributors (me included) to hack on and contribute to this project. Goals:
What I did:
Instead of requiring users to install coffeescript globally (
npm install -g coffeescript
) they only have to runyarn
. This will:git submodule update
to pull inshoulda.js
(viapostinstall
script).cake build
(viaprepare
script).After this the project is immediately ready to be installed as a Chrome extension. It’s also ready to be tested (using
yarn test
) if the user have PhantomJS installed.The
cake
command is available asyarn cake
. (yarn
behaves somewhat likebundle exec
here, allowing developers to run locally-installed CLI apps.)Since the project now follows npm script conventions the Travis CI configuration has been simplified.
Relevant documentation has been updated (in CONTRIBUTING.md).
Added
.vscode/tasks.json
for better integration with VS Code. When opening the project in VS Code, pressing Cmd+Shift+B will launch theautobuild
task.Related: #3029.