Git Product home page Git Product logo

Comments (4)

waynebeaton avatar waynebeaton commented on July 25, 2024

The current implementation is something of a quick-and-dirty just-what-we-need convenience hack. Extending it to support multiple versions shouldn't be too hard (so we should do it), but I'm concerned that there may be some subtlety in parsing the file that we're missing.

It would be better to have npm do the parsing for us (even is only as a backup for cases where the hypothetical subtlety that I'm concerned about bites us).

AFAICT, the npm-ls command is the magic that gives us the dependency list, but I don't see a configuration that generates a simple flat file. The parseable option, even when combined with the long option doesn't seem to give us something that is any more workable than just the straight hierarchy list.

AFAICT, the simplest get-npm-to-do-it solution is this:

npm ls --all | grep -Poh "[\w\-\/]+@\d+(?:\.\d+){2}" | sort | uniq

and then pipe the result into the tool.

Do you have any further insight @ffendt ?

Can you provide me a link to the package-lock.json file for your project so that I can test with it?

from dash-licenses.

waynebeaton avatar waynebeaton commented on July 25, 2024

I've been looking a bit harder at the file format.

There's a "dev" option; when this is set to true, the library is required only at development time (i.e., it is specifically not required at runtime). I'm thinking that we can (at least optionally) skip these, or try to otherwise use the feature to identify "works with" dependencies.

from dash-licenses.

waynebeaton avatar waynebeaton commented on July 25, 2024

Rudimentary support for v2 has been added with 448b95b

from dash-licenses.

ffendt avatar ffendt commented on July 25, 2024

Thanks a lot for the work you've already put into this. Sadly I don't have further insights as I just stumbled upon this. Afaik, the dev option also was there for files in v1 format.

In our CI we're splitting the existing package-lock.json files at the dev option and run the dash-licenses tool once for the lockfile with only prod dependencies and once for the lockfile with only dev dependencies. You can find one of the bigger lockfiles we're running on in ditto-clients/javascript/lib/node/package-lock.json. (Side note: Sadly ClearlyDefined also times out sometimes for this amount of packages).

I'd really like to test your enhancements, but I'm not sure when I'll get to this as the next two weeks are already quite packed.

from dash-licenses.

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.