-
Notifications
You must be signed in to change notification settings - Fork 14
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
Incoming: Arborist #64
Comments
Would you be open to a PR that changes this to use Arborist instead of using |
@isaacs I've been strongly considering rewriting Licensee as a new package, dropping old Node support, using Arborist, offering substantial additional functionality, and charging for closed and commercial use. The code would remain public. I'm sure I'd run CI. I've probably spent more time on all sides of licensing in npm than most anyone I know, but it's not exactly fun (or risk free) coding package metadata corrections, staying on top of SPDX upstream, writing generators to spit out due diligence tables, and so on. Especially after doing it for years. If Arborist fells ready, I can put this on my weekend list. |
Yeah, it's definitely close. We'll probably have a v7 beta in a few weeks. I'd set the dependency to I'm happy to help with all the tree handling stuff, but I'm not eager to wade into the actual license logic :) |
FYI it looks like Arborist is stable now, and read-package-tree says:
One small reason it would be nice to update:
Since |
@jsha thanks for the heads-up. I still think that Licensee should get in line with npm CLI on Arborist. Any personal interest here? I'd certainly welcome a PR. I'll get to it eventually, but can't say when. PS: Three cheers for Let's Encrypt! I've more than a few LE certs myself. |
I'm pretty rusty on the Node ecosystem lately - I noticed the issue because I just installed npm for the first time in a while and wanted to look at its dependencies. So the migration is probably more than I can handle right now, but who knows!
Aw, thanks! That's always lovely to hear. |
Poking around with Arborist for the license checker a little. Good News: Arborist can spit out a nice, flat structure representing the current Bad News:
|
The former seems likely for arborist to add, assuming that data is in the packument. |
Arborist is no longer a separate repo. They've folded it into the larger CLI repo. It's clearly processing license metadata. There's a subcommand of the |
Last I was involved in this, I believe that the blocker to having license info in Arborist by default is for it to be included in the minified packuments served by the registry. This is still the only blocker:
Once the registry starts including license info in the minified packument, Arborist will track it, as it is on the list of fields that Arborist would record in the lockfile and add to Node objects. |
It looks like sometimes I'm getting data on @isaacs, sorry to bug you here---I'm a bit afraid of wading into npm/cli issues. Is Arborist still going to rely on minified pakuments from the registry if we always just ask for the local tree with |
No worries about bugging me, I'm the right one to bug, and you've earned it ;) Tl;dr - If you do Full explanation: Arborist doesn't exactly rely on the minified packuments for doing a Arborist saves the state of the tree to a lockfile at If you have a full node_modules, and no hidden lockfile, then When it does a The problem is, So, the tree it's reifying doesn't have license identifiers, and thus, the tree it writes to the hidden lockfile doesn't either. The next loadActual takes the shortcut, and you get no licenses. |
@isaacs, thanks so much. Might it be possible to get an Arborist flag to ignore existing second lockfiles? I suppose our alternative for Licensee is looking for a second lockfile, squirreling it away to a temp dir if present, doing our analysis on a fresh free, then replacing. Feels wrong. |
Deleting the hidden lockfile is perfectly safe. (There are a number of situations where npm will ignore or clobber it anyway, and users routinely delete node_modules, update the tree with yarn, etc., so it can never be more than a cautiously-trusted nice-to-have enhancement.) But yes, it does feel wrong, and this is exposing the wrongness of a design constraint of Arborist (Virtual Trees and Actual Trees are Interchangeable for All Relevant Purposes) is not possible, due to an expected contract with the registry being violated (Minified Packuments Have All That npm Needs). The fix that won't feel wrong is to get In any event, you'd probably like to be able to run licensee on the virtual tree expressed in package-lock.json, so getting it into the minified registry metadata is worthwhile. |
Forgive me. Why would we want the "virtual tree" as opposed to a reflection of what's on disk? Sounds like the way forward for now is detecting and deleting |
Let's say that you're using chokidar, which has an optional dep on fsevents, which only installs on macOS systems. One day, fsevents changes its license to something objectionable for your organization. You run licensee as part of your CI process, which executes on a Linux VM. If you run Flip it the other direction, and it gets potentially even more hazardous. Say |
@isaacs I don't think we have any plans to add more blessed fields/data to corgi docs at the moment (I also can't remember when/why we considered Funny enough though, @nlf happened to "fix" this the other day as he was digging into another bug where The way we "fixed" this was by introducing a new |
Ah, too bad it's not an option to add fields to the corgis, we tried hard to avoid having to force a |
Thanks, @darcyclarke and @isaacs. I have marked #77 ready for review. |
Left a few drive-by comments from a retired maintainer, hopefully they're helpful :) |
Isaac was kind enough to confirm that
read-package-tree
will probably be deprecated in favor of Arborist. Arborist will expose a promise API.I have watched release on the Arborist repo. When the time comes,
licensee
will want to switch. But I'd strongly recommend that we hold off doing any substantial development until that decision is taken.The text was updated successfully, but these errors were encountered: