No change to logic. This checks for stale README in the unit tests
instead of by calling 'gendocs' directly.
The main goal is for GitHub CI to stop getting tripped up by
package-lock.json formatting changes. `npm install` sometimes overwrites
the package-lock file with a new format, and this breaks the
after-travis step.
Test: node_modules/.bin/ava test/docs.js
Starting in node >= 22.10.0, a commandNotFound error will have
`undefined` values for stdout/stderr, whereas in earlier versions these
values were `null`.
Fixes#1180
This configures the eslint config to allow ES6 features. This fixes some
lint errors caught in the new config, but this mostly suppresses new
warnings.
The gendocs script no longer depends on commands.js. This now works by
iterating over source files and parsing them directly.
Partially related to issue #1160 and #1172.
Test: npm run gendocs
No change to logic. This refactors the exec-child.js script to move all
of its main logic into a main() function. This function is only invoked
if the script is executed, not when it is imported.
Importing the script is now a NOOP instead of throwing an exception.
It's still not advisable to import the script, however this can be done
if absolutely necessary to trick JavaScript bundlers which try to prune
non-imported code files.
Partially related to issue #1160 and #1172.
Dropping support for everything before node v18, which is the current
maintenance LTS and also the version in Ubuntu 24.04 LTS.
This also updates all devDependencies while trying to minimize the
required source code changes. Some devDependencies can go higher still
(ava, chalk), but this is going to require extensive refactoring.
Test: npm run test-with-coverage
Test: npm run lint
Test: npm run check-node-support
No change to official support. We will still accept patches for non-LTS
versions when it's reasonable to support them, especially for the most
recent Node release (whether that is odd-numbered or even-numbered).
This just lightens up the workload on CI because most of our users are
probably running node LTS.
There's a bug when running on node v22.10. This temporarily pins 22 to
22.9.0 to workaround the problem and keep tests passing on CI.
Mitigation for issue #1180.
This updates js-yaml to 4.1.0 and swaps out `yaml.safeLoad()` for
`yaml.load()` because the `safe*` functions are deprecated starting in
4.0.0 (the "regular" functions are considered safe).
No change to logic. GitHub Actions recently dropped some NodeJS configurations from their service. This excludes those configs from our CI.
This also adds Node versions up through v22.
Test: npm run check-node-support
This adds testing for node v14. This removes testing for node v6 and v7
because codecov breaks on these versions. This omits node v15 because
appveyor doesn't seem to support this version. The nodejs org currently
supports [10, 12, 14, 15].
This makes a couple minor edits to the check-node-support script for
consistency with shelljs/shx#186.
This bumps the shx dependency because it seems we're hitting issue #973
on node v14.
Test: npm run check-node-support
This updates `eslint-config-airbnb-base` and `eslint-plugin-import`.
This also addresses lint errors these updates raise, and excludes
several rules.
This also adds a minor simplification to the gendocs script.
Test: npm run lint
Test: npm run gendocs
This drops support for node v4 and v5. Neither is currently supported by
the Node.js team, nor by the `npm` CLI team, so it's hard to justify we
continue to support it.
The new minimum supported version is v6.
Fixes#873
No change to node support, this just adds a script.
This adds a script to check that we correctly configure all supported
node versions, since we need to update quite a few spots (README.md,
package.json, travis, appveyor).
Issue #873
Test: manual
This removes our lockfile and our `ci-or-install` script. The lockfile
caused headaches, since `npm install` would modify the lockfile.
Unfortunately, `ci-or-install` (added in #896) didn't work reliably on
appveyor, so removing the lockfile seems easier. We remove the script
since it's now obsolete.
Fixes#893
* 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.