* chore(npm): add ci-or-install script
This adds a script which checks the npm version and runs either `npm ci`
or `npm install` based on support. This is primarily to work around an
issue where `npm install` modifies `package-lock.json` for newer npm
versions.
A side benefit is that `npm ci` is slightly faster than `npm install`.
Fixes#893
WebPack has issues with importing JSON directly and using JavaScript
methods on it. For this reason, using the `.forEach()` method on the
imported JSON array caused a method-not-found error.
Instead, we can make this a real JavaScript array by keeping it in a
JavaScript file and exporting it as a field.
It should be noted that exporting it as `exports = [...]` does not work,
because Node won't actually interpret it as a JavaScript array (with
the required methods). So instead we can export it as
`exports.list = [...]` and access the `list` field to get the real
JavaScript array of command names.
Fixes#667
* refactor: list all commands in commands.json
This also changes the order of commands in the docs, due to how I changed
the doc-generating script.
* fix lint error and alphabetize command list
run-tests.js previously relied on shell wildcard expansion, and did not specify
full paths. This uses common.expand to handle globbing internally, and specifies
the full path, so jshint can find all the files.
Plenty of errors surfaced with better test coverage. Aside from fixing
the broken implementations, this also prompted me to fully implement
the dirs command.
Also changed the run-tests script to always set cwd to the test folder,
so that tests that change cwd don't affect others (ehum, that'd be
mine.)
More tests to follow.