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

chore: refactor commands #3959

Merged
merged 1 commit into from Nov 3, 2021
Merged

chore: refactor commands #3959

merged 1 commit into from Nov 3, 2021

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented Oct 28, 2021

This is the first phase of refactoring the internal structure of the npm
commands to set us up for future changes. This iteration changes the
function signature of exec for all the commands to be a async (no more
callbacks), and also groups all the commands into their own
subdirectory.

It also removes the Proxy npm.commands object, in favor of an
npm.cmd and npm.exec function that breaks up the two things that
proxy was doing. Namely, getting to the attributes of a given command
(npm.cmd now does this), and actually running the command npm.exec
does this.

@wraithgar
Copy link
Member Author

tests for npm.js and cli.js are not done, that's all that's left before review is ready.

@ghost
Copy link

ghost commented Oct 28, 2021

may i ask what is the difference between ./ and ../ in programming

@wraithgar wraithgar force-pushed the gar/refactor-commands branch 3 times, most recently from b021364 to ec6598a Compare November 2, 2021 17:46
@wraithgar wraithgar marked this pull request as ready for review November 2, 2021 17:47
@wraithgar wraithgar requested a review from a team as a code owner November 2, 2021 17:47
@darcyclarke darcyclarke added semver:patch semver patch level for changes Release 8.x work is associated with a specific npm 8 release labels Nov 2, 2021
test/lib/load-all-commands.js Outdated Show resolved Hide resolved
lib/commands/completion.js Show resolved Hide resolved
lib/commands/deprecate.js Show resolved Hide resolved
lib/npm.js Outdated Show resolved Hide resolved
lib/utils/npm-usage.js Show resolved Hide resolved
test/fixtures/sandbox.js Outdated Show resolved Hide resolved
lib/commands/help.js Show resolved Hide resolved
lib/commands/ll.js Show resolved Hide resolved
lib/commands/pkg.js Show resolved Hide resolved
test/lib/commands/completion.js Show resolved Hide resolved
This is the first phase of refactoring the internal structure of the npm
commands to set us up for future changes.  This iteration changes the
function signature of `exec` for all the commands to be a async (no more
callbacks), and also groups all the commands into their own
subdirectory.

It also removes the Proxy `npm.commands` object, in favor of an
`npm.cmd` and `npm.exec` function that breaks up the two things that
proxy was doing. Namely, getting to the attributes of a given command
(`npm.cmd` now does this), and actually running the command `npm.exec`
does this.

PR-URL: #3959
Credit: @wraithgar
Close: #3959
Reviewed-by: @lukekarrys
@wraithgar wraithgar merged commit 8ffeb71 into release-next Nov 3, 2021
@wraithgar wraithgar deleted the gar/refactor-commands branch November 3, 2021 21:04
@wraithgar wraithgar mentioned this pull request Nov 4, 2021
@DaliborTrampota
Copy link

may i ask what is the difference between ./ and ../ in programming

./ is current directory while ../ is the adjacent directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release 8.x work is associated with a specific npm 8 release semver:patch semver patch level for changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants