Abhishek-Mallick / Abhishek-Mallick/universal-box

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

Offen
#7 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement help wanted
Vorherrschende Sprache
JavaScript
Sterne
47
Forks
41
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.