rollup/rollup-plugin-json

Unable to install via git url

jacobmischka opened this issue · 3 comments

I imagine this is likely a problem with all rollup plugins, but it seems it's impossible to install this one at least via a git url.

This is because the dist directory isn't checked into source control, and this project's rollup config is missing from the files array in package.json and there's no {pre,,post}install script. So the dist files aren't downloaded when installing, and can't be built either.

The two solutions I can imagine are either: dist should be checked into source control, or rollup.config.js should be added to the files array and an install script of some kind should be added. I'm not sure which feels less dirty to you.

Certainly this isn't a very big issue, as installing from the npm registry works correctly, and if someone needs to install via a git url they can fix this themselves, but it might be something worth considering.

Thanks for everything!

Hmm... this is a pattern I follow with almost all my repos – src files get checked in, but the npm package only contains the dist files, because they're different things with different jobs. Minimising package download size is a high priority, and adding postinstall stuff just seems like a world of hurt.

What is the situation where you would need to install via git URL? It's only for forks, no? (As you say, it seems like anyone would be able to fix it themselves at that point)

Yeah there's really no great solution. Install scripts are a mess. I usually just commit dist along with the source, but that feels pretty gross so I don't blame you for not wanting to do that either. I felt a little better about it though after finding that github excludes it from the linguist language counter for repos, if that means anything.

Right, pretty much just for forks, or if for some reason someone can't access the npm registry I suppose. It's also handy for projects that don't publish releases often, but that's not an issue with any of your projects.

Like I said, it's not really a problem, I just thought it was worth pointing out if it's something you hadn't considered.

I felt a little better about it though after finding that github excludes it

Huh, interesting. Yeah, my main two reasons for not commiting dist files is that a) it really messes up your git history, and b) you get people submitting PRs that change them via the web interface. Easier all round if that isn't an option in the first place.

I'll close this as I don't think there's a way to square this circle. Cheers