@mikimatsub/ttui 0.0.0-stage → 1.0.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.
Binary file
package/bin/ttui.mjs ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'node:child_process';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { realpathSync } from 'node:fs';
5
+
6
+ export function binaryPath(platform, arch) {
7
+ if (arch !== 'x64' || !['linux', 'win32'].includes(platform)) {
8
+ throw new Error(`T-TUI supports Linux and Windows x64; received ${platform}/${arch}. See GitHub Releases or build from source.`);
9
+ }
10
+ return fileURLToPath(new URL(`${platform}-x64/ttui${platform === 'win32' ? '.exe' : ''}`, import.meta.url));
11
+ }
12
+
13
+ if (process.argv[1] && realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
14
+ try {
15
+ const child = spawn(binaryPath(process.platform, process.arch), process.argv.slice(2), { stdio: 'inherit', shell: false });
16
+ const signals = ['SIGINT', 'SIGTERM'];
17
+ const handlers = signals.map(signal => () => child.kill(signal));
18
+ signals.forEach((signal, index) => process.on(signal, handlers[index]));
19
+ child.on('error', error => {
20
+ console.error(`Could not launch T-TUI (${error.code ?? 'unknown error'}). Reinstall the package or use the native GitHub release.`);
21
+ process.exitCode = 1;
22
+ });
23
+ child.on('exit', (code, signal) => {
24
+ signals.forEach((name, index) => process.removeListener(name, handlers[index]));
25
+ process.exitCode = code ?? (signal === 'SIGINT' ? 130 : 143);
26
+ });
27
+ } catch (error) {
28
+ console.error(error.message);
29
+ process.exitCode = 1;
30
+ }
31
+ }
Binary file
package/checksums.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "bin/linux-x64/ttui": "80bb649e30f1066dfd7da1740bfa1e1c8505b9afd60c407af840820275125f7b",
3
+ "bin/win32-x64/ttui.exe": "da7a658e1a9f7b69dfdb1d12cb344de302eebb81efcee393910f410f40bfd078"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "@mikimatsub/ttui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "T-TUI native terminal client for Linux and Windows",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": { "ttui": "bin/ttui.mjs" },
8
+ "files": ["bin", "LICENSE", "CROSSTERM-LICENSE", "THIRD_PARTY_NOTICES.txt", "RUST-STDLIB-LICENSE.html", "README.md", "checksums.json"],
9
+ "os": ["linux", "win32"],
10
+ "cpu": ["x64"],
11
+ "engines": { "node": ">=24.21.0" },
12
+ "repository": { "type": "git", "url": "git+https://github.com/mikimatsub/T-Tui.git" },
13
+ "bugs": { "url": "https://github.com/mikimatsub/T-Tui/issues" },
14
+ "publishConfig": { "access": "public" }
15
+ }