Skip to content

Commit

Permalink
Fix dependencies across directories
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <[email protected]>
  • Loading branch information
mcollina committed Oct 8, 2024
1 parent 8c7949d commit 40ee2fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ const fastifyAutoload = async function autoload (fastify, options) {
}

async function loadPlugins ({ pluginTree, options, opts, fastify }) {
const nodes = []
const pluginsMeta = {}
for (const key in pluginTree) {
const node = {
...pluginTree[key],
pluginsMeta: {},
pluginsMeta,
hooksMeta: {}
}
nodes.push(node)

await Promise.all(node.plugins.map(({ file, type, prefix }) => {
return loadPlugin({ file, type, directoryPrefix: prefix, options: opts, log: fastify.log })
Expand Down Expand Up @@ -56,6 +59,9 @@ async function loadPlugins ({ pluginTree, options, opts, fastify }) {
})
}))

Check failure on line 60 in index.js

View workflow job for this annotation

GitHub Actions / test / Lint Code

Block must not be padded by blank lines

}

for (const node of nodes) {
registerNode(node, fastify)
}
}
Expand Down

0 comments on commit 40ee2fd

Please sign in to comment.