GithubHelp home page GithubHelp logo

Not detecting shrinkwrap about patch-package HOT 9 CLOSED

ds300 avatar ds300 commented on June 2, 2024 1
Not detecting shrinkwrap

from patch-package.

Comments (9)

ds300 avatar ds300 commented on June 2, 2024 1

Ah I see. Sorry I was a bit distracted when I read your previous reply.

Yes, to support shrinkwrap we'd need to check whether the json file exists and then copy it to the temporary directory that is used for generating the 'clean' node modules. That happens in makePatch.ts. I have some free time tonight to take a look at it.

from patch-package.

ds300 avatar ds300 commented on June 2, 2024

patch-package doesn't support shrinkwrap at the moment. It shouldn't be difficult to add support, although it's not a priority for me. Happy to accept PRs though!

from patch-package.

ds300 avatar ds300 commented on June 2, 2024

I'm also happy to provide guidance for anyone wanting to give this a go. Probably the first places to look are makePatch.ts and detectPackageManager.ts. It might be best to treat npm shrinkwrap as a third package manager.

from patch-package.

rhys-e avatar rhys-e commented on June 2, 2024

Why does patch-package need to access the package-lock.json/npm-shrinkwrap.json at all? I kind of assumed it was only creating and applying diffs - not sure where the lock-file comes in?

from patch-package.

ds300 avatar ds300 commented on June 2, 2024

patch-package uses the lock files to build a 'clean' version of your node_modules folder when creating patches. I decided to err on the side of reproducible builds for safety.

from patch-package.

rhys-e avatar rhys-e commented on June 2, 2024

Is that not just a case then of checking for the existence of a package-lock.json and then doing an npm install? In which case, could you not just check for the existence of a package-lock.json or an npm-shrinkwrap.json and then do an npm install given that if they're present, they'll be used automatically by npm? Am I missing some subtlety?

from patch-package.

ds300 avatar ds300 commented on June 2, 2024

from patch-package.

rhys-e avatar rhys-e commented on June 2, 2024

from patch-package.

ds300 avatar ds300 commented on June 2, 2024

Just about to publish a fix for this. Feel free to reopen if you still have issues.

from patch-package.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.