@dev.fast/diffr 0.1.1 → 0.1.4
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 +24 -29
- package/bin/fetch.mjs +1 -1
- package/dist/contract.d.ts +4 -12
- package/dist/contract.js +4 -12
- package/dist/stream.d.ts +0 -1
- package/dist/stream.js +0 -1
- package/package.json +1 -1
- package/pins.json +4 -3
- package/src/contract.ts +4 -12
- package/src/stream.ts +0 -1
package/README.md
CHANGED
|
@@ -1,45 +1,40 @@
|
|
|
1
1
|
# @dev.fast/diffr
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
release it describes.
|
|
3
|
+
TypeScript types, zod validators, and a binary fetcher for diffr's NDJSON protocol.
|
|
4
|
+
The package version matches the diffr release.
|
|
6
5
|
|
|
7
6
|
```ts
|
|
8
7
|
import { decodeStructuralDiffEvent } from "@dev.fast/diffr";
|
|
9
|
-
|
|
10
|
-
const event = decodeStructuralDiffEvent(line); // throws on any shape drift
|
|
11
|
-
}
|
|
8
|
+
const event = decodeStructuralDiffEvent(line);
|
|
12
9
|
```
|
|
13
10
|
|
|
14
11
|
```sh
|
|
15
|
-
npx --package @dev.fast/diffr@0.1.
|
|
16
|
-
npx --package @dev.fast/diffr@0.1.1 diffr-fetch --into ./bin --check
|
|
12
|
+
npx --package @dev.fast/diffr@0.1.4 diffr-fetch --into ./bin --required
|
|
17
13
|
```
|
|
18
14
|
|
|
19
|
-
Supports macOS arm64 and Linux x64. `--check`
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
Supports macOS arm64, macOS x64, and Linux x64. `--check` verifies an existing install without
|
|
16
|
+
network access. Downloads warn on network failure unless `--required`; invalid
|
|
17
|
+
hashes or archives always fail.
|
|
22
18
|
|
|
23
|
-
##
|
|
19
|
+
## Wire changes
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
Keep these files in sync:
|
|
26
22
|
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
| `src/protocol/mod.rs`, `src/pairing.rs
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| this package's version | consumers' exact-version dependency (Review: `packages/review-protocol` and `packages/review`) | the consumer's bump PR |
|
|
23
|
+
| Files (from repo root) | Check |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `src/protocol/mod.rs`, `src/pairing.rs`, `diffr-ts/src/contract.ts` | Contract tests against the binary; Rust version check |
|
|
26
|
+
| `docs/streaming.md` | Review against the wire format |
|
|
27
|
+
| `tui/packages/hunk/src/diffr/wire.ts` (v3 only) | TUI fixture tests |
|
|
28
|
+
| Review's `packages/review-protocol/package.json` and `packages/review/package.json` | Exact package version pins |
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
source where zod is the only external, so keep it that way.
|
|
30
|
+
## Release
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
After tagging the matching Rust release and building with `cargo build --locked`,
|
|
33
|
+
run from `diffr-ts`:
|
|
39
34
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
```sh
|
|
36
|
+
bun install --frozen-lockfile
|
|
37
|
+
npm run pin
|
|
38
|
+
bun run typecheck && bun test
|
|
39
|
+
npm publish --access public
|
|
40
|
+
```
|
package/bin/fetch.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url";
|
|
|
7
7
|
import { parseArgs } from "node:util";
|
|
8
8
|
|
|
9
9
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
|
-
const targets = { "darwin-arm64": "aarch64-apple-darwin", "linux-x64": "x86_64-unknown-linux-gnu" };
|
|
10
|
+
const targets = { "darwin-arm64": "aarch64-apple-darwin", "darwin-x64": "x86_64-apple-darwin", "linux-x64": "x86_64-unknown-linux-gnu" };
|
|
11
11
|
|
|
12
12
|
try {
|
|
13
13
|
await main();
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* tui/packages/hunk/src/diffr/wire.ts (the terminal UI's copy, v3 only)
|
|
7
|
-
* contract.test.ts runs the built binary and validates every record against
|
|
8
|
-
* these schemas; version.test.ts checks the Rust VERSION constant.
|
|
9
|
-
*
|
|
10
|
-
* This file may import only zod: consumers concatenate it into generated
|
|
11
|
-
* source where zod is the sole external.
|
|
12
|
-
* Serde omits default/empty fields rather than sending null. Lines are zero-based,
|
|
13
|
-
* columns are UTF-8 byte offsets, and ranges are half-open.
|
|
2
|
+
* Mirrors src/protocol/mod.rs and src/pairing.rs. See ../README.md for sync checks.
|
|
3
|
+
* Import only zod: Review embeds this file in generated source.
|
|
4
|
+
* Defaults are omitted, not null. Lines are zero-based, columns are UTF-8 bytes,
|
|
5
|
+
* and ranges are half-open.
|
|
14
6
|
*/
|
|
15
7
|
import { z } from "zod";
|
|
16
8
|
/** A pairing always has at least one side; additions/deletions omit the other. */
|
package/dist/contract.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* tui/packages/hunk/src/diffr/wire.ts (the terminal UI's copy, v3 only)
|
|
7
|
-
* contract.test.ts runs the built binary and validates every record against
|
|
8
|
-
* these schemas; version.test.ts checks the Rust VERSION constant.
|
|
9
|
-
*
|
|
10
|
-
* This file may import only zod: consumers concatenate it into generated
|
|
11
|
-
* source where zod is the sole external.
|
|
12
|
-
* Serde omits default/empty fields rather than sending null. Lines are zero-based,
|
|
13
|
-
* columns are UTF-8 byte offsets, and ranges are half-open.
|
|
2
|
+
* Mirrors src/protocol/mod.rs and src/pairing.rs. See ../README.md for sync checks.
|
|
3
|
+
* Import only zod: Review embeds this file in generated source.
|
|
4
|
+
* Defaults are omitted, not null. Lines are zero-based, columns are UTF-8 bytes,
|
|
5
|
+
* and ranges are half-open.
|
|
14
6
|
*/
|
|
15
7
|
import { z } from "zod";
|
|
16
8
|
function structuralPairingSchema(value) {
|
package/dist/stream.d.ts
CHANGED
package/dist/stream.js
CHANGED
package/package.json
CHANGED
package/pins.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.4",
|
|
3
3
|
"sha256": {
|
|
4
|
-
"aarch64-apple-darwin": "
|
|
5
|
-
"x86_64-
|
|
4
|
+
"aarch64-apple-darwin": "15d6c2a314a8851ae41ecc9f9942836d609fdbb638000ef2c210b1e4bdcb6334",
|
|
5
|
+
"x86_64-apple-darwin": "6bb7188ff3b9568ac98f8e2be8537f510b9f81fe9f0f6a24844c98c3178879bb",
|
|
6
|
+
"x86_64-unknown-linux-gnu": "9852012b0b88361510e6af074dac38a5c83bfd61cb287cff938e77152ff0a1d4"
|
|
6
7
|
}
|
|
7
8
|
}
|
package/src/contract.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* tui/packages/hunk/src/diffr/wire.ts (the terminal UI's copy, v3 only)
|
|
7
|
-
* contract.test.ts runs the built binary and validates every record against
|
|
8
|
-
* these schemas; version.test.ts checks the Rust VERSION constant.
|
|
9
|
-
*
|
|
10
|
-
* This file may import only zod: consumers concatenate it into generated
|
|
11
|
-
* source where zod is the sole external.
|
|
12
|
-
* Serde omits default/empty fields rather than sending null. Lines are zero-based,
|
|
13
|
-
* columns are UTF-8 byte offsets, and ranges are half-open.
|
|
2
|
+
* Mirrors src/protocol/mod.rs and src/pairing.rs. See ../README.md for sync checks.
|
|
3
|
+
* Import only zod: Review embeds this file in generated source.
|
|
4
|
+
* Defaults are omitted, not null. Lines are zero-based, columns are UTF-8 bytes,
|
|
5
|
+
* and ranges are half-open.
|
|
14
6
|
*/
|
|
15
7
|
import { z } from "zod";
|
|
16
8
|
|
package/src/stream.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type StructuralDiffEvent, StructuralDiffEventSchema } from "./contract.js";
|
|
2
2
|
|
|
3
|
-
/** JSON is untrusted until the complete nested Rust wire contract validates. */
|
|
4
3
|
export function decodeStructuralDiffEvent(line: string): StructuralDiffEvent {
|
|
5
4
|
try {
|
|
6
5
|
return StructuralDiffEventSchema.parse(JSON.parse(line));
|