mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.67k stars 334 forks source link

Ignore more files by default #1109

Open mbid opened 6 years ago

mbid commented 6 years ago

Is this a feature request or a bug?

A feature request.

What is the current behavior?

web-ext only ignores a very limited set of files, e.g. dot files, .zips and the node_modules folder.

What is the expected or desired behavior?

web-ext should also ignore other common build files. For example, I have package.json, package-lock.json, yarn.lock, and web-ext-artifacts in my project directory, which shouldn't end up in the .xpi.

kumar303 commented 6 years ago

Can't you just use --ignore-files?

mbid commented 6 years ago

Sure, but I could've also used that for node_modules. web-ext ignores some files because (I suppose) it's more convenient and less error-prone than specifying them every time. So I assumed that some more files should be ignored by web-ext by default. E.g. package.json and package-lock.json, which are very often also present if node_modules is and should not end up in the bundle.

kumar303 commented 6 years ago

Yeah, that's true. I guess putting those files in the default list would make sense.

kumar303 commented 6 years ago

Also, once we have config files then you could use one to set the value of --ignore-files.

carlin-q-scott commented 5 years ago

What's weird is that web-ext build ignores the web-ext-artifacts folder by default, but web-ext sign does not. That caught me off guard as it published my extension containing all the older builds of it, which was quite a bloated install for thousands of users.

Rob--W commented 5 years ago

@carlin-q-scott That sounds like a bad bug. Could you open a new issue with steps to reproduce, including the version number and the output with the --verbose flag?

carlin-q-scott commented 5 years ago

@Rob--W Sure I guess. It seemed pretty closely related to this issue but I guess there's a difference in the impact of the bug.

stokito commented 4 years ago

Also please ignore common dev's files like: README, README.txt, README.md, LICENSE, LICENSE.txt, LICENSE.md, CONTRIBUTING.md, HACKING, CODE_OF_CONDUCT.md etc. GitHub repos can also have .github folder. It also would be nice to exclude IDE's specific files like .idea which is created by WebSrorm. Maybe it even will be easier just to ignore all files from .gitignore

Rob--W commented 4 years ago

I would expect built artifacts (e.g. generated by tools like webpack) to be .gitignored. Excluding those in the build output would result in non-functional extensions, so I don't think that we should automatically import the ignores from .gitignore.

fregante commented 4 years ago

I think web-ext could use modules like these to exclude common junk:

https://github.com/sindresorhus/junk/blob/master/index.js https://github.com/novemberborn/ignore-by-default/blob/master/index.js https://github.com/abranhe/init-gitignore/blob/master/gitignore/Node.gitignore