@dev.fast/diffr 0.1.15 → 0.1.17
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 +2 -2
- package/dist/binary.js +3 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +2 -0
- package/dist/contract.d.ts +2 -0
- package/dist/contract.js +1 -0
- package/package.json +18 -12
- package/src/binary.ts +3 -0
- package/src/browser.ts +2 -0
- package/src/contract.ts +8 -1
package/README.md
CHANGED
|
@@ -17,12 +17,12 @@ glibc Linux arm64 and x64, Windows x64.
|
|
|
17
17
|
|
|
18
18
|
Keep these files in sync:
|
|
19
19
|
|
|
20
|
-
| Files (
|
|
20
|
+
| Files (relative to `diffr/` in the Whiteboard repository) | Check |
|
|
21
21
|
|---|---|
|
|
22
22
|
| `crates/diffr-core/src/protocol/mod.rs`, `crates/diffr-core/src/pairing.rs`, `diffr-ts/src/contract.ts` | Contract tests against the binary; Rust version check |
|
|
23
23
|
| `docs/streaming.md` | Review against the wire format |
|
|
24
24
|
| `tui/packages/hunk/src/diffr/wire.ts` (v3 only) | TUI fixture tests |
|
|
25
|
-
|
|
|
25
|
+
| `../packages/review-protocol/package.json` and `../packages/review/package.json` | Exact package version pins |
|
|
26
26
|
|
|
27
27
|
## Release
|
|
28
28
|
|
package/dist/binary.js
CHANGED
|
@@ -3,6 +3,9 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
export function diffrBinaryPath() {
|
|
4
4
|
const name = process.platform === "win32" ? "diffr.exe" : "diffr";
|
|
5
5
|
try {
|
|
6
|
+
// Workspace consumers see local TypeScript changes, but the native binary
|
|
7
|
+
// remains version-pinned in package.json. Rust edits need a new platform
|
|
8
|
+
// build until development builds can opt into a local diffr executable.
|
|
6
9
|
// Resolve from this package's own directory, which also holds when a bundler inlines it.
|
|
7
10
|
const self = createRequire(import.meta.url).resolve("@dev.fast/diffr/package.json");
|
|
8
11
|
return createRequire(self).resolve(`@dev.fast/diffr-${process.platform}-${process.arch}/${name}`);
|
package/dist/browser.js
ADDED
package/dist/contract.d.ts
CHANGED
|
@@ -124,6 +124,8 @@ export declare const StructuralRegionSchema: z.ZodType<StructuralRegion>;
|
|
|
124
124
|
export type StructuralNode = {
|
|
125
125
|
kind: "leaf";
|
|
126
126
|
alignment_id: number;
|
|
127
|
+
/** The partner leaf's `id` on the other side; absent when added or deleted. */
|
|
128
|
+
pair?: number;
|
|
127
129
|
changed?: StructuralSpan[];
|
|
128
130
|
} | {
|
|
129
131
|
kind: "fold";
|
package/dist/contract.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev.fast/diffr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "diffr's NDJSON wire contract, validators, and the diffr binary for this platform",
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/devdotfast/whiteboard.git",
|
|
8
|
+
"directory": "diffr/diffr-ts"
|
|
9
|
+
},
|
|
6
10
|
"license": "MIT",
|
|
7
11
|
"type": "module",
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
10
14
|
"types": "./dist/index.d.ts",
|
|
15
|
+
"browser": "./dist/browser.js",
|
|
11
16
|
"import": "./dist/index.js",
|
|
12
17
|
"default": "./dist/index.js"
|
|
13
18
|
},
|
|
@@ -24,25 +29,26 @@
|
|
|
24
29
|
"scripts": {
|
|
25
30
|
"build": "tsc -p tsconfig.build.json",
|
|
26
31
|
"typecheck": "tsc --noEmit",
|
|
27
|
-
"test": "
|
|
32
|
+
"test": "vitest run --config vitest.config.ts",
|
|
28
33
|
"prepack": "npm run build"
|
|
29
34
|
},
|
|
30
35
|
"peerDependencies": {
|
|
31
36
|
"zod": "^4.0.0"
|
|
32
37
|
},
|
|
38
|
+
"optionalDependencies": {
|
|
39
|
+
"@dev.fast/diffr-darwin-arm64": "0.1.17",
|
|
40
|
+
"@dev.fast/diffr-darwin-x64": "0.1.17",
|
|
41
|
+
"@dev.fast/diffr-linux-x64": "0.1.17",
|
|
42
|
+
"@dev.fast/diffr-linux-arm64": "0.1.17",
|
|
43
|
+
"@dev.fast/diffr-win32-x64": "0.1.17"
|
|
44
|
+
},
|
|
33
45
|
"devDependencies": {
|
|
34
|
-
"@types/
|
|
46
|
+
"@types/node": "24.12.2",
|
|
35
47
|
"typescript": "5.9.3",
|
|
36
|
-
"
|
|
48
|
+
"vitest": "4.1.11",
|
|
49
|
+
"zod": "4.6.5"
|
|
37
50
|
},
|
|
38
51
|
"engines": {
|
|
39
52
|
"node": ">=20"
|
|
40
|
-
},
|
|
41
|
-
"optionalDependencies": {
|
|
42
|
-
"@dev.fast/diffr-darwin-arm64": "0.1.15",
|
|
43
|
-
"@dev.fast/diffr-darwin-x64": "0.1.15",
|
|
44
|
-
"@dev.fast/diffr-linux-x64": "0.1.15",
|
|
45
|
-
"@dev.fast/diffr-linux-arm64": "0.1.15",
|
|
46
|
-
"@dev.fast/diffr-win32-x64": "0.1.15"
|
|
47
53
|
}
|
|
48
54
|
}
|
package/src/binary.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { createRequire } from "node:module";
|
|
|
4
4
|
export function diffrBinaryPath(): string | undefined {
|
|
5
5
|
const name = process.platform === "win32" ? "diffr.exe" : "diffr";
|
|
6
6
|
try {
|
|
7
|
+
// Workspace consumers see local TypeScript changes, but the native binary
|
|
8
|
+
// remains version-pinned in package.json. Rust edits need a new platform
|
|
9
|
+
// build until development builds can opt into a local diffr executable.
|
|
7
10
|
// Resolve from this package's own directory, which also holds when a bundler inlines it.
|
|
8
11
|
const self = createRequire(import.meta.url).resolve("@dev.fast/diffr/package.json");
|
|
9
12
|
return createRequire(self).resolve(`@dev.fast/diffr-${process.platform}-${process.arch}/${name}`);
|
package/src/browser.ts
ADDED
package/src/contract.ts
CHANGED
|
@@ -272,7 +272,13 @@ export const StructuralRegionSchema: z.ZodType<StructuralRegion> = z.lazy(() =>
|
|
|
272
272
|
);
|
|
273
273
|
|
|
274
274
|
export type StructuralNode =
|
|
275
|
-
| {
|
|
275
|
+
| {
|
|
276
|
+
kind: "leaf";
|
|
277
|
+
alignment_id: number;
|
|
278
|
+
/** The partner leaf's `id` on the other side; absent when added or deleted. */
|
|
279
|
+
pair?: number;
|
|
280
|
+
changed?: StructuralSpan[];
|
|
281
|
+
}
|
|
276
282
|
| {
|
|
277
283
|
kind: "fold";
|
|
278
284
|
children: StructuralRegion[];
|
|
@@ -287,6 +293,7 @@ export const StructuralNodeSchema: z.ZodType<StructuralNode> = z.lazy(() =>
|
|
|
287
293
|
z.object({
|
|
288
294
|
kind: z.literal("leaf"),
|
|
289
295
|
alignment_id: structuralU32,
|
|
296
|
+
pair: structuralU32.optional(),
|
|
290
297
|
changed: z.array(StructuralSpanSchema).optional(),
|
|
291
298
|
}),
|
|
292
299
|
z.object({
|