-
Notifications
You must be signed in to change notification settings - Fork 100
/
Repo_Size_Guidelines
45 lines (34 loc) · 3.07 KB
/
Repo_Size_Guidelines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Repo-Size Management Guidelines
This repository hosts multiple projects, and to ensure smooth performance and efficient management, the following guidelines must be followed:
## 1. Project Size Limitation
- Each individual project folder should **not exceed 15 MB**.
- If a project requires more space due to additional assets or data, consider refactoring the code or storing external files in a separate location (such as cloud storage or GitHub Pages).
## 2. File Organization
- Projects should be organized in clearly labeled folders under the root directory.
- Keep the folder structure simple, e.g., `Project_name1/`, `Project_name2/`, etc.
## 3. Avoid Large Binary Files
- Do **not** commit large binary files (e.g., videos, high-resolution images, compiled executables) directly to the repository.
- Use [Git LFS (Large File Storage)](https://git-lfs.github.com/) for files larger than **100 MB** or consider storing large assets outside the repository and linking to them.
## 4. Minimize External Libraries
- Minimize the use of heavy third-party libraries or external dependencies.
- Use a `.gitignore` file to exclude unnecessary or autogenerated files (e.g., `node_modules/`, `build/`, etc.).
## 5. Regular Cleanup
- Perform regular cleanup of unnecessary files (e.g., logs, temporary files).
- Remove outdated or unused code, assets, or projects from the repository.
## 6. Compression of Assets
- **Image Compression**: Use tools like [TinyPNG](https://tinypng.com/), [ImageOptim](https://imageoptim.com/), or [Squoosh](https://squoosh.app/) to compress images (PNG, JPEG, etc.) before committing them.
- **For Web Images**: Use appropriate formats like **WebP** to significantly reduce size without compromising quality.
- **Limit Resolution**: Avoid using high-resolution images unnecessarily. For most React projects, a resolution of 72 DPI (dots per inch) is sufficient for the web.
- **SVG Usage**: Use **SVG** files whenever possible for vector graphics, as they are scalable and lightweight.
- Compress other assets like PDFs and audio files using lossless compression tools before adding them to the repository to reduce file size.
## 7. Optimize Code for Performance
- **Bundle and Minify**: Ensure your project setup uses tools like Webpack or Vite to bundle and minify JavaScript and CSS files. This reduces file sizes and speeds up load times.
- **Tree Shaking**: When using third-party libraries, make sure to only import the necessary parts (tree-shaking) to avoid bundling unused code.
- For example, prefer `import { Button } from 'library'` instead of `import * as Library from 'library'`.
## 8. Versioning and History Management
- Keep commit history clean by avoiding frequent commits of unnecessary files.
- Use meaningful and concise commit messages.
- If a project becomes too large over time, consider splitting it into a separate repository.
## 9. Contributions
- For contributors, please adhere to the project size limits. Large contributions should be discussed through an issue or a pull request.
- Ensure all contributions are optimized for size and performance before submitting them.