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

Git dependency is getting overwritten #5

Closed
pineapplehunter opened this issue Sep 19, 2024 · 5 comments
Closed

Git dependency is getting overwritten #5

pineapplehunter opened this issue Sep 19, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@pineapplehunter
Copy link
Contributor

I was using this to package super-productivity in nixpkgs NixOS/nixpkgs#334933, and found that one of the git dependencies got overwritten and could not be resolved during the npm config phase.

Since the git dependency already had resolved field, I patched npm-lockfile-fix to only check for packages without a resolved filled. I don't know if this is the correct fix, but it seems to work for me.

The dependency: "jira2md": "git+https://github.com/johannesjo/J2M.git"
The lockfile:

    "node_modules/jira2md": {
      "version": "2.0.3",
      "resolved": "git+ssh://git@github.com/johannesjo/J2M.git#d6e0211c6e6c4c1f09283faec3d0efdaed3a4caa",
      "dev": true,
      "dependencies": {
        "marked": "^0.6.2"
      }
    },

After using npm-lockfile-fix:

    "node_modules/jira2md": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/jira2md/-/jira2md-2.0.3.tgz",
      "dev": true,
      "dependencies": {
        "marked": "^0.6.2"
      },
      "integrity": "sha512-DbtL03W+Np0nRIMEChBJmViZ+bNCofCTz562GPt4oPzCpWa5j8anR5vu5e/20DqW75Zz0JdJ06Tns3YSQpftiQ=="
    },
@jeslie0
Copy link
Owner

jeslie0 commented Sep 19, 2024

Thank you for submitting this issue! I should have some more free time over the weekend, and will try and review it then.

@jeslie0
Copy link
Owner

jeslie0 commented Sep 25, 2024

Okay, I think I am happy to add this functionality into the script, but I don't think it should be on by default. My opinion is that it should be turned on by a flag, specified as a command line argument. How does that sound to you?

@pineapplehunter
Copy link
Contributor Author

I agree with enabling the feature by flag.
It may help to print out a message saying this flag may help if there are any git dependencies since it was hard to debug the issue.

jeslie0 added a commit that referenced this issue Oct 8, 2024
This commit also addresses Issue #5 and adds the ability to not
modify packages with a resolved field.
@jeslie0
Copy link
Owner

jeslie0 commented Oct 8, 2024

I have added a command line interface to the program now, and you can find it on the develop branch. You should just give the -r flag for it to work. If you are happy with it works, then I we can close this issue.

@jeslie0 jeslie0 self-assigned this Oct 8, 2024
@jeslie0 jeslie0 added the enhancement New feature or request label Oct 8, 2024
@pineapplehunter
Copy link
Contributor Author

I tried it out with the -r flag and it seems to work!
Thanks!

@jeslie0 jeslie0 closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants