54 Commits

Author SHA1 Message Date
Nate Fischer
964fb48e9e test: check for README changes in the unit tests
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
2025-11-18 22:25:05 -08:00
Nate Fischer
75d26de5b3 fix: cmd is compatible with node 22.10
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
2025-04-10 01:26:54 -07:00
Nate Fischer
697bcf67d9 refactor: allow es6 language features
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.
2025-04-08 00:34:54 -07:00
Nate Fischer
fca5f1b74d refactor: rewrite gendocs script without commands.js
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
2025-02-20 01:49:29 -08:00
Nate Fischer
519308489c refactor: move exec-child logic into main function
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.
2025-02-20 00:32:19 -08:00
Nate Fischer
7e71b2686d chore: drop support for old node versions
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
2025-02-17 22:31:10 -08:00
Nate Fischer
9e51217484 chore: switch to testing LTS releases only
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.
2025-02-16 11:04:39 -08:00
Nate Fischer
81ed1226d2 chore: pin node v22.9.0
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.
2025-02-16 10:20:37 -08:00
Nate Fischer
8a960da838 chore(dependencies): update js-yaml
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).
2024-06-23 12:42:52 -07:00
Nate Fischer
3529d5095f chore: remove unsupported node configs from CI
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
2024-06-01 12:19:27 -07:00
Nate Fischer
547a739d61 chore: update CI to test against node v20
No change to logic. This updates GitHub actions CI to test on node v19
and v20.
2023-07-07 15:41:31 -07:00
Nate Fischer
a3a7e7496d chore: update CI to include v18
No change to logic. This updates GitHub actions to test up through node
v18.
2022-08-09 21:49:21 -07:00
Nate Fischer
d0a45166fd
chore: set up GitHub Actions CI (#1055) 2021-11-29 23:34:38 -08:00
Nate Fischer
54049d49d8
chore: change supported node versions (#1011)
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
2020-10-26 16:44:47 -07:00
Nate Fischer
aed6d994b5
chore: support up to node v13 (#978)
No change to logic. This just adds Travis and appveyor test support for
up to node v13. No change to the minimum supported version.
2019-11-13 22:35:03 -08:00
Nate Fischer
57df38c6ea
chore(lint): update lint dependencies (#948)
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
2019-07-12 12:36:55 -07:00
Nate Fischer
355287e2ff
chore(node): add v10 and v11 to CI (#921)
This adds support for v10 and v11, and removes a TODO.
2018-12-03 00:20:38 -08:00
Nate Fischer
3bb72eda8b
chore(node): drop node v4 and v5 (#917)
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
2018-12-01 20:23:46 -08:00
Nate Fischer
06450b8070
chore: script to bump supported node versions (#913)
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
2018-12-01 19:21:45 -08:00
Nate Fischer
87c1ff7d4c
chore(npm): remove lockfile (#911)
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
2018-11-29 22:55:45 -08:00
Nate Fischer
37acb86e89
chore(npm): add ci-or-install script (#896)
* 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
2018-10-27 13:48:31 -07:00
Nate Fischer
2d0428b1c9 Switch commands.json -> commands.js (#668)
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
2017-02-28 01:34:51 -08:00
Brandon Freitag
7fa4b995bf Finalize moving to ava (#630)
* Move ava-test/ directory to test/

* Remove unnecessary run-tests.js script

* Run only ava during npm test script
2016-12-20 11:27:02 -08:00
Nate Fischer
1548b3da00 refactor: list all commands in commands.json (#616)
* 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
2016-12-14 17:57:11 -08:00
Nate Fischer
2395214fee chore: switch to eslint (#504)
* chore: switch to eslint

* fix: works on older versions of NodeJS now

* chore: fix curly braces

* chore: fix indents and remove jshint references
2016-08-07 12:16:29 -07:00
Nate Fischer
fbe7458ad2 chore: switch to shelljs-changelog (#460) 2016-06-17 11:22:38 -07:00
Nate Fischer
2e87f14c07 chore: update jshint and move it to an npm script (#454) 2016-06-07 16:57:42 -07:00
Levi Thomason
87aaefa498 chore: setup changelog (#443)
* chore(changelog): add scripts

* docs(release): update release docs

* chore(editorconfig): add config

* docs(changelog): updated by levithomason
2016-05-16 21:03:26 -07:00
Nate Fischer
57a9be2693 docs: comment code better to help contributors 2016-05-12 07:40:18 -07:00
Nate Fischer
50f72b0c3d chore: add "Team" section to README (#423) 2016-04-13 08:48:05 -07:00
Nate Fischer
db20acebfb Switch to process.execPath over 'node' 2016-03-10 17:06:32 -08:00
Nate Fischer
6ebc2d3db7 refactor(shellstring): return consistent objects
- fix(string): no longer overrides string prototype
 - exec() now returns a ShellString object
2016-02-19 14:54:30 -08:00
Nate Fischer
ddff4692fd fix(gen-docs): fix issue where docs are generated wrong
This fixes an issue where the gen-docs script's sed() command would improperly
update the docs. Travis now checks that docs are generated properly.
2016-01-25 00:20:36 -08:00
Nate Fischer
900384bda8 Now runs jshint on the src/ folder. This fixes the pre-existing lint issues 2016-01-19 00:25:21 -08:00
Nate Fischer
03c30c6a1f fix: jshint works on Windows
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.
2016-01-18 21:36:41 -08:00
Artur Adib
21f721cb45 more stringent jshint; catch leaks/undefs 2013-09-21 10:12:28 -04:00
Artur Adib
561b1ea99c factoring docs, sed.js fix 2013-08-25 18:09:31 -04:00
Artur
ffb1e9acc5 fix JSHint problem 2013-03-20 10:52:04 -04:00
Artur Adib
b020cd4d7a clean up for PR #47 2012-12-31 13:47:33 -05:00
Artur Adib
a9a03b3f4e Merge pull request #47 from mstade/pushd-popd-dirs
Work in progress: pushd/popd/dirs
2012-12-31 10:40:06 -08:00
Marcus Stade
829bdbc785 Improved tests and implementation.
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.
2012-12-29 03:43:23 +01:00
Artur Adib
ac24ccaf1a minor 2012-12-27 16:44:11 -05:00
Artur Adib
ef795af7e4 adding jshint to tests; all tests pass 2012-12-27 16:32:31 -05:00
Artur Adib
e4d9dabe52 introducing config.silent, config.fatal
deprecates silent()
2012-12-01 09:48:23 -05:00
Artur Adib
99b9b759fa closes #31 2012-09-28 15:45:34 -04:00
Artur Adib
11f340cd0c update README 2012-09-06 08:18:52 -04:00
Artur Adib
88292eacf8 ls() and find() return arrays 2012-03-22 10:12:16 -04:00
Artur Adib
2e69be3c0c minor doc fix 2012-03-14 17:27:47 -04:00
Artur Adib
083445440d minor 2012-03-03 10:34:19 -05:00
Artur Adib
d93c4d1022 make.js 2012-03-02 15:11:40 -05:00