type-git 0.3.0-alpha.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  Type-safe Git wrapper library with LFS support, progress tracking, and abort control for Node.js/Deno/Bun.
4
4
 
5
- (To be honest, I wrote the entire code with Claude Code. But it works appropriately.)
5
+ Typed inputs are checked against supported output contracts, with runtime validation for JavaScript callers.
6
+
7
+ **Upgrading:** [0.4.0 migration guide](docs/migrations/0.4.0.md).
6
8
 
7
9
  **[Documentation](https://ash-r1.github.io/type-git/)** | **[API Reference](https://ash-r1.github.io/type-git/api/readme/)**
8
10
 
@@ -19,7 +21,7 @@ Type-safe Git wrapper library with LFS support, progress tracking, and abort con
19
21
 
20
22
  ## Design Philosophy
21
23
 
22
- This library wraps Git CLI (and optionally libgit2) with a focus on:
24
+ This library wraps Git CLI with a focus on:
23
25
 
24
26
  1. **Output Contract Safety**: Typed APIs only expose operations where stdout format is guaranteed
25
27
  2. **Repository Context**: Separates `Git` (non-repo operations) from `Repo` (repo operations)
@@ -112,11 +114,10 @@ const git = await TypeGit.create();
112
114
  // Clone a repository with progress tracking
113
115
  const repo = await git.clone('https://github.com/user/repo.git', '/path/to/clone', {
114
116
  onProgress: (progress) => {
115
- if (progress.kind === 'git') {
116
- console.log(`${progress.phase}: ${progress.message}`);
117
- } else if (progress.kind === 'lfs') {
118
- console.log(`LFS ${progress.direction}: ${progress.bytesSoFar}/${progress.bytesTotal}`);
119
- }
117
+ console.log(`${progress.phase}: ${progress.message}`);
118
+ },
119
+ onLfsProgress: (progress) => {
120
+ console.log(`LFS ${progress.direction}: ${progress.bytesSoFar}/${progress.bytesTotal}`);
120
121
  },
121
122
  });
122
123
 
@@ -192,15 +193,45 @@ src/
192
193
  │ ├── node/ # Node.js adapter
193
194
  │ ├── bun/ # Bun adapter
194
195
  │ └── deno/ # Deno adapter
195
- ├── cli/ # CLI command builders
196
- ├── lfs/ # LFS-specific logic
197
- ├── parsers/ # Output parsers
198
- └── utils/ # Utilities
196
+ ├── impl/ # Git and repository operations
197
+ ├── runner/ # Command execution, progress, and errors
198
+ ├── parsers/ # Machine-output parsers
199
+ └── internal/ # Shared clients, transport, config, and LFS helpers
199
200
  ```
200
201
 
201
202
  ## Development Status
202
203
 
203
- This library is currently in early development (v0.0.1). It's not tested well. Especially, on Bun/Deno.
204
+ 0.4.0 strengthens typed output contracts and rejects conflicting options before execution.
205
+ See the [migration guide](docs/migrations/0.4.0.md) for breaking changes and API boundaries.
206
+ The public API is still evolving; pin an exact version for controlled upgrades.
207
+ Some flags require newer Git versions; LFS JSON queries require a compatible Git LFS installation.
208
+
209
+ ### Validation scope
210
+
211
+ - **Node.js**: Unit and real-Git integration tests run in CI on Linux and Windows
212
+ with Node.js 20, 22, and 24. A separate job checks legacy Git 2.25 compatibility.
213
+ - **Bun and Deno**: Adapter smoke tests and a shared repository contract suite run on Linux.
214
+ Their test coverage is narrower than Node.js; cross-runtime behavior still needs
215
+ more real-application feedback.
216
+ - **Package distribution**: CI installs the npm tarball and checks ESM, CommonJS,
217
+ and TypeScript consumers. Repository API type assertions are also compiled in CI.
218
+ - **LFS**: Automated tests cover command construction, progress callback wiring,
219
+ and smudge-mode handling, primarily with mocked adapters. Remote-service
220
+ authentication, interrupted transfers, and large transfers need further validation.
221
+ - **macOS**: Not currently included in the CI matrix.
222
+
223
+ ### Toward 1.0
224
+
225
+ The 1.0 release will establish a public API maintained with semantic versioning.
226
+ Before then, the priorities are sustained use in real applications, broader Git/LFS
227
+ transfer and failure-path validation, and settling the contracts for errors,
228
+ cancellation, progress callbacks, and environment inheritance. Full coverage of
229
+ every Git command-line option is not a release requirement; `raw()` remains the
230
+ escape hatch.
231
+
232
+ Please report issues with your type-git, runtime, Git, and Git LFS versions,
233
+ operating system, and a minimal reproduction. Remove credentials from logs before
234
+ sharing them.
204
235
 
205
236
  ## License
206
237