@teambit/builder 0.0.813 → 0.0.816
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.
- package/artifact/artifact-extractor.ts +31 -30
- package/artifact/artifact-factory.ts +10 -17
- package/artifact/artifact-list.ts +61 -19
- package/artifact/artifact.ts +27 -18
- package/artifact/fs-artifact.ts +21 -0
- package/artifact/index.ts +1 -0
- package/dist/artifact/artifact-extractor.js +43 -26
- package/dist/artifact/artifact-extractor.js.map +1 -1
- package/dist/artifact/artifact-factory.d.ts +4 -4
- package/dist/artifact/artifact-factory.js +9 -10
- package/dist/artifact/artifact-factory.js.map +1 -1
- package/dist/artifact/artifact-list.d.ts +15 -12
- package/dist/artifact/artifact-list.js +68 -13
- package/dist/artifact/artifact-list.js.map +1 -1
- package/dist/artifact/artifact.d.ts +8 -26
- package/dist/artifact/artifact.js +33 -14
- package/dist/artifact/artifact.js.map +1 -1
- package/dist/artifact/fs-artifact.d.ts +18 -0
- package/dist/artifact/fs-artifact.js +35 -0
- package/dist/artifact/fs-artifact.js.map +1 -0
- package/dist/artifact/index.d.ts +1 -0
- package/dist/artifact/index.js +16 -0
- package/dist/artifact/index.js.map +1 -1
- package/dist/build-pipe.d.ts +2 -2
- package/dist/build-pipe.js.map +1 -1
- package/dist/build-pipeline-result-list.js +2 -2
- package/dist/build-pipeline-result-list.js.map +1 -1
- package/dist/build-task.d.ts +5 -0
- package/dist/build-task.js.map +1 -1
- package/dist/builder.graphql.d.ts +76 -4
- package/dist/builder.graphql.js +114 -16
- package/dist/builder.graphql.js.map +1 -1
- package/dist/builder.main.runtime.d.ts +30 -16
- package/dist/builder.main.runtime.js +88 -41
- package/dist/builder.main.runtime.js.map +1 -1
- package/dist/builder.route.d.ts +20 -0
- package/dist/builder.route.js +145 -0
- package/dist/builder.route.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/storage/default-resolver.d.ts +2 -2
- package/dist/storage/default-resolver.js.map +1 -1
- package/dist/storage/storage-resolver.d.ts +3 -3
- package/dist/storage/storage-resolver.js.map +1 -1
- package/package-tar/teambit-builder-0.0.816.tgz +0 -0
- package/package.json +20 -14
- package/{preview-1660188657912.js → preview-1660447667955.js} +2 -2
- package/storage/default-resolver.ts +2 -2
- package/storage/storage-resolver.ts +3 -3
- package/package-tar/teambit-builder-0.0.813.tgz +0 -0
package/dist/build-pipe.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EnvDefinition } from '@teambit/envs';
|
|
2
2
|
import { ComponentMap } from '@teambit/component';
|
|
3
3
|
import { Logger } from '@teambit/logger';
|
|
4
|
-
import { ArtifactFactory, ArtifactList } from './artifact';
|
|
4
|
+
import { ArtifactFactory, ArtifactList, FsArtifact } from './artifact';
|
|
5
5
|
import { BuildTask } from './build-task';
|
|
6
6
|
import { ComponentResult } from './types';
|
|
7
7
|
import { TasksQueue } from './tasks-queue';
|
|
@@ -24,7 +24,7 @@ export declare type TaskResults = {
|
|
|
24
24
|
* artifacts generated by the build pipeline.
|
|
25
25
|
* in case the task finished with errors, this prop is undefined.
|
|
26
26
|
*/
|
|
27
|
-
artifacts: ComponentMap<ArtifactList
|
|
27
|
+
artifacts: ComponentMap<ArtifactList<FsArtifact>> | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* timestamp of start initiation.
|
|
30
30
|
*/
|
package/dist/build-pipe.js.map
CHANGED
|
@@ -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 } 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> | 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;\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;;E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BAAL,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","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,EA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76,9 +76,9 @@ class BuildPipelineResultList {
|
|
|
76
76
|
const artifacts = [];
|
|
77
77
|
artifactListsMaps.forEach(artifactListMap => {
|
|
78
78
|
const artifactList = artifactListMap.getValueByComponentId(component.id);
|
|
79
|
-
if (artifactList) artifacts.push(...artifactList
|
|
79
|
+
if (artifactList) artifacts.push(...artifactList);
|
|
80
80
|
});
|
|
81
|
-
return
|
|
81
|
+
return _artifact().ArtifactList.fromArray(artifacts);
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BuildPipelineResultList","constructor","tasksResults","components","artifactListsMap","getFlattenedArtifactListsMapFromAllTasks","artifactListsMaps","flatMap","t","artifacts","ComponentMap","as","component","forEach","artifactListMap","artifactList","getValueByComponentId","id","push","
|
|
1
|
+
{"version":3,"names":["BuildPipelineResultList","constructor","tasksResults","components","artifactListsMap","getFlattenedArtifactListsMapFromAllTasks","artifactListsMaps","flatMap","t","artifacts","ComponentMap","as","component","forEach","artifactListMap","artifactList","getValueByComponentId","id","push","ArtifactList","fromArray","getMetadataFromTaskResults","componentId","compResults","reduce","acc","current","foundComponent","componentsResults","find","c","isEqual","taskId","task","aspectId","metadata","mergeDataIfPossible","getPipelineReportOfComponent","map","taskResults","pipelineReport","taskName","name","taskDescription","description","errors","warnings","startTime","endTime","compact","getDataOfComponent","tasksData","Object","keys","data","getArtifactsDataOfComponent","toObject","currentData","existingData","isEmpty","Error","Array","isArray"],"sources":["build-pipeline-result-list.ts"],"sourcesContent":["import { ComponentID, ComponentMap, Component } from '@teambit/component';\nimport { isEmpty, compact } from 'lodash';\nimport type { ArtifactObject } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { Artifact, ArtifactList } from './artifact';\nimport { TaskResults } from './build-pipe';\nimport { Serializable, TaskMetadata } from './types';\n\nexport type PipelineReport = {\n taskId: string; // task aspect-id\n taskName: string;\n taskDescription?: string;\n startTime?: number;\n endTime?: number;\n errors?: Array<Error | string>;\n warnings?: string[];\n};\n\nexport type AspectData = {\n aspectId: string;\n data: Serializable;\n};\n\n/**\n * Helper to get the data and artifacts from the TasksResultsList before saving during the tag\n */\nexport class BuildPipelineResultList {\n private artifactListsMap: ComponentMap<ArtifactList<Artifact>>;\n constructor(private tasksResults: TaskResults[], private components: Component[]) {\n this.artifactListsMap = this.getFlattenedArtifactListsMapFromAllTasks();\n }\n\n private getFlattenedArtifactListsMapFromAllTasks(): ComponentMap<ArtifactList<Artifact>> {\n const artifactListsMaps = this.tasksResults.flatMap((t) => (t.artifacts ? [t.artifacts] : []));\n return ComponentMap.as<ArtifactList<Artifact>>(this.components, (component) => {\n const artifacts: Artifact[] = [];\n artifactListsMaps.forEach((artifactListMap) => {\n const artifactList = artifactListMap.getValueByComponentId(component.id);\n if (artifactList) artifacts.push(...artifactList);\n });\n return ArtifactList.fromArray(artifacts);\n });\n }\n\n public getMetadataFromTaskResults(componentId: ComponentID): { [taskId: string]: TaskMetadata } {\n const compResults = this.tasksResults.reduce((acc, current: TaskResults) => {\n const foundComponent = current.componentsResults.find((c) => c.component.id.isEqual(componentId));\n const taskId = current.task.aspectId;\n if (foundComponent && foundComponent.metadata) {\n acc[taskId] = this.mergeDataIfPossible(foundComponent.metadata, acc[taskId], taskId);\n }\n return acc;\n }, {});\n return compResults;\n }\n\n public getPipelineReportOfComponent(componentId: ComponentID): PipelineReport[] {\n const compResults = this.tasksResults.map((taskResults: TaskResults) => {\n const foundComponent = taskResults.componentsResults.find((c) => c.component.id.isEqual(componentId));\n if (!foundComponent) return null;\n const pipelineReport: PipelineReport = {\n taskId: taskResults.task.aspectId,\n taskName: taskResults.task.name,\n taskDescription: taskResults.task.description,\n errors: foundComponent.errors,\n warnings: foundComponent.warnings,\n startTime: foundComponent.startTime,\n endTime: foundComponent.endTime,\n };\n return pipelineReport;\n });\n return compact(compResults);\n }\n\n public getDataOfComponent(componentId: ComponentID): AspectData[] {\n const tasksData = this.getMetadataFromTaskResults(componentId);\n return Object.keys(tasksData).map((taskId) => ({\n aspectId: taskId,\n data: tasksData[taskId],\n }));\n }\n\n public getArtifactsDataOfComponent(componentId: ComponentID): ArtifactObject[] | undefined {\n return this.artifactListsMap.getValueByComponentId(componentId)?.toObject();\n }\n\n private mergeDataIfPossible(currentData: Serializable, existingData: Serializable | undefined, taskId: string) {\n if (!existingData || isEmpty(existingData)) return currentData;\n // both exist\n if (typeof currentData !== 'object') {\n throw new Error(`task data must be \"object\", get ${typeof currentData} for ${taskId}`);\n }\n if (Array.isArray(currentData)) {\n throw new Error(`task data must be \"object\", get Array for ${taskId}`);\n }\n return { ...currentData, ...existingData };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAmBA;AACA;AACA;AACO,MAAMA,uBAAN,CAA8B;EAEnCC,WAAW,CAASC,YAAT,EAA8CC,UAA9C,EAAuE;IAAA,KAA9DD,YAA8D,GAA9DA,YAA8D;IAAA,KAAzBC,UAAyB,GAAzBA,UAAyB;IAAA;IAChF,KAAKC,gBAAL,GAAwB,KAAKC,wCAAL,EAAxB;EACD;;EAEOA,wCAAwC,GAAyC;IACvF,MAAMC,iBAAiB,GAAG,KAAKJ,YAAL,CAAkBK,OAAlB,CAA2BC,CAAD,IAAQA,CAAC,CAACC,SAAF,GAAc,CAACD,CAAC,CAACC,SAAH,CAAd,GAA8B,EAAhE,CAA1B;IACA,OAAOC,yBAAA,CAAaC,EAAb,CAAwC,KAAKR,UAA7C,EAA0DS,SAAD,IAAe;MAC7E,MAAMH,SAAqB,GAAG,EAA9B;MACAH,iBAAiB,CAACO,OAAlB,CAA2BC,eAAD,IAAqB;QAC7C,MAAMC,YAAY,GAAGD,eAAe,CAACE,qBAAhB,CAAsCJ,SAAS,CAACK,EAAhD,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;EACD;;AAtEkC"}
|
package/dist/build-task.d.ts
CHANGED
|
@@ -33,6 +33,11 @@ export interface BuildContext extends ExecutionContext {
|
|
|
33
33
|
*/
|
|
34
34
|
dev?: boolean;
|
|
35
35
|
}
|
|
36
|
+
export interface TaskDescriptor {
|
|
37
|
+
aspectId: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
36
41
|
export interface BuildTask {
|
|
37
42
|
/**
|
|
38
43
|
* aspect id serialized of the creator of the task.
|
package/dist/build-task.js.map
CHANGED
|
@@ -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 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;;;
|
|
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,12 +1,84 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
1
|
+
import { Component, ComponentID } from '@teambit/component';
|
|
2
2
|
import { BuilderMain } from './builder.main.runtime';
|
|
3
|
+
import { PipelineReport } from './build-pipeline-result-list';
|
|
4
|
+
declare type ArtifactGQLFile = {
|
|
5
|
+
/**
|
|
6
|
+
* same as the path - used for GQL caching
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* name of the artifact file
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* path of the artifact file
|
|
15
|
+
*/
|
|
16
|
+
path: string;
|
|
17
|
+
/**
|
|
18
|
+
* artifact file content (only for text files). Use /api/<component-id>/~aspect/builder/<extension-id>/~<path> to fetch binary file data
|
|
19
|
+
*/
|
|
20
|
+
content?: string;
|
|
21
|
+
/**
|
|
22
|
+
* REST endpoint to fetch artifact data from. /api/<component-id>/~aspect/builder/<extension-id>/~<pat
|
|
23
|
+
*/
|
|
24
|
+
downloadUrl?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Remote storage url to resolve artifact file from
|
|
27
|
+
*/
|
|
28
|
+
externalUrl?: string;
|
|
29
|
+
};
|
|
30
|
+
declare type ArtifactGQLData = {
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
files: ArtifactGQLFile[];
|
|
34
|
+
};
|
|
35
|
+
declare type TaskReport = PipelineReport & {
|
|
36
|
+
artifact?: ArtifactGQLData;
|
|
37
|
+
componentId: ComponentID;
|
|
38
|
+
};
|
|
3
39
|
export declare function builderSchema(builder: BuilderMain): {
|
|
4
40
|
typeDefs: import("graphql").DocumentNode;
|
|
5
41
|
resolvers: {
|
|
6
42
|
Component: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) => Promise<
|
|
43
|
+
pipelineReport: (component: Component, { taskId }: {
|
|
44
|
+
taskId?: string | undefined;
|
|
45
|
+
}) => Promise<{
|
|
46
|
+
artifact: {
|
|
47
|
+
files: {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
path: string;
|
|
51
|
+
content: string | undefined;
|
|
52
|
+
downloadUrl: string;
|
|
53
|
+
externalUrl: string | undefined;
|
|
54
|
+
}[];
|
|
55
|
+
def: import("./artifact").ArtifactDefinition;
|
|
56
|
+
task: import("./build-task").TaskDescriptor;
|
|
57
|
+
timestamp: number;
|
|
58
|
+
} | undefined;
|
|
59
|
+
taskId: string;
|
|
60
|
+
taskName: string;
|
|
61
|
+
taskDescription?: string | undefined;
|
|
62
|
+
startTime?: number | undefined;
|
|
63
|
+
endTime?: number | undefined;
|
|
64
|
+
errors?: (string | Error)[] | undefined;
|
|
65
|
+
warnings?: string[] | undefined;
|
|
66
|
+
}[]>;
|
|
67
|
+
};
|
|
68
|
+
TaskReport: {
|
|
69
|
+
id: (taskReport: TaskReport) => string;
|
|
70
|
+
name: (taskReport: TaskReport) => string;
|
|
71
|
+
description: (taskReport: TaskReport) => string | undefined;
|
|
72
|
+
errors: (taskReport: TaskReport) => string[];
|
|
73
|
+
warnings: (taskReport: TaskReport) => string[];
|
|
74
|
+
artifact: (taskReport: TaskReport, { path: pathFilter }: {
|
|
75
|
+
path?: string;
|
|
76
|
+
}) => Promise<{
|
|
77
|
+
files: ArtifactGQLFile[];
|
|
78
|
+
name: string;
|
|
79
|
+
description?: string | undefined;
|
|
80
|
+
} | undefined>;
|
|
10
81
|
};
|
|
11
82
|
};
|
|
12
83
|
};
|
|
84
|
+
export {};
|
package/dist/builder.graphql.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
|
|
5
7
|
require("core-js/modules/es.promise.js");
|
|
6
8
|
|
|
7
9
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -9,6 +11,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
11
|
});
|
|
10
12
|
exports.builderSchema = builderSchema;
|
|
11
13
|
|
|
14
|
+
function _defineProperty2() {
|
|
15
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
|
|
17
|
+
_defineProperty2 = function () {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
|
|
12
24
|
function _graphqlTag() {
|
|
13
25
|
const data = _interopRequireDefault(require("graphql-tag"));
|
|
14
26
|
|
|
@@ -19,35 +31,121 @@ function _graphqlTag() {
|
|
|
19
31
|
return data;
|
|
20
32
|
}
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
function _isBinaryPath() {
|
|
35
|
+
const data = _interopRequireDefault(require("is-binary-path"));
|
|
36
|
+
|
|
37
|
+
_isBinaryPath = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
45
|
+
|
|
46
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
47
|
+
|
|
23
48
|
function builderSchema(builder) {
|
|
24
49
|
return {
|
|
25
50
|
typeDefs: (0, _graphqlTag().default)`
|
|
26
|
-
type
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
type TaskReport {
|
|
52
|
+
id: String!
|
|
53
|
+
name: String!
|
|
54
|
+
description: String
|
|
55
|
+
startTime: String
|
|
56
|
+
endTime: String
|
|
57
|
+
errors: [String!]
|
|
58
|
+
warnings: [String!]
|
|
59
|
+
artifact(path: String): Artifact
|
|
60
|
+
}
|
|
29
61
|
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
type ArtifactFile {
|
|
63
|
+
# for GQL caching - same as the path
|
|
64
|
+
id: String!
|
|
65
|
+
# name of the artifact file
|
|
66
|
+
name: String
|
|
67
|
+
# path of the artifact file
|
|
68
|
+
path: String!
|
|
69
|
+
# artifact file content (only for text files). Use /api/<component-id>/~aspect/builder/<extension-id>/~<path> to fetch binary file data
|
|
70
|
+
content: String
|
|
71
|
+
# REST endpoint to fetch artifact data from. /api/<component-id>/~aspect/builder/<extension-id>/~<pat
|
|
72
|
+
downloadUrl: String
|
|
73
|
+
# Remote storage url to resolve artifact file from
|
|
74
|
+
externalUrl: String
|
|
32
75
|
}
|
|
33
76
|
|
|
34
|
-
type
|
|
35
|
-
#
|
|
36
|
-
|
|
77
|
+
type Artifact {
|
|
78
|
+
# artifact name
|
|
79
|
+
name: String!
|
|
80
|
+
description: String
|
|
81
|
+
storage: String
|
|
82
|
+
generatedBy: String
|
|
83
|
+
files: [ArtifactFile!]!
|
|
37
84
|
}
|
|
38
85
|
|
|
39
86
|
extend type Component {
|
|
40
|
-
|
|
41
|
-
getArtifacts(hash: String!): [ExtensionArtifact]
|
|
87
|
+
pipelineReport(taskId: String): [TaskReport!]!
|
|
42
88
|
}
|
|
43
89
|
`,
|
|
44
90
|
resolvers: {
|
|
45
91
|
Component: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
92
|
+
pipelineReport: async (component, {
|
|
93
|
+
taskId
|
|
94
|
+
}) => {
|
|
95
|
+
const builderData = builder.getBuilderData(component);
|
|
96
|
+
const pipeline = (builderData === null || builderData === void 0 ? void 0 : builderData.pipeline) || [];
|
|
97
|
+
const artifacts = taskId ? builder.getArtifactsByAspect(component, taskId) : builder.getArtifacts(component);
|
|
98
|
+
const artifactsWithVinyl = await Promise.all(artifacts.map(async artifact => {
|
|
99
|
+
const id = artifact.task.aspectId;
|
|
100
|
+
const artifactFiles = (await builder.getArtifactsVinylByAspect(component, id)).map(vinyl => {
|
|
101
|
+
const {
|
|
102
|
+
basename,
|
|
103
|
+
path,
|
|
104
|
+
contents
|
|
105
|
+
} = vinyl || {};
|
|
106
|
+
const isBinary = path && (0, _isBinaryPath().default)(path);
|
|
107
|
+
const content = !isBinary ? contents === null || contents === void 0 ? void 0 : contents.toString('utf-8') : undefined;
|
|
108
|
+
const downloadUrl = encodeURI(builder.getDownloadUrlForArtifact(component.id, artifact.task.aspectId, path));
|
|
109
|
+
const externalUrl = vinyl.url;
|
|
110
|
+
return {
|
|
111
|
+
id: path,
|
|
112
|
+
name: basename,
|
|
113
|
+
path,
|
|
114
|
+
content,
|
|
115
|
+
downloadUrl,
|
|
116
|
+
externalUrl
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const artifactObj = _objectSpread(_objectSpread({}, artifact), {}, {
|
|
121
|
+
files: artifactFiles
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
return artifactObj;
|
|
125
|
+
}));
|
|
126
|
+
const result = pipeline.map(task => _objectSpread(_objectSpread({}, task), {}, {
|
|
127
|
+
artifact: artifactsWithVinyl.find(data => data.task.aspectId === task.taskId)
|
|
128
|
+
}));
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
TaskReport: {
|
|
133
|
+
id: taskReport => taskReport.taskId,
|
|
134
|
+
name: taskReport => taskReport.taskName,
|
|
135
|
+
description: taskReport => taskReport.taskDescription,
|
|
136
|
+
errors: taskReport => {
|
|
137
|
+
var _taskReport$errors;
|
|
138
|
+
|
|
139
|
+
return ((_taskReport$errors = taskReport.errors) === null || _taskReport$errors === void 0 ? void 0 : _taskReport$errors.map(e => e.toString())) || [];
|
|
140
|
+
},
|
|
141
|
+
warnings: taskReport => taskReport.warnings || [],
|
|
142
|
+
artifact: async (taskReport, {
|
|
143
|
+
path: pathFilter
|
|
144
|
+
}) => {
|
|
145
|
+
if (!taskReport.artifact) return undefined;
|
|
146
|
+
return _objectSpread(_objectSpread({}, taskReport.artifact), {}, {
|
|
147
|
+
files: taskReport.artifact.files.filter(file => !pathFilter || file.path === pathFilter)
|
|
148
|
+
});
|
|
51
149
|
}
|
|
52
150
|
}
|
|
53
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["builderSchema","builder","typeDefs","gql","resolvers","Component","
|
|
1
|
+
{"version":3,"names":["builderSchema","builder","typeDefs","gql","resolvers","Component","pipelineReport","component","taskId","builderData","getBuilderData","pipeline","artifacts","getArtifactsByAspect","getArtifacts","artifactsWithVinyl","Promise","all","map","artifact","id","task","aspectId","artifactFiles","getArtifactsVinylByAspect","vinyl","basename","path","contents","isBinary","isBinaryPath","content","toString","undefined","downloadUrl","encodeURI","getDownloadUrlForArtifact","externalUrl","url","name","artifactObj","files","result","find","data","TaskReport","taskReport","taskName","description","taskDescription","errors","e","warnings","pathFilter","filter","file"],"sources":["builder.graphql.ts"],"sourcesContent":["import { Component, ComponentID } from '@teambit/component';\nimport gql from 'graphql-tag';\nimport isBinaryPath from 'is-binary-path';\nimport { BuilderMain } from './builder.main.runtime';\nimport { PipelineReport } from './build-pipeline-result-list';\n\ntype ArtifactGQLFile = {\n /**\n * same as the path - used for GQL caching\n */\n id: string;\n /**\n * name of the artifact file\n */\n name: string;\n /**\n * path of the artifact file\n */\n path: string;\n /**\n * artifact file content (only for text files). Use /api/<component-id>/~aspect/builder/<extension-id>/~<path> to fetch binary file data\n */\n content?: string;\n /**\n * REST endpoint to fetch artifact data from. /api/<component-id>/~aspect/builder/<extension-id>/~<pat\n */\n downloadUrl?: string;\n /**\n * Remote storage url to resolve artifact file from\n */\n externalUrl?: string;\n};\n\ntype ArtifactGQLData = { name: string; description?: string; files: ArtifactGQLFile[] };\ntype TaskReport = PipelineReport & {\n artifact?: ArtifactGQLData;\n componentId: ComponentID;\n};\n\nexport function builderSchema(builder: BuilderMain) {\n return {\n typeDefs: gql`\n type TaskReport {\n id: String!\n name: String!\n description: String\n startTime: String\n endTime: String\n errors: [String!]\n warnings: [String!]\n artifact(path: String): Artifact\n }\n\n type ArtifactFile {\n # for GQL caching - same as the path\n id: String!\n # name of the artifact file\n name: String\n # path of the artifact file\n path: String!\n # artifact file content (only for text files). Use /api/<component-id>/~aspect/builder/<extension-id>/~<path> to fetch binary file data\n content: String\n # REST endpoint to fetch artifact data from. /api/<component-id>/~aspect/builder/<extension-id>/~<pat\n downloadUrl: String\n # Remote storage url to resolve artifact file from\n externalUrl: String\n }\n\n type Artifact {\n # artifact name\n name: String!\n description: String\n storage: String\n generatedBy: String\n files: [ArtifactFile!]!\n }\n\n extend type Component {\n pipelineReport(taskId: String): [TaskReport!]!\n }\n `,\n\n resolvers: {\n Component: {\n pipelineReport: async (component: Component, { taskId }: { taskId?: string }) => {\n const builderData = builder.getBuilderData(component);\n const pipeline = builderData?.pipeline || [];\n const artifacts = taskId ? builder.getArtifactsByAspect(component, taskId) : builder.getArtifacts(component);\n\n const artifactsWithVinyl = await Promise.all(\n artifacts.map(async (artifact) => {\n const id = artifact.task.aspectId;\n const artifactFiles = (await builder.getArtifactsVinylByAspect(component, id)).map((vinyl) => {\n const { basename, path, contents } = vinyl || {};\n const isBinary = path && isBinaryPath(path);\n const content = !isBinary ? contents?.toString('utf-8') : undefined;\n const downloadUrl = encodeURI(\n builder.getDownloadUrlForArtifact(component.id, artifact.task.aspectId, path)\n );\n const externalUrl = vinyl.url;\n return { id: path, name: basename, path, content, downloadUrl, externalUrl };\n });\n const artifactObj = { ...artifact, files: artifactFiles };\n return artifactObj;\n })\n );\n\n const result = pipeline.map((task) => ({\n ...task,\n artifact: artifactsWithVinyl.find((data) => data.task.aspectId === task.taskId),\n }));\n\n return result;\n },\n },\n TaskReport: {\n id: (taskReport: TaskReport) => taskReport.taskId,\n name: (taskReport: TaskReport) => taskReport.taskName,\n description: (taskReport: TaskReport) => taskReport.taskDescription,\n errors: (taskReport: TaskReport) => taskReport.errors?.map((e) => e.toString()) || [],\n warnings: (taskReport: TaskReport) => taskReport.warnings || [],\n artifact: async (taskReport: TaskReport, { path: pathFilter }: { path?: string }) => {\n if (!taskReport.artifact) return undefined;\n return {\n ...taskReport.artifact,\n files: taskReport.artifact.files.filter((file) => !pathFilter || file.path === pathFilter),\n };\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAqCO,SAASA,aAAT,CAAuBC,OAAvB,EAA6C;EAClD,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAA,CAAI;AAClB;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAxCS;IA0CLC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTC,cAAc,EAAE,OAAOC,SAAP,EAA6B;UAAEC;QAAF,CAA7B,KAAiE;UAC/E,MAAMC,WAAW,GAAGR,OAAO,CAACS,cAAR,CAAuBH,SAAvB,CAApB;UACA,MAAMI,QAAQ,GAAG,CAAAF,WAAW,SAAX,IAAAA,WAAW,WAAX,YAAAA,WAAW,CAAEE,QAAb,KAAyB,EAA1C;UACA,MAAMC,SAAS,GAAGJ,MAAM,GAAGP,OAAO,CAACY,oBAAR,C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A,IADuB;YAE1BF,QAAQ,EAAEJ,kBAAkB,CAAC4B,IAAnB,CAAyBC,IAAD,IAAUA,IAAI,CAACvB,IAAL,CAAUC,QAAV,KAAuBD,IAAI,CAACb,MAA9D;UAFgB,EAAb,CAAf;UAKA,OAAOkC,MAAP;QACD;MA9BQ,CADF;MAiCTG,UAAU,EAAE;QACVzB,EAAE,EAAG0B,UAAD,IAA4BA,UAAU,CAACtC,MADjC;QAEV+B,IAAI,EAAGO,UAAD,IAA4BA,UAAU,CAACC,QAFnC;QAGVC,WAAW,EAAGF,UAAD,IAA4BA,UAAU,CAACG,eAH1C;QAIVC,MAAM,EAAGJ,UAAD;UAAA;;UAAA,OAA4B,uBAAAA,UAAU,CAACI,MAAX,0EAAmBhC,GAAnB,CAAwBiC,CAAD,IAAOA,CAAC,CAACnB,QAAF,EAA9B,MAA+C,EAA3E;QAAA,CAJE;QAKVoB,QAAQ,EAAGN,UAAD,IAA4BA,UAAU,CAACM,QAAX,IAAuB,EALnD;QAMVjC,QAAQ,EAAE,OAAO2B,UAAP,EAA+B;UAAEnB,IAAI,EAAE0B;QAAR,CAA/B,KAA2E;UACnF,IAAI,CAACP,UAAU,CAAC3B,QAAhB,EAA0B,OAAOc,SAAP;UAC1B,uCACKa,UAAU,CAAC3B,QADhB;YAEEsB,KAAK,EAAEK,UAAU,CAAC3B,QAAX,CAAoBsB,KAApB,CAA0Ba,MAA1B,CAAkCC,IAAD,IAAU,CAACF,UAAD,IAAeE,IAAI,CAAC5B,IAAL,KAAc0B,UAAxE;UAFT;QAID;MAZS;IAjCH;EA1CN,CAAP;AA2FD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';
|
|
2
|
+
import { ArtifactObject } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';
|
|
2
3
|
import { AspectLoaderMain } from '@teambit/aspect-loader';
|
|
3
4
|
import { CLIMain } from '@teambit/cli';
|
|
4
|
-
import { Component, IComponent } from '@teambit/component';
|
|
5
|
+
import { Component, IComponent, ComponentMain, ComponentID } from '@teambit/component';
|
|
5
6
|
import { EnvsMain } from '@teambit/envs';
|
|
6
7
|
import { GraphqlMain } from '@teambit/graphql';
|
|
7
8
|
import { SlotRegistry } from '@teambit/harmony';
|
|
@@ -10,8 +11,8 @@ import { ScopeMain, OnTagResults } from '@teambit/scope';
|
|
|
10
11
|
import { Workspace } from '@teambit/workspace';
|
|
11
12
|
import { IsolateComponentsOptions, IsolatorMain } from '@teambit/isolator';
|
|
12
13
|
import { OnTagOpts } from '@teambit/legacy/dist/scope/scope';
|
|
13
|
-
import { ArtifactObject } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';
|
|
14
14
|
import { GeneratorMain } from '@teambit/generator';
|
|
15
|
+
import { Artifact, ArtifactList } from './artifact';
|
|
15
16
|
import { BuilderService, BuilderServiceOptions } from './builder.service';
|
|
16
17
|
import { BuildTask } from './build-task';
|
|
17
18
|
import { TaskResults } from './build-pipe';
|
|
@@ -19,12 +20,22 @@ import { TaskResultsList } from './task-results-list';
|
|
|
19
20
|
import { AspectData, PipelineReport } from './build-pipeline-result-list';
|
|
20
21
|
import { Serializable } from './types';
|
|
21
22
|
export declare type TaskSlot = SlotRegistry<BuildTask[]>;
|
|
22
|
-
export declare
|
|
23
|
+
export declare const FILE_PATH_PARAM_DELIM = "~";
|
|
24
|
+
/**
|
|
25
|
+
* builder data format for the bit object store
|
|
26
|
+
*/
|
|
27
|
+
export declare type RawBuilderData = {
|
|
23
28
|
pipeline: PipelineReport[];
|
|
24
|
-
artifacts
|
|
29
|
+
artifacts?: ArtifactObject[];
|
|
25
30
|
aspectsData: AspectData[];
|
|
26
31
|
bitVersion?: string;
|
|
27
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* builder data mapped to an ArtifactList instance
|
|
35
|
+
*/
|
|
36
|
+
export declare type BuilderData = Omit<RawBuilderData, 'artifacts'> & {
|
|
37
|
+
artifacts: ArtifactList<Artifact>;
|
|
38
|
+
};
|
|
28
39
|
export declare class BuilderMain {
|
|
29
40
|
private envs;
|
|
30
41
|
private workspace;
|
|
@@ -34,23 +45,24 @@ export declare class BuilderMain {
|
|
|
34
45
|
private scope;
|
|
35
46
|
private isolator;
|
|
36
47
|
private aspectLoader;
|
|
48
|
+
private componentAspect;
|
|
37
49
|
private buildTaskSlot;
|
|
38
50
|
private tagTaskSlot;
|
|
39
51
|
private snapTaskSlot;
|
|
40
|
-
constructor(envs: EnvsMain, workspace: Workspace, buildService: BuilderService, tagService: BuilderService, snapService: BuilderService, scope: ScopeMain, isolator: IsolatorMain, aspectLoader: AspectLoaderMain, buildTaskSlot: TaskSlot, tagTaskSlot: TaskSlot, snapTaskSlot: TaskSlot);
|
|
52
|
+
constructor(envs: EnvsMain, workspace: Workspace, buildService: BuilderService, tagService: BuilderService, snapService: BuilderService, scope: ScopeMain, isolator: IsolatorMain, aspectLoader: AspectLoaderMain, componentAspect: ComponentMain, buildTaskSlot: TaskSlot, tagTaskSlot: TaskSlot, snapTaskSlot: TaskSlot);
|
|
41
53
|
private storeArtifacts;
|
|
42
54
|
private pipelineResultsToBuilderData;
|
|
43
55
|
tagListener(components: Component[], options?: OnTagOpts, isolateOptions?: IsolateComponentsOptions): Promise<OnTagResults>;
|
|
44
56
|
private validateBuilderDataMap;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
getArtifactsByName(component: Component, name: string):
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
getArtifactsVinylByAspect(component: Component, aspectName: string): Promise<ArtifactVinyl[]>;
|
|
58
|
+
getArtifactsVinylByAspectAndName(component: Component, aspectName: string, name: string): Promise<ArtifactVinyl[]>;
|
|
59
|
+
getArtifactsVinylByAspectAndTaskName(component: Component, aspectName: string, name: string): Promise<ArtifactVinyl[]>;
|
|
60
|
+
getArtifactsByName(component: Component, name: string): ArtifactList<Artifact>;
|
|
61
|
+
getArtifactsByAspect(component: Component, aspectName: string): ArtifactList<Artifact>;
|
|
62
|
+
getArtifactsByAspectAndName(component: Component, aspectName: string, name: string): ArtifactList<Artifact>;
|
|
63
|
+
getArtifactsbyAspectAndTaskName(component: Component, aspectName: string, taskName: string): ArtifactList<Artifact>;
|
|
52
64
|
getDataByAspect(component: IComponent, aspectName: string): Serializable | undefined;
|
|
53
|
-
getArtifacts(component: Component):
|
|
65
|
+
getArtifacts(component: Component): ArtifactList<Artifact>;
|
|
54
66
|
getBuilderData(component: IComponent): BuilderData | undefined;
|
|
55
67
|
/**
|
|
56
68
|
* build given components for release.
|
|
@@ -62,7 +74,7 @@ export declare class BuilderMain {
|
|
|
62
74
|
runTagTasks(components: Component[], isolateOptions?: IsolateComponentsOptions, previousTasksResults?: TaskResults[]): Promise<TaskResultsList>;
|
|
63
75
|
runSnapTasks(components: Component[], isolateOptions?: IsolateComponentsOptions, previousTasksResults?: TaskResults[]): Promise<TaskResultsList>;
|
|
64
76
|
listTasks(component: Component): {
|
|
65
|
-
id:
|
|
77
|
+
id: ComponentID;
|
|
66
78
|
envId: string;
|
|
67
79
|
buildTasks: string[];
|
|
68
80
|
tagTasks: string[];
|
|
@@ -87,10 +99,11 @@ export declare class BuilderMain {
|
|
|
87
99
|
* this pipeline is running once the build-pipeline has completed.
|
|
88
100
|
*/
|
|
89
101
|
registerSnapTasks(tasks: BuildTask[]): this;
|
|
102
|
+
getDownloadUrlForArtifact(componentId: ComponentID, taskId: string, path?: string): string;
|
|
90
103
|
static slots: ((registerFn: () => string) => SlotRegistry<BuildTask>)[];
|
|
91
104
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
92
105
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
93
|
-
static provider([cli, envs, workspace, scope, isolator, loggerExt, aspectLoader, graphql, generator]: [
|
|
106
|
+
static provider([cli, envs, workspace, scope, isolator, loggerExt, aspectLoader, graphql, generator, component]: [
|
|
94
107
|
CLIMain,
|
|
95
108
|
EnvsMain,
|
|
96
109
|
Workspace,
|
|
@@ -99,6 +112,7 @@ export declare class BuilderMain {
|
|
|
99
112
|
LoggerMain,
|
|
100
113
|
AspectLoaderMain,
|
|
101
114
|
GraphqlMain,
|
|
102
|
-
GeneratorMain
|
|
115
|
+
GeneratorMain,
|
|
116
|
+
ComponentMain
|
|
103
117
|
], config: any, [buildTaskSlot, tagTaskSlot, snapTaskSlot]: [TaskSlot, TaskSlot, TaskSlot]): Promise<BuilderMain>;
|
|
104
118
|
}
|