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 adds an initial implementation of shell.cmd(), which is intended as
the eventual replacement for shell.exec(). This PR does not fully
implement the API, but demonstrates a simple and secure alternative, and
will allow further iteration to cover other use cases in follow-up PRs.
Design doc: https://shelljs.page.link/cmd-design
Issue #495
Test: automated test suite
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 upgrades eslint to a new version to resolve a security warning.
This fixes a couple new lint errors, and disables some lint checks.
The current version of the airbnb lint config triggers
DeprecationWarnings in the new version of eslint. These warnings will be
resolved in a follow-up.
Test: npm run lint
NYC takes forever on my local machine, and I generally prefer to look at
coverage reports on the website anyway.
This changes `npm test` to run without coverage, and changes our CI to
run `npm run test-with-coverage` instead.
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
No change to logic.
This reduces install spam by bumping codecov to avoid depending on a
deprecated graceful-fs version, as well as adding a package-lock.json.
This bumps the version of our dependency, shelljs-release. I just cut
the 3.0 release for shelljs-release, which contains support for the
`--otp` flag, as well as the significant refactoring work we put in.
This sets 2 AVA options:
* `serial`: same behavior as the CLI flag, which this replaces
* `powerAssert`: if an assert fails, it will inspect all objects involved in
the failed assert. This causes readability issues if `t.falsy(shell.error())`
breaks, since it inspects all of `shell` (which is way too large).
AVA options are a little easier to manage than CLI options (we only update one
place instead of 2 in `package.json`).
This updates tests for `AVA` 19.0.0+.
`AVA` 0.18.0 has a breaking change which changes the current working directory
for tests. As a result, we need to change 'resources' -> 'test/resources' (and
similar path changes).
`AVA` 0.19.0 has a breaking change that all tests must run at least one assert.
This breaking change was already resolved by #746, so no change was necessary in
this PR.
This updates to `AVA` 0.21.0, since there are no other breaking changes.
This adds `skipOnWin` and `skipOnUnix` to help us manage our platform-dependent
tests. These methods give a nice warning message when we skip tests. We may also
consider adding warnings when running platform-dependent tests.
Part of the motivation for this is if we ever update to AVA v0.19. This version
requires at least one assertion per test case. While this could be disabled with
an AVA setting, we instead benefit from warnings for any case when we
unintentionally skip assertions.
This adds chalk as a dev dependency to enable colored messages.
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
Prefer the `files` attribute over `.npmignore` to minimize the bytes users
download when installing ShellJS. This cuts the size down from ~1.8M to ~1.2M.
* test: set up ava and move cd.js
Set up ava as the new test framework. Migrate the tests for the cd command to
use the ava framework.
* refactor: reorder imports, remove useless dep
* Get pipe tests running on Windows.
I used the FIND command which ships with Windows as something to
pass data through.
The test checks that a POSIX-like find(1) exists and skips the tests
if this condition is true because Windows-provided FIND is incompatible
with find(1).
* Remove obvious comments.
Requested by @nfischer. I removed both the unix-specific and Windows
specific comments because I figure they both fall under being too
obvious based on being in the process.platform conditional.
* Make FIND usage cleaner and document it.
* Use shx grep to make pipe tests portable.
Discussed in #550. To test piping and its interaction with
real processes, a shellout is necessary. But on Windows,
you cannot rely on utilities like grep(1) being around.
Using shx, we can write portable code. Otherwise, the
tests have to be conditional on the platform and be
way more complicated.