History

fix build

Rhys Sullivan committed 8 months ago

Commit bcdff4d1 parent 7b9d40e4 files · +51 −6Browse files

Unified · Split

4 files
  1. apps/executor/package.json +2 −2
  2. apps/executor/src/distribution/artifact.ts +6 −1
  3. apps/web/src/components/shell.tsx +19 −3
  4. apps/web/vite.config.ts +24 −0
apps/executor/package.json+2−2
@@ -1,6 +1,6 @@
11 {
22 "name": "executor",
3− "version": "1.1.3",
3+ "version": "1.1.5",
44 "description": "Local AI executor with a CLI, local API server, and web UI.",
55 "keywords": [
66 "executor",
@@ -22,7 +22,7 @@ · 15 unmodified lines
2222 "private": true,
2323 "type": "module",
2424 "bin": {
25− "executor": "./bin/executor"
25+ "executor": "bin/executor"
2626 },
2727 "scripts": {
2828 "typecheck": "bunx tsc --noEmit -p tsconfig.json",
apps/executor/src/distribution/artifact.ts+6−1
@@ -120,7 +120,7 @@ const createPackageJson = (input: { · 119 unmodified lines
120120 type: "module",
121121 private: false,
122122 bin: {
123− executor: "./bin/executor.js",
123+ executor: "bin/executor.js",
124124 },
125125 files: [
126126 "bin",
@@ -195,6 +195,11 @@ export const buildDistributionPackage = async ( · 68 unmodified lines
195195 });
196196 await cp(pgliteDataPath, join(binDir, "pglite.data"));
197197 await cp(pgliteWasmPath, join(binDir, "pglite.wasm"));
198+ await mkdir(join(binDir, "openapi-extractor-wasm"), { recursive: true });
199+ await cp(
200+ join(repoRoot, "packages/codemode-openapi/src/openapi-extractor-wasm/openapi_extractor_bg.wasm"),
201+ join(binDir, "openapi-extractor-wasm/openapi_extractor_bg.wasm"),
202+ );
198203 await cp(
199204 join(repoRoot, "packages/runtime-deno-subprocess/src/deno-subprocess-worker.mjs"),
200205 join(binDir, "deno-subprocess-worker.mjs"),
apps/web/src/components/shell.tsx+19−3
@@ -15,8 +15,16 @@ const statusColor: Record<string, string> = { · 14 unmodified lines
1515 error: "bg-destructive",
1616 };
1717
18−// ── AppShell ─────────────────────────────────────────────────────────────
18+type AppMetaEnv = {
19+ readonly VITE_APP_VERSION: string;
20+ readonly VITE_GITHUB_URL: string;
21+};
1922
23+const { VITE_APP_VERSION, VITE_GITHUB_URL } = (import.meta as ImportMeta & {
24+ readonly env: AppMetaEnv;
25+}).env;
26+
27+// ── AppShell ─────────────────────────────────────────────────────────────
2028 export function AppShell() {
2129 const sources = useSources();
2230 const matchRoute = useMatchRoute();
@@ -75,8 +83,16 @@ export function AppShell() { · 52 unmodified lines
7583
7684 {/* Footer */}
7785 <div className="shrink-0 border-t border-sidebar-border px-4 py-2.5">
78− <div className="text-[10px] text-muted-foreground/30">
79− executor v3
86+ <div className="flex flex-col items-start gap-1 text-[10px] leading-none">
87+ <span className="text-muted-foreground/35">v{VITE_APP_VERSION}</span>
88+ <a
89+ href={VITE_GITHUB_URL}
90+ target="_blank"
91+ rel="noreferrer"
92+ className="text-muted-foreground/50 transition-colors hover:text-foreground"
93+ >
94+ Star on GitHub
95+ </a>
8096 </div>
8197 </div>
8298 </aside>
apps/web/vite.config.ts+24−0
@@ -1,8 +1,28 @@
1+import { readFileSync } from "node:fs";
12 import { defineConfig } from "vite";
23 import react from "@vitejs/plugin-react";
34 import tailwindcss from "@tailwindcss/vite";
45 import devServer from "@hono/vite-dev-server";
56
7+type ExecutorPackageMetadata = {
8+ version: string;
9+ homepage?: string;
10+ repository?: string | { url?: string };
11+};
12+
13+const executorPackage = JSON.parse(
14+ readFileSync(new URL("../executor/package.json", import.meta.url), "utf8"),
15+) as ExecutorPackageMetadata;
16+
17+const repositoryUrl =
18+ typeof executorPackage.repository === "string"
19+ ? executorPackage.repository
20+ : executorPackage.repository?.url;
21+
22+const githubUrl = (executorPackage.homepage ?? repositoryUrl ?? "https://github.com/RhysSullivan/executor")
23+ .replace(/^git\+/, "")
24+ .replace(/\.git$/, "");
25+
626 export default defineConfig({
727 root: "src",
828 plugins: [
@@ -19,6 +39,10 @@ export default defineConfig({ · 10 unmodified lines
1939 injectClientScript: false,
2040 }),
2141 ],
42+ define: {
43+ "import.meta.env.VITE_APP_VERSION": JSON.stringify(executorPackage.version),
44+ "import.meta.env.VITE_GITHUB_URL": JSON.stringify(githubUrl),
45+ },
2246 build: {
2347 outDir: "../dist",
2448 emptyOutDir: true,