Claude Bot
ae6437ecfc
Add git sparse checkout support for subdirectories
Implements pnpm-compatible path: syntax for installing from git repository subdirectories.
This enables efficient monorepo support by only downloading the required subdirectory
using Git 2.25+ sparse checkout features.
Syntax:
- github:user/repo#path:/packages/foo
- user/repo#branch&path:/packages/bar
- git+https://github.com/user/repo.git#commit&path:subdir
Features:
- Modern sparse checkout with cone mode for O(1) performance
- Subdirectory path normalized once during parsing (no leading slash)
- Uses stack buffers (PathBuffer) to avoid allocations in hot path
- Atomic directory restructuring with proper error handling
- Cache isolation with subdirectory hash
- Works with both regular and isolated installs
- Comprehensive tests with .d.ts file verification
Implementation details:
- Added subdirectory field to Repository struct
- Normalize subdirectory path during dependency parsing (strip leading /)
- Tag.infer checks for path: parameter early to route to git (not GitHub API)
- Sparse checkout restructures directory atomically using temp location
- Tests verify actual package files, no flaky timing-based checks
Files modified:
- src/install/repository.zig - Core sparse checkout + atomic restructuring
- src/install/dependency.zig - Parsing with normalization + Tag.infer fixes
- src/install/PackageManager/PackageManagerDirectories.zig - Cache naming
- src/install/PackageManagerTask.zig - Task handling
- src/install/PackageManager/PackageManagerEnqueue.zig - Task queueing
- src/install/PackageManager/runTasks.zig - Task execution
- test/cli/install/git-sparse-checkout.test.ts - Comprehensive tests (new)
Tests: 6 passing, 42 expect() calls, 7.89s
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 11:10:07 +00:00
..
2025-11-03 22:20:07 -08:00
2025-09-24 02:42:57 -07:00
2025-10-29 19:29:04 -07:00
2025-11-07 20:58:44 -08:00
2025-11-03 20:36:22 -08:00
2025-08-12 17:07:46 -07:00
2024-09-11 16:47:38 -07:00
2025-10-07 08:17:13 -07:00
2023-03-07 12:22:34 -08:00
2023-03-07 12:22:34 -08:00
2023-03-07 12:22:34 -08:00
2023-10-10 20:05:58 -07:00
2025-11-03 22:20:07 -08:00
2025-08-14 16:36:44 -07:00
2025-07-14 00:47:53 -07:00
2025-09-22 05:30:34 -07:00
2025-11-03 22:20:07 -08:00
2025-11-03 22:20:07 -08:00
2025-11-03 20:36:22 -08:00
2025-11-03 22:20:07 -08:00
2025-11-07 05:28:33 -08:00
2025-09-25 19:03:22 -07:00
2025-11-03 22:20:07 -08:00
2025-11-03 22:20:07 -08:00
2025-10-08 18:00:38 -07:00
2025-11-03 22:20:07 -08:00
2025-11-03 22:20:07 -08:00
2025-09-27 00:45:29 -07:00
2025-09-27 00:45:29 -07:00
2025-10-19 23:28:59 -07:00
2025-11-03 22:20:07 -08:00
2025-07-15 22:14:00 -07:00
2025-09-09 21:42:01 -07:00
2025-07-07 11:21:36 -07:00
2025-09-22 05:30:34 -07:00
2025-10-29 21:05:25 -07:00
2025-09-30 13:25:50 -07:00
2025-07-14 00:47:53 -07:00
2025-09-26 15:23:32 -07:00
2025-10-08 12:13:06 -07:00
2025-08-27 06:39:11 -07:00
2025-08-27 06:39:11 -07:00
2025-09-09 21:42:01 -07:00
2025-09-09 21:42:01 -07:00
2025-09-09 21:42:01 -07:00
2025-09-09 21:42:01 -07:00
2025-10-08 18:00:38 -07:00
2025-09-09 21:42:01 -07:00
2025-09-09 21:42:01 -07:00
2025-11-03 22:20:07 -08:00
2025-07-14 00:47:53 -07:00
2025-11-03 22:20:07 -08:00
2025-01-20 23:17:52 -08:00
2025-08-12 17:07:46 -07:00
2025-11-03 22:20:07 -08:00
2025-11-03 22:20:07 -08:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-09-22 03:27:09 -07:00
2025-08-21 14:53:50 -07:00
2025-10-08 18:00:38 -07:00
2025-09-09 21:42:01 -07:00
2025-11-08 11:10:07 +00:00
2025-09-09 21:42:01 -07:00
2025-09-09 21:42:01 -07:00
2025-11-03 22:20:07 -08:00
2025-09-09 21:42:01 -07:00
2023-10-12 15:17:03 -07:00
2025-10-08 18:00:38 -07:00
2025-11-01 22:38:36 -07:00
2025-11-03 22:20:07 -08:00
2025-01-03 08:21:00 -08:00
2025-08-21 14:53:50 -07:00
2023-03-29 20:38:19 -07:00
2023-10-13 20:37:48 -07:00
2025-11-03 20:36:22 -08:00
2025-08-12 17:07:46 -07:00
2025-10-20 16:32:04 -07:00
2025-11-03 22:20:07 -08:00
2023-10-10 20:05:58 -07:00
2023-10-10 20:05:58 -07:00
2024-10-12 02:37:51 -07:00
2024-06-12 16:50:57 -07:00
2025-11-03 22:20:07 -08:00
2023-12-11 22:08:25 -08:00
2025-11-07 05:28:33 -08:00
2025-08-12 17:07:46 -07:00
2024-03-06 20:38:49 -08:00
2024-05-27 02:17:43 -07:00
2025-10-08 01:51:25 -07:00
2025-09-09 21:42:01 -07:00
2025-07-16 01:01:10 -07:00
2025-09-09 21:42:01 -07:00
2025-09-09 21:42:01 -07:00
2025-09-09 21:42:01 -07:00
2024-02-19 22:50:24 -08:00