tuiweather 0.3.2 → 0.3.7
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 +4 -2
- package/bin/tuiweather.js +39 -2
- package/dist/index.js +7318 -4538
- package/package.json +3 -3
- package/dist/highlights-eq9cgrbb.scm +0 -604
- package/dist/highlights-ghv9g403.scm +0 -205
- package/dist/highlights-hk7bwhj4.scm +0 -284
- package/dist/highlights-r812a2qc.scm +0 -150
- package/dist/highlights-x6tmsnaa.scm +0 -115
- package/dist/injections-73j83es3.scm +0 -27
- package/dist/parser.worker-q7b31n6a.js +0 -4566
- package/dist/tree-sitter-3jzf13jk.wasm +0 -0
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
package/README.md
CHANGED
|
@@ -16,13 +16,15 @@ Keyboard-driven terminal weather app: Dark Sky-style rain nowcasting, hourly and
|
|
|
16
16
|
|
|
17
17
|
## Install
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Requires Node.js to run: the package declares `engines.node >= 20`, and the command-line
|
|
20
|
+
paths (`--version`, `--help`, `--one-line`) work on any such Node; the interactive TUI
|
|
21
|
+
needs Node >= 26.4.0, enforced at runtime by the launcher. Install globally with npm:
|
|
20
22
|
|
|
21
23
|
```sh
|
|
22
24
|
npm install --global tuiweather
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
or with Bun:
|
|
27
|
+
or with the Bun package manager:
|
|
26
28
|
|
|
27
29
|
```sh
|
|
28
30
|
bun install --global tuiweather
|
package/bin/tuiweather.js
CHANGED
|
@@ -1,2 +1,39 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import "
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const FFI_FLAGS = ["--experimental-ffi", "--disable-warning=ExperimentalWarning"];
|
|
6
|
+
const FFI_MIN_NODE = [26, 4, 0];
|
|
7
|
+
|
|
8
|
+
function nodeAtLeast(min) {
|
|
9
|
+
const parts = process.versions.node.split(".").map(Number);
|
|
10
|
+
for (let i = 0; i < min.length; i++) {
|
|
11
|
+
const have = parts[i] ?? 0;
|
|
12
|
+
if (have !== min[i]) return have > min[i];
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const underBun = Boolean(process.versions.bun);
|
|
18
|
+
const hasFlags = FFI_FLAGS.every((flag) => process.execArgv.includes(flag));
|
|
19
|
+
|
|
20
|
+
if (underBun || hasFlags || !nodeAtLeast(FFI_MIN_NODE)) {
|
|
21
|
+
await import("../dist/index.js");
|
|
22
|
+
} else {
|
|
23
|
+
const script = fileURLToPath(new URL("../dist/index.js", import.meta.url));
|
|
24
|
+
const child = spawnSync(process.execPath, [...FFI_FLAGS, script, ...process.argv.slice(2)], {
|
|
25
|
+
stdio: "inherit",
|
|
26
|
+
});
|
|
27
|
+
if (child.error) {
|
|
28
|
+
console.error(child.error.message);
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
} else if (child.signal) {
|
|
31
|
+
try {
|
|
32
|
+
process.kill(process.pid, child.signal);
|
|
33
|
+
} catch {
|
|
34
|
+
process.exitCode = child.status ?? 1;
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
process.exitCode = child.status ?? 1;
|
|
38
|
+
}
|
|
39
|
+
}
|