diff --git a/packages/core/package.json b/packages/core/package.json index dc48387..70fd8ad 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -23,6 +23,7 @@ "@latus/core": "^2.0.0", "debug": "4.3.1", "glob": "^7.1.6", + "lodash.flatten": "^4.4.0", "natsort": "^2.0.2" }, "devDependencies": { diff --git a/packages/core/src/index.js b/packages/core/src/index.js index 121d35b..3f242e4 100644 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -1,3 +1,5 @@ +import flatten from 'lodash.flatten'; + import {projects, user} from './state'; export * from './state'; @@ -8,7 +10,7 @@ export default { 'resource-renderers': [], }), '@latus/core/starting': async (latus) => { - const Renderers = await latus.invokeOrdered('@persea/core/resource-renderers'); + const Renderers = flatten(await latus.invokeOrdered('@persea/core/resource-renderers')); const Renderer = (uri) => { const R = Renderers.find(({matcher}) => uri.match(matcher)); return R ? R.Component : ({buffer}) => buffer.toString(); diff --git a/packages/json/src/index.js b/packages/json/src/index.js index 267d8b9..3167a9d 100644 --- a/packages/json/src/index.js +++ b/packages/json/src/index.js @@ -22,6 +22,8 @@ export default { draft.projects.resources[`${project}${uri}`] = JSONB.bufferify(json).toString('base64'); }); }, - '@persea/core/resource-renderers': () => JsonResourceComponent, + '@persea/core/resource-renderers': () => [ + JsonResourceComponent, + ], }, };