From 5c626e0a2fb787798363284ee6af8f6c68b41f58 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 9 Jul 2025 11:25:58 -0400 Subject: ci: generate config schema as part of build --- packages/web/astro.config.mjs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'packages/web') diff --git a/packages/web/astro.config.mjs b/packages/web/astro.config.mjs index aea32caec..38a339c74 100644 --- a/packages/web/astro.config.mjs +++ b/packages/web/astro.config.mjs @@ -7,6 +7,7 @@ import theme from "toolbeam-docs-theme" import config from "./config.mjs" import { rehypeHeadingIds } from "@astrojs/markdown-remark" import rehypeAutolinkHeadings from "rehype-autolink-headings" +import { spawnSync } from "child_process" const github = "https://github.com/sst/opencode" @@ -26,7 +27,9 @@ export default defineConfig({ markdown: { rehypePlugins: [rehypeHeadingIds, [rehypeAutolinkHeadings, { behavior: "wrap" }]], }, + build: {}, integrations: [ + configSchema(), solidJs(), starlight({ title: "opencode", @@ -83,3 +86,15 @@ export default defineConfig({ "/discord": "https://discord.com/invite/opencode", }, }) + +function configSchema() { + return { + name: "configSchema", + hooks: { + "astro:build:done": async () => { + console.log("generating config schema") + spawnSync("../opencode/script/schema.ts", ["./dist/config.json"]) + }, + }, + } +} -- cgit v1.2.3