mirror of
https://github.com/Dokploy/templates.git
synced 2026-06-15 20:25:24 +02:00
chore: add yaml and toml dependencies, and create script for converting YAML to TOML
- Added 'yaml' and '@iarna/toml' dependencies in package.json. - Created a new script.js file to process YAML files and convert them to TOML format. - Added template.toml files for various blueprints in the blueprints directory.
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"yaml":"2.7.1",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"@codemirror/autocomplete": "^6.18.6",
|
||||
"@codemirror/lang-json": "^6.0.1",
|
||||
"@codemirror/lang-yaml": "^6.1.1",
|
||||
|
||||
41
app/pnpm-lock.yaml
generated
41
app/pnpm-lock.yaml
generated
@@ -26,6 +26,9 @@ importers:
|
||||
'@codemirror/view':
|
||||
specifier: 6.29.0
|
||||
version: 6.29.0
|
||||
'@iarna/toml':
|
||||
specifier: ^2.2.5
|
||||
version: 2.2.5
|
||||
'@radix-ui/react-dialog':
|
||||
specifier: ^1.1.6
|
||||
version: 1.1.6(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||
@@ -46,7 +49,7 @@ importers:
|
||||
version: 1.1.3(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||
'@tailwindcss/vite':
|
||||
specifier: ^4.0.12
|
||||
version: 4.0.12(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
version: 4.0.12(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1))
|
||||
'@uiw/codemirror-theme-github':
|
||||
specifier: ^4.22.1
|
||||
version: 4.23.10(@codemirror/language@6.10.8)(@codemirror/state@6.5.2)(@codemirror/view@6.29.0)
|
||||
@@ -91,7 +94,10 @@ importers:
|
||||
version: 1.0.7(tailwindcss@4.0.12)
|
||||
vite-plugin-static-copy:
|
||||
specifier: 2.3.0
|
||||
version: 2.3.0(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
version: 2.3.0(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1))
|
||||
yaml:
|
||||
specifier: 2.7.1
|
||||
version: 2.7.1
|
||||
zustand:
|
||||
specifier: ^5.0.3
|
||||
version: 5.0.3(@types/react@19.0.10)(react@19.0.0)
|
||||
@@ -107,7 +113,7 @@ importers:
|
||||
version: 19.0.4(@types/react@19.0.10)
|
||||
'@vitejs/plugin-react':
|
||||
specifier: ^4.3.4
|
||||
version: 4.3.4(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
version: 4.3.4(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1))
|
||||
globals:
|
||||
specifier: ^15.15.0
|
||||
version: 15.15.0
|
||||
@@ -116,7 +122,7 @@ importers:
|
||||
version: 5.7.3
|
||||
vite:
|
||||
specifier: ^6.2.0
|
||||
version: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)
|
||||
version: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1)
|
||||
|
||||
packages:
|
||||
|
||||
@@ -408,6 +414,9 @@ packages:
|
||||
'@floating-ui/utils@0.2.9':
|
||||
resolution: {integrity: sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==}
|
||||
|
||||
'@iarna/toml@2.2.5':
|
||||
resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
|
||||
|
||||
'@jridgewell/gen-mapping@0.3.8':
|
||||
resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
@@ -1657,6 +1666,11 @@ packages:
|
||||
yallist@3.1.1:
|
||||
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
|
||||
|
||||
yaml@2.7.1:
|
||||
resolution: {integrity: sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==}
|
||||
engines: {node: '>= 14'}
|
||||
hasBin: true
|
||||
|
||||
zustand@5.0.3:
|
||||
resolution: {integrity: sha512-14fwWQtU3pH4dE0dOpdMiWjddcH+QzKIgk1cl8epwSE7yag43k/AD/m4L6+K7DytAOr9gGBe3/EXj9g7cdostg==}
|
||||
engines: {node: '>=12.20.0'}
|
||||
@@ -1965,6 +1979,8 @@ snapshots:
|
||||
|
||||
'@floating-ui/utils@0.2.9': {}
|
||||
|
||||
'@iarna/toml@2.2.5': {}
|
||||
|
||||
'@jridgewell/gen-mapping@0.3.8':
|
||||
dependencies:
|
||||
'@jridgewell/set-array': 1.2.1
|
||||
@@ -2581,13 +2597,13 @@ snapshots:
|
||||
'@tailwindcss/oxide-win32-arm64-msvc': 4.0.12
|
||||
'@tailwindcss/oxide-win32-x64-msvc': 4.0.12
|
||||
|
||||
'@tailwindcss/vite@4.0.12(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2))':
|
||||
'@tailwindcss/vite@4.0.12(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1))':
|
||||
dependencies:
|
||||
'@tailwindcss/node': 4.0.12
|
||||
'@tailwindcss/oxide': 4.0.12
|
||||
lightningcss: 1.29.2
|
||||
tailwindcss: 4.0.12
|
||||
vite: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)
|
||||
vite: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1)
|
||||
|
||||
'@types/babel__core@7.20.5':
|
||||
dependencies:
|
||||
@@ -2665,14 +2681,14 @@ snapshots:
|
||||
- '@codemirror/lint'
|
||||
- '@codemirror/search'
|
||||
|
||||
'@vitejs/plugin-react@4.3.4(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2))':
|
||||
'@vitejs/plugin-react@4.3.4(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1))':
|
||||
dependencies:
|
||||
'@babel/core': 7.26.9
|
||||
'@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.9)
|
||||
'@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.9)
|
||||
'@types/babel__core': 7.20.5
|
||||
react-refresh: 0.14.2
|
||||
vite: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)
|
||||
vite: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
@@ -3087,16 +3103,16 @@ snapshots:
|
||||
optionalDependencies:
|
||||
'@types/react': 19.0.10
|
||||
|
||||
vite-plugin-static-copy@2.3.0(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)):
|
||||
vite-plugin-static-copy@2.3.0(vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1)):
|
||||
dependencies:
|
||||
chokidar: 3.6.0
|
||||
fast-glob: 3.3.3
|
||||
fs-extra: 11.3.0
|
||||
p-map: 7.0.3
|
||||
picocolors: 1.1.1
|
||||
vite: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)
|
||||
vite: 6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1)
|
||||
|
||||
vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2):
|
||||
vite@6.2.1(@types/node@20.17.24)(jiti@2.4.2)(lightningcss@1.29.2)(yaml@2.7.1):
|
||||
dependencies:
|
||||
esbuild: 0.25.1
|
||||
postcss: 8.5.3
|
||||
@@ -3106,11 +3122,14 @@ snapshots:
|
||||
fsevents: 2.3.3
|
||||
jiti: 2.4.2
|
||||
lightningcss: 1.29.2
|
||||
yaml: 2.7.1
|
||||
|
||||
w3c-keyname@2.2.8: {}
|
||||
|
||||
yallist@3.1.1: {}
|
||||
|
||||
yaml@2.7.1: {}
|
||||
|
||||
zustand@5.0.3(@types/react@19.0.10)(react@19.0.0):
|
||||
optionalDependencies:
|
||||
'@types/react': 19.0.10
|
||||
|
||||
36
app/script.js
Normal file
36
app/script.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import yaml from "yaml";
|
||||
import toml from "@iarna/toml";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
function convertYamlToToml(yamlContent) {
|
||||
const parsedYaml = yaml.parse(yamlContent);
|
||||
return toml.stringify(parsedYaml);
|
||||
}
|
||||
|
||||
function processDirectory(dirPath) {
|
||||
const files = fs.readdirSync(dirPath);
|
||||
|
||||
files.forEach((file) => {
|
||||
const filePath = path.join(dirPath, file);
|
||||
const stat = fs.statSync(filePath);
|
||||
|
||||
if (stat.isDirectory()) {
|
||||
processDirectory(filePath);
|
||||
} else if (file === "template.yml") {
|
||||
console.log(`Converting ${filePath}`);
|
||||
const yamlContent = fs.readFileSync(filePath, "utf8");
|
||||
const tomlContent = convertYamlToToml(yamlContent);
|
||||
const tomlPath = path.join(dirPath, "template.toml");
|
||||
fs.writeFileSync(tomlPath, tomlContent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Ruta al directorio blueprints relativa al script
|
||||
const blueprintsPath = path.join(__dirname, "..", "blueprints");
|
||||
processDirectory(blueprintsPath);
|
||||
Reference in New Issue
Block a user