Skip to content

Commit 65c3dd1

Browse files
climba03003jean-michelet
authored andcommitted
Revert "composedPlugin should have its own prefix context (#368)"
This reverts commit c1685f4.
1 parent a26d1e4 commit 65c3dd1

File tree

9 files changed

+3
-150
lines changed

9 files changed

+3
-150
lines changed

index.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,16 @@ const fastifyAutoload = async function autoload (fastify, options) {
8181
// encapsulate hooks at plugin level
8282
app.register(hookPlugin)
8383
}
84-
registerAllPlugins(app, pluginFiles, true)
84+
registerAllPlugins(app, pluginFiles)
8585
}
86-
87-
fastify.register(composedPlugin, { prefix: options.options?.prefix ?? prefix })
86+
fastify.register(composedPlugin)
8887
}
8988
}
9089

91-
function registerAllPlugins (app, pluginFiles, composed = false) {
90+
function registerAllPlugins (app, pluginFiles) {
9291
for (const pluginFile of pluginFiles) {
9392
// find plugins for this prefix, based on filename stored in registerPlugins()
9493
const plugin = metas.find((i) => i.filename === pluginFile.file)
95-
96-
if (composed) {
97-
plugin.options.prefix = undefined
98-
}
99-
10094
// register plugins at fastify level
10195
if (plugin) registerPlugin(app, plugin, pluginsMeta)
10296
}

test/issues/326/autohooks/index.js

-19
This file was deleted.

test/issues/326/autohooks/routes-a/child/.autohooks.js

-7
This file was deleted.

test/issues/326/autohooks/routes-a/child/routes.js

-7
This file was deleted.

test/issues/326/autohooks/routes-a/sibling/.autohooks.js

-7
This file was deleted.

test/issues/326/autohooks/routes-a/sibling/routes.js

-7
This file was deleted.

test/issues/326/autohooks/routes-b/child/.autohooks.js

-7
This file was deleted.

test/issues/326/autohooks/routes-b/child/routes.js

-7
This file was deleted.

test/issues/326/test.js

-80
This file was deleted.

0 commit comments

Comments
 (0)