@teambit/builder 0.0.844 → 0.0.847

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.
@@ -37,7 +37,7 @@ const pipeNames = {
37
37
  getSnapPipe: 'snap',
38
38
  };
39
39
 
40
- type PipeName = 'build' | 'tag' | 'snap';
40
+ export type PipeName = 'build' | 'tag' | 'snap';
41
41
 
42
42
  export type BuilderDescriptor = Array<{ pipeName: PipeName; tasks: string[] }>;
43
43
 
@@ -69,7 +69,7 @@ export class BuilderService implements EnvService<BuildServiceResults, BuilderDe
69
69
  /**
70
70
  * pipe name to display on the console during the execution
71
71
  */
72
- private displayPipeName: string,
72
+ private displayPipeName: PipeName,
73
73
  private artifactFactory: ArtifactFactory,
74
74
  private scope: ScopeMain
75
75
  ) {}
@@ -110,12 +110,13 @@ export class BuilderService implements EnvService<BuildServiceResults, BuilderDe
110
110
  const buildContext = Object.assign(executionContext, {
111
111
  capsuleNetwork,
112
112
  previousTasksResults: [],
113
+ pipeName: this.displayPipeName,
113
114
  dev: options.dev,
114
115
  });
115
116
  envsBuildContext[executionContext.id] = buildContext;
116
117
  })
117
118
  );
118
- const buildPipe = BuildPipe.from(
119
+ const buildPipe = new BuildPipe(
119
120
  tasksQueue,
120
121
  envsBuildContext,
121
122
  this.logger,
@@ -67,8 +67,4 @@ export declare class BuildPipe {
67
67
  private updateFailedDependencyTask;
68
68
  private shouldSkipTask;
69
69
  private getBuildContext;
70
- /**
71
- * create a build pipe from an array of tasks.
72
- */
73
- static from(tasksQueue: TasksQueue, envsBuildContext: EnvsBuildContext, logger: Logger, artifactFactory: ArtifactFactory, previousTaskResults?: TaskResults[]): BuildPipe;
74
70
  }
@@ -222,14 +222,6 @@ class BuildPipe {
222
222
  buildContext.previousTasksResults = this.allTasksResults;
223
223
  return buildContext;
224
224
  }
225
- /**
226
- * create a build pipe from an array of tasks.
227
- */
228
-
229
-
230
- static from(tasksQueue, envsBuildContext, logger, artifactFactory, previousTaskResults) {
231
- return new BuildPipe(tasksQueue, envsBuildContext, logger, artifactFactory, previousTaskResults);
232
- }
233
225
 
234
226
  }
235
227
 
@@ -1 +1 @@
1
- {"version":3,"names":["BuildPipe","constructor","tasksQueue","envsBuildContext","logger","artifactFactory","previousTaskResults","allTasksResults","taskResults","execute","addSignalListener","executePreBuild","longProcessLogger","createLongProcessLogger","length","mapSeries","task","env","executeTask","end","tasksResultsList","TaskResultsList","executePostBuild","process","on","exit","setStatusLine","preBuild","getBuildContext","id","consoleSuccess","taskId","BuildTaskHelper","serializeId","taskName","description","logProgress","updateFailedDependencyTask","shouldSkipTask","startTask","hrtime","taskStartTime","Date","now","buildContext","buildTaskResult","err","consoleFailure","endTime","compsWithErrors","componentsResults","filter","c","errors","artifacts","failedTasks","push","duration","prettyTime","defs","generate","startTime","tasksResults","postBuild","failedDependencyTask","dependencies","forEach","dependency","aspectId","name","deserializeIdAllowEmptyName","find","failedTask","envId","failedTaskId","consoleWarning","Error","previousTasksResults","from"],"sources":["build-pipe.ts"],"sourcesContent":["import { EnvDefinition } from '@teambit/envs';\nimport { ComponentMap } from '@teambit/component';\nimport { Logger, LongProcessLogger } from '@teambit/logger';\nimport mapSeries from 'p-map-series';\nimport prettyTime from 'pretty-time';\nimport { ArtifactFactory, ArtifactList, FsArtifact } from './artifact';\nimport { BuildTask, BuildTaskHelper, BuiltTaskResult } from './build-task';\nimport { ComponentResult } from './types';\nimport { TasksQueue } from './tasks-queue';\nimport { EnvsBuildContext } from './builder.service';\nimport { TaskResultsList } from './task-results-list';\n\nexport type TaskResults = {\n /**\n * task itself. useful for getting its id/description later on.\n */\n task: BuildTask;\n\n /**\n * environment were the task was running\n */\n env: EnvDefinition;\n\n /**\n * component build results.\n */\n componentsResults: ComponentResult[];\n\n /**\n * artifacts generated by the build pipeline.\n * in case the task finished with errors, this prop is undefined.\n */\n artifacts: ComponentMap<ArtifactList<FsArtifact>> | undefined;\n\n /**\n * timestamp of start initiation.\n */\n startTime: number;\n\n /**\n * timestamp of task completion.\n */\n endTime: number;\n};\n\nexport class BuildPipe {\n private failedTasks: BuildTask[] = [];\n private failedDependencyTask: BuildTask | undefined;\n private longProcessLogger: LongProcessLogger;\n private taskResults: TaskResults[] = [];\n constructor(\n /**\n * array of services to apply on the components.\n */\n readonly tasksQueue: TasksQueue,\n readonly envsBuildContext: EnvsBuildContext,\n readonly logger: Logger,\n readonly artifactFactory: ArtifactFactory,\n private previousTaskResults?: TaskResults[]\n ) {}\n\n get allTasksResults(): TaskResults[] {\n return [...(this.previousTaskResults || []), ...(this.taskResults || [])];\n }\n\n /**\n * execute a pipeline of build tasks.\n */\n async execute(): Promise<TaskResultsList> {\n this.addSignalListener();\n await this.executePreBuild();\n this.longProcessLogger = this.logger.createLongProcessLogger('running tasks', this.tasksQueue.length);\n await mapSeries(this.tasksQueue, async ({ task, env }) => this.executeTask(task, env));\n this.longProcessLogger.end();\n const tasksResultsList = new TaskResultsList(this.tasksQueue, this.taskResults);\n await this.executePostBuild(tasksResultsList);\n\n return tasksResultsList;\n }\n\n /**\n * for some reason, some tasks (such as typescript compilation) ignore ctrl+C. this fixes it.\n */\n private addSignalListener() {\n process.on('SIGTERM', () => {\n process.exit();\n });\n\n process.on('SIGINT', () => {\n process.exit();\n });\n }\n\n private async executePreBuild() {\n this.logger.setStatusLine('executing pre-build for all tasks');\n await mapSeries(this.tasksQueue, async ({ task, env }) => {\n if (!task.preBuild) return;\n await task.preBuild(this.getBuildContext(env.id));\n });\n this.logger.consoleSuccess();\n }\n\n private async executeTask(task: BuildTask, env: EnvDefinition): Promise<void> {\n const taskId = BuildTaskHelper.serializeId(task);\n const taskName = `${taskId}${task.description ? ` (${task.description})` : ''}`;\n this.longProcessLogger.logProgress(`env \"${env.id}\", task \"${taskName}\"`);\n this.updateFailedDependencyTask(task);\n if (this.shouldSkipTask(taskId, env.id)) {\n return;\n }\n const startTask = process.hrtime();\n const taskStartTime = Date.now();\n const buildContext = this.getBuildContext(env.id);\n let buildTaskResult: BuiltTaskResult;\n try {\n buildTaskResult = await task.execute(buildContext);\n } catch (err) {\n this.logger.consoleFailure(`env: ${env.id}, task \"${taskId}\" threw an error`);\n throw err;\n }\n\n const endTime = Date.now();\n const compsWithErrors = buildTaskResult.componentsResults.filter((c) => c.errors?.length);\n let artifacts: ComponentMap<ArtifactList<FsArtifact>> | undefined;\n if (compsWithErrors.length) {\n this.logger.consoleFailure(`env: ${env.id}, task \"${taskId}\" has failed`);\n this.failedTasks.push(task);\n } else {\n const duration = prettyTime(process.hrtime(startTask));\n this.logger.consoleSuccess(`env \"${env.id}\", task \"${taskName}\" has completed successfully in ${duration}`);\n const defs = buildTaskResult.artifacts || [];\n artifacts = this.artifactFactory.generate(buildContext, defs, task);\n }\n\n const taskResults: TaskResults = {\n task,\n env,\n componentsResults: buildTaskResult.componentsResults,\n artifacts,\n startTime: taskStartTime,\n endTime,\n };\n\n this.taskResults.push(taskResults);\n }\n\n private async executePostBuild(tasksResults: TaskResultsList) {\n this.logger.setStatusLine('executing post-build for all tasks');\n await mapSeries(this.tasksQueue, async ({ task, env }) => {\n if (!task.postBuild) return;\n await task.postBuild(this.getBuildContext(env.id), tasksResults);\n });\n this.logger.consoleSuccess();\n }\n\n private updateFailedDependencyTask(task: BuildTask) {\n if (!this.failedDependencyTask && this.failedTasks.length && task.dependencies) {\n task.dependencies.forEach((dependency) => {\n const { aspectId, name } = BuildTaskHelper.deserializeIdAllowEmptyName(dependency);\n this.failedDependencyTask = this.failedTasks.find((failedTask) => {\n if (name && name !== failedTask.name) return false;\n return aspectId === failedTask.aspectId;\n });\n });\n }\n }\n\n private shouldSkipTask(taskId: string, envId: string): boolean {\n if (!this.failedDependencyTask) return false;\n const failedTaskId = BuildTaskHelper.serializeId(this.failedDependencyTask);\n this.logger.consoleWarning(`env: ${envId}, task \"${taskId}\" has skipped due to \"${failedTaskId}\" failure`);\n return true;\n }\n\n private getBuildContext(envId: string) {\n const buildContext = this.envsBuildContext[envId];\n if (!buildContext) throw new Error(`unable to find buildContext for ${envId}`);\n buildContext.previousTasksResults = this.allTasksResults;\n return buildContext;\n }\n\n /**\n * create a build pipe from an array of tasks.\n */\n static from(\n tasksQueue: TasksQueue,\n envsBuildContext: EnvsBuildContext,\n logger: Logger,\n artifactFactory: ArtifactFactory,\n previousTaskResults?: TaskResults[]\n ) {\n return new BuildPipe(tasksQueue, envsBuildContext, logger, artifactFactory, previousTaskResults);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAmCO,MAAMA,SAAN,CAAgB;EAKrBC,WAAW;EACT;AACJ;AACA;EACaC,UAJA,EAKAC,gBALA,EAMAC,MANA,EAOAC,eAPA,EAQDC,mBARC,EAST;IAAA,KALSJ,UAKT,GALSA,UAKT;IAAA,KAJSC,gBAIT,GAJSA,gBAIT;IAAA,KAHSC,MAGT,GAHSA,MAGT;IAAA,KAFSC,eAET,GAFSA,eAET;IAAA,KADQC,mBACR,GADQA,mBACR;IAAA,qDAbiC,EAajC;IAAA;IAAA;IAAA,qDAVmC,EAUnC;EAAE;;EAEe,IAAfC,eAAe,GAAkB;IACnC,OAAO,CAAC,IAAI,KAAKD,mBAAL,IAA4B,EAAhC,CAAD,EAAsC,IAAI,KAAKE,WAAL,IAAoB,EAAxB,CAAtC,CAAP;EACD;EAED;AACF;AACA;;;EACe,MAAPC,OAAO,GAA6B;IACxC,KAAKC,iBAAL;IACA,MAAM,KAAKC,eAAL,EAAN;IACA,KAAKC,iBAAL,GAAyB,KAAKR,MAAL,CAAYS,uBAAZ,CAAoC,eAApC,EAAqD,KAAKX,UAAL,CAAgBY,MAArE,CAAzB;IACA,MAAM,IAAAC,qBAAA,EAAU,KAAKb,UAAf,EAA2B,O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O,KAAP;UACtC,OAAOD,QAAQ,KAAKI,UAAU,CAACJ,QAA/B;QACD,CAH2B,CAA5B;MAID,CAND;IAOD;EACF;;EAEO9B,cAAc,CAACP,MAAD,EAAiB0C,KAAjB,EAAyC;IAC7D,IAAI,CAAC,KAAKT,oBAAV,EAAgC,OAAO,KAAP;;IAChC,MAAMU,YAAY,GAAG1C,4BAAA,CAAgBC,WAAhB,CAA4B,KAAK+B,oBAAjC,CAArB;;IACA,KAAK5D,MAAL,CAAYuE,cAAZ,CAA4B,QAAOF,KAAM,WAAU1C,MAAO,yBAAwB2C,YAAa,WAA/F;IACA,OAAO,IAAP;EACD;;EAEO9C,eAAe,CAAC6C,KAAD,EAAgB;IACrC,MAAM7B,YAAY,GAAG,KAAKzC,gBAAL,CAAsBsE,KAAtB,CAArB;IACA,IAAI,CAAC7B,YAAL,EAAmB,MAAM,IAAIgC,KAAJ,CAAW,mCAAkCH,KAAM,EAAnD,CAAN;IACnB7B,YAAY,CAACiC,oBAAb,GAAoC,KAAKtE,eAAzC;IACA,OAAOqC,YAAP;EACD;EAED;AACF;AACA;;;EACa,OAAJkC,IAAI,CACT5E,UADS,EAETC,gBAFS,EAGTC,MAHS,EAITC,eAJS,EAKTC,mBALS,EAMT;IACA,OAAO,IAAIN,SAAJ,CAAcE,UAAd,EAA0BC,gBAA1B,EAA4CC,MAA5C,EAAoDC,eAApD,EAAqEC,mBAArE,CAAP;EACD;;AAnJoB"}
1
+ {"version":3,"names":["BuildPipe","constructor","tasksQueue","envsBuildContext","logger","artifactFactory","previousTaskResults","allTasksResults","taskResults","execute","addSignalListener","executePreBuild","longProcessLogger","createLongProcessLogger","length","mapSeries","task","env","executeTask","end","tasksResultsList","TaskResultsList","executePostBuild","process","on","exit","setStatusLine","preBuild","getBuildContext","id","consoleSuccess","taskId","BuildTaskHelper","serializeId","taskName","description","logProgress","updateFailedDependencyTask","shouldSkipTask","startTask","hrtime","taskStartTime","Date","now","buildContext","buildTaskResult","err","consoleFailure","endTime","compsWithErrors","componentsResults","filter","c","errors","artifacts","failedTasks","push","duration","prettyTime","defs","generate","startTime","tasksResults","postBuild","failedDependencyTask","dependencies","forEach","dependency","aspectId","name","deserializeIdAllowEmptyName","find","failedTask","envId","failedTaskId","consoleWarning","Error","previousTasksResults"],"sources":["build-pipe.ts"],"sourcesContent":["import { EnvDefinition } from '@teambit/envs';\nimport { ComponentMap } from '@teambit/component';\nimport { Logger, LongProcessLogger } from '@teambit/logger';\nimport mapSeries from 'p-map-series';\nimport prettyTime from 'pretty-time';\nimport { ArtifactFactory, ArtifactList, FsArtifact } from './artifact';\nimport { BuildContext, BuildTask, BuildTaskHelper, BuiltTaskResult } from './build-task';\nimport { ComponentResult } from './types';\nimport { TasksQueue } from './tasks-queue';\nimport { EnvsBuildContext } from './builder.service';\nimport { TaskResultsList } from './task-results-list';\n\nexport type TaskResults = {\n /**\n * task itself. useful for getting its id/description later on.\n */\n task: BuildTask;\n\n /**\n * environment were the task was running\n */\n env: EnvDefinition;\n\n /**\n * component build results.\n */\n componentsResults: ComponentResult[];\n\n /**\n * artifacts generated by the build pipeline.\n * in case the task finished with errors, this prop is undefined.\n */\n artifacts: ComponentMap<ArtifactList<FsArtifact>> | undefined;\n\n /**\n * timestamp of start initiation.\n */\n startTime: number;\n\n /**\n * timestamp of task completion.\n */\n endTime: number;\n};\n\nexport class BuildPipe {\n private failedTasks: BuildTask[] = [];\n private failedDependencyTask: BuildTask | undefined;\n private longProcessLogger: LongProcessLogger;\n private taskResults: TaskResults[] = [];\n constructor(\n /**\n * array of services to apply on the components.\n */\n readonly tasksQueue: TasksQueue,\n readonly envsBuildContext: EnvsBuildContext,\n readonly logger: Logger,\n readonly artifactFactory: ArtifactFactory,\n private previousTaskResults?: TaskResults[]\n ) {}\n\n get allTasksResults(): TaskResults[] {\n return [...(this.previousTaskResults || []), ...(this.taskResults || [])];\n }\n\n /**\n * execute a pipeline of build tasks.\n */\n async execute(): Promise<TaskResultsList> {\n this.addSignalListener();\n await this.executePreBuild();\n this.longProcessLogger = this.logger.createLongProcessLogger('running tasks', this.tasksQueue.length);\n await mapSeries(this.tasksQueue, async ({ task, env }) => this.executeTask(task, env));\n this.longProcessLogger.end();\n const tasksResultsList = new TaskResultsList(this.tasksQueue, this.taskResults);\n await this.executePostBuild(tasksResultsList);\n\n return tasksResultsList;\n }\n\n /**\n * for some reason, some tasks (such as typescript compilation) ignore ctrl+C. this fixes it.\n */\n private addSignalListener() {\n process.on('SIGTERM', () => {\n process.exit();\n });\n\n process.on('SIGINT', () => {\n process.exit();\n });\n }\n\n private async executePreBuild() {\n this.logger.setStatusLine('executing pre-build for all tasks');\n await mapSeries(this.tasksQueue, async ({ task, env }) => {\n if (!task.preBuild) return;\n await task.preBuild(this.getBuildContext(env.id));\n });\n this.logger.consoleSuccess();\n }\n\n private async executeTask(task: BuildTask, env: EnvDefinition): Promise<void> {\n const taskId = BuildTaskHelper.serializeId(task);\n const taskName = `${taskId}${task.description ? ` (${task.description})` : ''}`;\n this.longProcessLogger.logProgress(`env \"${env.id}\", task \"${taskName}\"`);\n this.updateFailedDependencyTask(task);\n if (this.shouldSkipTask(taskId, env.id)) {\n return;\n }\n const startTask = process.hrtime();\n const taskStartTime = Date.now();\n const buildContext = this.getBuildContext(env.id);\n let buildTaskResult: BuiltTaskResult;\n try {\n buildTaskResult = await task.execute(buildContext);\n } catch (err) {\n this.logger.consoleFailure(`env: ${env.id}, task \"${taskId}\" threw an error`);\n throw err;\n }\n\n const endTime = Date.now();\n const compsWithErrors = buildTaskResult.componentsResults.filter((c) => c.errors?.length);\n let artifacts: ComponentMap<ArtifactList<FsArtifact>> | undefined;\n if (compsWithErrors.length) {\n this.logger.consoleFailure(`env: ${env.id}, task \"${taskId}\" has failed`);\n this.failedTasks.push(task);\n } else {\n const duration = prettyTime(process.hrtime(startTask));\n this.logger.consoleSuccess(`env \"${env.id}\", task \"${taskName}\" has completed successfully in ${duration}`);\n const defs = buildTaskResult.artifacts || [];\n artifacts = this.artifactFactory.generate(buildContext, defs, task);\n }\n\n const taskResults: TaskResults = {\n task,\n env,\n componentsResults: buildTaskResult.componentsResults,\n artifacts,\n startTime: taskStartTime,\n endTime,\n };\n\n this.taskResults.push(taskResults);\n }\n\n private async executePostBuild(tasksResults: TaskResultsList) {\n this.logger.setStatusLine('executing post-build for all tasks');\n await mapSeries(this.tasksQueue, async ({ task, env }) => {\n if (!task.postBuild) return;\n await task.postBuild(this.getBuildContext(env.id), tasksResults);\n });\n this.logger.consoleSuccess();\n }\n\n private updateFailedDependencyTask(task: BuildTask) {\n if (!this.failedDependencyTask && this.failedTasks.length && task.dependencies) {\n task.dependencies.forEach((dependency) => {\n const { aspectId, name } = BuildTaskHelper.deserializeIdAllowEmptyName(dependency);\n this.failedDependencyTask = this.failedTasks.find((failedTask) => {\n if (name && name !== failedTask.name) return false;\n return aspectId === failedTask.aspectId;\n });\n });\n }\n }\n\n private shouldSkipTask(taskId: string, envId: string): boolean {\n if (!this.failedDependencyTask) return false;\n const failedTaskId = BuildTaskHelper.serializeId(this.failedDependencyTask);\n this.logger.consoleWarning(`env: ${envId}, task \"${taskId}\" has skipped due to \"${failedTaskId}\" failure`);\n return true;\n }\n\n private getBuildContext(envId: string): BuildContext {\n const buildContext = this.envsBuildContext[envId];\n if (!buildContext) throw new Error(`unable to find buildContext for ${envId}`);\n buildContext.previousTasksResults = this.allTasksResults;\n return buildContext;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAmCO,MAAMA,SAAN,CAAgB;EAKrBC,WAAW;EACT;AACJ;AACA;EACaC,UAJA,EAKAC,gBALA,EAMAC,MANA,EAOAC,eAPA,EAQDC,mBARC,EAST;IAAA,KALSJ,UA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KAAKtE,eAAzC;IACA,OAAOqC,YAAP;EACD;;AAtIoB"}
@@ -5,6 +5,7 @@ import type { ComponentResult } from './types';
5
5
  import type { ArtifactDefinition } from './artifact';
6
6
  import { TaskResultsList } from './task-results-list';
7
7
  import { TaskResults } from './build-pipe';
8
+ import { PipeName } from './builder.service';
8
9
  export declare type TaskLocation = 'start' | 'end';
9
10
  /**
10
11
  * delimiter between task.aspectId and task.name
@@ -32,6 +33,11 @@ export interface BuildContext extends ExecutionContext {
32
33
  * Run the build pipeline in dev mode
33
34
  */
34
35
  dev?: boolean;
36
+ /**
37
+ * pipe name such as "build", "tas", "snap".
38
+ * an example usage is "deploy" task which is running in snap and tag pipeline and has different needs in each one.
39
+ */
40
+ pipeName: PipeName;
35
41
  }
36
42
  export interface TaskDescriptor {
37
43
  aspectId: string;
@@ -1 +1 @@
1
- {"version":3,"names":["TaskIdDelimiter","CAPSULE_ARTIFACTS_DIR","BuildTaskHelper","serializeId","aspectId","name","deserializeId","id","split","length","Error","deserializeIdAllowEmptyName","includes","undefined"],"sources":["build-task.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport { ExecutionContext } from '@teambit/envs';\nimport type { Network } from '@teambit/isolator';\nimport type { ComponentResult } from './types';\nimport type { ArtifactDefinition } from './artifact';\nimport { TaskResultsList } from './task-results-list';\nimport { TaskResults } from './build-pipe';\n\nexport type TaskLocation = 'start' | 'end';\n\n/**\n * delimiter between task.aspectId and task.name\n */\nexport const TaskIdDelimiter = ':';\n\n/**\n * A folder to write artifacts generated during a build task\n * This folder is used in the core envs and excluded by default from the package tar file (the core envs is writing this into the npmignore file)\n */\nexport const CAPSULE_ARTIFACTS_DIR = 'artifacts';\n\nexport interface BuildContext extends ExecutionContext {\n /**\n * all components about to be built/tagged.\n */\n components: Component[];\n\n /**\n * network of capsules ready to be built.\n */\n capsuleNetwork: Network;\n\n /**\n * data generated by tasks that were running before this task\n */\n previousTasksResults: TaskResults[];\n\n /**\n * Run the build pipeline in dev mode\n */\n dev?: boolean;\n}\n\nexport interface TaskDescriptor {\n aspectId: string;\n name?: string;\n description?: string;\n}\n\nexport interface BuildTask {\n /**\n * aspect id serialized of the creator of the task.\n * todo: automate this so then it won't be needed to pass manually.\n */\n aspectId: string;\n\n /**\n * name of the task. function as an identifier among other tasks of the same aspectId.\n * spaces and special characters are not allowed. as a convention, use UpperCamelCase style.\n * (e.g. TypescriptCompiler).\n */\n name: string;\n\n /**\n * description of what the task does.\n * if available, the logger will log it show it in the status-line.\n */\n description?: string;\n\n /**\n * where to put the task, before the env pipeline or after\n */\n location?: TaskLocation;\n\n /**\n * execute a task in a build context\n */\n execute(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n * e.g. typescript compiler needs to write the tsconfig file. doing it during the task, will\n * cause dependencies from other envs to get this tsconfig written.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for doing some cleanup on the\n * capsules before the deployment starts.\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * needed if you want the task to be running only after the dependencies were completed\n * for *all* envs.\n * normally this is not needed because the build-pipeline runs the tasks in the same order\n * they're located in the `getBuildPipe()` array and according to the task.location.\n * the case where this is useful is when a task not only needs to be after another task, but also\n * after all environments were running that task.\n * a dependency is task.aspectId. if an aspect has multiple tasks, to be more specific, use\n * \"aspectId:name\", e.g. \"teambit.compilation/compiler:TypescriptCompiler\".\n */\n dependencies?: string[];\n}\n\n// TODO: rename to BuildTaskResults\nexport interface BuiltTaskResult {\n /**\n * build results for each of the components in the build context.\n */\n componentsResults: ComponentResult[];\n\n /**\n * array of artifact definitions to generate after a successful build.\n */\n artifacts?: ArtifactDefinition[];\n}\n\nexport class BuildTaskHelper {\n static serializeId({ aspectId, name }: { aspectId: string; name: string }): string {\n return aspectId + TaskIdDelimiter + name;\n }\n static deserializeId(id: string): { aspectId: string; name: string } {\n const split = id.split(TaskIdDelimiter);\n if (split.length === 0) throw new Error(`deserializeId, ${id} is empty`);\n if (split.length === 1) throw new Error(`deserializeId, ${id} has only aspect-id without name`);\n if (split.length === 2) return { aspectId: split[0], name: split[1] };\n throw new Error(`deserializeId, id ${id} has more than one ${TaskIdDelimiter}`);\n }\n /**\n * don't throw an error when the id includes only the aspect-id without the task name.\n * useful for task dependencies, when it's allowed to specify the aspect-id only.\n */\n static deserializeIdAllowEmptyName(id: string): { aspectId: string; name?: string } {\n return id.includes(TaskIdDelimiter) ? BuildTaskHelper.deserializeId(id) : { aspectId: id, name: undefined };\n }\n}\n"],"mappings":";;;;;;;;;AAUA;AACA;AACA;AACO,MAAMA,eAAe,GAAG,GAAxB;AAEP;AACA;AACA;AACA;;;AACO,MAAMC,qBAAqB,GAAG,WAA9B;;;AAoGA,MAAMC,eAAN,CAAsB;EACT,OAAXC,WAAW,CAAC;IAAEC,QAAF;IAAYC;EAAZ,CAAD,EAAiE;IACjF,OAAOD,QAAQ,GAAGJ,eAAX,GAA6BK,IAApC;EACD;;EACmB,OAAbC,aAAa,CAACC,EAAD,EAAiD;IACnE,MAAMC,KAAK,GAAGD,EAAE,CAACC,KAAH,CAASR,eAAT,CAAd;IACA,IAAIQ,KAAK,CAACC,MAAN,KAAiB,CAArB,EAAwB,MAAM,IAAIC,KAAJ,CAAW,kBAAiBH,EAAG,WAA/B,CAAN;IACxB,IAAIC,KAAK,CAACC,MAAN,KAAiB,CAArB,EAAwB,MAAM,IAAIC,KAAJ,CAAW,kBAAiBH,EAAG,kCAA/B,CAAN;IACxB,IAAIC,KAAK,CAACC,MAAN,KAAiB,CAArB,EAAwB,OAAO;MAAEL,QAAQ,EAAEI,KAAK,CAAC,CAAD,CAAjB;MAAsBH,IAAI,EAAEG,KAAK,CAAC,CAAD;IAAjC,CAAP;IACxB,MAAM,IAAIE,KAAJ,CAAW,qBAAoBH,EAAG,sBAAqBP,eAAgB,EAAvE,CAAN;EACD;EACD;AACF;AACA;AACA;;;EACoC,OAA3BW,2BAA2B,CAACJ,EAAD,EAAkD;IAClF,OAAOA,EAAE,CAACK,QAAH,CAAYZ,eAAZ,IAA+BE,eAAe,CAACI,aAAhB,CAA8BC,EAA9B,CAA/B,GAAmE;MAAEH,QAAQ,EAAEG,EAAZ;MAAgBF,IAAI,EAAEQ;IAAtB,CAA1E;EACD;;AAjB0B"}
1
+ {"version":3,"names":["TaskIdDelimiter","CAPSULE_ARTIFACTS_DIR","BuildTaskHelper","serializeId","aspectId","name","deserializeId","id","split","length","Error","deserializeIdAllowEmptyName","includes","undefined"],"sources":["build-task.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport { ExecutionContext } from '@teambit/envs';\nimport type { Network } from '@teambit/isolator';\nimport type { ComponentResult } from './types';\nimport type { ArtifactDefinition } from './artifact';\nimport { TaskResultsList } from './task-results-list';\nimport { TaskResults } from './build-pipe';\nimport { PipeName } from './builder.service';\n\nexport type TaskLocation = 'start' | 'end';\n\n/**\n * delimiter between task.aspectId and task.name\n */\nexport const TaskIdDelimiter = ':';\n\n/**\n * A folder to write artifacts generated during a build task\n * This folder is used in the core envs and excluded by default from the package tar file (the core envs is writing this into the npmignore file)\n */\nexport const CAPSULE_ARTIFACTS_DIR = 'artifacts';\n\nexport interface BuildContext extends ExecutionContext {\n /**\n * all components about to be built/tagged.\n */\n components: Component[];\n\n /**\n * network of capsules ready to be built.\n */\n capsuleNetwork: Network;\n\n /**\n * data generated by tasks that were running before this task\n */\n previousTasksResults: TaskResults[];\n\n /**\n * Run the build pipeline in dev mode\n */\n dev?: boolean;\n\n /**\n * pipe name such as \"build\", \"tas\", \"snap\".\n * an example usage is \"deploy\" task which is running in snap and tag pipeline and has different needs in each one.\n */\n pipeName: PipeName;\n}\n\nexport interface TaskDescriptor {\n aspectId: string;\n name?: string;\n description?: string;\n}\n\nexport interface BuildTask {\n /**\n * aspect id serialized of the creator of the task.\n * todo: automate this so then it won't be needed to pass manually.\n */\n aspectId: string;\n\n /**\n * name of the task. function as an identifier among other tasks of the same aspectId.\n * spaces and special characters are not allowed. as a convention, use UpperCamelCase style.\n * (e.g. TypescriptCompiler).\n */\n name: string;\n\n /**\n * description of what the task does.\n * if available, the logger will log it show it in the status-line.\n */\n description?: string;\n\n /**\n * where to put the task, before the env pipeline or after\n */\n location?: TaskLocation;\n\n /**\n * execute a task in a build context\n */\n execute(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n * e.g. typescript compiler needs to write the tsconfig file. doing it during the task, will\n * cause dependencies from other envs to get this tsconfig written.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for doing some cleanup on the\n * capsules before the deployment starts.\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * needed if you want the task to be running only after the dependencies were completed\n * for *all* envs.\n * normally this is not needed because the build-pipeline runs the tasks in the same order\n * they're located in the `getBuildPipe()` array and according to the task.location.\n * the case where this is useful is when a task not only needs to be after another task, but also\n * after all environments were running that task.\n * a dependency is task.aspectId. if an aspect has multiple tasks, to be more specific, use\n * \"aspectId:name\", e.g. \"teambit.compilation/compiler:TypescriptCompiler\".\n */\n dependencies?: string[];\n}\n\n// TODO: rename to BuildTaskResults\nexport interface BuiltTaskResult {\n /**\n * build results for each of the components in the build context.\n */\n componentsResults: ComponentResult[];\n\n /**\n * array of artifact definitions to generate after a successful build.\n */\n artifacts?: ArtifactDefinition[];\n}\n\nexport class BuildTaskHelper {\n static serializeId({ aspectId, name }: { aspectId: string; name: string }): string {\n return aspectId + TaskIdDelimiter + name;\n }\n static deserializeId(id: string): { aspectId: string; name: string } {\n const split = id.split(TaskIdDelimiter);\n if (split.length === 0) throw new Error(`deserializeId, ${id} is empty`);\n if (split.length === 1) throw new Error(`deserializeId, ${id} has only aspect-id without name`);\n if (split.length === 2) return { aspectId: split[0], name: split[1] };\n throw new Error(`deserializeId, id ${id} has more than one ${TaskIdDelimiter}`);\n }\n /**\n * don't throw an error when the id includes only the aspect-id without the task name.\n * useful for task dependencies, when it's allowed to specify the aspect-id only.\n */\n static deserializeIdAllowEmptyName(id: string): { aspectId: string; name?: string } {\n return id.includes(TaskIdDelimiter) ? BuildTaskHelper.deserializeId(id) : { aspectId: id, name: undefined };\n }\n}\n"],"mappings":";;;;;;;;;AAWA;AACA;AACA;AACO,MAAMA,eAAe,GAAG,GAAxB;AAEP;AACA;AACA;AACA;;;AACO,MAAMC,qBAAqB,GAAG,WAA9B;;;AA0GA,MAAMC,eAAN,CAAsB;EACT,OAAXC,WAAW,CAAC;IAAEC,QAAF;IAAYC;EAAZ,CAAD,EAAiE;IACjF,OAAOD,QAAQ,GAAGJ,eAAX,GAA6BK,IAApC;EACD;;EACmB,OAAbC,aAAa,CAACC,EAAD,EAAiD;IACnE,MAAMC,KAAK,GAAGD,EAAE,CAACC,KAAH,CAASR,eAAT,CAAd;IACA,IAAIQ,KAAK,CAACC,MAAN,KAAiB,CAArB,EAAwB,MAAM,IAAIC,KAAJ,CAAW,kBAAiBH,EAAG,WAA/B,CAAN;IACxB,IAAIC,KAAK,CAACC,MAAN,KAAiB,CAArB,EAAwB,MAAM,IAAIC,KAAJ,CAAW,kBAAiBH,EAAG,kCAA/B,CAAN;IACxB,IAAIC,KAAK,CAACC,MAAN,KAAiB,CAArB,EAAwB,OAAO;MAAEL,QAAQ,EAAEI,KAAK,CAAC,CAAD,CAAjB;MAAsBH,IAAI,EAAEG,KAAK,CAAC,CAAD;IAAjC,CAAP;IACxB,MAAM,IAAIE,KAAJ,CAAW,qBAAoBH,EAAG,sBAAqBP,eAAgB,EAAvE,CAAN;EACD;EACD;AACF;AACA;AACA;;;EACoC,OAA3BW,2BAA2B,CAACJ,EAAD,EAAkD;IAClF,OAAOA,EAAE,CAACK,QAAH,CAAYZ,eAAZ,IAA+BE,eAAe,CAACI,aAAhB,CAA8BC,EAA9B,CAA/B,GAAmE;MAAEH,QAAQ,EAAEG,EAAZ;MAAgBF,IAAI,EAAEQ;IAAtB,CAA1E;EACD;;AAjB0B"}
@@ -31,7 +31,7 @@ declare const pipeNames: {
31
31
  getTagPipe: string;
32
32
  getSnapPipe: string;
33
33
  };
34
- declare type PipeName = 'build' | 'tag' | 'snap';
34
+ export declare type PipeName = 'build' | 'tag' | 'snap';
35
35
  export declare type BuilderDescriptor = Array<{
36
36
  pipeName: PipeName;
37
37
  tasks: string[];
@@ -81,7 +81,7 @@ export declare class BuilderService implements EnvService<BuildServiceResults, B
81
81
  /**
82
82
  * pipe name to display on the console during the execution
83
83
  */
84
- displayPipeName: string, artifactFactory: ArtifactFactory, scope: ScopeMain);
84
+ displayPipeName: PipeName, artifactFactory: ArtifactFactory, scope: ScopeMain);
85
85
  /**
86
86
  * runs all tasks for all envs
87
87
  */
@@ -147,13 +147,12 @@ class BuilderService {
147
147
  const buildContext = Object.assign(executionContext, {
148
148
  capsuleNetwork,
149
149
  previousTasksResults: [],
150
+ pipeName: this.displayPipeName,
150
151
  dev: options.dev
151
152
  });
152
153
  envsBuildContext[executionContext.id] = buildContext;
153
154
  }));
154
-
155
- const buildPipe = _buildPipe().BuildPipe.from(tasksQueue, envsBuildContext, this.logger, this.artifactFactory, options.previousTasksResults);
156
-
155
+ const buildPipe = new (_buildPipe().BuildPipe)(tasksQueue, envsBuildContext, this.logger, this.artifactFactory, options.previousTasksResults);
157
156
  const buildResults = await buildPipe.execute();
158
157
  longProcessLogger.end();
159
158
  buildResults.hasErrors() ? this.logger.consoleFailure() : this.logger.consoleSuccess();
@@ -1 +1 @@
1
- {"version":3,"names":["pipeNames","getBuildPipe","getTagPipe","getSnapPipe","BuilderService","constructor","isolator","logger","taskSlot","pipeNameOnEnv","displayPipeName","artifactFactory","scope","runOnce","envsExecutionContext","options","envs","map","executionContext","envDefinition","tasksQueue","calculatePipelineOrder","tasks","skipTests","validate","info","toString","title","length","longProcessLogger","createLongProcessLogger","consoleTitle","envsBuildContext","Promise","all","componentIds","components","component","id","originalSeeders","originalSeedersOfThisEnv","filter","compId","find","seeder","isEqual","capsuleNetwork","isolateComponents","getExistingAsIs","seedersOnly","_originalSeeders","console","seedersCapsules","graphCapsules","buildContext","Object","assign","previousTasksResults","dev","buildPipe","BuildPipe","from","buildResults","execute","end","hasErrors","consoleFailure","consoleSuccess","render","env","pipes","getDescriptor","BuilderAspect","pipeName","renderOnePipe","task","index","keys","pipeFuncName","getTasksNamesByPipeFunc","BuildTaskHelper","serializeId","getCurrentPipeTasks"],"sources":["builder.service.tsx"],"sourcesContent":["import { EnvDefinition, EnvService, ExecutionContext } from '@teambit/envs';\nimport React from 'react';\nimport { ScopeMain } from '@teambit/scope';\nimport { Text, Newline } from 'ink';\nimport { Logger } from '@teambit/logger';\nimport { IsolatorMain } from '@teambit/isolator';\nimport { Component, ComponentID } from '@teambit/component';\nimport { BuildPipe, TaskResults } from './build-pipe';\nimport { TaskResultsList } from './task-results-list';\nimport { TaskSlot } from './builder.main.runtime';\nimport { BuildContext, BuildTaskHelper } from './build-task';\nimport { ArtifactFactory } from './artifact';\nimport { calculatePipelineOrder } from './build-pipeline-order';\nimport { BuilderAspect } from './builder.aspect';\n\nexport type BuildServiceResults = {\n id: string;\n buildResults: TaskResultsList;\n components: Component[];\n errors?: [];\n};\n\nexport type BuilderServiceOptions = {\n seedersOnly?: boolean;\n originalSeeders?: ComponentID[];\n tasks?: string[];\n skipTests?: boolean;\n previousTasksResults?: TaskResults[];\n dev?: boolean;\n};\n\nexport type EnvsBuildContext = { [envId: string]: BuildContext };\n\nconst pipeNames = {\n getBuildPipe: 'build',\n getTagPipe: 'tag',\n getSnapPipe: 'snap',\n};\n\ntype PipeName = 'build' | 'tag' | 'snap';\n\nexport type BuilderDescriptor = Array<{ pipeName: PipeName; tasks: string[] }>;\n\ntype PipeFunctionNames = keyof typeof pipeNames;\nexport class BuilderService implements EnvService<BuildServiceResults, BuilderDescriptor> {\n name = 'builder';\n\n constructor(\n /**\n * isolator extension.\n */\n private isolator: IsolatorMain,\n\n /**\n * logger extension.\n */\n private logger: Logger,\n\n /**\n * task slot (e.g tasks registered by other extensions.).\n */\n private taskSlot: TaskSlot,\n\n /**\n * a method with such name should be implemented on the env in order to run the pipe tasks.\n */\n private pipeNameOnEnv: PipeFunctionNames,\n\n /**\n * pipe name to display on the console during the execution\n */\n private displayPipeName: string,\n private artifactFactory: ArtifactFactory,\n private scope: ScopeMain\n ) {}\n\n /**\n * runs all tasks for all envs\n */\n async runOnce(envsExecutionContext: ExecutionContext[], options: BuilderServiceOptions): Promise<TaskResultsList> {\n const envs = envsExecutionContext.map((executionContext) => executionContext.envDefinition);\n const tasksQueue = calculatePipelineOrder(\n this.taskSlot,\n envs,\n this.pipeNameOnEnv,\n options.tasks,\n options.skipTests\n );\n tasksQueue.validate();\n this.logger.info(`going to run tasks in the following order:\\n${tasksQueue.toString()}`);\n const title = `running ${this.displayPipeName} pipe for ${envs.length} environments, total ${tasksQueue.length} tasks`;\n const longProcessLogger = this.logger.createLongProcessLogger(title);\n this.logger.consoleTitle(title);\n const envsBuildContext: EnvsBuildContext = {};\n await Promise.all(\n envsExecutionContext.map(async (executionContext) => {\n const componentIds = executionContext.components.map((component) => component.id);\n const { originalSeeders } = options;\n const originalSeedersOfThisEnv = componentIds.filter((compId) =>\n originalSeeders ? originalSeeders.find((seeder) => compId.isEqual(seeder)) : true\n );\n const capsuleNetwork = await this.isolator.isolateComponents(componentIds, {\n getExistingAsIs: true,\n seedersOnly: options.seedersOnly,\n });\n capsuleNetwork._originalSeeders = originalSeedersOfThisEnv;\n this.logger.console(\n `generated graph for env \"${executionContext.id}\", originalSeedersOfThisEnv: ${originalSeedersOfThisEnv.length}, graphOfThisEnv: ${capsuleNetwork.seedersCapsules.length}, graph total: ${capsuleNetwork.graphCapsules.length}`\n );\n const buildContext = Object.assign(executionContext, {\n capsuleNetwork,\n previousTasksResults: [],\n dev: options.dev,\n });\n envsBuildContext[executionContext.id] = buildContext;\n })\n );\n const buildPipe = BuildPipe.from(\n tasksQueue,\n envsBuildContext,\n this.logger,\n this.artifactFactory,\n options.previousTasksResults\n );\n const buildResults = await buildPipe.execute();\n longProcessLogger.end();\n buildResults.hasErrors() ? this.logger.consoleFailure() : this.logger.consoleSuccess();\n\n return buildResults;\n }\n\n render(env: EnvDefinition) {\n const pipes = this.getDescriptor(env);\n\n return (\n <Text key={BuilderAspect.id}>{pipes.map(({ pipeName, tasks }) => this.renderOnePipe(pipeName, tasks))}</Text>\n );\n }\n\n private renderOnePipe(pipeName, tasks) {\n if (!tasks || !tasks.length) return null;\n return (\n <Text key={pipeName}>\n <Text underline color=\"green\">\n {pipeName} pipe\n </Text>\n <Newline />\n <Text color=\"cyan\">total {tasks.length} tasks are configured to be executed in the following order</Text>\n <Newline />\n {tasks.map((task, index) => (\n <Text key={index}>\n <Text>\n {index + 1}. {task}\n </Text>\n <Newline />\n </Text>\n ))}\n <Newline />\n </Text>\n );\n }\n\n getDescriptor(env: EnvDefinition) {\n // @ts-ignore\n const tasks = Object.keys(pipeNames).map((pipeFuncName: PipeFunctionNames) => {\n const tasksQueue = this.getTasksNamesByPipeFunc(env, pipeFuncName);\n return { pipeName: pipeNames[pipeFuncName], tasks: tasksQueue };\n });\n return tasks as BuilderDescriptor;\n }\n\n private getTasksNamesByPipeFunc(env: EnvDefinition, pipeFuncName: PipeFunctionNames): string[] {\n const tasksQueue = calculatePipelineOrder(this.taskSlot, [env], pipeFuncName).map(({ task }) =>\n BuildTaskHelper.serializeId(task)\n );\n return tasksQueue;\n }\n\n getCurrentPipeTasks(env: EnvDefinition) {\n return this.getTasksNamesByPipeFunc(env, this.pipeNameOnEnv);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA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gBACE,+BAAC,WAAD,QACGA,KAAK,GAAG,CADX,QACgBD,IADhB,CADF,eAIE,+BAAC,cAAD,OAJF,CADD,CAPH,eAeE,+BAAC,cAAD,OAfF,CADF;EAmBD;;EAEDJ,aAAa,CAACF,GAAD,EAAqB;IAChC;IACA,MAAM/C,KAAK,GAAGiC,MAAM,CAACsB,IAAP,CAAY7E,SAAZ,EAAuBiB,GAAvB,CAA4B6D,YAAD,IAAqC;MAC5E,MAAM1D,UAAU,GAAG,KAAK2D,uBAAL,CAA6BV,GAA7B,EAAkCS,YAAlC,CAAnB;MACA,OAAO;QAAEL,QAAQ,EAAEzE,SAAS,CAAC8E,YAAD,CAArB;QAAqCxD,KAAK,EAAEF;MAA5C,CAAP;IACD,CAHa,CAAd;IAIA,OAAOE,KAAP;EACD;;EAEOyD,uBAAuB,CAACV,GAAD,EAAqBS,YAArB,EAAgE;IAC7F,MAAM1D,UAAU,GAAG,IAAAC,4CAAA,EAAuB,KAAKb,QAA5B,EAAsC,CAAC6D,GAAD,CAAtC,EAA6CS,YAA7C,EAA2D7D,GAA3D,CAA+D,CAAC;MAAE0D;IAAF,CAAD,KAChFK,4BAAA,CAAgBC,WAAhB,CAA4BN,IAA5B,CADiB,CAAnB;IAGA,OAAOvD,UAAP;EACD;;EAED8D,mBAAmB,CAACb,GAAD,EAAqB;IACtC,OAAO,KAAKU,uBAAL,CAA6BV,GAA7B,EAAkC,KAAK5D,aAAvC,CAAP;EACD;;AAxIuF"}
1
+ {"version":3,"names":["pipeNames","getBuildPipe","getTagPipe","getSnapPipe","BuilderService","constructor","isolator","logger","taskSlot","pipeNameOnEnv","displayPipeName","artifactFactory","scope","runOnce","envsExecutionContext","options","envs","map","executionContext","envDefinition","tasksQueue","calculatePipelineOrder","tasks","skipTests","validate","info","toString","title","length","longProcessLogger","createLongProcessLogger","consoleTitle","envsBuildContext","Promise","all","componentIds","components","component","id","originalSeeders","originalSeedersOfThisEnv","filter","compId","find","seeder","isEqual","capsuleNetwork","isolateComponents","getExistingAsIs","seedersOnly","_originalSeeders","console","seedersCapsules","graphCapsules","buildContext","Object","assign","previousTasksResults","pipeName","dev","buildPipe","BuildPipe","buildResults","execute","end","hasErrors","consoleFailure","consoleSuccess","render","env","pipes","getDescriptor","BuilderAspect","renderOnePipe","task","index","keys","pipeFuncName","getTasksNamesByPipeFunc","BuildTaskHelper","serializeId","getCurrentPipeTasks"],"sources":["builder.service.tsx"],"sourcesContent":["import { EnvDefinition, EnvService, ExecutionContext } from '@teambit/envs';\nimport React from 'react';\nimport { ScopeMain } from '@teambit/scope';\nimport { Text, Newline } from 'ink';\nimport { Logger } from '@teambit/logger';\nimport { IsolatorMain } from '@teambit/isolator';\nimport { Component, ComponentID } from '@teambit/component';\nimport { BuildPipe, TaskResults } from './build-pipe';\nimport { TaskResultsList } from './task-results-list';\nimport { TaskSlot } from './builder.main.runtime';\nimport { BuildContext, BuildTaskHelper } from './build-task';\nimport { ArtifactFactory } from './artifact';\nimport { calculatePipelineOrder } from './build-pipeline-order';\nimport { BuilderAspect } from './builder.aspect';\n\nexport type BuildServiceResults = {\n id: string;\n buildResults: TaskResultsList;\n components: Component[];\n errors?: [];\n};\n\nexport type BuilderServiceOptions = {\n seedersOnly?: boolean;\n originalSeeders?: ComponentID[];\n tasks?: string[];\n skipTests?: boolean;\n previousTasksResults?: TaskResults[];\n dev?: boolean;\n};\n\nexport type EnvsBuildContext = { [envId: string]: BuildContext };\n\nconst pipeNames = {\n getBuildPipe: 'build',\n getTagPipe: 'tag',\n getSnapPipe: 'snap',\n};\n\nexport type PipeName = 'build' | 'tag' | 'snap';\n\nexport type BuilderDescriptor = Array<{ pipeName: PipeName; tasks: string[] }>;\n\ntype PipeFunctionNames = keyof typeof pipeNames;\nexport class BuilderService implements EnvService<BuildServiceResults, BuilderDescriptor> {\n name = 'builder';\n\n constructor(\n /**\n * isolator extension.\n */\n private isolator: IsolatorMain,\n\n /**\n * logger extension.\n */\n private logger: Logger,\n\n /**\n * task slot (e.g tasks registered by other extensions.).\n */\n private taskSlot: TaskSlot,\n\n /**\n * a method with such name should be implemented on the env in order to run the pipe tasks.\n */\n private pipeNameOnEnv: PipeFunctionNames,\n\n /**\n * pipe name to display on the console during the execution\n */\n private displayPipeName: PipeName,\n private artifactFactory: ArtifactFactory,\n private scope: ScopeMain\n ) {}\n\n /**\n * runs all tasks for all envs\n */\n async runOnce(envsExecutionContext: ExecutionContext[], options: BuilderServiceOptions): Promise<TaskResultsList> {\n const envs = envsExecutionContext.map((executionContext) => executionContext.envDefinition);\n const tasksQueue = calculatePipelineOrder(\n this.taskSlot,\n envs,\n this.pipeNameOnEnv,\n options.tasks,\n options.skipTests\n );\n tasksQueue.validate();\n this.logger.info(`going to run tasks in the following order:\\n${tasksQueue.toString()}`);\n const title = `running ${this.displayPipeName} pipe for ${envs.length} environments, total ${tasksQueue.length} tasks`;\n const longProcessLogger = this.logger.createLongProcessLogger(title);\n this.logger.consoleTitle(title);\n const envsBuildContext: EnvsBuildContext = {};\n await Promise.all(\n envsExecutionContext.map(async (executionContext) => {\n const componentIds = executionContext.components.map((component) => component.id);\n const { originalSeeders } = options;\n const originalSeedersOfThisEnv = componentIds.filter((compId) =>\n originalSeeders ? originalSeeders.find((seeder) => compId.isEqual(seeder)) : true\n );\n const capsuleNetwork = await this.isolator.isolateComponents(componentIds, {\n getExistingAsIs: true,\n seedersOnly: options.seedersOnly,\n });\n capsuleNetwork._originalSeeders = originalSeedersOfThisEnv;\n this.logger.console(\n `generated graph for env \"${executionContext.id}\", originalSeedersOfThisEnv: ${originalSeedersOfThisEnv.length}, graphOfThisEnv: ${capsuleNetwork.seedersCapsules.length}, graph total: ${capsuleNetwork.graphCapsules.length}`\n );\n const buildContext = Object.assign(executionContext, {\n capsuleNetwork,\n previousTasksResults: [],\n pipeName: this.displayPipeName,\n dev: options.dev,\n });\n envsBuildContext[executionContext.id] = buildContext;\n })\n );\n const buildPipe = new BuildPipe(\n tasksQueue,\n envsBuildContext,\n this.logger,\n this.artifactFactory,\n options.previousTasksResults\n );\n const buildResults = await buildPipe.execute();\n longProcessLogger.end();\n buildResults.hasErrors() ? this.logger.consoleFailure() : this.logger.consoleSuccess();\n\n return buildResults;\n }\n\n render(env: EnvDefinition) {\n const pipes = this.getDescriptor(env);\n\n return (\n <Text key={BuilderAspect.id}>{pipes.map(({ pipeName, tasks }) => this.renderOnePipe(pipeName, tasks))}</Text>\n );\n }\n\n private renderOnePipe(pipeName, tasks) {\n if (!tasks || !tasks.length) return null;\n return (\n <Text key={pipeName}>\n <Text underline color=\"green\">\n {pipeName} pipe\n </Text>\n <Newline />\n <Text color=\"cyan\">total {tasks.length} tasks are configured to be executed in the following order</Text>\n <Newline />\n {tasks.map((task, index) => (\n <Text key={index}>\n <Text>\n {index + 1}. {task}\n </Text>\n <Newline />\n </Text>\n ))}\n <Newline />\n </Text>\n );\n }\n\n getDescriptor(env: EnvDefinition) {\n // @ts-ignore\n const tasks = Object.keys(pipeNames).map((pipeFuncName: PipeFunctionNames) => {\n const tasksQueue = this.getTasksNamesByPipeFunc(env, pipeFuncName);\n return { pipeName: pipeNames[pipeFuncName], tasks: tasksQueue };\n });\n return tasks as BuilderDescriptor;\n }\n\n private getTasksNamesByPipeFunc(env: EnvDefinition, pipeFuncName: PipeFunctionNames): string[] {\n const tasksQueue = calculatePipelineOrder(this.taskSlot, [env], pipeFuncName).map(({ task }) =>\n BuildTaskHelper.serializeId(task)\n );\n return tasksQueue;\n }\n\n getCurrentPipeTasks(env: EnvDefinition) {\n return this.getTasksNamesByPipeFunc(env, this.pipeNameOnEnv);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAA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,KAAK,GAAG,CADX,QACgBD,IADhB,CADF,eAIE,+BAAC,cAAD,OAJF,CADD,CAPH,eAeE,+BAAC,cAAD,OAfF,CADF;EAmBD;;EAEDH,aAAa,CAACF,GAAD,EAAqB;IAChC;IACA,MAAM/C,KAAK,GAAGiC,MAAM,CAACqB,IAAP,CAAY5E,SAAZ,EAAuBiB,GAAvB,CAA4B4D,YAAD,IAAqC;MAC5E,MAAMzD,UAAU,GAAG,KAAK0D,uBAAL,CAA6BT,GAA7B,EAAkCQ,YAAlC,CAAnB;MACA,OAAO;QAAEnB,QAAQ,EAAE1D,SAAS,CAAC6E,YAAD,CAArB;QAAqCvD,KAAK,EAAEF;MAA5C,CAAP;IACD,CAHa,CAAd;IAIA,OAAOE,KAAP;EACD;;EAEOwD,uBAAuB,CAACT,GAAD,EAAqBQ,YAArB,EAAgE;IAC7F,MAAMzD,UAAU,GAAG,IAAAC,4CAAA,EAAuB,KAAKb,QAA5B,EAAsC,CAAC6D,GAAD,CAAtC,EAA6CQ,YAA7C,EAA2D5D,GAA3D,CAA+D,CAAC;MAAEyD;IAAF,CAAD,KAChFK,4BAAA,CAAgBC,WAAhB,CAA4BN,IAA5B,CADiB,CAAnB;IAGA,OAAOtD,UAAP;EACD;;EAED6D,mBAAmB,CAACZ,GAAD,EAAqB;IACtC,OAAO,KAAKS,uBAAL,CAA6BT,GAA7B,EAAkC,KAAK5D,aAAvC,CAAP;EACD;;AAzIuF"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { BuildPipe, TaskResults } from './build-pipe';
2
2
  export { ComponentResult, TaskMetadata } from './types';
3
3
  export { BuildContext, BuildTask, BuiltTaskResult, TaskLocation, BuildTaskHelper, CAPSULE_ARTIFACTS_DIR, } from './build-task';
4
+ export type { PipeName } from './builder.service';
4
5
  export type { BuilderMain, RawBuilderData, BuilderData } from './builder.main.runtime';
5
6
  export type { PipelineReport } from './build-pipeline-result-list';
6
7
  export { BuilderAspect } from './builder.aspect';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { BuildPipe, TaskResults } from './build-pipe';\nexport { ComponentResult, TaskMetadata } from './types';\nexport {\n BuildContext,\n BuildTask,\n BuiltTaskResult,\n TaskLocation,\n BuildTaskHelper,\n CAPSULE_ARTIFACTS_DIR,\n} from './build-task';\nexport type { BuilderMain, RawBuilderData, BuilderData } from './builder.main.runtime';\nexport type { PipelineReport } from './build-pipeline-result-list';\nexport { BuilderAspect } from './builder.aspect';\nexport { WholeArtifactStorageResolver, FileStorageResolver, ArtifactStorageResolver } from './storage';\nexport { Artifact, ArtifactList, ArtifactFactory, ArtifactDefinition, ArtifactModelDefinition } from './artifact';\nexport { TaskResultsList } from './task-results-list';\nexport { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAUA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { BuildPipe, TaskResults } from './build-pipe';\nexport { ComponentResult, TaskMetadata } from './types';\nexport {\n BuildContext,\n BuildTask,\n BuiltTaskResult,\n TaskLocation,\n BuildTaskHelper,\n CAPSULE_ARTIFACTS_DIR,\n} from './build-task';\nexport type { PipeName } from './builder.service';\nexport type { BuilderMain, RawBuilderData, BuilderData } from './builder.main.runtime';\nexport type { PipelineReport } from './build-pipeline-result-list';\nexport { BuilderAspect } from './builder.aspect';\nexport { WholeArtifactStorageResolver, FileStorageResolver, ArtifactStorageResolver } from './storage';\nexport { Artifact, ArtifactList, ArtifactFactory, ArtifactDefinition, ArtifactModelDefinition } from './artifact';\nexport { TaskResultsList } from './task-results-list';\nexport { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAWA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/builder",
3
- "version": "0.0.844",
3
+ "version": "0.0.847",
4
4
  "homepage": "https://bit.dev/teambit/pipelines/builder",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.pipelines",
8
8
  "name": "builder",
9
- "version": "0.0.844"
9
+ "version": "0.0.847"
10
10
  },
11
11
  "dependencies": {
12
12
  "p-map-series": "2.1.0",
@@ -24,20 +24,20 @@
24
24
  "globby": "11.0.1",
25
25
  "@babel/runtime": "7.12.18",
26
26
  "core-js": "^3.0.0",
27
+ "@teambit/component": "0.0.847",
28
+ "@teambit/envs": "0.0.847",
29
+ "@teambit/logger": "0.0.658",
27
30
  "@teambit/graph.cleargraph": "0.0.1",
31
+ "@teambit/tester": "0.0.847",
32
+ "@teambit/isolator": "0.0.847",
33
+ "@teambit/cli": "0.0.565",
34
+ "@teambit/workspace": "0.0.847",
28
35
  "@teambit/harmony": "0.3.3",
29
- "@teambit/component": "0.0.844",
30
- "@teambit/envs": "0.0.844",
31
- "@teambit/logger": "0.0.656",
32
- "@teambit/tester": "0.0.844",
33
- "@teambit/isolator": "0.0.844",
34
- "@teambit/cli": "0.0.563",
35
- "@teambit/workspace": "0.0.844",
36
- "@teambit/aspect-loader": "0.0.844",
37
- "@teambit/generator": "0.0.844",
38
- "@teambit/graphql": "0.0.844",
39
- "@teambit/scope": "0.0.844",
40
- "@teambit/express": "0.0.661",
36
+ "@teambit/aspect-loader": "0.0.847",
37
+ "@teambit/generator": "0.0.847",
38
+ "@teambit/graphql": "0.0.847",
39
+ "@teambit/scope": "0.0.847",
40
+ "@teambit/express": "0.0.663",
41
41
  "@teambit/bit-error": "0.0.400",
42
42
  "@teambit/component-id": "0.0.417"
43
43
  },
@@ -56,7 +56,7 @@
56
56
  "@teambit/pipelines.aspect-docs.builder": "0.0.145"
57
57
  },
58
58
  "peerDependencies": {
59
- "@teambit/legacy": "1.0.344",
59
+ "@teambit/legacy": "1.0.346",
60
60
  "react-dom": "^16.8.0 || ^17.0.0",
61
61
  "react": "^16.8.0 || ^17.0.0"
62
62
  },
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.844/dist/builder.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.844/dist/builder.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.847/dist/builder.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.847/dist/builder.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];