mirror of
https://github.com/Dokploy/website.git
synced 2026-06-20 14:45:48 +02:00
chore: update Node.js and pnpm versions in Dockerfiles and package.json
- Updated base image in Dockerfile.docs and Dockerfile.website to Node.js 24.4-alpine. - Updated package manager version in package.json to pnpm 10.22.0. - Adjusted Node.js engine requirement in package.json to ^24.4.0. - Added new script to fix API path references in MDX files for documentation. - Updated build command in apps/docs/package.json to include the new script.
This commit is contained in:
27
apps/docs/scripts/fix-api-paths.mjs
Normal file
27
apps/docs/scripts/fix-api-paths.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Normalizes OpenAPI path references in API docs MDX files.
|
||||
* Converts dot notation (/tag.operation) to slash notation (/tag/operation)
|
||||
* to match the OpenAPI schema paths.
|
||||
*/
|
||||
import { readdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
const API_DOCS_DIR = join(process.cwd(), "content", "docs", "api");
|
||||
|
||||
let totalFixed = 0;
|
||||
for (const name of readdirSync(API_DOCS_DIR)) {
|
||||
if (!name.endsWith(".mdx")) continue;
|
||||
const file = join(API_DOCS_DIR, name);
|
||||
const content = readFileSync(file, "utf8");
|
||||
const newContent = content.replace(/"path":"(\/[^"]+)"/g, (_, path) => {
|
||||
if (path.includes(".")) {
|
||||
totalFixed++;
|
||||
return `"path":"${path.replace(/\./g, "/")}"`;
|
||||
}
|
||||
return `"path":"${path}"`;
|
||||
});
|
||||
if (newContent !== content) writeFileSync(file, newContent);
|
||||
}
|
||||
if (totalFixed > 0) {
|
||||
console.log(`✓ Normalized ${totalFixed} API path(s) in MDX (dot → slash)`);
|
||||
}
|
||||
Reference in New Issue
Block a user