@neo4j-devtools/workspace-guides
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -39,2 +39,3 @@ #!/usr/bin/env node | ||
const manifests_1 = require("../manifests"); | ||
const playlists_1 = require("../playlists"); | ||
const server_1 = require("./server"); | ||
@@ -50,11 +51,18 @@ const watcher_1 = require("./watcher"); | ||
debugLog('Processing manifest entries'); | ||
await Promise.all(manifest.map((entry) => (0, __1.convertFile)({ | ||
...options, | ||
entry, | ||
guideIdList, | ||
}))); | ||
const enrichedManifest = await Promise.all(manifest.map(async (entry) => { | ||
const json = await (0, __1.convertFile)({ | ||
...options, | ||
entry, | ||
guideIdList, | ||
}); | ||
const enrichedEntry = { ...entry }; | ||
if ((0, playlists_1.isGuidePlaylist)(json) && json.title.length > 0) { | ||
enrichedEntry.title = json.title; | ||
} | ||
return enrichedEntry; | ||
})); | ||
if (!options.dryRun) { | ||
await (0, manifests_1.writeManifest)({ entries: manifest, outputDirPath: options.outputDirPath, rootUrl: options.rootUrl }); | ||
await (0, manifests_1.writeManifest)({ entries: enrichedManifest, outputDirPath: options.outputDirPath, rootUrl: options.rootUrl }); | ||
} | ||
return manifest; | ||
return enrichedManifest; | ||
} | ||
@@ -61,0 +69,0 @@ exports.convertFiles = convertFiles; |
@@ -66,3 +66,6 @@ "use strict"; | ||
playlists: { | ||
'getting-started': { url: './getting-started.playlist.adoc' }, | ||
'getting-started': { | ||
title: 'Get started with Neo4j with beginner guides', | ||
url: './getting-started.playlist.adoc', | ||
}, | ||
}, | ||
@@ -154,3 +157,6 @@ }), | ||
playlists: { | ||
'getting-started': { url: 'http://localhost:4000/getting-started.playlist.json' }, | ||
'getting-started': { | ||
title: 'Get started with Neo4j with beginner guides', | ||
url: 'http://localhost:4000/getting-started.playlist.json', | ||
}, | ||
}, | ||
@@ -157,0 +163,0 @@ }); |
@@ -19,2 +19,3 @@ "use strict"; | ||
imgBaseUrl: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
title: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
url: typebox_1.Type.String(), | ||
@@ -232,3 +233,6 @@ }); | ||
...object, | ||
[entry.id]: { url: toOutputUrl({ entry, rootUrl: options.rootUrl }) }, | ||
[entry.id]: { | ||
...(entry.title !== undefined ? { title: entry.title } : {}), | ||
url: toOutputUrl({ entry, rootUrl: options.rootUrl }), | ||
}, | ||
}), {}), | ||
@@ -235,0 +239,0 @@ }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parsePlaylist = void 0; | ||
exports.parsePlaylist = exports.isGuidePlaylist = void 0; | ||
const jsdom_1 = require("jsdom"); | ||
const dom_to_json_1 = require("./dom-to-json"); | ||
const ensure_trailing_slash_1 = require("./ensure-trailing-slash"); | ||
function isGuidePlaylist(input) { | ||
return 'title' in input && 'preamble' in input && 'steps' in input; | ||
} | ||
exports.isGuidePlaylist = isGuidePlaylist; | ||
function htmlToJson(input) { | ||
@@ -8,0 +12,0 @@ if (input === undefined) { |
{ | ||
"name": "@neo4j-devtools/workspace-guides", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"main": "./src/index.ts", | ||
@@ -5,0 +5,0 @@ "types": "./src/index.ts", |
76113
1755