Abhishek-Mallick / Abhishek-Mallick/universal-box

Reduce npm Package Size by Excluding `templates/` Directory from Distribution

Đang mở
#7 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement help wanted
Ngôn ngữ chính
JavaScript
Star
47
Fork
41
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The `templates/` directory in our npm package contains various templates used for scaffolding code. As we continue to add more templates, the size of the npm package will increase unnecessarily, leading to version inflation and potential issues for users with limited bandwidth.

## Proposed Solution:

Exclude the `templates/` directory from the npm package by adding it to `.npmignore`.
Modify the `bin/universal-box.js` script to dynamically display available template options by iterating through the `templates/` directory.
Since the `templates/` directory will not be present in the npm package, we can create empty directories representing each template just to display the options. These empty directories won't be ignored by `.npmignore`.
When a user selects a template, the corresponding directory should be cloned from the repository, pulling in the necessary files only when needed.

## Expected Outcome:

Reduced package size, making it more efficient to install and update.
Users will still be able to see all available templates and select them for scaffolding without downloading unnecessary files.

Open to further discussions

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Examine the .npmignore file and the bin/universal-box.js script. Understand how templates are currently included and used. The change involves updating .npmignore to exclude the templates/ directory, then modifying the CLI script to list templates by reading the repository (likely via Git) instead of the local directory, and cloning the selected template on demand. Test the package build and installation locally to ensure the CLI still works without the templates directory present.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, nodejs
Lĩnh vực
build-system, cli, tooling
Loại issue
Tái cấu trúc
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.