mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[kbn-pm] Stricter types when creating maps (#16848)
This commit is contained in:
parent
eae414ac32
commit
293f280b14
2 changed files with 5 additions and 4 deletions
|
@ -7,6 +7,7 @@ import {
|
|||
getProjects,
|
||||
buildProjectGraph,
|
||||
topologicallyBatchProjects,
|
||||
ProjectMap,
|
||||
} from '../utils/projects';
|
||||
import {
|
||||
createProductionPackageJson,
|
||||
|
@ -53,7 +54,7 @@ async function getProductionProjects(
|
|||
) {
|
||||
const projects = await getProjects(kibanaRoot, projectPaths);
|
||||
|
||||
const buildProjects = new Map();
|
||||
const buildProjects: ProjectMap = new Map();
|
||||
for (const [name, project] of projects.entries()) {
|
||||
if (!project.skipFromBuild()) {
|
||||
buildProjects.set(name, project);
|
||||
|
|
|
@ -16,7 +16,7 @@ export async function getProjects(
|
|||
rootPath: string,
|
||||
projectsPathsPatterns: string[]
|
||||
) {
|
||||
const projects = new Map();
|
||||
const projects: ProjectMap = new Map();
|
||||
|
||||
for (const pattern of projectsPathsPatterns) {
|
||||
const pathsToProcess = await packagesFromGlobPattern({ pattern, rootPath });
|
||||
|
@ -31,7 +31,7 @@ export async function getProjects(
|
|||
`There are multiple projects with the same name [${project.name}]`,
|
||||
{
|
||||
name: project.name,
|
||||
paths: [project.path, projects.get(project.name).path],
|
||||
paths: [project.path, projects.get(project.name)!.path],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ function normalize(dir: string) {
|
|||
}
|
||||
|
||||
export function buildProjectGraph(projects: ProjectMap) {
|
||||
const projectGraph = new Map();
|
||||
const projectGraph: ProjectGraph = new Map();
|
||||
|
||||
for (const project of projects.values()) {
|
||||
const projectDeps = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue