Add toml package and update configuration parsing in Dokploy

- Added toml package version 3.0.0 to package.json files in both apps/dokploy and packages/server.
- Replaced js-yaml load function with toml parse function for configuration parsing in compose.ts and github.ts files, ensuring compatibility with TOML format.
- Updated pnpm-lock.yaml to reflect the new toml dependency.
This commit is contained in:
Mauricio Siu
2025-03-30 01:12:27 -06:00
parent adee87b6da
commit 4eaf8fee0f
5 changed files with 23 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { load } from "js-yaml";
import { parse } from "toml";
/**
* Complete template interface that includes both metadata and configuration
@@ -86,7 +86,7 @@ export async function fetchTemplateFiles(
try {
// Fetch both files in parallel
const [templateYmlResponse, dockerComposeResponse] = await Promise.all([
fetch(`${baseUrl}/blueprints/${templateId}/template.yml`),
fetch(`${baseUrl}/blueprints/${templateId}/template.toml`),
fetch(`${baseUrl}/blueprints/${templateId}/docker-compose.yml`),
]);
@@ -99,7 +99,7 @@ export async function fetchTemplateFiles(
dockerComposeResponse.text(),
]);
const config = load(templateYml) as CompleteTemplate;
const config = parse(templateYml) as CompleteTemplate;
return { config, dockerCompose };
} catch (error) {