@dfosco/storyboard 0.6.7 → 0.6.8
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/package.json
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
buildTemplateRecipeIndex,
|
|
14
14
|
resolveTemplateRecipeEntry,
|
|
15
15
|
} from '../templateIndex.js'
|
|
16
|
+
import { readWorkshopPartials } from '../partialRender.js'
|
|
16
17
|
|
|
17
18
|
// ---------------------------------------------------------------------------
|
|
18
19
|
// Helpers
|
|
@@ -461,7 +462,10 @@ function generateFlowJson({ title, author, description, globals, sourceData, rou
|
|
|
461
462
|
*/
|
|
462
463
|
export function createFlowsHandler(ctx) {
|
|
463
464
|
const { root, sendJson, workshopConfig = {} } = ctx
|
|
464
|
-
const getTemplateRecipes = () =>
|
|
465
|
+
const getTemplateRecipes = () => {
|
|
466
|
+
const partials = readWorkshopPartials(root)
|
|
467
|
+
return buildTemplateRecipeIndex(root, partials.length ? partials : workshopConfig.partials)
|
|
468
|
+
}
|
|
465
469
|
|
|
466
470
|
return async (req, res, { body, path: routePath, method }) => {
|
|
467
471
|
const templateRecipes = getTemplateRecipes()
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
buildTemplateRecipeIndex,
|
|
22
22
|
resolveTemplateRecipeEntry,
|
|
23
23
|
} from '../templateIndex.js'
|
|
24
|
+
import { readWorkshopPartials } from '../partialRender.js'
|
|
24
25
|
|
|
25
26
|
const FLOW_SKELETON = JSON.stringify({ $global: [] }, null, 2) + '\n'
|
|
26
27
|
|
|
@@ -178,7 +179,10 @@ function generatePrototypeJson({ title, author, description, partialEntry, url }
|
|
|
178
179
|
*/
|
|
179
180
|
export function createPrototypesHandler(ctx) {
|
|
180
181
|
const { root, sendJson, workshopConfig = {} } = ctx
|
|
181
|
-
const getTemplateRecipes = () =>
|
|
182
|
+
const getTemplateRecipes = () => {
|
|
183
|
+
const partials = readWorkshopPartials(root)
|
|
184
|
+
return buildTemplateRecipeIndex(root, partials.length ? partials : workshopConfig.partials)
|
|
185
|
+
}
|
|
182
186
|
|
|
183
187
|
return async (req, res, { body, path: routePath, method }) => {
|
|
184
188
|
const templateRecipes = getTemplateRecipes()
|