Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions apps/web/src/components/landing/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,18 @@ export function Footer() {
© {new Date().getFullYear()} Stackpanel · MIT licensed · Built on
Nix, devenv, Caddy, SOPS, and process-compose
</p>
<p className="text-muted-foreground text-xs">
Not affiliated with NixOS, devenv, or Cloudflare.
<p className="flex items-center gap-2 text-muted-foreground text-xs">
<span>Not affiliated with NixOS, devenv, or Cloudflare.</span>
<span aria-hidden>·</span>
<a
className="font-mono transition-colors hover:text-foreground"
href={`https://github.com/darkmatter/stackpanel/commit/${__COMMIT_SHA__}`}
rel="noopener noreferrer"
target="_blank"
title="Deployed commit"
>
{__COMMIT_SHA__}
</a>
</p>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/types/build-info.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare const __COMMIT_SHA__: string;
14 changes: 14 additions & 0 deletions apps/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import tailwindcss from "@tailwindcss/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
// import alchemy from "alchemy/cloudflare/tanstack-start";
import { execSync } from "node:child_process";
import type { Plugin } from "vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
Expand Down Expand Up @@ -30,7 +31,20 @@ function patchImportMetaUrl(): Plugin {

const docsProxyUrl = process.env.DOCS_PROXY_URL || "http://localhost:4000";

const commitSha = (() => {
const fromCi = process.env.GITHUB_SHA;
if (fromCi) return fromCi.slice(0, 7);
try {
return execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim();
} catch {
return "unknown";
}
})();

export default defineConfig({
define: {
__COMMIT_SHA__: JSON.stringify(commitSha),
},
plugins: [
tsconfigPaths({
skip: (dir) => dir === ".worktrees" || dir === ".stack",
Expand Down
Loading