mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
feat: plugin docs and env manifest fields, in-app docs links, SDK 1.0.3
This commit is contained in:
1 parent
7fcda3bb01
commit
cfab6f764c
65 files changed
+1665
-294
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
// Writes openapi.json for core from the @openapi blocks in src/backend.
|
||||
// The docs site runs the same builder on each release.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { buildOpenApi } from "@termix-ssh/plugin-sdk/openapi";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const pkg = JSON.parse(
|
||||
fs.readFileSync(path.join(root, "package.json"), "utf8"),
|
||||
);
|
||||
const tags = JSON.parse(
|
||||
fs.readFileSync(
|
||||
path.join(root, "src/backend/utils/openapi-tags.json"),
|
||||
"utf8",
|
||||
),
|
||||
);
|
||||
const out = process.argv[2] ?? path.join(root, "openapi.json");
|
||||
|
||||
const spec = await buildOpenApi({
|
||||
title: "Termix API",
|
||||
version: pkg.version,
|
||||
description: "The core Termix API. Each plugin documents its own routes.",
|
||||
files: [path.join(root, "src/backend/**/!(*.test).ts")],
|
||||
tags,
|
||||
});
|
||||
|
||||
fs.writeFileSync(out, `${JSON.stringify(spec, null, 2)}\n`);
|
||||
console.log(
|
||||
`wrote ${path.relative(root, out)} (${Object.keys(spec.paths ?? {}).length} paths)`,
|
||||
);
|
||||
Reference in new issue
Block a user