type-git 0.5.0 → 0.7.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.
Files changed (42) hide show
  1. package/README.md +27 -7
  2. package/dist/adapters/bun/index.cjs +82 -13348
  3. package/dist/adapters/bun/index.d.cts +7 -1
  4. package/dist/adapters/bun/index.d.ts +7 -1
  5. package/dist/adapters/bun/index.js +49 -13275
  6. package/dist/adapters/deno/index.cjs +76 -13344
  7. package/dist/adapters/deno/index.d.cts +7 -1
  8. package/dist/adapters/deno/index.d.ts +7 -1
  9. package/dist/adapters/deno/index.js +44 -13272
  10. package/dist/adapters/node/index.cjs +5 -13617
  11. package/dist/adapters/node/index.d.cts +44 -6
  12. package/dist/adapters/node/index.d.ts +44 -6
  13. package/dist/adapters/node/index.js +8 -13580
  14. package/dist/chunk-5NI3KM5Z.js +4822 -0
  15. package/dist/chunk-IAJF67MB.js +392 -0
  16. package/dist/chunk-MFY7MGIJ.cjs +4822 -0
  17. package/dist/chunk-NBX6BNQF.cjs +5588 -0
  18. package/dist/chunk-X3F6MDXQ.cjs +392 -0
  19. package/dist/chunk-YIWTIIXH.js +5588 -0
  20. package/dist/client.d-Cs32YZX6.d.ts +566 -0
  21. package/dist/client.d-PRQCR2_T.d.cts +566 -0
  22. package/dist/{client-KHa1WMIH.d.cts → git.d-DrhCzWEn.d.cts} +4541 -6876
  23. package/dist/index.cjs +42 -13717
  24. package/dist/index.d.cts +3 -2
  25. package/dist/index.d.ts +3 -2
  26. package/dist/index.js +38 -13649
  27. package/dist/strict/index.cjs +2919 -0
  28. package/dist/strict/index.d.cts +134022 -0
  29. package/dist/strict/index.d.ts +1 -0
  30. package/dist/strict/index.js +2919 -0
  31. package/docs/adapters.md +168 -0
  32. package/docs/migrations/0.7.0.md +152 -0
  33. package/package.json +58 -21
  34. package/dist/adapters/bun/index.cjs.map +0 -1
  35. package/dist/adapters/bun/index.js.map +0 -1
  36. package/dist/adapters/deno/index.cjs.map +0 -1
  37. package/dist/adapters/deno/index.js.map +0 -1
  38. package/dist/adapters/node/index.cjs.map +0 -1
  39. package/dist/adapters/node/index.js.map +0 -1
  40. package/dist/client-KHa1WMIH.d.ts +0 -12041
  41. package/dist/index.cjs.map +0 -1
  42. package/dist/index.js.map +0 -1
package/README.md CHANGED
@@ -89,19 +89,35 @@ import { TypeGit } from 'type-git/node';
89
89
  const git = await TypeGit.create({ useLegacyVersion: true });
90
90
  ```
91
91
 
92
- ### Typed CLI commands
92
+ ### Typed CLI commands (`type-git/strict`)
93
93
 
94
- Use `command()` for registered CLI operations, including ones without a parsed convenience method:
94
+ For registered CLI operations without a parsed convenience method, import `strict` from
95
+ `type-git/strict`. It wraps a client or repository and adds a grammar-checked `command()`:
95
96
 
96
97
  ```typescript
97
- const hash = await git.command('hash-object', [['--stdin']], { stdin: 'hello' });
98
- await repo.command('remote add', [{ operand: 'origin' }, { operand: '/path/to/upstream' }]);
98
+ import { strict } from 'type-git/strict';
99
+
100
+ const strictGit = strict(git);
101
+ const hash = await strictGit.command('hash-object', [['--stdin']], { stdin: 'hello' });
102
+
103
+ const strictRepo = strict(repo);
104
+ await strictRepo.command('remote add', [{ operand: 'origin' }, { operand: '/path/to/upstream' }]);
105
+ await strictRepo.status(); // every other method is still available
99
106
  ```
100
107
 
101
108
  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.
109
+ checked against Git's option grammar at compile time; dynamic input is validated at runtime,
110
+ including probes of the selected Git executable where its parser behavior differs between
111
+ builds. The result contains raw stdout, stderr, and exit status. See the
112
+ [API design and pinned baselines](docs/design/typed-command-api.md) and
113
+ [coverage ledger](docs/design/command-coverage.md) for the registered scopes and remaining audit
114
+ work.
115
+
116
+ The grammar catalogue is large, so it lives only in `type-git/strict`. The main entry point
117
+ (`type-git`, `type-git/node`, `type-git/bun`, `type-git/deno`) keeps `raw()`, the high-level API,
118
+ and the runtime checks against argument injection, and neither its bundle nor its type
119
+ declarations include the catalogue. For an application that only calls high-level methods such
120
+ as `repo.status()`, the bundled size is about 180 KB minified instead of about 1.6 MB.
105
121
 
106
122
  ### Advanced Usage
107
123
 
@@ -118,6 +134,10 @@ const git = await createGit({
118
134
  });
119
135
  ```
120
136
 
137
+ On Windows, pass `{ windowsHide: true }` to `TypeGit.create()` or `createNodeAdapters()` to keep
138
+ Git from opening console windows. To write your own `ExecAdapter` (for example one that only
139
+ allows specific invocations), see the [adapter contract](docs/adapters.md).
140
+
121
141
  ### Full Example
122
142
 
123
143
  ```typescript