mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 03:04:21 +01:00
ci: generate config schema as part of build
This commit is contained in:
@@ -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"])
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user