@mattfillipe/diffler 0.18.0 → 0.19.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 +3 -3
- package/bin/diffler.js +0 -3
- package/install.js +2 -4
- package/lib/resolve.js +3 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# diffler
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
A magit-style git TUI and code reviewer. This package installs a launcher that
|
|
4
|
+
downloads the prebuilt binary for your platform from the GitHub release.
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
|
-
npm install -g diffler
|
|
7
|
+
npm install -g @mattfillipe/diffler
|
|
8
8
|
diffler
|
|
9
9
|
```
|
|
10
10
|
|
package/bin/diffler.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
// Launcher shim: resolve the platform binary (fetching it on first run if the
|
|
5
|
-
// postinstall step was skipped), then exec it with the caller's args/stdio.
|
|
6
|
-
|
|
7
4
|
const { spawnSync } = require("node:child_process");
|
|
8
5
|
const { ensureBinary } = require("../lib/resolve.js");
|
|
9
6
|
|
package/install.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
// the launcher shim downloads it lazily on first run, so `npm install
|
|
5
|
-
// --ignore-scripts` and offline-then-online still work.
|
|
3
|
+
// The launcher fetches the binary on first run, so a failed prefetch here is fine.
|
|
6
4
|
|
|
7
5
|
const { ensureBinary } = require("./lib/resolve.js");
|
|
8
6
|
|
|
9
7
|
ensureBinary().catch((err) => {
|
|
10
8
|
process.stderr.write(
|
|
11
9
|
`diffler: could not prefetch the binary (${err.message}); ` +
|
|
12
|
-
"
|
|
10
|
+
"run diffler to fetch it.\n",
|
|
13
11
|
);
|
|
14
12
|
});
|
package/lib/resolve.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// so `--ignore-scripts` installs still work).
|
|
3
|
+
// The npm package ships only this JS. We fetch the binary from the matching
|
|
4
|
+
// GitHub release on install, and again on first run so `--ignore-scripts`
|
|
5
|
+
// installs still work.
|
|
7
6
|
|
|
8
7
|
const fs = require("node:fs");
|
|
9
8
|
const os = require("node:os");
|
|
@@ -17,7 +16,6 @@ const BASE =
|
|
|
17
16
|
process.env.DIFFLER_DOWNLOAD_BASE ||
|
|
18
17
|
`https://github.com/${REPO}/releases/download`;
|
|
19
18
|
|
|
20
|
-
// node platform-arch -> { rust target triple, archive extension }
|
|
21
19
|
const TARGETS = {
|
|
22
20
|
"darwin-arm64": { target: "aarch64-apple-darwin", ext: "tar.gz" },
|
|
23
21
|
"darwin-x64": { target: "x86_64-apple-darwin", ext: "tar.gz" },
|
|
@@ -88,8 +86,6 @@ function download(url, dest) {
|
|
|
88
86
|
function extract(archive, ext, into) {
|
|
89
87
|
fs.mkdirSync(into, { recursive: true });
|
|
90
88
|
if (ext === "zip") {
|
|
91
|
-
// Expand-Archive is built into Windows PowerShell; the only platform that
|
|
92
|
-
// ships a .zip asset is win32
|
|
93
89
|
execFileSync("powershell", [
|
|
94
90
|
"-NoProfile",
|
|
95
91
|
"-Command",
|
package/package.json
CHANGED