-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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. | ||
|