@fabriccode/cli 7.0.115 → 7.0.116

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.
Files changed (2) hide show
  1. package/package.json +13 -13
  2. package/bin/kilo +0 -188
package/package.json CHANGED
@@ -6,21 +6,21 @@
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "7.0.115",
9
+ "version": "7.0.116",
10
10
  "license": "MIT",
11
11
  "optionalDependencies": {
12
- "@fabriccode/cli-linux-x64-baseline-musl": "7.0.115",
13
- "@fabriccode/cli-linux-x64-musl": "7.0.115",
14
- "@fabriccode/cli-darwin-x64-baseline": "7.0.115",
15
- "@fabriccode/cli-darwin-x64": "7.0.115",
16
- "@fabriccode/cli-linux-arm64": "7.0.115",
17
- "@fabriccode/cli-linux-x64": "7.0.115",
18
- "@fabriccode/cli-windows-x64-baseline": "7.0.115",
19
- "@fabriccode/cli-linux-arm64-musl": "7.0.115",
20
- "@fabriccode/cli-windows-arm64": "7.0.115",
21
- "@fabriccode/cli-windows-x64": "7.0.115",
22
- "@fabriccode/cli-linux-x64-baseline": "7.0.115",
23
- "@fabriccode/cli-darwin-arm64": "7.0.115"
12
+ "@fabriccode/cli-linux-x64-baseline-musl": "7.0.116",
13
+ "@fabriccode/cli-linux-x64-musl": "7.0.116",
14
+ "@fabriccode/cli-darwin-x64-baseline": "7.0.116",
15
+ "@fabriccode/cli-darwin-x64": "7.0.116",
16
+ "@fabriccode/cli-linux-arm64": "7.0.116",
17
+ "@fabriccode/cli-linux-x64": "7.0.116",
18
+ "@fabriccode/cli-windows-x64-baseline": "7.0.116",
19
+ "@fabriccode/cli-linux-arm64-musl": "7.0.116",
20
+ "@fabriccode/cli-windows-arm64": "7.0.116",
21
+ "@fabriccode/cli-windows-x64": "7.0.116",
22
+ "@fabriccode/cli-linux-x64-baseline": "7.0.116",
23
+ "@fabriccode/cli-darwin-arm64": "7.0.116"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
package/bin/kilo DELETED
@@ -1,188 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const childProcess = require("child_process")
4
- const fs = require("fs")
5
- const path = require("path")
6
- const os = require("os")
7
-
8
- function run(target) {
9
- const result = childProcess.spawnSync(target, process.argv.slice(2), {
10
- stdio: "inherit",
11
- })
12
- if (result.error) {
13
- console.error(result.error.message)
14
- process.exit(1)
15
- }
16
- const code = typeof result.status === "number" ? result.status : 0
17
- process.exit(code)
18
- }
19
-
20
- const envPath = process.env.FABRIC_BIN_PATH
21
- if (envPath) {
22
- run(envPath)
23
- }
24
-
25
- const scriptPath = fs.realpathSync(__filename)
26
- const scriptDir = path.dirname(scriptPath)
27
-
28
- // fabriccode_change start - fall through to findBinary() if cached binary fails
29
- const cached = path.join(scriptDir, ".kilo")
30
- if (fs.existsSync(cached)) {
31
- const result = childProcess.spawnSync(cached, process.argv.slice(2), {
32
- stdio: "inherit",
33
- })
34
- if (!result.error) {
35
- const code = typeof result.status === "number" ? result.status : 0
36
- process.exit(code)
37
- }
38
- // cached binary failed (e.g. wrong platform/arch, missing dynamic linker),
39
- // fall through to findBinary() which has better variant detection
40
- }
41
- // fabriccode_change end
42
-
43
- const platformMap = {
44
- darwin: "darwin",
45
- linux: "linux",
46
- win32: "windows",
47
- }
48
- const archMap = {
49
- x64: "x64",
50
- arm64: "arm64",
51
- arm: "arm",
52
- }
53
-
54
- let platform = platformMap[os.platform()]
55
- if (!platform) {
56
- platform = os.platform()
57
- }
58
- let arch = archMap[os.arch()]
59
- if (!arch) {
60
- arch = os.arch()
61
- }
62
- const base = "@fabriccode/cli-" + platform + "-" + arch
63
- const binary = platform === "windows" ? "fabric.exe" : "fabric" // fabriccode_change: binary is built as "fabric" not "kilo"
64
-
65
- function supportsAvx2() {
66
- if (arch !== "x64") return false
67
-
68
- if (platform === "linux") {
69
- try {
70
- return /(^|\s)avx2(\s|$)/i.test(fs.readFileSync("/proc/cpuinfo", "utf8"))
71
- } catch {
72
- return false
73
- }
74
- }
75
-
76
- if (platform === "darwin") {
77
- try {
78
- const result = childProcess.spawnSync("sysctl", ["-n", "hw.optional.avx2_0"], {
79
- encoding: "utf8",
80
- timeout: 1500,
81
- })
82
- if (result.status !== 0) return false
83
- return (result.stdout || "").trim() === "1"
84
- } catch {
85
- return false
86
- }
87
- }
88
-
89
- if (platform === "windows") {
90
- const cmd =
91
- '(Add-Type -MemberDefinition "[DllImport(""kernel32.dll"")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);" -Name Kernel32 -Namespace Win32 -PassThru)::IsProcessorFeaturePresent(40)'
92
-
93
- for (const exe of ["powershell.exe", "pwsh.exe", "pwsh", "powershell"]) {
94
- try {
95
- const result = childProcess.spawnSync(exe, ["-NoProfile", "-NonInteractive", "-Command", cmd], {
96
- encoding: "utf8",
97
- timeout: 3000,
98
- windowsHide: true,
99
- })
100
- if (result.status !== 0) continue
101
- const out = (result.stdout || "").trim().toLowerCase()
102
- if (out === "true" || out === "1") return true
103
- if (out === "false" || out === "0") return false
104
- } catch {
105
- continue
106
- }
107
- }
108
-
109
- return false
110
- }
111
-
112
- return false
113
- }
114
-
115
- const names = (() => {
116
- const avx2 = supportsAvx2()
117
- const baseline = arch === "x64" && !avx2
118
-
119
- if (platform === "linux") {
120
- const musl = (() => {
121
- try {
122
- if (fs.existsSync("/etc/alpine-release")) return true
123
- } catch {
124
- // ignore
125
- }
126
-
127
- try {
128
- const result = childProcess.spawnSync("ldd", ["--version"], { encoding: "utf8" })
129
- const text = ((result.stdout || "") + (result.stderr || "")).toLowerCase()
130
- if (text.includes("musl")) return true
131
- } catch {
132
- // ignore
133
- }
134
-
135
- return false
136
- })()
137
-
138
- if (musl) {
139
- if (arch === "x64") {
140
- if (baseline) return [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base]
141
- return [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]
142
- }
143
- return [`${base}-musl`, base]
144
- }
145
-
146
- if (arch === "x64") {
147
- if (baseline) return [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`]
148
- return [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]
149
- }
150
- return [base, `${base}-musl`]
151
- }
152
-
153
- if (arch === "x64") {
154
- if (baseline) return [`${base}-baseline`, base]
155
- return [base, `${base}-baseline`]
156
- }
157
- return [base]
158
- })()
159
-
160
- function findBinary(startDir) {
161
- let current = startDir
162
- for (;;) {
163
- const modules = path.join(current, "node_modules")
164
- if (fs.existsSync(modules)) {
165
- for (const name of names) {
166
- const candidate = path.join(modules, name, "bin", binary)
167
- if (fs.existsSync(candidate)) return candidate
168
- }
169
- }
170
- const parent = path.dirname(current)
171
- if (parent === current) {
172
- return
173
- }
174
- current = parent
175
- }
176
- }
177
-
178
- const resolved = findBinary(scriptDir)
179
- if (!resolved) {
180
- console.error(
181
- "It seems that your package manager failed to install the right version of the Fabric CLI for your platform. You can try manually installing " +
182
- names.map((n) => `\"${n}\"`).join(" or ") +
183
- " package",
184
- )
185
- process.exit(1)
186
- }
187
-
188
- run(resolved)