@treble-app/cli 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.
- package/bin/treble +69 -0
- package/npm/darwin-arm64/bin/treble +0 -0
- package/npm/darwin-arm64/package.json +19 -0
- package/npm/darwin-x64/bin/treble +0 -0
- package/npm/darwin-x64/package.json +19 -0
- package/npm/linux-arm64/bin/treble +0 -0
- package/npm/linux-arm64/package.json +19 -0
- package/npm/linux-x64/bin/treble +0 -0
- package/npm/linux-x64/package.json +19 -0
- package/package.json +51 -0
package/bin/treble
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
7
|
+
const PLATFORMS = {
|
|
8
|
+
"darwin-arm64": "@treble-app/cli-darwin-arm64",
|
|
9
|
+
"darwin-x64": "@treble-app/cli-darwin-x64",
|
|
10
|
+
"linux-x64": "@treble-app/cli-linux-x64",
|
|
11
|
+
"linux-arm64": "@treble-app/cli-linux-arm64",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function getBinaryPath() {
|
|
15
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
16
|
+
const packageName = PLATFORMS[platformKey];
|
|
17
|
+
|
|
18
|
+
if (!packageName) {
|
|
19
|
+
console.error(`Unsupported platform: ${platformKey}`);
|
|
20
|
+
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(", ")}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const binaryName = process.platform === "win32" ? "treble.exe" : "treble";
|
|
25
|
+
|
|
26
|
+
// Paths to check, in order of priority
|
|
27
|
+
const paths = [
|
|
28
|
+
// Bundled in npm/ folder (primary - works with npx)
|
|
29
|
+
path.join(__dirname, "..", "npm", platformKey, "bin", binaryName),
|
|
30
|
+
// Optional dependency in node_modules
|
|
31
|
+
path.join(__dirname, "..", "node_modules", packageName, "bin", binaryName),
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
for (const binPath of paths) {
|
|
35
|
+
try {
|
|
36
|
+
if (fs.existsSync(binPath)) {
|
|
37
|
+
return binPath;
|
|
38
|
+
}
|
|
39
|
+
} catch {}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Try require.resolve as last resort
|
|
43
|
+
try {
|
|
44
|
+
const pkgPath = require.resolve(`${packageName}/package.json`);
|
|
45
|
+
const pkgDir = path.dirname(pkgPath);
|
|
46
|
+
const binPath = path.join(pkgDir, "bin", binaryName);
|
|
47
|
+
if (fs.existsSync(binPath)) {
|
|
48
|
+
return binPath;
|
|
49
|
+
}
|
|
50
|
+
} catch {}
|
|
51
|
+
|
|
52
|
+
console.error(`Could not find treble binary for platform: ${platformKey}`);
|
|
53
|
+
console.error(`Checked paths:`);
|
|
54
|
+
paths.forEach(p => console.error(` - ${p}`));
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const binaryPath = getBinaryPath();
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
execFileSync(binaryPath, process.argv.slice(2), {
|
|
62
|
+
stdio: "inherit",
|
|
63
|
+
});
|
|
64
|
+
} catch (error) {
|
|
65
|
+
if (error.status !== null) {
|
|
66
|
+
process.exit(error.status);
|
|
67
|
+
}
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@treble-app/cli-darwin-arm64",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "treble CLI binary for macOS ARM64",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/treble-app/treble-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"os": [
|
|
11
|
+
"darwin"
|
|
12
|
+
],
|
|
13
|
+
"cpu": [
|
|
14
|
+
"arm64"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/treble"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@treble-app/cli-darwin-x64",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "treble CLI binary for macOS x64",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/treble-app/treble-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"os": [
|
|
11
|
+
"darwin"
|
|
12
|
+
],
|
|
13
|
+
"cpu": [
|
|
14
|
+
"x64"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/treble"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@treble-app/cli-linux-arm64",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "treble CLI binary for Linux ARM64",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/treble-app/treble-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"os": [
|
|
11
|
+
"linux"
|
|
12
|
+
],
|
|
13
|
+
"cpu": [
|
|
14
|
+
"arm64"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/treble"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@treble-app/cli-linux-x64",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "treble CLI binary for Linux x64",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/treble-app/treble-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"os": [
|
|
11
|
+
"linux"
|
|
12
|
+
],
|
|
13
|
+
"cpu": [
|
|
14
|
+
"x64"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/treble"
|
|
18
|
+
]
|
|
19
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@treble-app/cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Figma-to-code CLI — plan, implement, compare",
|
|
5
|
+
"author": "treble.build",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/treble-app/treble-cli.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://treble.build",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/treble-app/treble-cli/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"cli",
|
|
17
|
+
"figma",
|
|
18
|
+
"code-generation",
|
|
19
|
+
"design-to-code",
|
|
20
|
+
"treble"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"treble": "bin/treble"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin",
|
|
27
|
+
"npm"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "cargo test",
|
|
31
|
+
"postinstall": "node scripts/postinstall.js"
|
|
32
|
+
},
|
|
33
|
+
"optionalDependencies": {
|
|
34
|
+
"@treble-app/cli-darwin-arm64": "1.0.0",
|
|
35
|
+
"@treble-app/cli-darwin-x64": "1.0.0",
|
|
36
|
+
"@treble-app/cli-linux-x64": "1.0.0",
|
|
37
|
+
"@treble-app/cli-linux-arm64": "1.0.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@commitlint/cli": "^19.0.0",
|
|
41
|
+
"@commitlint/config-conventional": "^19.0.0",
|
|
42
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
43
|
+
"@semantic-release/exec": "^6.0.3",
|
|
44
|
+
"@semantic-release/git": "^10.0.1",
|
|
45
|
+
"conventional-changelog-conventionalcommits": "^7.0.2",
|
|
46
|
+
"semantic-release": "^24.0.0"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18"
|
|
50
|
+
}
|
|
51
|
+
}
|