tailflow 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/bin/run.js +66 -0
- package/bin/tailflow-daemon.js +3 -0
- package/bin/tailflow.js +3 -0
- package/package.json +35 -0
package/bin/run.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared launcher for tailflow and tailflow-daemon.
|
|
3
|
+
*
|
|
4
|
+
* Resolves the compiled binary from the correct platform-specific optional
|
|
5
|
+
* dependency (@tailflow/<platform>) and exec's it, forwarding all args and
|
|
6
|
+
* stdio so that ratatui TUI and TTY interaction work correctly.
|
|
7
|
+
*/
|
|
8
|
+
'use strict'
|
|
9
|
+
|
|
10
|
+
const { spawnSync } = require('child_process')
|
|
11
|
+
const { join } = require('path')
|
|
12
|
+
|
|
13
|
+
// Maps Node.js { platform, arch } → optional dependency name.
|
|
14
|
+
const PLATFORM_MAP = {
|
|
15
|
+
'darwin-arm64': '@thinkgrid/tailflow-darwin-arm64',
|
|
16
|
+
'darwin-x64': '@thinkgrid/tailflow-darwin-x64',
|
|
17
|
+
'linux-arm64': '@thinkgrid/tailflow-linux-arm64',
|
|
18
|
+
'linux-x64': '@thinkgrid/tailflow-linux-x64',
|
|
19
|
+
'win32-x64': '@thinkgrid/tailflow-win32-x64',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function run(binaryName) {
|
|
23
|
+
const key = `${process.platform}-${process.arch}`
|
|
24
|
+
const pkg = PLATFORM_MAP[key]
|
|
25
|
+
|
|
26
|
+
if (!pkg) {
|
|
27
|
+
process.stderr.write(
|
|
28
|
+
`tailflow: unsupported platform "${key}"\n` +
|
|
29
|
+
`Supported platforms: ${Object.keys(PLATFORM_MAP).join(', ')}\n`
|
|
30
|
+
)
|
|
31
|
+
process.exit(1)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Locate the platform package on disk
|
|
35
|
+
let pkgJsonPath
|
|
36
|
+
try {
|
|
37
|
+
pkgJsonPath = require.resolve(`${pkg}/package.json`)
|
|
38
|
+
} catch {
|
|
39
|
+
process.stderr.write(
|
|
40
|
+
`tailflow: platform package "${pkg}" is not installed.\n` +
|
|
41
|
+
`This usually means the optional dependency was skipped.\n` +
|
|
42
|
+
`Try: npm install ${pkg}\n`
|
|
43
|
+
)
|
|
44
|
+
process.exit(1)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const ext = process.platform === 'win32' ? '.exe' : ''
|
|
48
|
+
const binDir = join(pkgJsonPath, '..', 'bin')
|
|
49
|
+
const bin = join(binDir, `${binaryName}${ext}`)
|
|
50
|
+
|
|
51
|
+
const result = spawnSync(bin, process.argv.slice(2), {
|
|
52
|
+
stdio: 'inherit',
|
|
53
|
+
// Pass through the current environment so RUST_LOG etc. work
|
|
54
|
+
env: process.env,
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
if (result.error) {
|
|
58
|
+
// Binary not executable or not found
|
|
59
|
+
process.stderr.write(`tailflow: could not start binary: ${result.error.message}\n`)
|
|
60
|
+
process.exit(1)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
process.exit(result.status ?? 0)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = { run }
|
package/bin/tailflow.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tailflow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Zero-configuration, high-speed local log aggregator for modern full-stack development",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"log",
|
|
8
|
+
"tail",
|
|
9
|
+
"docker",
|
|
10
|
+
"developer-tools",
|
|
11
|
+
"cli",
|
|
12
|
+
"tui"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/your-org/tailflow"
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"tailflow": "bin/tailflow.js",
|
|
20
|
+
"tailflow-daemon": "bin/tailflow-daemon.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin/"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"optionalDependencies": {
|
|
29
|
+
"@thinkgrid/tailflow-darwin-arm64": "0.1.0",
|
|
30
|
+
"@thinkgrid/tailflow-darwin-x64": "0.1.0",
|
|
31
|
+
"@thinkgrid/tailflow-linux-arm64": "0.1.0",
|
|
32
|
+
"@thinkgrid/tailflow-linux-x64": "0.1.0",
|
|
33
|
+
"@thinkgrid/tailflow-win32-x64": "0.1.0"
|
|
34
|
+
}
|
|
35
|
+
}
|