Questions about contributions to Select2

Is there a single command to build and test Select2 during development, and using the correct version of Grunt (not whatever I happen to install globally)? (I made such a script locally and wish to submit a pull request if it’s not redundant.)

Also, the contribution guidelines dictate that we should not submit changes to the dist directory. Are such changes made on a CI server at specific times?

So, typically we will compile Select2 (which includes building dist/ and generating minified versions) any time a PR is merged. You will still need to compile dist/ when developing locally, because the test framework relies on these compiled files.

So, just be sure to reset any changes to dist/ before submitting your PR. There is an open issue about running tests directly from src/ to avoid needing to build dist/ during development - see https://github.com/select2/select2/issues/4648.

As for building Select2, just run grunt compile and grunt minify. You may need to run the tests in your browser instead of the command line. The CLI test runner uses PhantomJS, which appears to be quite outdated at this point (and actually gives me an error!)

Thanks!

PhantomJS works on my machine (using dependencies specified in package.json).

If you’re interested, I submitted an MR adding scripts that I personally find helpful (https://github.com/select2/select2/pull/5118).