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

Update your repo #1

Open
wants to merge 2,412 commits into
base: latest
Choose a base branch
from
Open

Update your repo #1

wants to merge 2,412 commits into from

Conversation

hello-smile6
Copy link

idk

lukekarrys and others added 14 commits May 2, 2024 09:50
This also refactors auth and prompt related files to use
promises and new npm-profile behavior
If the package specification does not match any
existing version, a warning message is added to the log.

## References

Ref #7472
Closes #7180
This PR refactors `exit-handler.js` to be a class so that it can more
easily track its internal state. It uses this state to now fully
distinguish between 3 states: npm never being set, npm not loaded, and
exit handler never called. There are some new error messages shown via
console.error if we know we are in an unexpected state.

This also continues the refactoring started in #7415 to separate
concerns between `npm` and `CLI`. Identifying the error message and
logging it have been move to `npm` but catching that error and setting
the `process.exitCode` are still handled in `exit-handler.js` and
`cli/entry.js`.

It also moves `command.cmdExec` to `npm` since it never called from
within any `command` instance. This lets `npm` only ever call
`command.exec` or `command.workspaceExec` now.
This has the effect of adding licenses back into the lockfiles.
Based on code in shrinkwrap.js and inventory.js, it appears that
lockfiles are supposed to store the license. It's likely that in
practice this behavior has not been consistent due to fetching
of minifed manifests and packuments.

I also attempted to remove the license code from shrinkwrap but
that caused many more tests to break. Plus I believe this is the
intended behavior, to have licenses in lockfiles based on bug
reports like #7384
reggi and others added 30 commits October 14, 2024 12:42
BREAKING CHANGE: @npmcli/docs now supports node `^20.17.0 || >=22.9.0`
…>=22.9.0`

BREAKING CHANGE: @npmcli/smoke-tests now supports node `^20.17.0 || >=22.9.0`
… >=22.9.0`

BREAKING CHANGE: @npmcli/mock-globals now supports node `^20.17.0 || >=22.9.0`
…| >=22.9.0`

BREAKING CHANGE: @npmcli/mock-registry now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmversion now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmteam now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmsearch now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmpublish now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmpack now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmorg now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmhook now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmfund now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmexec now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmdiff now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: libnpmaccess now supports node `^20.17.0 || >=22.9.0`
…9.0`

BREAKING CHANGE: @npmcli/config now supports node `^20.17.0 || >=22.9.0`
…2.9.0`

BREAKING CHANGE: @npmcli/arborist now supports node `^20.17.0 || >=22.9.0`
BREAKING CHANGE: npm now supports node `^20.17.0 || >=22.9.0`
Passing arborist constructor to pacote.manifest call because internally
when fetching git deps DirFetcher requires Arborist constructor from
GitFetcher
https://github.com/npm/pacote/blob/main/CHANGELOG.md#1400-pre3-2022-09-28

- [x] Trying to add some tests 

Fixes: #6723
adds a DEPENDENCIES.json for programatic use
BREAKING CHANGE: Attestations made by this package will no longer validate in npm versions prior to 10.6.0

Signed-off-by: Brian DeHamer <bdehamer@github.com>
Signed-off-by: Brian DeHamer <bdehamer@github.com>
BREAKING CHANGE: The `npm hook` command has been removed
BREAKING CHANGE: npm will no longer switch to global mode if aliased to
"npmg" or "npm-g" etc.

[This
code](03bd669)
is a remnant from when npm defined `bin` entries for itself that
included `npm_g` and `npm-g`.

npm no longer defines these, and this code should have been removed when
those entries were removed. To utilize this today one would have to
manually alias npm themselves.

What this code does today in practice is make local development very
tricky, because if you (like me) use git worktrees, and have a worktree
directory that ends in "g", npm will be in global mode when you invoke
it as `node .`. This is very "magical" behavior and not at all
intuitive.

It's best if this just goes away. `npm -g` is explicit and does not
require npm trying to guess if you really wanted to be in global mode or
not.
<!-- What / Why -->
<!-- Describe the request in detail. What it does and why it's being
changed. -->

See #7854 for the why and more details.

I changed the unwrap logic so that it only runs when the result contains
one entry and the amount of arguments is one. Otherwise, when multiple
arguments are provided the unwrap results in an undefined. Additionally,
I think it makes sense to skip the unwrap logic when the result contains
one entry and pkg has multiple arguments because you would expect an
object.

In the existing comment above the if-statement, it is mentioned the CLI
should not unwrap at all. I chose not to do this because it is not clear
to me if this is a final decision and has a large impact. However, if it
is the desired direction, I am happy to do the work.

## References
Fixes #7854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.