From 72e12bea99e76804fcb2ade527c946c0d775d5e7 Mon Sep 17 00:00:00 2001 From: Colum Ferry Date: Fri, 26 Apr 2024 12:54:56 +0100 Subject: [PATCH] fix(core): ensure include and excluded return from plugin worker --- packages/nx/src/project-graph/plugins/isolation/messaging.ts | 2 ++ .../nx/src/project-graph/plugins/isolation/plugin-pool.ts | 4 +++- .../nx/src/project-graph/plugins/isolation/plugin-worker.ts | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/nx/src/project-graph/plugins/isolation/messaging.ts b/packages/nx/src/project-graph/plugins/isolation/messaging.ts index 33e394ae7505f..ce64fb43aa45f 100644 --- a/packages/nx/src/project-graph/plugins/isolation/messaging.ts +++ b/packages/nx/src/project-graph/plugins/isolation/messaging.ts @@ -24,6 +24,8 @@ export interface PluginWorkerLoadResult { payload: | { name: string; + include?: string[]; + exclude?: string[]; createNodesPattern: string; hasCreateDependencies: boolean; hasProcessProjectGraph: boolean; diff --git a/packages/nx/src/project-graph/plugins/isolation/plugin-pool.ts b/packages/nx/src/project-graph/plugins/isolation/plugin-pool.ts index b5caf590ff072..221aefd323cfc 100644 --- a/packages/nx/src/project-graph/plugins/isolation/plugin-pool.ts +++ b/packages/nx/src/project-graph/plugins/isolation/plugin-pool.ts @@ -110,11 +110,13 @@ function createWorkerHandler( return consumeMessage(message, { 'load-result': (result) => { if (result.success) { - const { name, createNodesPattern } = result; + const { name, createNodesPattern, include, exclude } = result; pluginName = name; pluginNames.set(worker, pluginName); onload({ name, + include, + exclude, createNodes: createNodesPattern ? [ createNodesPattern, diff --git a/packages/nx/src/project-graph/plugins/isolation/plugin-worker.ts b/packages/nx/src/project-graph/plugins/isolation/plugin-worker.ts index f09a50a4bd2ed..0f61ab620c3ba 100644 --- a/packages/nx/src/project-graph/plugins/isolation/plugin-worker.ts +++ b/packages/nx/src/project-graph/plugins/isolation/plugin-worker.ts @@ -26,6 +26,8 @@ process.on('message', async (message: Serializable) => { type: 'load-result', payload: { name: plugin.name, + include: plugin.include, + exclude: plugin.exclude, createNodesPattern: plugin.createNodes?.[0], hasCreateDependencies: 'createDependencies' in plugin && !!plugin.createDependencies,