type-git 0.3.0-beta.0 → 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 +18 -17
- package/dist/adapters/bun/index.cjs +6332 -0
- package/dist/adapters/bun/index.cjs.map +1 -1
- package/dist/adapters/bun/index.d.cts +11 -6
- package/dist/adapters/bun/index.d.ts +11 -6
- package/dist/adapters/bun/index.js +6321 -0
- package/dist/adapters/bun/index.js.map +1 -1
- package/dist/adapters/deno/index.cjs +6332 -0
- package/dist/adapters/deno/index.cjs.map +1 -1
- package/dist/adapters/deno/index.d.cts +11 -6
- package/dist/adapters/deno/index.d.ts +11 -6
- package/dist/adapters/deno/index.js +6321 -0
- package/dist/adapters/deno/index.js.map +1 -1
- package/dist/adapters/node/index.cjs +1212 -1085
- package/dist/adapters/node/index.cjs.map +1 -1
- package/dist/adapters/node/index.d.cts +8 -4268
- package/dist/adapters/node/index.d.ts +8 -4268
- package/dist/adapters/node/index.js +1212 -1085
- package/dist/adapters/node/index.js.map +1 -1
- package/dist/client-DAAbUvgo.d.cts +5291 -0
- package/dist/client-DAAbUvgo.d.ts +5291 -0
- package/dist/index.cjs +1199 -1088
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1199 -1088
- package/dist/index.js.map +1 -1
- package/docs/migrations/0.4.0.md +93 -0
- package/package.json +4 -3
- package/dist/adapters-CZ8wj9Kr.d.cts +0 -850
- package/dist/adapters-CZ8wj9Kr.d.ts +0 -850
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
|
-
|
|
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
|
|
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)
|
|
@@ -45,7 +47,7 @@ This library wraps Git CLI (and optionally libgit2) with a focus on:
|
|
|
45
47
|
## Installation
|
|
46
48
|
|
|
47
49
|
```bash
|
|
48
|
-
npm install type-git
|
|
50
|
+
npm install type-git
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
## Usage
|
|
@@ -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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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,24 +193,24 @@ src/
|
|
|
192
193
|
│ ├── node/ # Node.js adapter
|
|
193
194
|
│ ├── bun/ # Bun adapter
|
|
194
195
|
│ └── deno/ # Deno adapter
|
|
195
|
-
├──
|
|
196
|
-
├──
|
|
197
|
-
├── parsers/ #
|
|
198
|
-
└──
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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.
|
|
207
208
|
|
|
208
209
|
### Validation scope
|
|
209
210
|
|
|
210
211
|
- **Node.js**: Unit and real-Git integration tests run in CI on Linux and Windows
|
|
211
212
|
with Node.js 20, 22, and 24. A separate job checks legacy Git 2.25 compatibility.
|
|
212
|
-
- **Bun and Deno**: Adapter and
|
|
213
|
+
- **Bun and Deno**: Adapter smoke tests and a shared repository contract suite run on Linux.
|
|
213
214
|
Their test coverage is narrower than Node.js; cross-runtime behavior still needs
|
|
214
215
|
more real-application feedback.
|
|
215
216
|
- **Package distribution**: CI installs the npm tarball and checks ESM, CommonJS,
|