mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
feat(build-docs): switch to redocly
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"packageManager": "pnpm@10.19.0",
|
"packageManager": "pnpm@10.19.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"swagger-ui-dist": "5.30.1"
|
"@redocly/cli": "2.10.0",
|
||||||
|
"react": "19.2.0",
|
||||||
|
"react-dom": "19.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { getAbsoluteFSPath } from "swagger-ui-dist";
|
|
||||||
import BuildContext from "./context";
|
import BuildContext from "./context";
|
||||||
import { cpSync, mkdirSync } from "fs";
|
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
import { execSync } from "child_process";
|
||||||
|
|
||||||
export default function buildSwagger({ baseDir }: BuildContext) {
|
export default function buildSwagger({ baseDir }: BuildContext) {
|
||||||
const absolutePath = getAbsoluteFSPath();
|
|
||||||
const targetDir = join(baseDir, "api");
|
const targetDir = join(baseDir, "api");
|
||||||
cpSync(absolutePath, targetDir, { recursive: true });
|
const specPath = join(__dirname, "../../server/src/assets/api-openapi.yaml");
|
||||||
|
|
||||||
|
execSync(`pnpm redocly build-docs ${specPath} -o ${targetDir}/internal-api.html`, { stdio: "inherit" });
|
||||||
}
|
}
|
||||||
|
|||||||
1300
pnpm-lock.yaml
generated
1300
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user