@toothfairyai/tfcode 1.0.2 → 1.0.3
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/LICENSE +0 -0
- package/bin/tfcode +0 -0
- package/bin/tfcode.js +8 -9
- package/package.json +1 -33
- package/postinstall.mjs +7 -0
package/LICENSE
CHANGED
|
File without changes
|
package/bin/tfcode
ADDED
|
Binary file
|
package/bin/tfcode.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const { spawn } = require(
|
|
3
|
-
const path = require(
|
|
4
|
-
const fs = require(
|
|
2
|
+
const { spawn } = require("child_process")
|
|
3
|
+
const path = require("path")
|
|
4
|
+
const fs = require("fs")
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const binaryPath = path.join(binDir, binary)
|
|
6
|
+
const binary = process.platform === "win32" ? "tfcode.exe" : "tfcode"
|
|
7
|
+
const binaryPath = path.join(__dirname, binary)
|
|
9
8
|
|
|
10
9
|
if (!fs.existsSync(binaryPath)) {
|
|
11
|
-
console.error(
|
|
10
|
+
console.error("tfcode binary not found at " + binaryPath)
|
|
12
11
|
process.exit(1)
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
16
|
-
stdio:
|
|
15
|
+
stdio: "inherit",
|
|
17
16
|
env: process.env
|
|
18
17
|
})
|
|
19
18
|
|
|
20
|
-
child.on(
|
|
19
|
+
child.on("exit", (code) => process.exit(code || 0))
|
package/package.json
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@toothfairyai/tfcode",
|
|
3
|
-
"version": "1.0.2",
|
|
4
|
-
"bin": {
|
|
5
|
-
"tfcode": "./bin/tfcode.js"
|
|
6
|
-
},
|
|
7
|
-
"scripts": {
|
|
8
|
-
"postinstall": "node ./postinstall.mjs"
|
|
9
|
-
},
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"optionalDependencies": {
|
|
12
|
-
"@toothfairyai/tfcode-linux-arm64": "1.0.2",
|
|
13
|
-
"@toothfairyai/tfcode-windows-x64": "1.0.2",
|
|
14
|
-
"@toothfairyai/tfcode-linux-x64-baseline-musl": "1.0.2",
|
|
15
|
-
"@toothfairyai/tfcode-darwin-x64-baseline": "1.0.2",
|
|
16
|
-
"@toothfairyai/tfcode-linux-x64-musl": "1.0.2",
|
|
17
|
-
"@toothfairyai/tfcode-windows-x64-baseline": "1.0.2",
|
|
18
|
-
"@toothfairyai/tfcode-linux-arm64-musl": "1.0.2",
|
|
19
|
-
"@toothfairyai/tfcode-windows-arm64": "1.0.2",
|
|
20
|
-
"@toothfairyai/tfcode-linux-x64": "1.0.2",
|
|
21
|
-
"@toothfairyai/tfcode-darwin-x64": "1.0.2",
|
|
22
|
-
"@toothfairyai/tfcode-linux-x64-baseline": "1.0.2",
|
|
23
|
-
"@toothfairyai/tfcode-darwin-arm64": "1.0.2"
|
|
24
|
-
},
|
|
25
|
-
"engines": {
|
|
26
|
-
"node": ">=18"
|
|
27
|
-
},
|
|
28
|
-
"homepage": "https://toothfairyai.com/developers/tfcode",
|
|
29
|
-
"repository": {
|
|
30
|
-
"type": "git",
|
|
31
|
-
"url": "https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
{"name":"@toothfairyai/tfcode","version":"1.0.3","bin":{"tfcode":"./bin/tfcode.js"},"scripts":{"postinstall":"node ./postinstall.mjs"},"license":"MIT","optionalDependencies":{"@toothfairyai/tfcode-darwin-arm64":"1.0.3"},"engines":{"node":">=18"},"homepage":"https://toothfairyai.com/developers/tfcode","repository":{"type":"git","url":"https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git"}}
|
package/postinstall.mjs
CHANGED
|
@@ -4,6 +4,10 @@ import fs from "fs"
|
|
|
4
4
|
import path from "path"
|
|
5
5
|
import os from "os"
|
|
6
6
|
import { spawnSync } from "child_process"
|
|
7
|
+
import { fileURLToPath } from "url"
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
10
|
+
const __dirname = path.dirname(__filename)
|
|
7
11
|
|
|
8
12
|
const GITEA_HOST = process.env.TFCODE_GITEA_HOST || "gitea.toothfairyai.com"
|
|
9
13
|
const GITEA_REPO = process.env.TFCODE_GITEA_REPO || "ToothFairyAI/tf_code"
|
|
@@ -174,6 +178,9 @@ async function main() {
|
|
|
174
178
|
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
|
175
179
|
console.log("")
|
|
176
180
|
|
|
181
|
+
// Download and setup binary
|
|
182
|
+
await downloadBinary()
|
|
183
|
+
|
|
177
184
|
// Check for Python (needed for TF integration)
|
|
178
185
|
try {
|
|
179
186
|
const result = spawnSync("python3", ["--version"], { encoding: "utf8" })
|