type-git 0.4.0 → 0.5.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 +20 -1
- package/dist/adapters/bun/index.cjs +7191 -336
- package/dist/adapters/bun/index.cjs.map +1 -1
- package/dist/adapters/bun/index.d.cts +1 -1
- package/dist/adapters/bun/index.d.ts +1 -1
- package/dist/adapters/bun/index.js +7191 -336
- package/dist/adapters/bun/index.js.map +1 -1
- package/dist/adapters/deno/index.cjs +7191 -336
- package/dist/adapters/deno/index.cjs.map +1 -1
- package/dist/adapters/deno/index.d.cts +1 -1
- package/dist/adapters/deno/index.d.ts +1 -1
- package/dist/adapters/deno/index.js +7191 -336
- package/dist/adapters/deno/index.js.map +1 -1
- package/dist/adapters/node/index.cjs +7191 -336
- package/dist/adapters/node/index.cjs.map +1 -1
- package/dist/adapters/node/index.d.cts +1 -1
- package/dist/adapters/node/index.d.ts +1 -1
- package/dist/adapters/node/index.js +7191 -336
- package/dist/adapters/node/index.js.map +1 -1
- package/dist/client-KHa1WMIH.d.cts +12041 -0
- package/dist/client-KHa1WMIH.d.ts +12041 -0
- package/dist/index.cjs +7191 -336
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7191 -336
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
- package/dist/client-DAAbUvgo.d.cts +0 -5291
- package/dist/client-DAAbUvgo.d.ts +0 -5291
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Typed inputs are checked against supported output contracts, with runtime valida
|
|
|
23
23
|
|
|
24
24
|
This library wraps Git CLI with a focus on:
|
|
25
25
|
|
|
26
|
-
1. **Output Contract Safety**:
|
|
26
|
+
1. **Output Contract Safety**: Parsed convenience APIs expose operations with stable stdout formats; typed CLI access returns raw output
|
|
27
27
|
2. **Repository Context**: Separates `Git` (non-repo operations) from `Repo` (repo operations)
|
|
28
28
|
3. **Worktree vs Bare**: Type-safe distinction between worktree and bare repositories
|
|
29
29
|
4. **Raw Escape Hatch**: Arbitrary git commands via `raw()` when needed
|
|
@@ -89,6 +89,20 @@ import { TypeGit } from 'type-git/node';
|
|
|
89
89
|
const git = await TypeGit.create({ useLegacyVersion: true });
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
+
### Typed CLI commands
|
|
93
|
+
|
|
94
|
+
Use `command()` for registered CLI operations, including ones without a parsed convenience method:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
const hash = await git.command('hash-object', [['--stdin']], { stdin: 'hello' });
|
|
98
|
+
await repo.command('remote add', [{ operand: 'origin' }, { operand: '/path/to/upstream' }]);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Option tuples and operand objects retain ordering and repeated flags. Literal combinations are
|
|
102
|
+
checked against declarative rules; dynamic input is validated at runtime. The result contains
|
|
103
|
+
raw stdout, stderr, and exit status. See the [API design and pinned baselines](docs/design/typed-command-api.md)
|
|
104
|
+
and [coverage ledger](docs/design/command-coverage.md) for the currently registered scopes and remaining audit work.
|
|
105
|
+
|
|
92
106
|
### Advanced Usage
|
|
93
107
|
|
|
94
108
|
For more control over adapters, you can use the factory function:
|
|
@@ -193,6 +207,7 @@ src/
|
|
|
193
207
|
│ ├── node/ # Node.js adapter
|
|
194
208
|
│ ├── bun/ # Bun adapter
|
|
195
209
|
│ └── deno/ # Deno adapter
|
|
210
|
+
├── constraints/ # Declarative Git rules, type projection, and finite-domain exploration
|
|
196
211
|
├── impl/ # Git and repository operations
|
|
197
212
|
├── runner/ # Command execution, progress, and errors
|
|
198
213
|
├── parsers/ # Machine-output parsers
|
|
@@ -206,6 +221,10 @@ See the [migration guide](docs/migrations/0.4.0.md) for breaking changes and API
|
|
|
206
221
|
The public API is still evolving; pin an exact version for controlled upgrades.
|
|
207
222
|
Some flags require newer Git versions; LFS JSON queries require a compatible Git LFS installation.
|
|
208
223
|
|
|
224
|
+
Option restrictions are maintained in an [evidence-backed constraint model](docs/design/option-constraints.md).
|
|
225
|
+
Git restrictions and typed API exceptions are listed separately. Clone has generated finite-domain
|
|
226
|
+
compiler tests and independent Git conformance tests; this does not claim exhaustive Git coverage.
|
|
227
|
+
|
|
209
228
|
### Validation scope
|
|
210
229
|
|
|
211
230
|
- **Node.js**: Unit and real-Git integration tests run in CI on Linux and Windows
|