diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 188e2a0..026e0d6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,12 @@ updates: interval: weekly open-pull-requests-limit: 5 - package-ecosystem: "npm" - directory: "/config" + directory: "/.opencode" + schedule: + interval: weekly + open-pull-requests-limit: 5 + - package-ecosystem: "npm" + directory: "/.opencode/draw-image" schedule: interval: weekly open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57d5151..5f9aecf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,10 @@ jobs: - run: sudo apt-get update && sudo apt-get install -y ripgrep - run: npm ci working-directory: .opencode + - run: npm ci + working-directory: .opencode/draw-image + - run: npm test + working-directory: .opencode/draw-image - uses: astral-sh/setup-uv@v3 - run: uv sync --extra dev --python ${{ matrix.python }} - run: uv run --python ${{ matrix.python }} pytest diff --git a/.opencode/draw-image/.gitignore b/.opencode/draw-image/.gitignore new file mode 100644 index 0000000..0a78b69 --- /dev/null +++ b/.opencode/draw-image/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +.tmp-render.svg +icons/lucide/* +!icons/lucide/mic.svg +!icons/lucide/play.svg \ No newline at end of file diff --git a/.opencode/draw-image/brand-logos/.gitkeep b/.opencode/draw-image/brand-logos/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.opencode/draw-image/brand.json b/.opencode/draw-image/brand.json new file mode 100644 index 0000000..db10a32 --- /dev/null +++ b/.opencode/draw-image/brand.json @@ -0,0 +1,8 @@ +{ + "base": "#0a0a0a", + "surface": "#121212", + "fg": "#ededed", + "muted": "#a1a1aa", + "accent": "#ccff00", + "line": "rgba(255,255,255,0.06)" +} \ No newline at end of file diff --git a/.opencode/draw-image/cli.ts b/.opencode/draw-image/cli.ts new file mode 100644 index 0000000..7af443a --- /dev/null +++ b/.opencode/draw-image/cli.ts @@ -0,0 +1,84 @@ +import { writeFileSync, mkdirSync, existsSync, readFileSync } from "node:fs" +import path from "node:path" +import { fileURLToPath } from "node:url" +import { spawnSync } from "node:child_process" +import { loadBrand } from "./src/config.ts" +import { loadTemplate, buildSvg, computeHash } from "./src/render.ts" + +const __dirname = path.dirname(fileURLToPath(import.meta.url)) + +function parseArgs(argv: string[]): Record { + const out: Record = {} + for (let i = 0; i < argv.length; i++) { + const a = argv[i] + if (a.startsWith("--")) { + const key = a.slice(2) + const val = argv[i + 1] ?? "" + out[key] = val + i++ + } + } + return out +} + +function main() { + const argv = process.argv.slice(2) + if (argv.length < 2 || argv[0] !== "render") { + process.stderr.write('usage: node cli.ts render