Skip to content

feat: support copying from local file protocol#228

Open
pandanoir wants to merge 2 commits into
unjs:mainfrom
pandanoir:main
Open

feat: support copying from local file protocol#228
pandanoir wants to merge 2 commits into
unjs:mainfrom
pandanoir:main

Conversation

@pandanoir

Copy link
Copy Markdown

resolves #109

Support for the file protocol has been added.

  • Templates can now be specified using file:///path/to/dir
  • Tilde (~) expansion is also supported. However, since the standard file:// format typically only supports absolute paths, a custom format file:~/ is used to enable this feature.

Since the file protocol involves copying a directory rather than extracting a tarball, the processing logic and handling of options differ significantly from those in downloadTemplate. For this reason, we’ve separated the responsibilities and implemented it as a separate function.

If you believe it would be better to handle the file protocol as a branch within downloadTemplate, we’re happy to revise the implementation accordingly. We would appreciate your feedback.

@pandanoir pandanoir mentioned this pull request Jun 24, 2025
1 task
@pandanoir

Copy link
Copy Markdown
Author

@pi0
Gentle reminder: could you review this when you get a chance?

Comment thread README.md Outdated
@codecov

codecov Bot commented Sep 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.06897% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.52%. Comparing base (743c9ae) to head (7fbbdfc).
⚠️ Report is 107 commits behind head on main.

Files with missing lines Patch % Lines
src/cli.ts 0.00% 19 Missing ⚠️
src/giget.ts 73.58% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #228      +/-   ##
==========================================
- Coverage   54.63%   48.52%   -6.11%     
==========================================
  Files           7        6       -1     
  Lines         615      577      -38     
  Branches       47       62      +15     
==========================================
- Hits          336      280      -56     
- Misses        278      297      +19     
+ Partials        1        0       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pandanoir pandanoir requested a review from pi0 October 8, 2025 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support file:// protocol

2 participants