@dev.fast/diffr 0.1.9 → 0.1.10

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 CHANGED
@@ -12,7 +12,7 @@ const event = decodeStructuralDiffEvent(line);
12
12
  npx --package @dev.fast/diffr@0.1.6 diffr-fetch --into ./bin --required
13
13
  ```
14
14
 
15
- Supports macOS arm64, macOS x64, Linux arm64, and Linux x64. `--check` verifies an existing install without
15
+ Supports macOS arm64, macOS x64, Linux arm64, Linux x64, and Windows x64 (`diffr.exe`). `--check` verifies an existing install without
16
16
  network access. Downloads warn on network failure unless `--required`; invalid
17
17
  hashes or archives always fail.
18
18
 
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", "darwin-x64": "x86_64-apple-darwin", "linux-x64": "x86_64-unknown-linux-gnu", "linux-arm64": "aarch64-unknown-linux-gnu" };
10
+ const targets = { "darwin-arm64": "aarch64-apple-darwin", "darwin-x64": "x86_64-apple-darwin", "linux-x64": "x86_64-unknown-linux-gnu", "linux-arm64": "aarch64-unknown-linux-gnu", "win32-x64": "x86_64-pc-windows-msvc" };
11
11
 
12
12
  try {
13
13
  await main();
@@ -38,13 +38,14 @@ async function main() {
38
38
  throw new Error(`pins.json has no valid sha256 for ${target}`);
39
39
  }
40
40
 
41
- const binary = join(into, "diffr");
41
+ const name = process.platform === "win32" ? "diffr.exe" : "diffr";
42
+ const binary = join(into, name);
42
43
  const stampPath = join(into, "diffr.stamp.json");
43
44
  let installed = false;
44
45
  try {
45
46
  const stamp = JSON.parse(readFileSync(stampPath, "utf8"));
46
47
  const stat = lstatSync(binary);
47
- installed = stat.isFile() && (stat.mode & 0o111) !== 0 && stamp.version === version && stamp.target === target
48
+ installed = stat.isFile() && (process.platform === "win32" || (stat.mode & 0o111) !== 0) && stamp.version === version && stamp.target === target
48
49
  && Boolean(stamp.full) === values.full;
49
50
  } catch { /* Missing or damaged installations are fetched again. */ }
50
51
  if (installed) {
@@ -73,12 +74,12 @@ async function main() {
73
74
  mkdirSync(into, { recursive: true });
74
75
  const staging = mkdtempSync(join(into, ".diffr-"));
75
76
  try {
76
- const archive = join(staging, "archive.tar.gz");
77
- writeFileSync(archive, bytes);
78
- const tar = spawnSync("tar", ["-xzf", archive, "-C", staging, "diffr"], { encoding: "utf8" });
79
- const extracted = join(staging, "diffr");
77
+ writeFileSync(join(staging, "archive.tar.gz"), bytes);
78
+ // Relative paths: GNU tar on Windows reads "C:" in an archive path as a remote host.
79
+ const tar = spawnSync("tar", ["-xzf", "archive.tar.gz", name], { cwd: staging, encoding: "utf8" });
80
+ const extracted = join(staging, name);
80
81
  if (tar.status !== 0 || !lstatSync(extracted).isFile()) {
81
- throw new Error(`${asset} does not contain a regular diffr file at its root`);
82
+ throw new Error(`${asset} does not contain a regular ${name} file at its root`);
82
83
  }
83
84
  chmodSync(extracted, 0o755);
84
85
  const stamp = join(staging, "stamp.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev.fast/diffr",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "diffr's NDJSON wire contract, validators, and release binary fetcher",
5
5
  "repository": "https://github.com/devdotfast/diffr",
6
6
  "license": "MIT",
package/pins.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
- "version": "0.1.9",
2
+ "version": "0.1.10",
3
3
  "artifact": "diffr-cli",
4
4
  "sha256": {
5
- "aarch64-apple-darwin": "6a7073252550b22217c588215b99c5642eabedfadcb545e087f1bf0a76a9cfa0",
6
- "x86_64-apple-darwin": "3c4ccef4daa952a9bd3cf0d4ac380c24595bca93f454e29b19ecf07fe16071dd",
7
- "x86_64-unknown-linux-gnu": "cda36ae600cdb4172952b295c16b2e47ab26bf93eb6c3301e9a0ad6b1472ebf6",
8
- "aarch64-unknown-linux-gnu": "33ed933688b4bca8f9e3f0177f5bc4520eef65077a39045a6aaab12629e3cc32"
5
+ "aarch64-apple-darwin": "2f67b7f4c096445047c618687a35eff40fd3a637683a738a59c40f702d97dd72",
6
+ "x86_64-apple-darwin": "674b719f45944ac387e58f21529e2a52a15c72d9cb28906e5e8ce7b28773c4da",
7
+ "x86_64-unknown-linux-gnu": "190c506b238d95f15a552b3983cd3351a5eb385f2057b5a08c90d87a2b466075",
8
+ "aarch64-unknown-linux-gnu": "91abbca8f38cb3de355cbc8a47086686c7e0f88961d6e2012fbefcdee1979607",
9
+ "x86_64-pc-windows-msvc": "0e129b2cf5c86af44643861da42656fc266f2e1f94ab501f0a2b34dc6efff1b7"
9
10
  },
10
11
  "full": {
11
12
  "sha256": {
12
- "aarch64-apple-darwin": "7a2b743175f879fca2d7394391dde41cfa05e7149ddd600072ba59b63f1f7354",
13
- "x86_64-apple-darwin": "9e0a4705097e7abfb0cabfbc48fcaf53b59cf41894fb99b60a35aa02f3cf1c9e",
14
- "x86_64-unknown-linux-gnu": "604536dfaee9ccd3fceae4bfa7d2e7e834330572d86d8d8a3c8b300c2ef22739",
15
- "aarch64-unknown-linux-gnu": "4858dfa3f53c377b6859769c1661e399e6615a633918953021bf37b4da048d5f"
13
+ "aarch64-apple-darwin": "6675ba404990be3e7b7f8e26b113b7f083e609e88c7eae366e3367a4e32364d5",
14
+ "x86_64-apple-darwin": "c9188df81078fe6bb3fbae2b44e7c1fff9b37cbe66c7cd9c11091c3d151e4dcf",
15
+ "x86_64-unknown-linux-gnu": "a56aa73980850ecdfdce201253d37d06a38ef30cdb0507d61bc973e944f4174a",
16
+ "aarch64-unknown-linux-gnu": "d6788ac5e17e986ce2f2ebc6069dc27bcb127847f38632a7cfecf434820e3f81",
17
+ "x86_64-pc-windows-msvc": "d10f2fbb55df4a42e3305c531ffd1e615bca494b8161d4817ed946239063b67b"
16
18
  }
17
19
  }
18
20
  }