opendocker 0.1.3 → 0.1.4
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/dist/main.js +1 -1
- package/package.json +4 -1
- package/scripts/build.ts +139 -0
- package/src/layouts/BaseLayout.tsx +1 -1
package/dist/main.js
CHANGED
|
@@ -31933,7 +31933,7 @@ function BaseLayout({ children }) {
|
|
|
31933
31933
|
const { activePane, setActivePane } = useApplicationStore((state) => state);
|
|
31934
31934
|
const dimensions = useTerminalDimensions();
|
|
31935
31935
|
const [pwd, setPwd] = import_react17.useState("");
|
|
31936
|
-
const version = "v0.1.
|
|
31936
|
+
const version = "v0.1.4";
|
|
31937
31937
|
import_react17.useEffect(() => {
|
|
31938
31938
|
Bun.$`pwd`.quiet().then((result) => setPwd(result.text()));
|
|
31939
31939
|
setActivePane("containers");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"name": "opendocker",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"opendocker": "./dist/main.js"
|
|
9
9
|
},
|
|
10
10
|
"file": ["dist/", "package.json", "README.md"],
|
|
11
|
+
"exports": {
|
|
12
|
+
"./*": "./src/*.ts"
|
|
13
|
+
},
|
|
11
14
|
"scripts": {
|
|
12
15
|
"build": "bun build ./src/main.tsx --outdir ./dist --target bun",
|
|
13
16
|
"start": "bun run dist/main.js",
|
package/scripts/build.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import path from "path"
|
|
4
|
+
import fs from "fs"
|
|
5
|
+
import { $ } from "bun"
|
|
6
|
+
import { fileURLToPath } from "url"
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
9
|
+
const __dirname = path.dirname(__filename)
|
|
10
|
+
const dir = path.resolve(__dirname, "..")
|
|
11
|
+
|
|
12
|
+
process.chdir(dir)
|
|
13
|
+
|
|
14
|
+
import pkg from "../package.json"
|
|
15
|
+
import { Script } from "@opencode-ai/script"
|
|
16
|
+
|
|
17
|
+
const singleFlag = process.argv.includes("--single")
|
|
18
|
+
|
|
19
|
+
const allTargets: {
|
|
20
|
+
os: string
|
|
21
|
+
arch: "arm64" | "x64"
|
|
22
|
+
abi?: "musl"
|
|
23
|
+
avx2?: false
|
|
24
|
+
}[] = [
|
|
25
|
+
{
|
|
26
|
+
os: "linux",
|
|
27
|
+
arch: "arm64",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
os: "linux",
|
|
31
|
+
arch: "x64",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
os: "linux",
|
|
35
|
+
arch: "x64",
|
|
36
|
+
avx2: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
os: "linux",
|
|
40
|
+
arch: "arm64",
|
|
41
|
+
abi: "musl",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
os: "linux",
|
|
45
|
+
arch: "x64",
|
|
46
|
+
abi: "musl",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
os: "linux",
|
|
50
|
+
arch: "x64",
|
|
51
|
+
abi: "musl",
|
|
52
|
+
avx2: false,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
os: "darwin",
|
|
56
|
+
arch: "arm64",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
os: "darwin",
|
|
60
|
+
arch: "x64",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
os: "darwin",
|
|
64
|
+
arch: "x64",
|
|
65
|
+
avx2: false,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
os: "win32",
|
|
69
|
+
arch: "x64",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
os: "win32",
|
|
73
|
+
arch: "x64",
|
|
74
|
+
avx2: false,
|
|
75
|
+
},
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
const targets = singleFlag
|
|
79
|
+
? allTargets.filter((item) => item.os === process.platform && item.arch === process.arch)
|
|
80
|
+
: allTargets
|
|
81
|
+
|
|
82
|
+
await $`rm -rf dist`
|
|
83
|
+
|
|
84
|
+
const binaries: Record<string, string> = {}
|
|
85
|
+
await $`bun install --os="*" --cpu="*" @opentui/core@${pkg.dependencies["@opentui/core"]}`
|
|
86
|
+
await $`bun install --os="*" --cpu="*" @parcel/watcher@${pkg.dependencies["@parcel/watcher"]}`
|
|
87
|
+
for (const item of targets) {
|
|
88
|
+
const name = [
|
|
89
|
+
pkg.name,
|
|
90
|
+
// changing to win32 flags npm for some reason
|
|
91
|
+
item.os === "win32" ? "windows" : item.os,
|
|
92
|
+
item.arch,
|
|
93
|
+
item.avx2 === false ? "baseline" : undefined,
|
|
94
|
+
item.abi === undefined ? undefined : item.abi,
|
|
95
|
+
]
|
|
96
|
+
.filter(Boolean)
|
|
97
|
+
.join("-")
|
|
98
|
+
console.log(`building ${name}`)
|
|
99
|
+
await $`mkdir -p dist/${name}/bin`
|
|
100
|
+
|
|
101
|
+
const parserWorker = fs.realpathSync(path.resolve(dir, "./node_modules/@opentui/core/parser.worker.js"))
|
|
102
|
+
const workerPath = "./src/cli/cmd/tui/worker.ts"
|
|
103
|
+
|
|
104
|
+
await Bun.build({
|
|
105
|
+
conditions: ["browser"],
|
|
106
|
+
tsconfig: "./tsconfig.json",
|
|
107
|
+
sourcemap: "external",
|
|
108
|
+
compile: {
|
|
109
|
+
target: name.replace(pkg.name, "bun") as any,
|
|
110
|
+
outfile: `dist/${name}/bin/opendocker`,
|
|
111
|
+
execArgv: [`--user-agent=opencode/${Script.version}`, `--env-file=""`, `--`],
|
|
112
|
+
windows: {},
|
|
113
|
+
},
|
|
114
|
+
entrypoints: ["./src/index.ts", parserWorker, workerPath],
|
|
115
|
+
define: {
|
|
116
|
+
OPENCODE_VERSION: `'${Script.version}'`,
|
|
117
|
+
OTUI_TREE_SITTER_WORKER_PATH: "/$bunfs/root/" + path.relative(dir, parserWorker).replaceAll("\\", "/"),
|
|
118
|
+
OPENCODE_WORKER_PATH: workerPath,
|
|
119
|
+
OPENCODE_CHANNEL: `'${Script.channel}'`,
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
await $`rm -rf ./dist/${name}/bin/tui`
|
|
124
|
+
await Bun.file(`dist/${name}/package.json`).write(
|
|
125
|
+
JSON.stringify(
|
|
126
|
+
{
|
|
127
|
+
name,
|
|
128
|
+
version: Script.version,
|
|
129
|
+
os: [item.os],
|
|
130
|
+
cpu: [item.arch],
|
|
131
|
+
},
|
|
132
|
+
null,
|
|
133
|
+
2,
|
|
134
|
+
),
|
|
135
|
+
)
|
|
136
|
+
binaries[name] = Script.version
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { binaries }
|
|
@@ -10,7 +10,7 @@ export default function BaseLayout({ children }: { children: React.ReactNode })
|
|
|
10
10
|
const { activePane, setActivePane } = useApplicationStore((state) => state);
|
|
11
11
|
const dimensions = useTerminalDimensions();
|
|
12
12
|
const [pwd, setPwd] = useState<string>("");
|
|
13
|
-
const version = "v0.1.
|
|
13
|
+
const version = "v0.1.4";
|
|
14
14
|
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
Bun.$`pwd`.quiet().then(result => setPwd(result.text()));
|