Abhishek-Mallick / Abhishek-Mallick/universal-box

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

オープン
#7 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement help wanted
主要言語
JavaScript
スター
47
フォーク
41
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
build-system, cli, tooling
issue の種類
リファクタリング
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。