ColorlibHQ / AdminLTE

AdminLTE - Free admin dashboard template based on Bootstrap 5
https://adminlte.io
MIT License
44.04k stars 18.17k forks source link

[BUG] Too much files within the package for Composer #4171

Open laurentj opened 2 years ago

laurentj commented 2 years ago

When installing AdminLTE with Composer, we got all files from the repository. This is not what we really want in a production environment, or even in a development environment, as many files are totally useless because :

Removing the docs/, pages/, .github/ and some files at the root directory, would save around 30 MB of disk space (which represents 30% of the total size). Downloading less bytes is faster for a CI environment, or to deploy to a production or test environment, and save bandwidth for applications that host the package, like Packagist.org.

To Reproduce Steps to reproduce the behavior:

  1. Install the package with Composer.json
  2. Go into vendor/almasaeed2010/adminlte/
  3. there are some directories that we don't need, as a user of AdminLTE

Expected behavior

We should not have some directories into vendor/almasaeed2010/adminlte/.

I suggest to add these lines into .gitattributes to not have these directories :

.babelrc.js export-ignore
.bundlewatch.config.json export-ignore
.editorconfig export-ignore
.eslintignore export-ignore
.eslintrc.json export-ignore
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
.gitpod.yml export-ignore
.lgtm.yml export-ignore
.npmignore export-ignore
.stylelintignore export-ignore
.stylelintrc export-ignore
build/ export-ignore
docs/ export-ignore
pages/ export-ignore
iframe.html export-ignore
index.html export-ignore
index2.html export-ignore
index3.html export-ignore
package.json export-ignore
package-lock.json export-ignore

Environment (please complete the following information):

REJack commented 2 years ago

If we set the gitattributes like your example, all downloaded zip's will stripped too and that is what we don't want.

laurentj commented 2 years ago

Well, you could provide your own zip files with content you want to distribute, by configuring github actions or an other CI tool. I understand that providing the documentation can be interesting for users, but do they really need all build stuff (so build/, package.json and all dot files)? (I'm not talking about contributors, because contributors should clone the repository).

ajiho commented 5 months ago

This problem cannot be truly solved unless adminlte is treated as a pure web project and the composer download method is removed, so that only the dist directory can be retained when pushed to NPM