@manfred-kunze-dev/backbone-cli 2.11.0-dev.7 → 2.11.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/convert.js +13 -2
- package/package.json +2 -2
package/dist/commands/convert.js
CHANGED
|
@@ -53,8 +53,19 @@ function outputConvertResult(data, command, opts) {
|
|
|
53
53
|
const formats = opts.format.map(mapFormat);
|
|
54
54
|
// --output: write content to file
|
|
55
55
|
if (opts.output) {
|
|
56
|
-
|
|
57
|
-
const
|
|
56
|
+
// For JSON format, produce a valid JSON array instead of ---‑separated objects
|
|
57
|
+
const isJson = formats.some((f) => f.toUpperCase() === "JSON");
|
|
58
|
+
let content;
|
|
59
|
+
if (isJson) {
|
|
60
|
+
const jsonParts = docs
|
|
61
|
+
.map((doc) => doc.jsonContent?.content ?? doc.jsonContent)
|
|
62
|
+
.filter(Boolean);
|
|
63
|
+
content = JSON.stringify(jsonParts.length === 1 ? jsonParts[0] : jsonParts, null, 2);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const parts = docs.map((doc) => getPrimaryContent(doc, formats));
|
|
67
|
+
content = parts.join("\n\n---\n\n");
|
|
68
|
+
}
|
|
58
69
|
writeFileSync(opts.output, content, "utf-8");
|
|
59
70
|
const size = Buffer.byteLength(content, "utf-8");
|
|
60
71
|
console.error(chalk.green(`Wrote ${formatBytes(size)} to ${opts.output}`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manfred-kunze-dev/backbone-cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.1-dev.1",
|
|
4
4
|
"description": "CLI for the Backbone AI platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ora": "^8.2.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/node": "^22.13
|
|
30
|
+
"@types/node": "^22.19.13",
|
|
31
31
|
"openapi-typescript": "^7.6.1",
|
|
32
32
|
"tsx": "^4.19.3",
|
|
33
33
|
"typescript": "^5.9.3"
|