Open ljharb opened 4 years ago
@ljharb Sorry about that, forget to add a note or do a check for a github api token. I've fixed it up now and the dependents should be outputted in JSON now. PTAL
Thanks; when I set that token, now I get:
Getting first 10 dependents of es-abstract sorted by forks
There are a total of 94 dependents
(node:95662) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at Object.getRepoData ($HOME/.npm/_npx/95662/lib/node_modules/dependents-testing/lib/github.js:35:20)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:95662) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:95662) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I can't reproduce what your seeing, but I've updated the code to fix the problem I think your seeing PTAL
Same credentials error (the length crash is fixed). What permissions does the token need to have? Most tokens should have repo read access, I'd think.
The token should just need public repo access I think.
Just tried it with a token with no additional scope permissions and it works for me 😕
Then it's likely not the token. Is there any more debug logging that can be done (currently it's just an unhandled promise rejection)? Happy to test a branch, as well.
Ive pushed a commit to log the error before throwing but I think thats the best I can do at the moment
Hmm, I guess it was a bad token; I used a different one and it's sort of working.
It seems like github's deps api doesn't allow you to only get direct deps? i'm mostly interested in testing things that directly depend on me.
The tool just grabs all the deps from this page https://www.npmjs.com/browse/depended/es-abstract
Its not ideal, and I know there's an issue thats been raised in package maintenance to see if there is or can be other ways of doing this https://github.com/nodejs/package-maintenance/issues/331
npx https://github.com/andrewhughes101/dependents-testing es-abstract 10 forks
prints out a bunch of errors, and then spits out a bunch of data (not JSON):Is there something I'm missing?