-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Add script to find Gatsby plugins w/o the "gatsby-plugin" keyword and add comment to repo suggesting they add it #5211
Comments
I'll be happy to work on it. For the moment, I don't know how it do but I will do some research. |
It's been a while ago. Are you still working on this @cricrio? I'd love to help if you stop or need help. |
Hi! I started to work on it but I didn't find the time to finish. There is what I have done. const axios = require(`axios`);
const keywords = ['gatsby-plugin', 'gatsby-source', 'gatsby-transformer'];
function filterDuplicate([head, ...rest], result) {
if (!head) {
return result;
} else {
result.push(head);
return filterDuplicate(rest.filter((r) => r.package.name != head.package.name), result);
}
}
function mergeResults(results) {
return results.reduce((t, r) => [...t, ...r], []);
}
const promises = keywords.map((keyword) =>
axios
.get(`https://api.npms.io/v2/search?q=${keyword}+keywords:-gatsby-plugin+not:deprecated&size=250`)
.then((responses) => responses.data.results)
);
exports.fetchRepository = Promise.all(promises)
.then(mergeResults)
.then((r) => {
console.log(r.length);
return r;
})
.then((results) => filterDuplicate(results, [])) |
@cricrio Thanks for the head start. I'll try and tackle this. |
Thanks @cricrio and @alexluong! |
It's a bit quiet in here, so I took a shot at this plugin-checker. Created an initial version of this plugin-checker in PR #7062
How do you want to run this script? From CI? Manually? What is your idea about this @KyleAMathews ? |
Sweet! My thinking is we'd just run it manually now and then. Nice work! Will try to land the PR soon or if @jlengstorf/@m-allanson/@calcsam/@pieh wants to take it over, feel free. |
Hey @KyleAMathews is this still open? I would like to contribute. |
Initial plugin checker for issue #5211 It reports found plugins to "plugins.json". Blacklist property can be manually set to avoid processing again. Notifying => see issue
@theevilhead that would be great! There's an initial version of this script that's just been merged. You can find it here: https://github.com/gatsbyjs/gatsby/tree/master/scripts/gatsby-plugin-checker. The PR that added it is #7062. I think the next step would be to refine the script results. It should only include packages who's name starts with It should ignore or blacklist any packages where:
When there are less false positives in the results, that'd be a good time to look at adding automated notifications or just manually going through the list and creating notifications. Finally it'd be great to add some docs explaining what the script does and how it works. Either as a comment at the top of the script, or as a README.md file in the same directory. |
Thanks @m-allanson, I will look into the script and get started with it |
Doesn't seem like there's been any work on this in a little while. I'd love to start contributing on it, hopefully will have something up soon! |
Initial plugin checker for issue gatsbyjs#5211 It reports found plugins to "plugins.json". Blacklist property can be manually set to avoid processing again. Notifying => see issue
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
Going to continue this conversation from #14013 here (cc: @dmarkiewicz)
In regards of using a token, we could document that a personal GitHub token is needed (and added to a |
i see there are some new plugins showing up while running this script... |
Spin off from discussion in #5180
@calcsam noticed that there's several dozen more Gatsby plugins that aren't showing up in the plugin search because they lack the
gatsby-plugin
keyword in their package.json.We should write a script which would search for NPM plugins that mention
gatsby-source
,gatsby-plugin
, andgatsby-transformer
in the text and then compare that our existing keyword search (also excluding deprecated packages) and find those packages without our keywords. This will still include a number of false positives so the script should include a way to "blacklist" spurious results (and save these in the repo so they won't show up in the future) — probably with https://www.npmjs.com/package/inquirer#checkbox---type-checkbox — and then the remaining packages, the script will automatically create a comment in the github repo suggesting they add thegatsby-plugin
keyword and linking to the docs on this.The text was updated successfully, but these errors were encountered: