From 92b6b82d1c9c35db82af3c0d9f7e9c18a68483c8 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 20 Nov 2023 09:52:53 +0000 Subject: [PATCH] fix(NA): getPluginsDistFromRepo to return only dist plugins on build (#171457) This PR fixes a problem where the `getPluginsDistFromRepo` would return every available plugin and not only the dist ones. --- src/dev/build/lib/config.ts | 2 +- src/dev/build/tasks/package_json/create_package_json_tasks.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dev/build/lib/config.ts b/src/dev/build/lib/config.ts index a33540ce00c5f..a27592e3f6427 100644 --- a/src/dev/build/lib/config.ts +++ b/src/dev/build/lib/config.ts @@ -251,6 +251,6 @@ export class Config { } getDistPluginsFromRepo() { - return getPackages(this.repoRoot).filter(this.pluginFilter); + return getPackages(this.repoRoot).filter((p) => !p.isDevOnly() && this.pluginFilter(p)); } } diff --git a/src/dev/build/tasks/package_json/create_package_json_tasks.ts b/src/dev/build/tasks/package_json/create_package_json_tasks.ts index d5f4ee94e049b..fae14c14e3db5 100644 --- a/src/dev/build/tasks/package_json/create_package_json_tasks.ts +++ b/src/dev/build/tasks/package_json/create_package_json_tasks.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { PluginPackage } from '@kbn/repo-packages'; import { findUsedDependencies } from './find_used_dependencies'; import { read, write, Task } from '../../lib'; @@ -13,7 +14,7 @@ export const CreatePackageJson: Task = { description: 'Creating build-ready version of package.json', async run(config, log, build) { - const plugins = config.getDistPluginsFromRepo(); + const plugins = config.getDistPluginsFromRepo() as PluginPackage[]; const distPkgIds = new Set(config.getDistPackagesFromRepo().map((p) => p.id)); const pkg = config.getKibanaPkg();