Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isaacs/unit test config commands #1607

Closed
wants to merge 20 commits into from

Conversation

isaacs
Copy link
Contributor

@isaacs isaacs commented Aug 4, 2020

refactor and add unit tests for config commands

based on isaacs/remove-deps-no-longer-used

isaacs and others added 20 commits August 3, 2020 21:38
- handle previous npx options that are still possible to be handled, and
  print a warning if any deprecated/removed options are used.
- expand shorthands properly in npx command line.
- take existing npm options into account when determining placement of
  the -- argument.
- document changes from previous versions of npx.

PR-URL: #1596
Credit: @isaacs
Close: #1596
Reviewed-by: @ruyadorno
Update the matrix to have two Windows workflows: one running PowerShell
and one running bash.
PR-URL: #1583
Credit: @ethomson
Close: #1583
Reviewed-by: @isaacs
The `tap` package bundles `import-jsx`, which in turn bundles
`@babel/core` and a bunch of other stuff.

However, even though `@babel/core` is in the bundle, it's getting placed
in the tree at the root.  This is a mistake.

Because the node is placed, and not given the `extraneous` flag, in the
ideal tree building process, when reified, it goes ahead and puts it in
place.  When reading the actual tree, we see a valid hidden lockfile,
which contains the module, and it doens't have the extraneous flag.  So
everything seems fine.

Remove the hidden lockfile, and the problem presents itself.

Corrected here through some arduous and painstaking manual installs, so
at least we have the tree in the state it *should* be for now.  But this
is a bug in arborist that must be fixed asap.

Re: #1597
There's still a task pending to get it actually up to date with
non-conflicting peer deps and everything updated to remove deprecated
and outdated packages.  But at least it builds at all now.
Still pending test coverage for most of these, but wanted to give them a
clean sweep to get the "load-all-commands" tests passing.

The following changes are in here:

- All commands now have a `completion()` method and a usage string that
  uses the same `usage` util consistently.
- The `silent` argument to many commands has been removed.
- All commands use the `cmd = ${cmd}(args).then(() => cb()).catch(cb)`
  pattern consistently.

Full test coverage for all commands is still lacking, and will have to
be done prior to the GA v7 release.
Arrays of string literals are fine, and we're only using it in one place.
@isaacs isaacs force-pushed the release/v7.0.0-beta branch 2 times, most recently from 81f5a05 to 835c1aa Compare August 5, 2020 19:23
@darcyclarke darcyclarke added the Release 7.x work is associated with a specific npm 7 release label Sep 1, 2020
@darcyclarke darcyclarke added the semver:patch semver patch level for changes label Oct 1, 2020
@darcyclarke darcyclarke added the pr: needs tests requires tests before merging label Oct 6, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 18 milestone Oct 19, 2020
@ruyadorno
Copy link
Contributor

replaced by #2001

@ruyadorno ruyadorno closed this Oct 22, 2020
@nlf nlf deleted the isaacs/unit-test-config-commands branch March 28, 2022 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: needs tests requires tests before merging Release 7.x work is associated with a specific npm 7 release semver:patch semver patch level for changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants