Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

Commit d06afd8

Browse files
committed
ignore: lander
1 parent 9fb6e81 commit d06afd8

File tree

5 files changed

+706
-121
lines changed

5 files changed

+706
-121
lines changed

packages/console/app/src/component/footer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createAsync } from "@solidjs/router"
22
import { createMemo } from "solid-js"
33
import { github } from "~/lib/github"
4+
import { config } from "~/config"
45

56
export function Footer() {
67
const githubData = createAsync(() => github())
@@ -10,13 +11,13 @@ export function Footer() {
1011
notation: "compact",
1112
compactDisplay: "short",
1213
}).format(githubData()!.stars!)
13-
: "25K",
14+
: config.github.starsFormatted.compact,
1415
)
1516

1617
return (
1718
<footer data-component="footer">
1819
<div data-slot="cell">
19-
<a href="https://github.com/sst/opencode" target="_blank">
20+
<a href={config.github.repoUrl} target="_blank">
2021
GitHub <span>[{starCount()}]</span>
2122
</a>
2223
</div>
@@ -27,7 +28,7 @@ export function Footer() {
2728
<a href="/discord">Discord</a>
2829
</div>
2930
<div data-slot="cell">
30-
<a href="https://x.com/opencode">X</a>
31+
<a href={config.social.twitter}>X</a>
3132
</div>
3233
</footer>
3334
)

packages/console/app/src/component/header.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { createMemo, Match, Show, Switch } from "solid-js"
1818
import { createStore } from "solid-js/store"
1919
import { github } from "~/lib/github"
2020
import { createEffect, onCleanup } from "solid-js"
21+
import { config } from "~/config"
2122
import "./header-context-menu.css"
2223

2324
const isDarkMode = () => window.matchMedia("(prefers-color-scheme: dark)").matches
@@ -42,7 +43,7 @@ export function Header(props: { zen?: boolean }) {
4243
notation: "compact",
4344
compactDisplay: "short",
4445
}).format(githubData()?.stars!)
45-
: "29K",
46+
: config.github.starsFormatted.compact,
4647
)
4748

4849
const [store, setStore] = createStore({
@@ -148,7 +149,7 @@ export function Header(props: { zen?: boolean }) {
148149
<nav data-component="nav-desktop">
149150
<ul>
150151
<li>
151-
<a href="https://github.com/sst/opencode" target="_blank">
152+
<a href={config.github.repoUrl} target="_blank">
152153
GitHub <span>[{starCount()}]</span>
153154
</a>
154155
</li>
@@ -222,7 +223,7 @@ export function Header(props: { zen?: boolean }) {
222223
<A href="/">Home</A>
223224
</li>
224225
<li>
225-
<a href="https://github.com/sst/opencode" target="_blank">
226+
<a href={config.github.repoUrl} target="_blank">
226227
GitHub <span>[{starCount()}]</span>
227228
</a>
228229
</li>

packages/console/app/src/config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Application-wide constants and configuration
3+
*/
4+
export const config = {
5+
// GitHub
6+
github: {
7+
repoUrl: "https://github.com/sst/opencode",
8+
starsFormatted: {
9+
compact: "30K",
10+
full: "30,000",
11+
},
12+
},
13+
14+
// Social links
15+
social: {
16+
twitter: "https://x.com/opencode",
17+
discord: "https://discord.gg/opencode",
18+
},
19+
20+
// Static stats (used on landing page)
21+
stats: {
22+
contributors: "250",
23+
commits: "3,500",
24+
monthlyUsers: "300,000",
25+
},
26+
} as const

packages/console/app/src/lib/github.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import { query } from "@solidjs/router"
2+
import { config } from "~/config"
23

34
export const github = query(async () => {
45
"use server"
56
const headers = {
67
"User-Agent":
78
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
89
}
10+
const apiBaseUrl = config.github.repoUrl.replace(
11+
"https://github.com/",
12+
"https://api.github.com/repos/",
13+
)
914
try {
1015
const [meta, releases, contributors] = await Promise.all([
11-
fetch("https://api.github.com/repos/sst/opencode", { headers }).then((res) => res.json()),
12-
fetch("https://api.github.com/repos/sst/opencode/releases", { headers }).then((res) => res.json()),
13-
fetch("https://api.github.com/repos/sst/opencode/contributors?per_page=1", { headers }),
16+
fetch(apiBaseUrl, { headers }).then((res) => res.json()),
17+
fetch(`${apiBaseUrl}/releases`, { headers }).then((res) => res.json()),
18+
fetch(`${apiBaseUrl}/contributors?per_page=1`, { headers }),
1419
])
1520
const [release] = releases
1621
const contributorCount = Number.parseInt(

0 commit comments

Comments
 (0)