@teambit/builder 1.0.769 → 1.0.771

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,9 +103,13 @@ function calculatePipelineOrder(taskSlot, envs, pipeNameOnEnv, tasks = [], skipT
103
103
  let tasksQueue = new (_tasksQueue().TasksQueue)();
104
104
  locations.forEach(location => addTasksToGraph(tasksQueue, dataPerLocation, location));
105
105
  if (tasks.length) {
106
+ const originalLength = tasksQueue.length;
106
107
  tasksQueue = new (_tasksQueue().TasksQueue)(...tasksQueue.filter(({
107
108
  task
108
109
  }) => tasks.includes(task.name) || tasks.includes(task.aspectId)));
110
+ if (tasksQueue.length === 0 && originalLength > 0) {
111
+ throw new Error(`Pipeline error - no tasks found matching the specified filter: "${tasks.join(', ')}". Available tasks: ${getAvailableTaskNames(flattenedPipeline).join(', ')}`);
112
+ }
109
113
  }
110
114
  if (skipTests) {
111
115
  tasksQueue = new (_tasksQueue().TasksQueue)(...tasksQueue.filter(({
@@ -119,6 +123,14 @@ function calculatePipelineOrder(taskSlot, envs, pipeNameOnEnv, tasks = [], skipT
119
123
  }
120
124
  return tasksQueue;
121
125
  }
126
+ function getAvailableTaskNames(tasks) {
127
+ const uniqueTaskNames = new Set();
128
+ tasks.forEach(task => {
129
+ uniqueTaskNames.add(task.name);
130
+ uniqueTaskNames.add(task.aspectId);
131
+ });
132
+ return Array.from(uniqueTaskNames).sort();
133
+ }
122
134
  function addTasksToGraph(tasksQueue, dataPerLocation, location) {
123
135
  const data = dataPerLocation.find(d => d.location === location);
124
136
  if (!data) return;
@@ -1 +1 @@
1
- {"version":3,"names":["_graph","data","require","_buildTask","_tasksQueue","_legacy","calculatePipelineOrder","taskSlot","envs","pipeNameOnEnv","tasks","skipTests","skipTasks","graphs","locations","forEach","location","push","graph","Graph","pipelineEnvs","envDefinition","pipeline","getPipelineForEnv","env","flattenedPipeline","map","pipelineEnv","flat","task","addDependenciesToGraph","dataPerLocation","pipelineEnvsPerLocation","filter","tasksQueue","TasksQueue","addTasksToGraph","length","includes","name","aspectId","Extensions","tester","find","d","sorted","toposort","taskNode","BuildTaskHelper","deserializeId","attr","taskIndex","findIndex","pipelineTask","splice","dependencies","taskId","serializeId","dependency","deserializeIdAllowEmptyName","dependencyTasks","Error","dependencyTask","getLocation","graphLocation","g","dependencyId","setNode","Node","setEdge","Edge","taskLocation","dependencyLocation","isDependencyAhead","isDependencyEqual","buildTasks","slotsTasks","values","tasksAtStart","tasksAtEnd","mergedTasks"],"sources":["build-pipeline-order.ts"],"sourcesContent":["import { Graph, Node, Edge } from '@teambit/graph.cleargraph';\nimport type { EnvDefinition, Environment } from '@teambit/envs';\nimport type { BuildTask } from './build-task';\nimport { BuildTaskHelper } from './build-task';\nimport type { TaskSlot } from './builder.main.runtime';\nimport { TasksQueue } from './tasks-queue';\nimport type { PipeFunctionNames } from './builder.service';\nimport { Extensions } from '@teambit/legacy.constants';\n\ntype TaskDependenciesGraph = Graph<string, string>;\ntype Location = 'start' | 'middle' | 'end';\ntype TasksLocationGraph = { location: Location; graph: TaskDependenciesGraph };\ntype PipelineEnv = { env: EnvDefinition; pipeline: BuildTask[] };\ntype DataPerLocation = { location: Location; graph: TaskDependenciesGraph; pipelineEnvs: PipelineEnv[] };\n\n/**\n * there are two ways how to add tasks to build pipeline.\n * 1. `getBuildPipe()` method of the env.\n * 2. registering to the `builder.registerBuildTask()`.\n *\n * in the option #1, it's possible to determine the order. e.g. `getBuildPipe() { return [taskA, taskB, taskC]; }`\n * in the option #2, the register happens once the extension is loaded, so there is no way to put\n * one task before/after another task.\n *\n * To be able to determine the order, you can do the following\n * 1. \"task.location\", it has two options \"start\" and \"end\". the rest are \"middle\".\n * 2. \"task.dependencies\", the dependencies must be completed for all envs before this task starts.\n * the dependencies are applicable inside a location and not across locations. see getLocation()\n * or/and continue reading for more info about this.\n *\n * to determine the final order of the tasks, the following is done:\n * 1. split all tasks to three groups: start, middle and end.\n * 2. for each group define a dependencies graph for the tasks with \"dependencies\" prop and the pipeline.\n * 3. start with the first group \"start\", toposort the dependencies graph and push the found tasks\n * to a queue. once completed, iterate the pipeline and add all tasks to the queue.\n * 4. do the same for the \"middle\" and \"end\" groups.\n *\n * the reason for splitting the tasks to the three groups and not using the \"dependencies\" field\n * alone to determine the order is that the \"start\" and \"end\" groups are mostly core and \"middle\"\n * is mostly the user entering tasks to the pipeline and we as the core don't know about the users\n * tasks. For example, a core task \"PublishComponent\" must happen after the compiler, however, a\n * user might have an env without a compiler. if we determine the order only by the dependencies\n * field, the \"PublishComponent\" would have a dependency \"compiler\" and because in this case there\n * is no compiler task, it would throw an error about missing dependencies.\n */\nexport function calculatePipelineOrder(\n taskSlot: TaskSlot,\n envs: EnvDefinition[],\n pipeNameOnEnv: PipeFunctionNames,\n tasks: string[] = [],\n skipTests = false,\n skipTasks: string[] = []\n): TasksQueue {\n const graphs: TasksLocationGraph[] = [];\n const locations: Location[] = ['start', 'middle', 'end']; // the order is important here!\n locations.forEach((location) => {\n graphs.push({ location, graph: new Graph<string, string>() });\n });\n const pipelineEnvs: PipelineEnv[] = [];\n envs.forEach((envDefinition) => {\n const pipeline = getPipelineForEnv(taskSlot, envDefinition.env, pipeNameOnEnv);\n pipelineEnvs.push({ env: envDefinition, pipeline });\n });\n\n const flattenedPipeline: BuildTask[] = pipelineEnvs.map((pipelineEnv) => pipelineEnv.pipeline).flat();\n flattenedPipeline.forEach((task) => addDependenciesToGraph(graphs, flattenedPipeline, task));\n\n const dataPerLocation: DataPerLocation[] = graphs.map(({ location, graph }) => {\n const pipelineEnvsPerLocation: PipelineEnv[] = pipelineEnvs.map(({ env, pipeline }) => {\n return { env, pipeline: pipeline.filter((task) => (task.location || 'middle') === location) };\n });\n return { location, graph, pipelineEnvs: pipelineEnvsPerLocation };\n });\n\n let tasksQueue = new TasksQueue();\n locations.forEach((location) => addTasksToGraph(tasksQueue, dataPerLocation, location));\n if (tasks.length) {\n tasksQueue = new TasksQueue(\n ...tasksQueue.filter(({ task }) => tasks.includes(task.name) || tasks.includes(task.aspectId))\n );\n }\n if (skipTests) {\n tasksQueue = new TasksQueue(...tasksQueue.filter(({ task }) => task.aspectId !== Extensions.tester));\n }\n if (skipTasks.length) {\n tasksQueue = new TasksQueue(\n ...tasksQueue.filter(({ task }) => !skipTasks.includes(task.name) && !skipTasks.includes(task.aspectId))\n );\n }\n\n return tasksQueue;\n}\n\nfunction addTasksToGraph(tasksQueue: TasksQueue, dataPerLocation: DataPerLocation[], location: Location) {\n const data = dataPerLocation.find((d) => d.location === location);\n if (!data) return;\n const sorted = data.graph.toposort();\n sorted.forEach((taskNode) => {\n const { aspectId, name } = BuildTaskHelper.deserializeId(taskNode.attr);\n data.pipelineEnvs.forEach(({ env, pipeline }) => {\n const taskIndex = pipeline.findIndex(\n (pipelineTask) => pipelineTask.aspectId === aspectId && pipelineTask.name === name\n );\n if (taskIndex < 0) return;\n const task = pipeline[taskIndex];\n tasksQueue.push({ env, task });\n pipeline.splice(taskIndex, 1); // delete the task from the pipeline\n });\n });\n data.pipelineEnvs.forEach(({ env, pipeline }) => {\n pipeline.forEach((task) => tasksQueue.push({ env, task }));\n });\n}\n\nfunction addDependenciesToGraph(graphs: TasksLocationGraph[], pipeline: BuildTask[], task: BuildTask) {\n if (!task.dependencies || !task.dependencies.length) return;\n const taskId = BuildTaskHelper.serializeId(task);\n task.dependencies.forEach((dependency) => {\n const { aspectId, name } = BuildTaskHelper.deserializeIdAllowEmptyName(dependency);\n const dependencyTasks = pipeline.filter((pipelineTask) => {\n if (pipelineTask.aspectId !== aspectId) return false;\n return name ? name === pipelineTask.name : true;\n });\n if (dependencyTasks.length === 0) {\n throw new Error(\n `Pipeline error - missing task dependency \"${dependency}\" of the \"${BuildTaskHelper.serializeId(task)}\"`\n );\n }\n dependencyTasks.forEach((dependencyTask) => {\n const location = getLocation(task, dependencyTask);\n if (!location) {\n // the dependency is behind and will be in the correct order regardless the graph.\n return;\n }\n const graphLocation = graphs.find((g) => g.location === location);\n if (!graphLocation) throw new Error(`unable to find graph for location ${location}`);\n const dependencyId = BuildTaskHelper.serializeId(dependencyTask);\n const graph = graphLocation.graph;\n graph.setNode(new Node(taskId, taskId));\n graph.setNode(new Node(dependencyId, dependencyId));\n graph.setEdge(new Edge(dependencyId, taskId, 'dependency'));\n });\n });\n}\n\n/**\n * since the task execution is happening per group: \"start\", \"middle\" and \"end\", the dependencies\n * need to be inside the same group.\n * e.g. if a dependency located at \"end\" group and the task located at \"start\", it's impossible to\n * complete the dependency before the task, there it throws an error.\n * it's ok to have the dependency located earlier, e.g. \"start\" and the task at \"end\", and in this\n * case, it will not be part of the graph because there is no need to do any special calculation.\n */\nfunction getLocation(task: BuildTask, dependencyTask: BuildTask): Location | null {\n const taskLocation = task.location || 'middle';\n const dependencyLocation = dependencyTask.location || 'middle';\n\n const isDependencyAhead =\n (taskLocation === 'start' && dependencyLocation !== 'start') ||\n (taskLocation === 'middle' && dependencyLocation === 'end');\n\n const isDependencyEqual = taskLocation === dependencyLocation;\n\n if (isDependencyAhead) {\n throw new Error(`a task \"${BuildTaskHelper.serializeId(task)}\" located at ${taskLocation}\nhas a dependency \"${BuildTaskHelper.serializeId(dependencyTask)} located at ${dependencyLocation},\nwhich is invalid. the dependency must be located earlier or in the same location as the task\"`);\n }\n\n if (isDependencyEqual) {\n return taskLocation;\n }\n\n // dependency is behind. e.g. task is \"end\" and dependency is \"start\". no need to enter to the\n // graph as it's going to be executed in the right order regardless the graph.\n return null;\n}\n\nfunction getPipelineForEnv(taskSlot: TaskSlot, env: Environment, pipeNameOnEnv: string): BuildTask[] {\n const buildTasks: BuildTask[] = env[pipeNameOnEnv] ? env[pipeNameOnEnv]() : [];\n const slotsTasks = taskSlot.values().flat();\n const tasksAtStart: BuildTask[] = [];\n const tasksAtEnd: BuildTask[] = [];\n slotsTasks.forEach((task) => {\n if (task.location === 'start') {\n tasksAtStart.push(task);\n return;\n }\n if (task.location === 'end') {\n tasksAtEnd.push(task);\n return;\n }\n tasksAtStart.push(task);\n });\n\n // merge with extension registered tasks.\n const mergedTasks = [...tasksAtStart, ...buildTasks, ...tasksAtEnd];\n\n return mergedTasks;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,sBAAsBA,CACpCC,QAAkB,EAClBC,IAAqB,EACrBC,aAAgC,EAChCC,KAAe,GAAG,EAAE,EACpBC,SAAS,GAAG,KAAK,EACjBC,SAAmB,GAAG,EAAE,EACZ;EACZ,MAAMC,MAA4B,GAAG,EAAE;EACvC,MAAMC,SAAqB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;EAC1DA,SAAS,CAACC,OAAO,CAAEC,QAAQ,IAAK;IAC9BH,MAAM,CAACI,IAAI,CAAC;MAAED,QAAQ;MAAEE,KAAK,EAAE,KAAIC,cAAK,EAAiB;IAAE,CAAC,CAAC;EAC/D,CAAC,CAAC;EACF,MAAMC,YAA2B,GAAG,EAA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acy","calculatePipelineOrder","taskSlot","envs","pipeNameOnEnv","tasks","skipTests","skipTasks","graphs","locations","forEach","location","push","graph","Graph","pipelineEnvs","envDefinition","pipeline","getPipelineForEnv","env","flattenedPipeline","map","pipelineEnv","flat","task","addDependenciesToGraph","dataPerLocation","pipelineEnvsPerLocation","filter","tasksQueue","TasksQueue","addTasksToGraph","length","originalLength","includes","name","aspectId","Error","join","getAvailableTaskNames","Extensions","tester","uniqueTaskNames","Set","add","Array","from","sort","find","d","sorted","toposort","taskNode","BuildTaskHelper","deserializeId","attr","taskIndex","findIndex","pipelineTask","splice","dependencies","taskId","serializeId","dependency","deserializeIdAllowEmptyName","dependencyTasks","dependencyTask","getLocation","graphLocation","g","dependencyId","setNode","Node","setEdge","Edge","taskLocation","dependencyLocation","isDependencyAhead","isDependencyEqual","buildTasks","slotsTasks","values","tasksAtStart","tasksAtEnd","mergedTasks"],"sources":["build-pipeline-order.ts"],"sourcesContent":["import { Graph, Node, Edge } from '@teambit/graph.cleargraph';\nimport type { EnvDefinition, Environment } from '@teambit/envs';\nimport type { BuildTask } from './build-task';\nimport { BuildTaskHelper } from './build-task';\nimport type { TaskSlot } from './builder.main.runtime';\nimport { TasksQueue } from './tasks-queue';\nimport type { PipeFunctionNames } from './builder.service';\nimport { Extensions } from '@teambit/legacy.constants';\n\ntype TaskDependenciesGraph = Graph<string, string>;\ntype Location = 'start' | 'middle' | 'end';\ntype TasksLocationGraph = { location: Location; graph: TaskDependenciesGraph };\ntype PipelineEnv = { env: EnvDefinition; pipeline: BuildTask[] };\ntype DataPerLocation = { location: Location; graph: TaskDependenciesGraph; pipelineEnvs: PipelineEnv[] };\n\n/**\n * there are two ways how to add tasks to build pipeline.\n * 1. `getBuildPipe()` method of the env.\n * 2. registering to the `builder.registerBuildTask()`.\n *\n * in the option #1, it's possible to determine the order. e.g. `getBuildPipe() { return [taskA, taskB, taskC]; }`\n * in the option #2, the register happens once the extension is loaded, so there is no way to put\n * one task before/after another task.\n *\n * To be able to determine the order, you can do the following\n * 1. \"task.location\", it has two options \"start\" and \"end\". the rest are \"middle\".\n * 2. \"task.dependencies\", the dependencies must be completed for all envs before this task starts.\n * the dependencies are applicable inside a location and not across locations. see getLocation()\n * or/and continue reading for more info about this.\n *\n * to determine the final order of the tasks, the following is done:\n * 1. split all tasks to three groups: start, middle and end.\n * 2. for each group define a dependencies graph for the tasks with \"dependencies\" prop and the pipeline.\n * 3. start with the first group \"start\", toposort the dependencies graph and push the found tasks\n * to a queue. once completed, iterate the pipeline and add all tasks to the queue.\n * 4. do the same for the \"middle\" and \"end\" groups.\n *\n * the reason for splitting the tasks to the three groups and not using the \"dependencies\" field\n * alone to determine the order is that the \"start\" and \"end\" groups are mostly core and \"middle\"\n * is mostly the user entering tasks to the pipeline and we as the core don't know about the users\n * tasks. For example, a core task \"PublishComponent\" must happen after the compiler, however, a\n * user might have an env without a compiler. if we determine the order only by the dependencies\n * field, the \"PublishComponent\" would have a dependency \"compiler\" and because in this case there\n * is no compiler task, it would throw an error about missing dependencies.\n */\nexport function calculatePipelineOrder(\n taskSlot: TaskSlot,\n envs: EnvDefinition[],\n pipeNameOnEnv: PipeFunctionNames,\n tasks: string[] = [],\n skipTests = false,\n skipTasks: string[] = []\n): TasksQueue {\n const graphs: TasksLocationGraph[] = [];\n const locations: Location[] = ['start', 'middle', 'end']; // the order is important here!\n locations.forEach((location) => {\n graphs.push({ location, graph: new Graph<string, string>() });\n });\n const pipelineEnvs: PipelineEnv[] = [];\n envs.forEach((envDefinition) => {\n const pipeline = getPipelineForEnv(taskSlot, envDefinition.env, pipeNameOnEnv);\n pipelineEnvs.push({ env: envDefinition, pipeline });\n });\n\n const flattenedPipeline: BuildTask[] = pipelineEnvs.map((pipelineEnv) => pipelineEnv.pipeline).flat();\n flattenedPipeline.forEach((task) => addDependenciesToGraph(graphs, flattenedPipeline, task));\n\n const dataPerLocation: DataPerLocation[] = graphs.map(({ location, graph }) => {\n const pipelineEnvsPerLocation: PipelineEnv[] = pipelineEnvs.map(({ env, pipeline }) => {\n return { env, pipeline: pipeline.filter((task) => (task.location || 'middle') === location) };\n });\n return { location, graph, pipelineEnvs: pipelineEnvsPerLocation };\n });\n\n let tasksQueue = new TasksQueue();\n locations.forEach((location) => addTasksToGraph(tasksQueue, dataPerLocation, location));\n if (tasks.length) {\n const originalLength = tasksQueue.length;\n tasksQueue = new TasksQueue(\n ...tasksQueue.filter(({ task }) => tasks.includes(task.name) || tasks.includes(task.aspectId))\n );\n if (tasksQueue.length === 0 && originalLength > 0) {\n throw new Error(\n `Pipeline error - no tasks found matching the specified filter: \"${tasks.join(', ')}\". Available tasks: ${getAvailableTaskNames(flattenedPipeline).join(', ')}`\n );\n }\n }\n if (skipTests) {\n tasksQueue = new TasksQueue(...tasksQueue.filter(({ task }) => task.aspectId !== Extensions.tester));\n }\n if (skipTasks.length) {\n tasksQueue = new TasksQueue(\n ...tasksQueue.filter(({ task }) => !skipTasks.includes(task.name) && !skipTasks.includes(task.aspectId))\n );\n }\n\n return tasksQueue;\n}\n\nfunction getAvailableTaskNames(tasks: BuildTask[]): string[] {\n const uniqueTaskNames = new Set<string>();\n tasks.forEach((task) => {\n uniqueTaskNames.add(task.name);\n uniqueTaskNames.add(task.aspectId);\n });\n return Array.from(uniqueTaskNames).sort();\n}\n\nfunction addTasksToGraph(tasksQueue: TasksQueue, dataPerLocation: DataPerLocation[], location: Location) {\n const data = dataPerLocation.find((d) => d.location === location);\n if (!data) return;\n const sorted = data.graph.toposort();\n sorted.forEach((taskNode) => {\n const { aspectId, name } = BuildTaskHelper.deserializeId(taskNode.attr);\n data.pipelineEnvs.forEach(({ env, pipeline }) => {\n const taskIndex = pipeline.findIndex(\n (pipelineTask) => pipelineTask.aspectId === aspectId && pipelineTask.name === name\n );\n if (taskIndex < 0) return;\n const task = pipeline[taskIndex];\n tasksQueue.push({ env, task });\n pipeline.splice(taskIndex, 1); // delete the task from the pipeline\n });\n });\n data.pipelineEnvs.forEach(({ env, pipeline }) => {\n pipeline.forEach((task) => tasksQueue.push({ env, task }));\n });\n}\n\nfunction addDependenciesToGraph(graphs: TasksLocationGraph[], pipeline: BuildTask[], task: BuildTask) {\n if (!task.dependencies || !task.dependencies.length) return;\n const taskId = BuildTaskHelper.serializeId(task);\n task.dependencies.forEach((dependency) => {\n const { aspectId, name } = BuildTaskHelper.deserializeIdAllowEmptyName(dependency);\n const dependencyTasks = pipeline.filter((pipelineTask) => {\n if (pipelineTask.aspectId !== aspectId) return false;\n return name ? name === pipelineTask.name : true;\n });\n if (dependencyTasks.length === 0) {\n throw new Error(\n `Pipeline error - missing task dependency \"${dependency}\" of the \"${BuildTaskHelper.serializeId(task)}\"`\n );\n }\n dependencyTasks.forEach((dependencyTask) => {\n const location = getLocation(task, dependencyTask);\n if (!location) {\n // the dependency is behind and will be in the correct order regardless the graph.\n return;\n }\n const graphLocation = graphs.find((g) => g.location === location);\n if (!graphLocation) throw new Error(`unable to find graph for location ${location}`);\n const dependencyId = BuildTaskHelper.serializeId(dependencyTask);\n const graph = graphLocation.graph;\n graph.setNode(new Node(taskId, taskId));\n graph.setNode(new Node(dependencyId, dependencyId));\n graph.setEdge(new Edge(dependencyId, taskId, 'dependency'));\n });\n });\n}\n\n/**\n * since the task execution is happening per group: \"start\", \"middle\" and \"end\", the dependencies\n * need to be inside the same group.\n * e.g. if a dependency located at \"end\" group and the task located at \"start\", it's impossible to\n * complete the dependency before the task, there it throws an error.\n * it's ok to have the dependency located earlier, e.g. \"start\" and the task at \"end\", and in this\n * case, it will not be part of the graph because there is no need to do any special calculation.\n */\nfunction getLocation(task: BuildTask, dependencyTask: BuildTask): Location | null {\n const taskLocation = task.location || 'middle';\n const dependencyLocation = dependencyTask.location || 'middle';\n\n const isDependencyAhead =\n (taskLocation === 'start' && dependencyLocation !== 'start') ||\n (taskLocation === 'middle' && dependencyLocation === 'end');\n\n const isDependencyEqual = taskLocation === dependencyLocation;\n\n if (isDependencyAhead) {\n throw new Error(`a task \"${BuildTaskHelper.serializeId(task)}\" located at ${taskLocation}\nhas a dependency \"${BuildTaskHelper.serializeId(dependencyTask)} located at ${dependencyLocation},\nwhich is invalid. the dependency must be located earlier or in the same location as the task\"`);\n }\n\n if (isDependencyEqual) {\n return taskLocation;\n }\n\n // dependency is behind. e.g. task is \"end\" and dependency is \"start\". no need to enter to the\n // graph as it's going to be executed in the right order regardless the graph.\n return null;\n}\n\nfunction getPipelineForEnv(taskSlot: TaskSlot, env: Environment, pipeNameOnEnv: string): BuildTask[] {\n const buildTasks: BuildTask[] = env[pipeNameOnEnv] ? env[pipeNameOnEnv]() : [];\n const slotsTasks = taskSlot.values().flat();\n const tasksAtStart: BuildTask[] = [];\n const tasksAtEnd: BuildTask[] = [];\n slotsTasks.forEach((task) => {\n if (task.location === 'start') {\n tasksAtStart.push(task);\n return;\n }\n if (task.location === 'end') {\n tasksAtEnd.push(task);\n return;\n }\n tasksAtStart.push(task);\n });\n\n // merge with extension registered tasks.\n const mergedTasks = [...tasksAtStart, ...buildTasks, ...tasksAtEnd];\n\n return mergedTasks;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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der@1.0.769/dist/builder.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.769/dist/builder.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.771/dist/builder.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.771/dist/builder.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/builder",
3
- "version": "1.0.769",
3
+ "version": "1.0.771",
4
4
  "homepage": "https://bit.cloud/teambit/pipelines/builder",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.pipelines",
8
8
  "name": "builder",
9
- "version": "1.0.769"
9
+ "version": "1.0.771"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -40,16 +40,16 @@
40
40
  "@teambit/component-id": "1.2.4",
41
41
  "@teambit/legacy.utils": "0.0.28",
42
42
  "@teambit/legacy.scope": "0.0.79",
43
- "@teambit/component": "1.0.769",
44
- "@teambit/envs": "1.0.769",
45
- "@teambit/isolator": "1.0.769",
46
- "@teambit/workspace": "1.0.769",
47
- "@teambit/aspect-loader": "1.0.769",
48
- "@teambit/generator": "1.0.770",
49
- "@teambit/graphql": "1.0.769",
50
- "@teambit/issues": "1.0.769",
51
- "@teambit/scope": "1.0.769",
52
- "@teambit/ui": "1.0.769"
43
+ "@teambit/component": "1.0.771",
44
+ "@teambit/envs": "1.0.771",
45
+ "@teambit/isolator": "1.0.771",
46
+ "@teambit/workspace": "1.0.771",
47
+ "@teambit/aspect-loader": "1.0.771",
48
+ "@teambit/generator": "1.0.772",
49
+ "@teambit/graphql": "1.0.771",
50
+ "@teambit/issues": "1.0.771",
51
+ "@teambit/scope": "1.0.771",
52
+ "@teambit/ui": "1.0.771"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/pretty-time": "^1.1.5",