@yakupseymen/nowdiff 0.0.0-stage → 0.1.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 +15 -2
- package/bin/nowdiff.js +56 -0
- package/package.json +40 -4
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# nowdiff (npm)
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package installs the `nowdiff` binary through a tiny Node shim. The actual
|
|
4
|
+
executable lives in a platform-specific optional dependency, so there is no
|
|
5
|
+
post-install download.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx @yakupseymen/nowdiff@latest
|
|
9
|
+
# or
|
|
10
|
+
npm install -g @yakupseymen/nowdiff
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
See the [main README](https://github.com/yakupseymen/nowdiff) for usage, keys,
|
|
14
|
+
and modes.
|
|
15
|
+
|
|
16
|
+
Licensed under MIT.
|
package/bin/nowdiff.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const { spawn } = require("node:child_process");
|
|
7
|
+
|
|
8
|
+
const platform = process.platform;
|
|
9
|
+
const arch = process.arch;
|
|
10
|
+
const exe = platform === "win32" ? "nowdiff.exe" : "nowdiff";
|
|
11
|
+
|
|
12
|
+
// The matching platform package is installed through optionalDependencies.
|
|
13
|
+
// Scoped packages are preferred; unscoped names are a fallback for registries
|
|
14
|
+
// where the scope is unavailable.
|
|
15
|
+
function resolveBinary() {
|
|
16
|
+
const candidates = [
|
|
17
|
+
`@nowdiff/${platform}-${arch}`,
|
|
18
|
+
`nowdiff-${platform}-${arch}`,
|
|
19
|
+
];
|
|
20
|
+
for (const name of candidates) {
|
|
21
|
+
try {
|
|
22
|
+
const manifest = require.resolve(`${name}/package.json`);
|
|
23
|
+
const bin = path.join(path.dirname(manifest), "bin", exe);
|
|
24
|
+
if (fs.existsSync(bin)) {
|
|
25
|
+
return bin;
|
|
26
|
+
}
|
|
27
|
+
} catch (_) {
|
|
28
|
+
// Try the next candidate.
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const bin = resolveBinary();
|
|
35
|
+
if (!bin) {
|
|
36
|
+
console.error(
|
|
37
|
+
`nowdiff: no prebuilt binary found for ${platform}/${arch}.\n` +
|
|
38
|
+
`Expected @nowdiff/${platform}-${arch} or nowdiff-${platform}-${arch}.\n` +
|
|
39
|
+
`Reinstall the package, or build from source:\n` +
|
|
40
|
+
` go install github.com/yakupseymen/nowdiff/cmd/nowdiff@latest`
|
|
41
|
+
);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
46
|
+
child.on("error", (err) => {
|
|
47
|
+
console.error(`nowdiff: failed to start binary: ${err.message}`);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
});
|
|
50
|
+
child.on("exit", (code, signal) => {
|
|
51
|
+
if (signal) {
|
|
52
|
+
process.kill(process.pid, signal);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
process.exit(code === null ? 1 : code);
|
|
56
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yakupseymen/nowdiff",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "See what changed while you work — a live TUI diff for your working tree.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/yakupseymen/nowdiff",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/yakupseymen/nowdiff.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/yakupseymen/nowdiff/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"diff",
|
|
16
|
+
"tui",
|
|
17
|
+
"terminal",
|
|
18
|
+
"git",
|
|
19
|
+
"watch",
|
|
20
|
+
"claude-code"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"nowdiff": "bin/nowdiff.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin/nowdiff.js",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=16"
|
|
31
|
+
},
|
|
32
|
+
"optionalDependencies": {
|
|
33
|
+
"@nowdiff/darwin-arm64": "0.1.0",
|
|
34
|
+
"@nowdiff/darwin-x64": "0.1.0",
|
|
35
|
+
"@nowdiff/linux-arm64": "0.1.0",
|
|
36
|
+
"@nowdiff/linux-x64": "0.1.0",
|
|
37
|
+
"@nowdiff/win32-x64": "0.1.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
}
|
|
42
|
+
}
|