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

Create a new pull request by comparing changes across two branches #119

Merged
merged 13 commits into from
Jul 2, 2024

Conversation

GulajavaMinistudio
Copy link
Owner

No description provided.

MikeMcC399 and others added 13 commits June 27, 2024 07:06
- closes #7614

## Issue

Examples in the
[repository](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#repository)
section of the [npm CI > Configuring npm >
package.json](https://docs.npmjs.com/cli/v10/configuring-npm/package-json)
reference page use the protocol `https`. The examples are:

```json
"url": "https://github.com/npm/cli.git"
```
```json
"url": "https://github.com/facebook/react.git"
```

Executing `npm pkg fix` in a repo with a `url` definition and `protocol`
using `https` normalizes the protocol to `git+https`.

Examples should be aligned with what `npm pkg fix` considers correct and
should also be aligned to the list of valid protocols in the [Git URLs
as
Dependencies](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#git-urls-as-dependencies)
section, which states:

> `<protocol>` is one of `git`, `git+ssh`, `git+http`, `git+https`, or
`git+file`.

## Change

1. `npm/cli.git`
    Change to
    ```json
    "url": "git+https://github.com/npm/cli.git"
    ```
2. `facebook/react.git`
Since the source example of
https://github.com/facebook/react/blob/main/packages/react-dom/package.json
does not use the correct `git+https` protocol, use instead
    ```json
    "url": "git+https://github.com/npm/cli.git",
    "directory": "workspaces/libnpmpublish"
    ```
…7602)

When metadata is committed for the first time when there is no
package-lock, when target node has the same name field value as target
package name and link node also share the same name field, name field is
omitted from lock file, in subsequent times when there is already a lock
file, it reads target node with name field derived from realpath value
of the node and included in lock file. this creates mismatch of lock
file between installs.

This PR adds additional condition to check if name derived from realpath
is the same name as package and adds the name property.

Fixes: #7166
It has historically not worked very consistently and we don't have the
bandwidth to keep fixing it.
…#7579)

<!-- What / Why -->
If a node represents a symbolic link or a file dep (node.isLink is
true), its target is expected to reference another node in the
dependency tree. If the linking is not done correctly or is incomplete,
node.target might be null.
<!-- Describe the request in detail. What it does and why it's being
changed. -->
in this PR, a null check is added to ensure node.target is not null or
before proceeding, which will prevent causing errors like:
`npm error Cannot set properties of null (setting 'peer')` 

## References
  Related to #7065, 
  Fixes #6622, #5007,
  Closes #6622, #5007
@GulajavaMinistudio GulajavaMinistudio merged commit 441f31c into GulajavaMinistudio:latest Jul 2, 2024
12 checks passed
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.

7 participants