-
Notifications
You must be signed in to change notification settings - Fork 6
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
Stop spamming npm #5
Comments
Thanks for bringing this up. There was a little discussion on this at HN: https://news.ycombinator.com/item?id=8248027
I believe above quote is from @bcoe, maybe he can chime in further. So far nobody has actually explained a compelling reason not to publish these to npm. I'm leaving this open for further discussion. |
There's enough man-made junk on npm to make discoverability hard. Adding bot created junk only makes that worse. Even with better discoverability at some point, it IMHO doesn't make sense to allow bots put whatever useless things on there. But ignoring that, why go through all the trouble when you can do this programmatically at runtime? |
// @substack @maxogden |
The main reason for doing this is to embed both the functionality of
in a function called It isn't totally clear that it this can be done programmatically at runtime. I know you can append a script pointing to wzrd.in to the page and then use that scripts exported Maybe one possibility is to have a
|
@mathisonian I dont fully understand what's going on here but it sounds like you should use the |
@jdalton I actually thought of lodash when I was writing my previous comment. IMO it's a different use case -- lodash-modularized lets people who consume lodash have more granular dependencies. I am not sure what the positive effect is of the requirify approach though -- it seems like it could be accomplished by other means than publishing new modules. |
Is this scripted? |
Thanks @maxogden. So to make it clear - I'm not married to this approach at all for requirify, I don't care much how it works as long as it works. The reason that I haven't had a chance to confirm that the pseudo-code in my previous comment would actually solve this issue, but if it does then I'm fine changing it to that. For reference for anyone stumbling up this: https://gist.github.com/mathisonian/c325dbe02ea4d6880c4e explains how everything works currently. |
@jdalton yeah, that's a result of the script https://gist.github.com/mathisonian/c325dbe02ea4d6880c4e#autopublishing-modules |
Yikes! Super clever & creative, but not cool... too much power and potential for abuse. |
@mathisonian just so we're on the same page: if you do this:
then the first one defines so could you accomplish your goals by just making a function that fetches |
@jdalton Okay I'm just going to disable the thing for now while we figure out a reasonable approach |
@maxogden yeah I'm on the same page with that, it just loses the magic that a Maybe the most reasonable thing is to just change the method name to |
@mathisonian now that I think about it you might be able to define a require function that still works with the require that browserify /bundle output defines. |
@jdalton fwiw npmjs.org/package/requirify-this-is-spam-this-is-spam isn't possible with the fix from #3 pushed to the server. Still doesn't help with https://www.npmjs.org/package/requirify-fuck-lodash though @maxogden I'm still not convinced require = function(varName, moduleName) {
moduleName = moduleName || varName
_require = require
// fetch wzrd.in code
// ...
window[varName] = require(moduleName) // this uses the require from wzrd.in code
require = _require
} wouldn't work. Or does browserserify looking for existing window |
The whole auto generate package should simply not happen. It's too risky. |
I've changed the script to: var request = require('browser-request');
window.require = function(name, moduleName) {
_require = require;
if(!moduleName) {
moduleName = name;
}
console.log('Fetching ' + moduleName + '... just one second');
request('http://wzrd.in/bundle/' + moduleName + '@latest/', function(er, res, body) {
require = null;
eval(body);
window[name] = require(moduleName);
require = _require;
console.log('Finished getting ' + moduleName);
});
}; which seems to have the same functionality and no module spam. |
Rock! Can the created npm packages be removed, is there a reason to keep them around? |
They can only be unpublished. They'll still appear in search results (npm/npm#4848, npm/npm#5645. |
Yeah, no reason to keep them at this point |
@mathisonian so, can you unpublish them? |
@sindresorhus yeah, I'm coming heading home from vacation today - will get to it once I'm back. |
They should all be unpublished now, thanks all |
Please stop spamming npm with useless wrapper modules: https://www.npmjs.org/~requirify-bot
Use the Browserify CDN or something: http://wzrd.in/
The text was updated successfully, but these errors were encountered: