@teambit/builder 0.0.1061 → 0.0.1063
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/builder.service.tsx +3 -1
- package/dist/build-pipe.d.ts +6 -1
- package/dist/build-pipe.js +8 -1
- package/dist/build-pipe.js.map +1 -1
- package/dist/build.cmd.d.ts +2 -1
- package/dist/build.cmd.js +5 -3
- package/dist/build.cmd.js.map +1 -1
- package/dist/builder.main.runtime.d.ts +3 -5
- package/dist/builder.main.runtime.js +12 -15
- package/dist/builder.main.runtime.js.map +1 -1
- package/dist/builder.service.d.ts +1 -0
- package/dist/builder.service.js +3 -1
- package/dist/builder.service.js.map +1 -1
- package/dist/{preview-1684639552093.js → preview-1684985676927.js} +2 -2
- package/package-tar/teambit-builder-0.0.1063.tgz +0 -0
- package/package.json +18 -18
- package/package-tar/teambit-builder-0.0.1061.tgz +0 -0
package/builder.service.tsx
CHANGED
|
@@ -28,6 +28,7 @@ export type BuilderServiceOptions = {
|
|
|
28
28
|
skipTests?: boolean;
|
|
29
29
|
previousTasksResults?: TaskResults[];
|
|
30
30
|
dev?: boolean;
|
|
31
|
+
exitOnFirstFailedTask?: boolean;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
type BuilderTransformationMap = ServiceTransformationMap & {
|
|
@@ -127,7 +128,8 @@ export class BuilderService implements EnvService<BuildServiceResults, BuilderDe
|
|
|
127
128
|
envsBuildContext,
|
|
128
129
|
this.logger,
|
|
129
130
|
this.artifactFactory,
|
|
130
|
-
options.previousTasksResults
|
|
131
|
+
options.previousTasksResults,
|
|
132
|
+
{ exitOnFirstFailedTask: options.exitOnFirstFailedTask }
|
|
131
133
|
);
|
|
132
134
|
const buildResults = await buildPipe.execute();
|
|
133
135
|
longProcessLogger.end();
|
package/dist/build-pipe.d.ts
CHANGED
|
@@ -34,6 +34,9 @@ export declare type TaskResults = {
|
|
|
34
34
|
*/
|
|
35
35
|
endTime: number;
|
|
36
36
|
};
|
|
37
|
+
declare type PipeOptions = {
|
|
38
|
+
exitOnFirstFailedTask?: boolean;
|
|
39
|
+
};
|
|
37
40
|
export declare class BuildPipe {
|
|
38
41
|
/**
|
|
39
42
|
* array of services to apply on the components.
|
|
@@ -43,6 +46,7 @@ export declare class BuildPipe {
|
|
|
43
46
|
readonly logger: Logger;
|
|
44
47
|
readonly artifactFactory: ArtifactFactory;
|
|
45
48
|
private previousTaskResults?;
|
|
49
|
+
private options?;
|
|
46
50
|
private failedTasks;
|
|
47
51
|
private failedDependencyTask;
|
|
48
52
|
private longProcessLogger;
|
|
@@ -51,7 +55,7 @@ export declare class BuildPipe {
|
|
|
51
55
|
/**
|
|
52
56
|
* array of services to apply on the components.
|
|
53
57
|
*/
|
|
54
|
-
tasksQueue: TasksQueue, envsBuildContext: EnvsBuildContext, logger: Logger, artifactFactory: ArtifactFactory, previousTaskResults?: TaskResults[] | undefined);
|
|
58
|
+
tasksQueue: TasksQueue, envsBuildContext: EnvsBuildContext, logger: Logger, artifactFactory: ArtifactFactory, previousTaskResults?: TaskResults[] | undefined, options?: PipeOptions | undefined);
|
|
55
59
|
get allTasksResults(): TaskResults[];
|
|
56
60
|
/**
|
|
57
61
|
* execute a pipeline of build tasks.
|
|
@@ -68,3 +72,4 @@ export declare class BuildPipe {
|
|
|
68
72
|
private shouldSkipTask;
|
|
69
73
|
private getBuildContext;
|
|
70
74
|
}
|
|
75
|
+
export {};
|
package/dist/build-pipe.js
CHANGED
|
@@ -48,12 +48,13 @@ class BuildPipe {
|
|
|
48
48
|
/**
|
|
49
49
|
* array of services to apply on the components.
|
|
50
50
|
*/
|
|
51
|
-
tasksQueue, envsBuildContext, logger, artifactFactory, previousTaskResults) {
|
|
51
|
+
tasksQueue, envsBuildContext, logger, artifactFactory, previousTaskResults, options) {
|
|
52
52
|
this.tasksQueue = tasksQueue;
|
|
53
53
|
this.envsBuildContext = envsBuildContext;
|
|
54
54
|
this.logger = logger;
|
|
55
55
|
this.artifactFactory = artifactFactory;
|
|
56
56
|
this.previousTaskResults = previousTaskResults;
|
|
57
|
+
this.options = options;
|
|
57
58
|
(0, _defineProperty2().default)(this, "failedTasks", []);
|
|
58
59
|
(0, _defineProperty2().default)(this, "failedDependencyTask", void 0);
|
|
59
60
|
(0, _defineProperty2().default)(this, "longProcessLogger", void 0);
|
|
@@ -171,6 +172,12 @@ class BuildPipe {
|
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
174
|
shouldSkipTask(taskId, envId) {
|
|
175
|
+
var _this$options;
|
|
176
|
+
if ((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.exitOnFirstFailedTask && this.failedTasks.length) {
|
|
177
|
+
const failedTaskId = _buildTask().BuildTaskHelper.serializeId(this.failedTasks[0]);
|
|
178
|
+
this.logger.consoleWarning(`env: ${envId}, task "${taskId}" has skipped due to "${failedTaskId}" failure`);
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
174
181
|
if (!this.failedDependencyTask) return false;
|
|
175
182
|
const failedTaskId = _buildTask().BuildTaskHelper.serializeId(this.failedDependencyTask);
|
|
176
183
|
this.logger.consoleWarning(`env: ${envId}, task "${taskId}" has skipped due to "${failedTaskId}" failure`);
|
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"],"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,SAAS,CAAC;EAKrBC,WAAW;EACT;AACJ;AACA;EACaC,UAAsB,EACtBC,gBAAkC,EAClCC,MAAc,EACdC,eAAgC,EACjCC,mBAAmC,EAC3C;IAAA,KALSJ,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,gBAAkC,GAAlCA,gBAAkC;IAAA,KAClCC,MAAc,GAAdA,MAAc;IAAA,KACdC,eAAgC,GAAhCA,eAAg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IAC9E7B,YAAY,CAACiC,oBAAoB,GAAG,IAAI,CAACtE,eAAe;IACxD,OAAOqC,YAAY;EACrB;AACF;AAAC"}
|
|
1
|
+
{"version":3,"names":["BuildPipe","constructor","tasksQueue","envsBuildContext","logger","artifactFactory","previousTaskResults","options","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","exitOnFirstFailedTask","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\ntype PipeOptions = {\n exitOnFirstFailedTask?: boolean; // by default it skips only when a dependent failed.\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 private options?: PipeOptions\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.options?.exitOnFirstFailedTask && this.failedTasks.length) {\n const failedTaskId = BuildTaskHelper.serializeId(this.failedTasks[0]);\n this.logger.consoleWarning(`env: ${envId}, task \"${taskId}\" has skipped due to \"${failedTaskId}\" failure`);\n return true;\n }\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;AAuCO,MAAMA,SAAS,CAAC;EAKrBC,WAAW;EACT;AACJ;AACA;EACaC,UAAsB,EACtBC,gBAAkC,EAClCC,MAAc,EACdC,eAAgC,EACjCC,mBAAmC,EACnCC,OAAqB,EAC7B;IAAA,KANSL,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,gBAAkC,GAAlCA,gBAAkC;IAAA,KAClCC,MAAc,GAAdA,MAAc;IAAA,KACdC,eAAgC,GAAhCA,eAAgC;IAAA,KACjCC,mBAAmC,GAAnCA,mBAAmC;IAAA,KACnCC,OAAqB,GAArBA,OAAqB;IAAA,qDAbI,EAAE;IAAA;IAAA;IAAA,qDAGA,EAAE;EAWpC;EAEH,IAAIC,eAAe,GAAkB;IACnC,OAAO,CAAC,IAAI,IAAI,CAACF,mBAAmB,IAAI,EAAE,CAAC,EAAE,IAAI,IAAI,CAACG,WAAW,IAAI,EAAE,CAAC,CAAC;EAC3E;;EAEA;AACF;AACA;EACE,MAAMC,OAAO,GAA6B;IACxC,IAAI,CAACC,iBAAiB,EAAE;IACxB,MAAM,IAAI,CAACC,eAAe,EAAE;IAC5B,IAAI,CAACC,iBA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E,eAAe;IACxD,OAAOqC,YAAY;EACrB;AACF;AAAC"}
|
package/dist/build.cmd.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare type BuildOpts = {
|
|
|
13
13
|
tasks: string;
|
|
14
14
|
listTasks?: string;
|
|
15
15
|
skipTests?: boolean;
|
|
16
|
+
failFast?: boolean;
|
|
16
17
|
};
|
|
17
18
|
export declare class BuilderCmd implements Command {
|
|
18
19
|
private builder;
|
|
@@ -29,7 +30,7 @@ export declare class BuilderCmd implements Command {
|
|
|
29
30
|
group: string;
|
|
30
31
|
options: CommandOptions;
|
|
31
32
|
constructor(builder: BuilderMain, workspace: Workspace, logger: Logger);
|
|
32
|
-
report([pattern]: [string], { all, unmodified, dev, install, cachePackagesOnCapsulesRoot, reuseCapsules, tasks, listTasks, skipTests, }: BuildOpts): Promise<string>;
|
|
33
|
+
report([pattern]: [string], { all, unmodified, dev, install, cachePackagesOnCapsulesRoot, reuseCapsules, tasks, listTasks, skipTests, failFast, }: BuildOpts): Promise<string>;
|
|
33
34
|
private getListTasks;
|
|
34
35
|
}
|
|
35
36
|
export {};
|
package/dist/build.cmd.js
CHANGED
|
@@ -52,7 +52,7 @@ class BuilderCmd {
|
|
|
52
52
|
(0, _defineProperty2().default)(this, "alias", '');
|
|
53
53
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
54
54
|
(0, _defineProperty2().default)(this, "options", [['a', 'all', 'DEPRECATED. use --unmodified'], ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are built)'], ['d', 'dev', 'run the pipeline in dev mode'], ['', 'install', 'install core aspects in capsules'], ['', 'reuse-capsules', 'avoid deleting the capsules root-dir before starting the build'], ['', 'tasks <string>', `build the specified task(s) only. for multiple tasks, separate by a comma and wrap with quotes.
|
|
55
|
-
specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)`], ['', 'cache-packages-on-capsule-root', 'set the package-manager cache on the capsule root'], ['', 'list-tasks <string>', 'list tasks of an env or a component-id for each one of the pipelines: build, tag and snap'], ['', 'skip-tests', 'skip running component tests during tag process']]);
|
|
55
|
+
specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)`], ['', 'cache-packages-on-capsule-root', 'set the package-manager cache on the capsule root'], ['', 'list-tasks <string>', 'list tasks of an env or a component-id for each one of the pipelines: build, tag and snap'], ['', 'skip-tests', 'skip running component tests during tag process'], ['', 'fail-fast', 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependent failed)']]);
|
|
56
56
|
}
|
|
57
57
|
async report([pattern], {
|
|
58
58
|
all = false,
|
|
@@ -63,7 +63,8 @@ specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. te
|
|
|
63
63
|
reuseCapsules = false,
|
|
64
64
|
tasks,
|
|
65
65
|
listTasks,
|
|
66
|
-
skipTests
|
|
66
|
+
skipTests,
|
|
67
|
+
failFast
|
|
67
68
|
}) {
|
|
68
69
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
69
70
|
if (all) {
|
|
@@ -93,7 +94,8 @@ specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. te
|
|
|
93
94
|
}, {
|
|
94
95
|
dev,
|
|
95
96
|
tasks: tasks ? tasks.split(',').map(task => task.trim()) : [],
|
|
96
|
-
skipTests
|
|
97
|
+
skipTests,
|
|
98
|
+
exitOnFirstFailedTask: failFast
|
|
97
99
|
});
|
|
98
100
|
longProcessLogger.end();
|
|
99
101
|
envsExecutionResults.throwErrorsIfExist();
|
package/dist/build.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BuilderCmd","constructor","builder","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","unmodified","dev","install","cachePackagesOnCapsulesRoot","reuseCapsules","tasks","listTasks","skipTests","OutsideWorkspaceError","consoleWarning","getListTasks","longProcessLogger","createLongProcessLogger","components","getComponentsByUserInput","length","chalk","bold","consoleSuccess","envsExecutionResults","build","installOptions","installTeambitBit","packageManagerConfigRootDir","path","linkingOptions","linkTeambitBit","emptyRootDir","getExistingAsIs","split","map","task","trim","end","throwErrorsIfExist","green","tasksQueue","componentIdStr","compId","resolveComponentId","component","get","results","id","toString","envId","buildTasks","join","tagTasks","snapTasks"],"sources":["build.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport chalk from 'chalk';\nimport { BuilderMain } from './builder.main.runtime';\n\ntype BuildOpts = {\n all: boolean; // deprecated. use unmodified\n unmodified?: boolean;\n dev: boolean;\n rebuild: boolean;\n install: boolean;\n cachePackagesOnCapsulesRoot: boolean;\n reuseCapsules: boolean;\n tasks: string;\n listTasks?: string;\n skipTests?: boolean;\n};\n\nexport class BuilderCmd implements Command {\n name = 'build [component-pattern]';\n description = 'run set of tasks for build';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n helpUrl = 'reference/build-pipeline/builder-overview';\n alias = '';\n group = 'development';\n options = [\n ['a', 'all', 'DEPRECATED. use --unmodified'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are built)'],\n ['d', 'dev', 'run the pipeline in dev mode'],\n ['', 'install', 'install core aspects in capsules'],\n ['', 'reuse-capsules', 'avoid deleting the capsules root-dir before starting the build'],\n [\n '',\n 'tasks <string>',\n `build the specified task(s) only. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'cache-packages-on-capsule-root', 'set the package-manager cache on the capsule root'],\n [\n '',\n 'list-tasks <string>',\n 'list tasks of an env or a component-id for each one of the pipelines: build, tag and snap',\n ],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n ] as CommandOptions;\n\n constructor(private builder: BuilderMain, private workspace: Workspace, private logger: Logger) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n unmodified = false,\n dev = false,\n install = false,\n cachePackagesOnCapsulesRoot = false,\n reuseCapsules = false,\n tasks,\n listTasks,\n skipTests,\n }: BuildOpts\n ): Promise<string> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n if (all) {\n this.logger.consoleWarning(`--all is deprecated, please use --unmodified instead`);\n unmodified = true;\n }\n if (listTasks) {\n return this.getListTasks(listTasks);\n }\n\n const longProcessLogger = this.logger.createLongProcessLogger('build');\n const components = await this.workspace.getComponentsByUserInput(unmodified, pattern, true);\n if (!components.length) {\n return chalk.bold(\n `no components found to build. use \"--unmodified\" flag to build all components or specify the ids to build, otherwise, only new and modified components will be built`\n );\n }\n this.logger.consoleSuccess(`found ${components.length} components to build`);\n const envsExecutionResults = await this.builder.build(\n components,\n {\n installOptions: {\n installTeambitBit: install,\n packageManagerConfigRootDir: this.workspace.path,\n },\n linkingOptions: { linkTeambitBit: !install },\n emptyRootDir: !reuseCapsules,\n getExistingAsIs: reuseCapsules,\n cachePackagesOnCapsulesRoot,\n },\n {\n dev,\n tasks: tasks ? tasks.split(',').map((task) => task.trim()) : [],\n skipTests,\n }\n );\n longProcessLogger.end();\n envsExecutionResults.throwErrorsIfExist();\n this.logger.consoleSuccess();\n return chalk.green(`the build has been completed. total: ${envsExecutionResults.tasksQueue.length} tasks`);\n }\n\n private async getListTasks(componentIdStr: string): Promise<string> {\n const compId = await this.workspace.resolveComponentId(componentIdStr);\n const component = await this.workspace.get(compId);\n const results = this.builder.listTasks(component);\n return `${chalk.green('Tasks List')}\nid: ${results.id.toString()}\nenvId: ${results.envId}\n\n${chalk.bold('Build Pipeline Tasks:')}\n${results.buildTasks.join('\\n')}\n\n${chalk.bold('Tag Pipeline Tasks:')}\n${results.tagTasks.join('\\n')}\n\n${chalk.bold('Snap Pipeline Tasks:')}\n${results.snapTasks.join('\\n') || '<N/A>'}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;
|
|
1
|
+
{"version":3,"names":["BuilderCmd","constructor","builder","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","unmodified","dev","install","cachePackagesOnCapsulesRoot","reuseCapsules","tasks","listTasks","skipTests","failFast","OutsideWorkspaceError","consoleWarning","getListTasks","longProcessLogger","createLongProcessLogger","components","getComponentsByUserInput","length","chalk","bold","consoleSuccess","envsExecutionResults","build","installOptions","installTeambitBit","packageManagerConfigRootDir","path","linkingOptions","linkTeambitBit","emptyRootDir","getExistingAsIs","split","map","task","trim","exitOnFirstFailedTask","end","throwErrorsIfExist","green","tasksQueue","componentIdStr","compId","resolveComponentId","component","get","results","id","toString","envId","buildTasks","join","tagTasks","snapTasks"],"sources":["build.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport chalk from 'chalk';\nimport { BuilderMain } from './builder.main.runtime';\n\ntype BuildOpts = {\n all: boolean; // deprecated. use unmodified\n unmodified?: boolean;\n dev: boolean;\n rebuild: boolean;\n install: boolean;\n cachePackagesOnCapsulesRoot: boolean;\n reuseCapsules: boolean;\n tasks: string;\n listTasks?: string;\n skipTests?: boolean;\n failFast?: boolean;\n};\n\nexport class BuilderCmd implements Command {\n name = 'build [component-pattern]';\n description = 'run set of tasks for build';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n helpUrl = 'reference/build-pipeline/builder-overview';\n alias = '';\n group = 'development';\n options = [\n ['a', 'all', 'DEPRECATED. use --unmodified'],\n ['u', 'unmodified', 'include unmodified components (by default, only new and modified components are built)'],\n ['d', 'dev', 'run the pipeline in dev mode'],\n ['', 'install', 'install core aspects in capsules'],\n ['', 'reuse-capsules', 'avoid deleting the capsules root-dir before starting the build'],\n [\n '',\n 'tasks <string>',\n `build the specified task(s) only. for multiple tasks, separate by a comma and wrap with quotes.\nspecify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n ['', 'cache-packages-on-capsule-root', 'set the package-manager cache on the capsule root'],\n [\n '',\n 'list-tasks <string>',\n 'list tasks of an env or a component-id for each one of the pipelines: build, tag and snap',\n ],\n ['', 'skip-tests', 'skip running component tests during tag process'],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependent failed)',\n ],\n ] as CommandOptions;\n\n constructor(private builder: BuilderMain, private workspace: Workspace, private logger: Logger) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n unmodified = false,\n dev = false,\n install = false,\n cachePackagesOnCapsulesRoot = false,\n reuseCapsules = false,\n tasks,\n listTasks,\n skipTests,\n failFast,\n }: BuildOpts\n ): Promise<string> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n if (all) {\n this.logger.consoleWarning(`--all is deprecated, please use --unmodified instead`);\n unmodified = true;\n }\n if (listTasks) {\n return this.getListTasks(listTasks);\n }\n\n const longProcessLogger = this.logger.createLongProcessLogger('build');\n const components = await this.workspace.getComponentsByUserInput(unmodified, pattern, true);\n if (!components.length) {\n return chalk.bold(\n `no components found to build. use \"--unmodified\" flag to build all components or specify the ids to build, otherwise, only new and modified components will be built`\n );\n }\n this.logger.consoleSuccess(`found ${components.length} components to build`);\n const envsExecutionResults = await this.builder.build(\n components,\n {\n installOptions: {\n installTeambitBit: install,\n packageManagerConfigRootDir: this.workspace.path,\n },\n linkingOptions: { linkTeambitBit: !install },\n emptyRootDir: !reuseCapsules,\n getExistingAsIs: reuseCapsules,\n cachePackagesOnCapsulesRoot,\n },\n {\n dev,\n tasks: tasks ? tasks.split(',').map((task) => task.trim()) : [],\n skipTests,\n exitOnFirstFailedTask: failFast,\n }\n );\n longProcessLogger.end();\n envsExecutionResults.throwErrorsIfExist();\n this.logger.consoleSuccess();\n return chalk.green(`the build has been completed. total: ${envsExecutionResults.tasksQueue.length} tasks`);\n }\n\n private async getListTasks(componentIdStr: string): Promise<string> {\n const compId = await this.workspace.resolveComponentId(componentIdStr);\n const component = await this.workspace.get(compId);\n const results = this.builder.listTasks(component);\n return `${chalk.green('Tasks List')}\nid: ${results.id.toString()}\nenvId: ${results.envId}\n\n${chalk.bold('Build Pipeline Tasks:')}\n${results.buildTasks.join('\\n')}\n\n${chalk.bold('Tag Pipeline Tasks:')}\n${results.tagTasks.join('\\n')}\n\n${chalk.bold('Snap Pipeline Tasks:')}\n${results.snapTasks.join('\\n') || '<N/A>'}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAiBO,MAAMA,UAAU,CAAoB;EAiCzCC,WAAW,CAASC,OAAoB,EAAUC,SAAoB,EAAUC,MAAc,EAAE;IAAA,KAA5EF,OAAoB,GAApBA,OAAoB;IAAA,KAAUC,SAAoB,GAApBA,SAAoB;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,8CAhCvF,2BAA2B;IAAA,qDACpB,4BAA4B;IAAA,mDAC9B,CAAC;MAAEC,IAAI,EAAE,mBAAmB;MAAEC,WAAW,EAAEC;IAAuB,CAAC,CAAC;IAAA,iDACtE,2CAA2C;IAAA,+CAC7C,EAAE;IAAA,+CACF,aAAa;IAAA,iDACX,CACR,CAAC,GAAG,EAAE,KAAK,EAAE,8BAA8B,CAAC,EAC5C,CAAC,GAAG,EAAE,YAAY,EAAE,wFAAwF,CAAC,EAC7G,CAAC,GAAG,EAAE,KAAK,EAAE,8BAA8B,CAAC,EAC5C,CAAC,EAAE,EAAE,SAAS,EAA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,CAACC,IAAI,CAAC,uBAAuB,CAAE;AACtC,EAAE0B,OAAO,CAACI,UAAU,CAACC,IAAI,CAAC,IAAI,CAAE;AAChC;AACA,EAAEhC,gBAAK,CAACC,IAAI,CAAC,qBAAqB,CAAE;AACpC,EAAE0B,OAAO,CAACM,QAAQ,CAACD,IAAI,CAAC,IAAI,CAAE;AAC9B;AACA,EAAEhC,gBAAK,CAACC,IAAI,CAAC,sBAAsB,CAAE;AACrC,EAAE0B,OAAO,CAACO,SAAS,CAACF,IAAI,CAAC,IAAI,CAAC,IAAI,OAAQ,EAAC;EACzC;AACF;AAAC"}
|
|
@@ -15,7 +15,6 @@ import { UiMain } from '@teambit/ui';
|
|
|
15
15
|
import { Artifact, ArtifactList } from './artifact';
|
|
16
16
|
import { BuilderService, BuilderServiceOptions } from './builder.service';
|
|
17
17
|
import { BuildTask } from './build-task';
|
|
18
|
-
import { TaskResults } from './build-pipe';
|
|
19
18
|
import { TaskResultsList } from './task-results-list';
|
|
20
19
|
import { AspectData, PipelineReport } from './build-pipeline-result-list';
|
|
21
20
|
import { Serializable } from './types';
|
|
@@ -30,7 +29,6 @@ export declare type OnTagOpts = {
|
|
|
30
29
|
forceDeploy?: boolean;
|
|
31
30
|
skipBuildPipeline?: boolean;
|
|
32
31
|
combineBuildDataFromParent?: boolean;
|
|
33
|
-
skipTests?: boolean;
|
|
34
32
|
isSnap?: boolean;
|
|
35
33
|
};
|
|
36
34
|
export declare const FILE_PATH_PARAM_DELIM = "~";
|
|
@@ -65,7 +63,7 @@ export declare class BuilderMain {
|
|
|
65
63
|
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);
|
|
66
64
|
private storeArtifacts;
|
|
67
65
|
private pipelineResultsToBuilderData;
|
|
68
|
-
tagListener(components: Component[], options?: OnTagOpts, isolateOptions?: IsolateComponentsOptions): Promise<OnTagResults>;
|
|
66
|
+
tagListener(components: Component[], options?: OnTagOpts, isolateOptions?: IsolateComponentsOptions, builderOptions?: BuilderServiceOptions): Promise<OnTagResults>;
|
|
69
67
|
private validateBuilderDataMap;
|
|
70
68
|
private combineBuildDataFromParent;
|
|
71
69
|
getArtifactsVinylByAspect(component: Component, aspectName: string): Promise<ArtifactVinyl[]>;
|
|
@@ -79,8 +77,8 @@ export declare class BuilderMain {
|
|
|
79
77
|
getArtifacts(component: IComponent): ArtifactList<Artifact>;
|
|
80
78
|
getBuilderData(component: IComponent): BuilderData | undefined;
|
|
81
79
|
build(components: Component[], isolateOptions?: IsolateComponentsOptions, builderOptions?: BuilderServiceOptions): Promise<TaskResultsList>;
|
|
82
|
-
runTagTasks(components: Component[],
|
|
83
|
-
runSnapTasks(components: Component[],
|
|
80
|
+
runTagTasks(components: Component[], builderOptions: BuilderServiceOptions): Promise<TaskResultsList>;
|
|
81
|
+
runSnapTasks(components: Component[], builderOptions: BuilderServiceOptions): Promise<TaskResultsList>;
|
|
84
82
|
listTasks(component: Component): {
|
|
85
83
|
id: ComponentID;
|
|
86
84
|
envId: string;
|
|
@@ -269,7 +269,7 @@ class BuilderMain {
|
|
|
269
269
|
};
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
async tagListener(components, options = {}, isolateOptions = {}) {
|
|
272
|
+
async tagListener(components, options = {}, isolateOptions = {}, builderOptions = {}) {
|
|
273
273
|
const pipeResults = [];
|
|
274
274
|
const allTasksResults = [];
|
|
275
275
|
const {
|
|
@@ -282,16 +282,19 @@ class BuilderMain {
|
|
|
282
282
|
if (options.skipBuildPipeline) isolateOptions.populateArtifactsFromParent = true;
|
|
283
283
|
const buildEnvsExecutionResults = await this.build(components, _objectSpread({
|
|
284
284
|
emptyRootDir: true
|
|
285
|
-
}, isolateOptions), {
|
|
286
|
-
skipTests: options.skipTests,
|
|
285
|
+
}, isolateOptions), _objectSpread(_objectSpread({}, builderOptions), {}, {
|
|
287
286
|
// even when build is skipped (in case of tag-from-scope), the pre-build/post-build and teambit.harmony/aspect tasks are needed
|
|
288
287
|
tasks: skipBuildPipeline ? [_aspect().default.id] : undefined
|
|
289
|
-
});
|
|
288
|
+
}));
|
|
290
289
|
if (throwOnError && !forceDeploy) buildEnvsExecutionResults.throwErrorsIfExist();
|
|
291
290
|
allTasksResults.push(...buildEnvsExecutionResults.tasksResults);
|
|
292
291
|
pipeResults.push(buildEnvsExecutionResults);
|
|
293
292
|
if (forceDeploy || !disableTagAndSnapPipelines && !(buildEnvsExecutionResults !== null && buildEnvsExecutionResults !== void 0 && buildEnvsExecutionResults.hasErrors())) {
|
|
294
|
-
const
|
|
293
|
+
const builderOptionsForTagSnap = _objectSpread(_objectSpread({}, builderOptions), {}, {
|
|
294
|
+
seedersOnly: isolateOptions.seedersOnly,
|
|
295
|
+
previousTasksResults: buildEnvsExecutionResults === null || buildEnvsExecutionResults === void 0 ? void 0 : buildEnvsExecutionResults.tasksResults
|
|
296
|
+
});
|
|
297
|
+
const deployEnvsExecutionResults = isSnap ? await this.runSnapTasks(components, builderOptionsForTagSnap) : await this.runTagTasks(components, builderOptionsForTagSnap);
|
|
295
298
|
if (throwOnError && !forceDeploy) deployEnvsExecutionResults.throwErrorsIfExist();
|
|
296
299
|
allTasksResults.push(...deployEnvsExecutionResults.tasksResults);
|
|
297
300
|
pipeResults.push(deployEnvsExecutionResults);
|
|
@@ -427,20 +430,14 @@ class BuilderMain {
|
|
|
427
430
|
const buildResult = await envs.runOnce(this.buildService, builderServiceOptions);
|
|
428
431
|
return buildResult;
|
|
429
432
|
}
|
|
430
|
-
async runTagTasks(components,
|
|
433
|
+
async runTagTasks(components, builderOptions) {
|
|
431
434
|
const envs = await this.envs.createEnvironment(components);
|
|
432
|
-
const buildResult = await envs.runOnce(this.tagService,
|
|
433
|
-
seedersOnly: isolateOptions === null || isolateOptions === void 0 ? void 0 : isolateOptions.seedersOnly,
|
|
434
|
-
previousTasksResults
|
|
435
|
-
});
|
|
435
|
+
const buildResult = await envs.runOnce(this.tagService, builderOptions);
|
|
436
436
|
return buildResult;
|
|
437
437
|
}
|
|
438
|
-
async runSnapTasks(components,
|
|
438
|
+
async runSnapTasks(components, builderOptions) {
|
|
439
439
|
const envs = await this.envs.createEnvironment(components);
|
|
440
|
-
const buildResult = await envs.runOnce(this.snapService,
|
|
441
|
-
seedersOnly: isolateOptions === null || isolateOptions === void 0 ? void 0 : isolateOptions.seedersOnly,
|
|
442
|
-
previousTasksResults
|
|
443
|
-
});
|
|
440
|
+
const buildResult = await envs.runOnce(this.snapService, builderOptions);
|
|
444
441
|
return buildResult;
|
|
445
442
|
}
|
|
446
443
|
listTasks(component) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FILE_PATH_PARAM_DELIM","BuilderMain","constructor","envs","workspace","buildService","tagService","snapService","scope","isolator","aspectLoader","componentAspect","buildTaskSlot","tagTaskSlot","snapTaskSlot","storeArtifacts","tasksResults","artifacts","flatMap","t","storeP","map","artifactMap","Promise","all","toArray","component","artifactList","store","err","ArtifactStorageError","pipelineResultsToBuilderData","components","buildPipelineResults","buildPipelineResultList","BuildPipelineResultList","ComponentMap","as","aspectsData","getDataOfComponent","id","pipelineReport","getPipelineReportOfComponent","getArtifactsDataOfComponent","pipeline","bitVersion","getHarmonyVersion","tagListener","options","isolateOptions","pipeResults","allTasksResults","throwOnError","forceDeploy","disableTagAndSnapPipelines","isSnap","skipBuildPipeline","populateArtifactsFromParent","buildEnvsExecutionResults","build","emptyRootDir","skipTests","tasks","AspectAspect","undefined","throwErrorsIfExist","push","hasErrors","deployEnvsExecutionResults","runSnapTasks","runTagTasks","builderDataMap","combineBuildDataFromParent","validateBuilderDataMap","forEach","buildData","taskSerializedIds","BuildTaskHelper","serializeId","aspectId","taskId","name","taskName","duplications","findDuplications","length","Error","toString","join","promises","builderData","idStr","parents","head","parent","parentComp","getHost","get","changeVersion","parentBuilderData","getBuilderData","artifact","artifactObj","toObject","find","a","task","aspectData","p","flattenValue","getArtifactsVinylByAspect","aspectName","getArtifactsByAspect","vinyls","getVinylsAndImportIfMissing","_legacy","legacyScope","getArtifactsVinylByAspectAndName","getArtifactsByAspectAndName","getArtifactsVinylByAspectAndTaskName","getArtifactsbyAspectAndTaskName","getArtifactsByName","getArtifacts","byAspectNameAndName","byAspectNameAndTaskName","getDataByAspect","data","ArtifactList","fromArray","BuilderAspect","clonedData","cloneDeep","artifactFiles","files","ArtifactFiles","fromObject","Artifact","Object","assign","fromArtifactObject","builderOptions","ids","c","network","isolateComponents","createEnvironment","graphCapsules","getAllComponents","builderServiceOptions","seedersOnly","originalSeeders","buildResult","runOnce","previousTasksResults","listTasks","compEnv","getEnv","buildTasks","getCurrentPipeTasks","tagTasks","snapTasks","envId","registerBuildTasks","register","registerDeployTasks","registerTagTasks","registerSnapTasks","getDownloadUrlForArtifact","componentId","path","provider","cli","loggerExt","graphql","generator","ui","config","artifactFactory","ArtifactFactory","logger","createLogger","BuilderService","registerService","builder","BundleUiTask","registerRoute","BuilderRoute","builderSchema","registerComponentTemplate","buildTaskTemplate","commands","BuilderCmd","ArtifactsCmd","Slot","withType","MainRuntime","CLIAspect","EnvsAspect","WorkspaceAspect","ScopeAspect","IsolatorAspect","LoggerAspect","AspectLoaderAspect","GraphqlAspect","GeneratorAspect","ComponentAspect","UIAspect","addRuntime"],"sources":["builder.main.runtime.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';\nimport { ArtifactFiles, ArtifactObject } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentMap, IComponent, ComponentAspect, ComponentMain, ComponentID } from '@teambit/component';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport AspectAspect from '@teambit/aspect';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { IsolateComponentsOptions, IsolatorAspect, IsolatorMain } from '@teambit/isolator';\nimport { getHarmonyVersion } from '@teambit/legacy/dist/bootstrap';\nimport findDuplications from '@teambit/legacy/dist/utils/array/find-duplications';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { UIAspect, UiMain, BundleUiTask } from '@teambit/ui';\nimport { Artifact, ArtifactList, FsArtifact } from './artifact';\nimport { ArtifactFactory } from './artifact/artifact-factory'; // it gets undefined when importing it from './artifact'\nimport { BuilderAspect } from './builder.aspect';\nimport { builderSchema } from './builder.graphql';\nimport { BuilderService, BuilderServiceOptions } from './builder.service';\nimport { BuilderCmd } from './build.cmd';\nimport { BuildTask, BuildTaskHelper } from './build-task';\nimport { TaskResults } from './build-pipe';\nimport { TaskResultsList } from './task-results-list';\nimport { ArtifactStorageError } from './exceptions';\nimport { BuildPipelineResultList, AspectData, PipelineReport } from './build-pipeline-result-list';\nimport { Serializable } from './types';\nimport { ArtifactsCmd } from './artifact/artifacts.cmd';\nimport { buildTaskTemplate } from './templates/build-task';\nimport { BuilderRoute } from './builder.route';\n\nexport type TaskSlot = SlotRegistry<BuildTask[]>;\nexport type OnTagResults = { builderDataMap: ComponentMap<RawBuilderData>; pipeResults: TaskResultsList[] };\nexport type OnTagOpts = {\n disableTagAndSnapPipelines?: boolean;\n throwOnError?: boolean; // on the CI it helps to save the results on failure so this is set to false\n forceDeploy?: boolean; // whether run the deploy-pipeline although the build-pipeline has failed\n skipBuildPipeline?: boolean; // helpful for tagging from scope where we want to use the build-artifacts of previous snap.\n combineBuildDataFromParent?: boolean; // helpful for tagging from scope where we want to save the build-data of parent snap.\n skipTests?: boolean;\n isSnap?: boolean;\n};\nexport const FILE_PATH_PARAM_DELIM = '~';\n\n/**\n * builder data format for the bit object store\n */\nexport type RawBuilderData = {\n pipeline: PipelineReport[];\n artifacts?: ArtifactObject[];\n aspectsData: AspectData[];\n bitVersion?: string;\n};\n/**\n * builder data mapped to an ArtifactList instance\n */\nexport type BuilderData = Omit<RawBuilderData, 'artifacts'> & {\n artifacts: ArtifactList<Artifact>;\n};\n\nexport class BuilderMain {\n constructor(\n private envs: EnvsMain,\n private workspace: Workspace,\n private buildService: BuilderService,\n private tagService: BuilderService,\n private snapService: BuilderService,\n private scope: ScopeMain,\n private isolator: IsolatorMain,\n private aspectLoader: AspectLoaderMain,\n private componentAspect: ComponentMain,\n private buildTaskSlot: TaskSlot,\n private tagTaskSlot: TaskSlot,\n private snapTaskSlot: TaskSlot\n ) {}\n\n private async storeArtifacts(tasksResults: TaskResults[]) {\n const artifacts = tasksResults.flatMap((t) => (t.artifacts ? [t.artifacts] : []));\n const storeP = artifacts.map(async (artifactMap: ComponentMap<ArtifactList<FsArtifact>>) => {\n return Promise.all(\n artifactMap.toArray().map(async ([component, artifactList]) => {\n try {\n return await artifactList.store(component);\n } catch (err: any) {\n throw new ArtifactStorageError(err, component);\n }\n })\n );\n });\n await Promise.all(storeP);\n }\n\n private pipelineResultsToBuilderData(\n components: Component[],\n buildPipelineResults: TaskResults[]\n ): ComponentMap<RawBuilderData> {\n const buildPipelineResultList = new BuildPipelineResultList(buildPipelineResults, components);\n return ComponentMap.as<RawBuilderData>(components, (component) => {\n const aspectsData = buildPipelineResultList.getDataOfComponent(component.id);\n const pipelineReport = buildPipelineResultList.getPipelineReportOfComponent(component.id);\n const artifacts = buildPipelineResultList.getArtifactsDataOfComponent(component.id);\n return { pipeline: pipelineReport, artifacts, aspectsData, bitVersion: getHarmonyVersion(true) };\n });\n }\n\n async tagListener(\n components: Component[],\n options: OnTagOpts = {},\n isolateOptions: IsolateComponentsOptions = {}\n ): Promise<OnTagResults> {\n const pipeResults: TaskResultsList[] = [];\n const allTasksResults: TaskResults[] = [];\n const { throwOnError, forceDeploy, disableTagAndSnapPipelines, isSnap, skipBuildPipeline } = options;\n if (options.skipBuildPipeline) isolateOptions.populateArtifactsFromParent = true;\n const buildEnvsExecutionResults = await this.build(\n components,\n { emptyRootDir: true, ...isolateOptions },\n {\n skipTests: options.skipTests,\n // even when build is skipped (in case of tag-from-scope), the pre-build/post-build and teambit.harmony/aspect tasks are needed\n tasks: skipBuildPipeline ? [AspectAspect.id] : undefined,\n }\n );\n if (throwOnError && !forceDeploy) buildEnvsExecutionResults.throwErrorsIfExist();\n allTasksResults.push(...buildEnvsExecutionResults.tasksResults);\n pipeResults.push(buildEnvsExecutionResults);\n\n if (forceDeploy || (!disableTagAndSnapPipelines && !buildEnvsExecutionResults?.hasErrors())) {\n const deployEnvsExecutionResults = isSnap\n ? await this.runSnapTasks(components, isolateOptions, buildEnvsExecutionResults?.tasksResults)\n : await this.runTagTasks(components, isolateOptions, buildEnvsExecutionResults?.tasksResults);\n if (throwOnError && !forceDeploy) deployEnvsExecutionResults.throwErrorsIfExist();\n allTasksResults.push(...deployEnvsExecutionResults.tasksResults);\n pipeResults.push(deployEnvsExecutionResults);\n }\n await this.storeArtifacts(allTasksResults);\n const builderDataMap = this.pipelineResultsToBuilderData(components, allTasksResults);\n if (options.combineBuildDataFromParent) await this.combineBuildDataFromParent(builderDataMap);\n this.validateBuilderDataMap(builderDataMap);\n\n return { builderDataMap, pipeResults };\n }\n\n private validateBuilderDataMap(builderDataMap: ComponentMap<RawBuilderData>) {\n builderDataMap.forEach((buildData: RawBuilderData, component) => {\n const taskSerializedIds = buildData.pipeline.map((t) =>\n BuildTaskHelper.serializeId({ aspectId: t.taskId, name: t.taskName })\n );\n const duplications = findDuplications(taskSerializedIds);\n if (duplications.length) {\n throw new Error(\n `build-task-results validation has failed. the following task(s) of \"${component.id.toString()}\" are duplicated: ${duplications.join(\n ', '\n )}`\n );\n }\n });\n }\n\n private async combineBuildDataFromParent(builderDataMap: ComponentMap<RawBuilderData>) {\n const promises = builderDataMap.map(async (builderData, component) => {\n const idStr = component.id.toString();\n const parents = component.head?.parents;\n if (!parents || parents.length !== 1) {\n throw new Error(`expect parents of ${idStr} to be 1, got ${parents?.length || 'none'}`);\n }\n const parent = parents[0];\n const parentComp = await this.componentAspect.getHost().get(component.id.changeVersion(parent.toString()));\n if (!parentComp) throw new Error(`unable to load parent component of ${idStr}. hash: ${parent}`);\n const parentBuilderData = this.getBuilderData(parentComp);\n if (!parentBuilderData) throw new Error(`parent of ${idStr} was not built yet. unable to continue`);\n parentBuilderData.artifacts.forEach((artifact) => {\n const artifactObj = artifact.toObject();\n if (!builderData.artifacts) builderData.artifacts = [];\n if (\n builderData.artifacts.find((a) => a.task.id === artifactObj.task.id && a.task.name === artifactObj.task.name)\n ) {\n return;\n }\n builderData.artifacts.push(artifactObj);\n });\n parentBuilderData.aspectsData.forEach((aspectData) => {\n if (builderData.aspectsData.find((a) => a.aspectId === aspectData.aspectId)) return;\n builderData.aspectsData.push(aspectData);\n });\n parentBuilderData.pipeline.forEach((pipeline) => {\n if (builderData.pipeline.find((p) => p.taskId === pipeline.taskId && p.taskName === pipeline.taskName)) return;\n builderData.pipeline.push(pipeline);\n });\n });\n\n await Promise.all(promises.flattenValue());\n }\n\n // TODO: merge with getArtifactsVinylByExtensionAndName by getting aspect name and name as object with optional props\n async getArtifactsVinylByAspect(component: Component, aspectName: string): Promise<ArtifactVinyl[]> {\n const artifacts = this.getArtifactsByAspect(component, aspectName);\n const vinyls = await artifacts.getVinylsAndImportIfMissing(component.id._legacy, this.scope.legacyScope);\n return vinyls;\n }\n\n async getArtifactsVinylByAspectAndName(\n component: Component,\n aspectName: string,\n name: string\n ): Promise<ArtifactVinyl[]> {\n const artifacts = this.getArtifactsByAspectAndName(component, aspectName, name);\n const vinyls = await artifacts.getVinylsAndImportIfMissing(component.id._legacy, this.scope.legacyScope);\n return vinyls;\n }\n\n async getArtifactsVinylByAspectAndTaskName(\n component: Component,\n aspectName: string,\n name: string\n ): Promise<ArtifactVinyl[]> {\n const artifacts = this.getArtifactsbyAspectAndTaskName(component, aspectName, name);\n const vinyls = await artifacts.getVinylsAndImportIfMissing(component.id._legacy, this.scope.legacyScope);\n return vinyls;\n }\n\n getArtifactsByName(component: Component, name: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndName(undefined, name);\n return artifacts;\n }\n\n getArtifactsByAspect(component: Component, aspectName: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndName(aspectName);\n return artifacts;\n }\n\n getArtifactsByAspectAndName(component: Component, aspectName: string, name: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndName(aspectName, name);\n return artifacts;\n }\n\n getArtifactsbyAspectAndTaskName(component: IComponent, aspectName: string, taskName: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndTaskName(aspectName, taskName);\n return artifacts;\n }\n\n getDataByAspect(component: IComponent, aspectName: string): Serializable | undefined {\n const aspectsData = this.getBuilderData(component)?.aspectsData;\n const data = aspectsData?.find((aspectData) => aspectData.aspectId === aspectName);\n return data?.data;\n }\n\n getArtifacts(component: IComponent): ArtifactList<Artifact> {\n const artifacts = this.getBuilderData(component)?.artifacts || ArtifactList.fromArray([]);\n return artifacts;\n }\n\n getBuilderData(component: IComponent): BuilderData | undefined {\n const data = component.get(BuilderAspect.id)?.data;\n if (!data) return undefined;\n const clonedData = cloneDeep(data) as BuilderData;\n let artifactFiles: ArtifactFiles;\n const artifacts = clonedData.artifacts?.map((artifact) => {\n if (!(artifact.files instanceof ArtifactFiles)) {\n artifactFiles = ArtifactFiles.fromObject(artifact.files);\n } else {\n artifactFiles = artifact.files;\n }\n if (artifact instanceof Artifact) {\n return artifact;\n }\n Object.assign(artifact, { files: artifactFiles });\n return Artifact.fromArtifactObject(artifact);\n });\n clonedData.artifacts = ArtifactList.fromArray(artifacts || []);\n return clonedData;\n }\n\n async build(\n components: Component[],\n isolateOptions?: IsolateComponentsOptions,\n builderOptions?: BuilderServiceOptions\n ): Promise<TaskResultsList> {\n const ids = components.map((c) => c.id);\n const network = await this.isolator.isolateComponents(ids, isolateOptions, this.scope.legacyScope);\n const envs = await this.envs.createEnvironment(network.graphCapsules.getAllComponents());\n const builderServiceOptions = {\n seedersOnly: isolateOptions?.seedersOnly,\n originalSeeders: ids,\n ...(builderOptions || {}),\n };\n const buildResult = await envs.runOnce(this.buildService, builderServiceOptions);\n return buildResult;\n }\n\n async runTagTasks(\n components: Component[],\n isolateOptions?: IsolateComponentsOptions,\n previousTasksResults?: TaskResults[]\n ): Promise<TaskResultsList> {\n const envs = await this.envs.createEnvironment(components);\n const buildResult = await envs.runOnce(this.tagService, {\n seedersOnly: isolateOptions?.seedersOnly,\n previousTasksResults,\n });\n\n return buildResult;\n }\n\n async runSnapTasks(\n components: Component[],\n isolateOptions?: IsolateComponentsOptions,\n previousTasksResults?: TaskResults[]\n ): Promise<TaskResultsList> {\n const envs = await this.envs.createEnvironment(components);\n const buildResult = await envs.runOnce(this.snapService, {\n seedersOnly: isolateOptions?.seedersOnly,\n previousTasksResults,\n });\n\n return buildResult;\n }\n\n listTasks(component: Component) {\n const compEnv = this.envs.getEnv(component);\n const buildTasks = this.buildService.getCurrentPipeTasks(compEnv);\n const tagTasks = this.tagService.getCurrentPipeTasks(compEnv);\n const snapTasks = this.snapService.getCurrentPipeTasks(compEnv);\n return { id: component.id, envId: compEnv.id, buildTasks, tagTasks, snapTasks };\n }\n\n /**\n * register a build task to apply on all component build pipelines.\n * build happens on `bit build` and as part of `bit tag --persist`.\n */\n registerBuildTasks(tasks: BuildTask[]) {\n this.buildTaskSlot.register(tasks);\n return this;\n }\n\n /**\n * @deprecated use registerTagTasks or registerSnapTasks\n */\n registerDeployTasks(tasks: BuildTask[]) {\n this.tagTaskSlot.register(tasks);\n return this;\n }\n\n /**\n * tag tasks that don't get executed on `bit build`, only on `bit tag'.\n * this pipeline is running once the build-pipeline has completed.\n */\n registerTagTasks(tasks: BuildTask[]) {\n this.tagTaskSlot.register(tasks);\n return this;\n }\n\n /**\n * tag tasks that don't get executed on `bit build`, only on `bit snap'.\n * this pipeline is running once the build-pipeline has completed.\n */\n registerSnapTasks(tasks: BuildTask[]) {\n this.snapTaskSlot.register(tasks);\n return this;\n }\n\n getDownloadUrlForArtifact(componentId: ComponentID, taskId: string, path?: string) {\n return `/api/${componentId}/~aspect/builder/${taskId}/${path ? `${FILE_PATH_PARAM_DELIM}${path}` : ''}`;\n }\n\n static slots = [Slot.withType<BuildTask>(), Slot.withType<BuildTask>(), Slot.withType<BuildTask>()];\n\n static runtime = MainRuntime;\n static dependencies = [\n CLIAspect,\n EnvsAspect,\n WorkspaceAspect,\n ScopeAspect,\n IsolatorAspect,\n LoggerAspect,\n AspectLoaderAspect,\n GraphqlAspect,\n GeneratorAspect,\n ComponentAspect,\n UIAspect,\n ];\n\n static async provider(\n [cli, envs, workspace, scope, isolator, loggerExt, aspectLoader, graphql, generator, component, ui]: [\n CLIMain,\n EnvsMain,\n Workspace,\n ScopeMain,\n IsolatorMain,\n LoggerMain,\n AspectLoaderMain,\n GraphqlMain,\n GeneratorMain,\n ComponentMain,\n UiMain\n ],\n config,\n [buildTaskSlot, tagTaskSlot, snapTaskSlot]: [TaskSlot, TaskSlot, TaskSlot]\n ) {\n const artifactFactory = new ArtifactFactory();\n const logger = loggerExt.createLogger(BuilderAspect.id);\n const buildService = new BuilderService(\n isolator,\n logger,\n buildTaskSlot,\n 'getBuildPipe',\n 'build',\n artifactFactory,\n scope\n );\n envs.registerService(buildService);\n const tagService = new BuilderService(isolator, logger, tagTaskSlot, 'getTagPipe', 'tag', artifactFactory, scope);\n const snapService = new BuilderService(\n isolator,\n logger,\n snapTaskSlot,\n 'getSnapPipe',\n 'snap',\n artifactFactory,\n scope\n );\n const builder = new BuilderMain(\n envs,\n workspace,\n buildService,\n tagService,\n snapService,\n scope,\n isolator,\n aspectLoader,\n component,\n buildTaskSlot,\n tagTaskSlot,\n snapTaskSlot\n );\n builder.registerBuildTasks([new BundleUiTask(ui, logger)]);\n component.registerRoute([new BuilderRoute(builder, scope, logger)]);\n graphql.register(builderSchema(builder, logger));\n if (generator) generator.registerComponentTemplate([buildTaskTemplate]);\n const commands = [new BuilderCmd(builder, workspace, logger), new ArtifactsCmd(builder, component)];\n cli.register(...commands);\n\n return builder;\n }\n}\n\nBuilderAspect.addRuntime(BuilderMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;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;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;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;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;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;A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AAC"}
|
|
1
|
+
{"version":3,"names":["FILE_PATH_PARAM_DELIM","BuilderMain","constructor","envs","workspace","buildService","tagService","snapService","scope","isolator","aspectLoader","componentAspect","buildTaskSlot","tagTaskSlot","snapTaskSlot","storeArtifacts","tasksResults","artifacts","flatMap","t","storeP","map","artifactMap","Promise","all","toArray","component","artifactList","store","err","ArtifactStorageError","pipelineResultsToBuilderData","components","buildPipelineResults","buildPipelineResultList","BuildPipelineResultList","ComponentMap","as","aspectsData","getDataOfComponent","id","pipelineReport","getPipelineReportOfComponent","getArtifactsDataOfComponent","pipeline","bitVersion","getHarmonyVersion","tagListener","options","isolateOptions","builderOptions","pipeResults","allTasksResults","throwOnError","forceDeploy","disableTagAndSnapPipelines","isSnap","skipBuildPipeline","populateArtifactsFromParent","buildEnvsExecutionResults","build","emptyRootDir","tasks","AspectAspect","undefined","throwErrorsIfExist","push","hasErrors","builderOptionsForTagSnap","seedersOnly","previousTasksResults","deployEnvsExecutionResults","runSnapTasks","runTagTasks","builderDataMap","combineBuildDataFromParent","validateBuilderDataMap","forEach","buildData","taskSerializedIds","BuildTaskHelper","serializeId","aspectId","taskId","name","taskName","duplications","findDuplications","length","Error","toString","join","promises","builderData","idStr","parents","head","parent","parentComp","getHost","get","changeVersion","parentBuilderData","getBuilderData","artifact","artifactObj","toObject","find","a","task","aspectData","p","flattenValue","getArtifactsVinylByAspect","aspectName","getArtifactsByAspect","vinyls","getVinylsAndImportIfMissing","_legacy","legacyScope","getArtifactsVinylByAspectAndName","getArtifactsByAspectAndName","getArtifactsVinylByAspectAndTaskName","getArtifactsbyAspectAndTaskName","getArtifactsByName","getArtifacts","byAspectNameAndName","byAspectNameAndTaskName","getDataByAspect","data","ArtifactList","fromArray","BuilderAspect","clonedData","cloneDeep","artifactFiles","files","ArtifactFiles","fromObject","Artifact","Object","assign","fromArtifactObject","ids","c","network","isolateComponents","createEnvironment","graphCapsules","getAllComponents","builderServiceOptions","originalSeeders","buildResult","runOnce","listTasks","compEnv","getEnv","buildTasks","getCurrentPipeTasks","tagTasks","snapTasks","envId","registerBuildTasks","register","registerDeployTasks","registerTagTasks","registerSnapTasks","getDownloadUrlForArtifact","componentId","path","provider","cli","loggerExt","graphql","generator","ui","config","artifactFactory","ArtifactFactory","logger","createLogger","BuilderService","registerService","builder","BundleUiTask","registerRoute","BuilderRoute","builderSchema","registerComponentTemplate","buildTaskTemplate","commands","BuilderCmd","ArtifactsCmd","Slot","withType","MainRuntime","CLIAspect","EnvsAspect","WorkspaceAspect","ScopeAspect","IsolatorAspect","LoggerAspect","AspectLoaderAspect","GraphqlAspect","GeneratorAspect","ComponentAspect","UIAspect","addRuntime"],"sources":["builder.main.runtime.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';\nimport { ArtifactFiles, ArtifactObject } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { AspectLoaderAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentMap, IComponent, ComponentAspect, ComponentMain, ComponentID } from '@teambit/component';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport AspectAspect from '@teambit/aspect';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { IsolateComponentsOptions, IsolatorAspect, IsolatorMain } from '@teambit/isolator';\nimport { getHarmonyVersion } from '@teambit/legacy/dist/bootstrap';\nimport findDuplications from '@teambit/legacy/dist/utils/array/find-duplications';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { UIAspect, UiMain, BundleUiTask } from '@teambit/ui';\nimport { Artifact, ArtifactList, FsArtifact } from './artifact';\nimport { ArtifactFactory } from './artifact/artifact-factory'; // it gets undefined when importing it from './artifact'\nimport { BuilderAspect } from './builder.aspect';\nimport { builderSchema } from './builder.graphql';\nimport { BuilderService, BuilderServiceOptions } from './builder.service';\nimport { BuilderCmd } from './build.cmd';\nimport { BuildTask, BuildTaskHelper } from './build-task';\nimport { TaskResults } from './build-pipe';\nimport { TaskResultsList } from './task-results-list';\nimport { ArtifactStorageError } from './exceptions';\nimport { BuildPipelineResultList, AspectData, PipelineReport } from './build-pipeline-result-list';\nimport { Serializable } from './types';\nimport { ArtifactsCmd } from './artifact/artifacts.cmd';\nimport { buildTaskTemplate } from './templates/build-task';\nimport { BuilderRoute } from './builder.route';\n\nexport type TaskSlot = SlotRegistry<BuildTask[]>;\nexport type OnTagResults = { builderDataMap: ComponentMap<RawBuilderData>; pipeResults: TaskResultsList[] };\nexport type OnTagOpts = {\n disableTagAndSnapPipelines?: boolean;\n throwOnError?: boolean; // on the CI it helps to save the results on failure so this is set to false\n forceDeploy?: boolean; // whether run the deploy-pipeline although the build-pipeline has failed\n skipBuildPipeline?: boolean; // helpful for tagging from scope where we want to use the build-artifacts of previous snap.\n combineBuildDataFromParent?: boolean; // helpful for tagging from scope where we want to save the build-data of parent snap.\n isSnap?: boolean;\n};\nexport const FILE_PATH_PARAM_DELIM = '~';\n\n/**\n * builder data format for the bit object store\n */\nexport type RawBuilderData = {\n pipeline: PipelineReport[];\n artifacts?: ArtifactObject[];\n aspectsData: AspectData[];\n bitVersion?: string;\n};\n/**\n * builder data mapped to an ArtifactList instance\n */\nexport type BuilderData = Omit<RawBuilderData, 'artifacts'> & {\n artifacts: ArtifactList<Artifact>;\n};\n\nexport class BuilderMain {\n constructor(\n private envs: EnvsMain,\n private workspace: Workspace,\n private buildService: BuilderService,\n private tagService: BuilderService,\n private snapService: BuilderService,\n private scope: ScopeMain,\n private isolator: IsolatorMain,\n private aspectLoader: AspectLoaderMain,\n private componentAspect: ComponentMain,\n private buildTaskSlot: TaskSlot,\n private tagTaskSlot: TaskSlot,\n private snapTaskSlot: TaskSlot\n ) {}\n\n private async storeArtifacts(tasksResults: TaskResults[]) {\n const artifacts = tasksResults.flatMap((t) => (t.artifacts ? [t.artifacts] : []));\n const storeP = artifacts.map(async (artifactMap: ComponentMap<ArtifactList<FsArtifact>>) => {\n return Promise.all(\n artifactMap.toArray().map(async ([component, artifactList]) => {\n try {\n return await artifactList.store(component);\n } catch (err: any) {\n throw new ArtifactStorageError(err, component);\n }\n })\n );\n });\n await Promise.all(storeP);\n }\n\n private pipelineResultsToBuilderData(\n components: Component[],\n buildPipelineResults: TaskResults[]\n ): ComponentMap<RawBuilderData> {\n const buildPipelineResultList = new BuildPipelineResultList(buildPipelineResults, components);\n return ComponentMap.as<RawBuilderData>(components, (component) => {\n const aspectsData = buildPipelineResultList.getDataOfComponent(component.id);\n const pipelineReport = buildPipelineResultList.getPipelineReportOfComponent(component.id);\n const artifacts = buildPipelineResultList.getArtifactsDataOfComponent(component.id);\n return { pipeline: pipelineReport, artifacts, aspectsData, bitVersion: getHarmonyVersion(true) };\n });\n }\n\n async tagListener(\n components: Component[],\n options: OnTagOpts = {},\n isolateOptions: IsolateComponentsOptions = {},\n builderOptions: BuilderServiceOptions = {}\n ): Promise<OnTagResults> {\n const pipeResults: TaskResultsList[] = [];\n const allTasksResults: TaskResults[] = [];\n const { throwOnError, forceDeploy, disableTagAndSnapPipelines, isSnap, skipBuildPipeline } = options;\n if (options.skipBuildPipeline) isolateOptions.populateArtifactsFromParent = true;\n const buildEnvsExecutionResults = await this.build(\n components,\n { emptyRootDir: true, ...isolateOptions },\n {\n ...builderOptions,\n // even when build is skipped (in case of tag-from-scope), the pre-build/post-build and teambit.harmony/aspect tasks are needed\n tasks: skipBuildPipeline ? [AspectAspect.id] : undefined,\n }\n );\n if (throwOnError && !forceDeploy) buildEnvsExecutionResults.throwErrorsIfExist();\n allTasksResults.push(...buildEnvsExecutionResults.tasksResults);\n pipeResults.push(buildEnvsExecutionResults);\n\n if (forceDeploy || (!disableTagAndSnapPipelines && !buildEnvsExecutionResults?.hasErrors())) {\n const builderOptionsForTagSnap: BuilderServiceOptions = {\n ...builderOptions,\n seedersOnly: isolateOptions.seedersOnly,\n previousTasksResults: buildEnvsExecutionResults?.tasksResults,\n };\n const deployEnvsExecutionResults = isSnap\n ? await this.runSnapTasks(components, builderOptionsForTagSnap)\n : await this.runTagTasks(components, builderOptionsForTagSnap);\n if (throwOnError && !forceDeploy) deployEnvsExecutionResults.throwErrorsIfExist();\n allTasksResults.push(...deployEnvsExecutionResults.tasksResults);\n pipeResults.push(deployEnvsExecutionResults);\n }\n await this.storeArtifacts(allTasksResults);\n const builderDataMap = this.pipelineResultsToBuilderData(components, allTasksResults);\n if (options.combineBuildDataFromParent) await this.combineBuildDataFromParent(builderDataMap);\n this.validateBuilderDataMap(builderDataMap);\n\n return { builderDataMap, pipeResults };\n }\n\n private validateBuilderDataMap(builderDataMap: ComponentMap<RawBuilderData>) {\n builderDataMap.forEach((buildData: RawBuilderData, component) => {\n const taskSerializedIds = buildData.pipeline.map((t) =>\n BuildTaskHelper.serializeId({ aspectId: t.taskId, name: t.taskName })\n );\n const duplications = findDuplications(taskSerializedIds);\n if (duplications.length) {\n throw new Error(\n `build-task-results validation has failed. the following task(s) of \"${component.id.toString()}\" are duplicated: ${duplications.join(\n ', '\n )}`\n );\n }\n });\n }\n\n private async combineBuildDataFromParent(builderDataMap: ComponentMap<RawBuilderData>) {\n const promises = builderDataMap.map(async (builderData, component) => {\n const idStr = component.id.toString();\n const parents = component.head?.parents;\n if (!parents || parents.length !== 1) {\n throw new Error(`expect parents of ${idStr} to be 1, got ${parents?.length || 'none'}`);\n }\n const parent = parents[0];\n const parentComp = await this.componentAspect.getHost().get(component.id.changeVersion(parent.toString()));\n if (!parentComp) throw new Error(`unable to load parent component of ${idStr}. hash: ${parent}`);\n const parentBuilderData = this.getBuilderData(parentComp);\n if (!parentBuilderData) throw new Error(`parent of ${idStr} was not built yet. unable to continue`);\n parentBuilderData.artifacts.forEach((artifact) => {\n const artifactObj = artifact.toObject();\n if (!builderData.artifacts) builderData.artifacts = [];\n if (\n builderData.artifacts.find((a) => a.task.id === artifactObj.task.id && a.task.name === artifactObj.task.name)\n ) {\n return;\n }\n builderData.artifacts.push(artifactObj);\n });\n parentBuilderData.aspectsData.forEach((aspectData) => {\n if (builderData.aspectsData.find((a) => a.aspectId === aspectData.aspectId)) return;\n builderData.aspectsData.push(aspectData);\n });\n parentBuilderData.pipeline.forEach((pipeline) => {\n if (builderData.pipeline.find((p) => p.taskId === pipeline.taskId && p.taskName === pipeline.taskName)) return;\n builderData.pipeline.push(pipeline);\n });\n });\n\n await Promise.all(promises.flattenValue());\n }\n\n // TODO: merge with getArtifactsVinylByExtensionAndName by getting aspect name and name as object with optional props\n async getArtifactsVinylByAspect(component: Component, aspectName: string): Promise<ArtifactVinyl[]> {\n const artifacts = this.getArtifactsByAspect(component, aspectName);\n const vinyls = await artifacts.getVinylsAndImportIfMissing(component.id._legacy, this.scope.legacyScope);\n return vinyls;\n }\n\n async getArtifactsVinylByAspectAndName(\n component: Component,\n aspectName: string,\n name: string\n ): Promise<ArtifactVinyl[]> {\n const artifacts = this.getArtifactsByAspectAndName(component, aspectName, name);\n const vinyls = await artifacts.getVinylsAndImportIfMissing(component.id._legacy, this.scope.legacyScope);\n return vinyls;\n }\n\n async getArtifactsVinylByAspectAndTaskName(\n component: Component,\n aspectName: string,\n name: string\n ): Promise<ArtifactVinyl[]> {\n const artifacts = this.getArtifactsbyAspectAndTaskName(component, aspectName, name);\n const vinyls = await artifacts.getVinylsAndImportIfMissing(component.id._legacy, this.scope.legacyScope);\n return vinyls;\n }\n\n getArtifactsByName(component: Component, name: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndName(undefined, name);\n return artifacts;\n }\n\n getArtifactsByAspect(component: Component, aspectName: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndName(aspectName);\n return artifacts;\n }\n\n getArtifactsByAspectAndName(component: Component, aspectName: string, name: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndName(aspectName, name);\n return artifacts;\n }\n\n getArtifactsbyAspectAndTaskName(component: IComponent, aspectName: string, taskName: string): ArtifactList<Artifact> {\n const artifacts = this.getArtifacts(component).byAspectNameAndTaskName(aspectName, taskName);\n return artifacts;\n }\n\n getDataByAspect(component: IComponent, aspectName: string): Serializable | undefined {\n const aspectsData = this.getBuilderData(component)?.aspectsData;\n const data = aspectsData?.find((aspectData) => aspectData.aspectId === aspectName);\n return data?.data;\n }\n\n getArtifacts(component: IComponent): ArtifactList<Artifact> {\n const artifacts = this.getBuilderData(component)?.artifacts || ArtifactList.fromArray([]);\n return artifacts;\n }\n\n getBuilderData(component: IComponent): BuilderData | undefined {\n const data = component.get(BuilderAspect.id)?.data;\n if (!data) return undefined;\n const clonedData = cloneDeep(data) as BuilderData;\n let artifactFiles: ArtifactFiles;\n const artifacts = clonedData.artifacts?.map((artifact) => {\n if (!(artifact.files instanceof ArtifactFiles)) {\n artifactFiles = ArtifactFiles.fromObject(artifact.files);\n } else {\n artifactFiles = artifact.files;\n }\n if (artifact instanceof Artifact) {\n return artifact;\n }\n Object.assign(artifact, { files: artifactFiles });\n return Artifact.fromArtifactObject(artifact);\n });\n clonedData.artifacts = ArtifactList.fromArray(artifacts || []);\n return clonedData;\n }\n\n async build(\n components: Component[],\n isolateOptions?: IsolateComponentsOptions,\n builderOptions?: BuilderServiceOptions\n ): Promise<TaskResultsList> {\n const ids = components.map((c) => c.id);\n const network = await this.isolator.isolateComponents(ids, isolateOptions, this.scope.legacyScope);\n const envs = await this.envs.createEnvironment(network.graphCapsules.getAllComponents());\n const builderServiceOptions = {\n seedersOnly: isolateOptions?.seedersOnly,\n originalSeeders: ids,\n ...(builderOptions || {}),\n };\n const buildResult = await envs.runOnce(this.buildService, builderServiceOptions);\n return buildResult;\n }\n\n async runTagTasks(components: Component[], builderOptions: BuilderServiceOptions): Promise<TaskResultsList> {\n const envs = await this.envs.createEnvironment(components);\n const buildResult = await envs.runOnce(this.tagService, builderOptions);\n\n return buildResult;\n }\n\n async runSnapTasks(components: Component[], builderOptions: BuilderServiceOptions): Promise<TaskResultsList> {\n const envs = await this.envs.createEnvironment(components);\n const buildResult = await envs.runOnce(this.snapService, builderOptions);\n\n return buildResult;\n }\n\n listTasks(component: Component) {\n const compEnv = this.envs.getEnv(component);\n const buildTasks = this.buildService.getCurrentPipeTasks(compEnv);\n const tagTasks = this.tagService.getCurrentPipeTasks(compEnv);\n const snapTasks = this.snapService.getCurrentPipeTasks(compEnv);\n return { id: component.id, envId: compEnv.id, buildTasks, tagTasks, snapTasks };\n }\n\n /**\n * register a build task to apply on all component build pipelines.\n * build happens on `bit build` and as part of `bit tag --persist`.\n */\n registerBuildTasks(tasks: BuildTask[]) {\n this.buildTaskSlot.register(tasks);\n return this;\n }\n\n /**\n * @deprecated use registerTagTasks or registerSnapTasks\n */\n registerDeployTasks(tasks: BuildTask[]) {\n this.tagTaskSlot.register(tasks);\n return this;\n }\n\n /**\n * tag tasks that don't get executed on `bit build`, only on `bit tag'.\n * this pipeline is running once the build-pipeline has completed.\n */\n registerTagTasks(tasks: BuildTask[]) {\n this.tagTaskSlot.register(tasks);\n return this;\n }\n\n /**\n * tag tasks that don't get executed on `bit build`, only on `bit snap'.\n * this pipeline is running once the build-pipeline has completed.\n */\n registerSnapTasks(tasks: BuildTask[]) {\n this.snapTaskSlot.register(tasks);\n return this;\n }\n\n getDownloadUrlForArtifact(componentId: ComponentID, taskId: string, path?: string) {\n return `/api/${componentId}/~aspect/builder/${taskId}/${path ? `${FILE_PATH_PARAM_DELIM}${path}` : ''}`;\n }\n\n static slots = [Slot.withType<BuildTask>(), Slot.withType<BuildTask>(), Slot.withType<BuildTask>()];\n\n static runtime = MainRuntime;\n static dependencies = [\n CLIAspect,\n EnvsAspect,\n WorkspaceAspect,\n ScopeAspect,\n IsolatorAspect,\n LoggerAspect,\n AspectLoaderAspect,\n GraphqlAspect,\n GeneratorAspect,\n ComponentAspect,\n UIAspect,\n ];\n\n static async provider(\n [cli, envs, workspace, scope, isolator, loggerExt, aspectLoader, graphql, generator, component, ui]: [\n CLIMain,\n EnvsMain,\n Workspace,\n ScopeMain,\n IsolatorMain,\n LoggerMain,\n AspectLoaderMain,\n GraphqlMain,\n GeneratorMain,\n ComponentMain,\n UiMain\n ],\n config,\n [buildTaskSlot, tagTaskSlot, snapTaskSlot]: [TaskSlot, TaskSlot, TaskSlot]\n ) {\n const artifactFactory = new ArtifactFactory();\n const logger = loggerExt.createLogger(BuilderAspect.id);\n const buildService = new BuilderService(\n isolator,\n logger,\n buildTaskSlot,\n 'getBuildPipe',\n 'build',\n artifactFactory,\n scope\n );\n envs.registerService(buildService);\n const tagService = new BuilderService(isolator, logger, tagTaskSlot, 'getTagPipe', 'tag', artifactFactory, scope);\n const snapService = new BuilderService(\n isolator,\n logger,\n snapTaskSlot,\n 'getSnapPipe',\n 'snap',\n artifactFactory,\n scope\n );\n const builder = new BuilderMain(\n envs,\n workspace,\n buildService,\n tagService,\n snapService,\n scope,\n isolator,\n aspectLoader,\n component,\n buildTaskSlot,\n tagTaskSlot,\n snapTaskSlot\n );\n builder.registerBuildTasks([new BundleUiTask(ui, logger)]);\n component.registerRoute([new BuilderRoute(builder, scope, logger)]);\n graphql.register(builderSchema(builder, logger));\n if (generator) generator.registerComponentTemplate([buildTaskTemplate]);\n const commands = [new BuilderCmd(builder, workspace, logger), new ArtifactsCmd(builder, component)];\n cli.register(...commands);\n\n return builder;\n }\n}\n\nBuilderAspect.addRuntime(BuilderMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;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;A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C,EAAE,KAAIa,yBAAY,EAACT,OAAO,EAAE7J,SAAS,CAAC,CAAC;IACnGiJ,GAAG,CAACR,QAAQ,CAAC,GAAG2B,QAAQ,CAAC;IAEzB,OAAOP,OAAO;EAChB;AACF;AAAC;AAAA,gCAxXYtL,WAAW,WAySP,CAACgM,eAAI,CAACC,QAAQ,EAAa,EAAED,eAAI,CAACC,QAAQ,EAAa,EAAED,eAAI,CAACC,QAAQ,EAAa,CAAC;AAAA,gCAzSxFjM,WAAW,aA2SLkM,kBAAW;AAAA,gCA3SjBlM,WAAW,kBA4SA,CACpBmM,gBAAS,EACTC,kBAAU,EACVC,4BAAe,EACfC,oBAAW,EACXC,0BAAc,EACdC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,4BAAe,EACfC,4BAAe,EACfC,cAAQ,CACT;AAkEH1E,wBAAa,CAAC2E,UAAU,CAAC9M,WAAW,CAAC"}
|
|
@@ -22,6 +22,7 @@ export declare type BuilderServiceOptions = {
|
|
|
22
22
|
skipTests?: boolean;
|
|
23
23
|
previousTasksResults?: TaskResults[];
|
|
24
24
|
dev?: boolean;
|
|
25
|
+
exitOnFirstFailedTask?: boolean;
|
|
25
26
|
};
|
|
26
27
|
declare type BuilderTransformationMap = ServiceTransformationMap & {
|
|
27
28
|
getBuildPipe: () => BuildTask[];
|
package/dist/builder.service.js
CHANGED
|
@@ -132,7 +132,9 @@ class BuilderService {
|
|
|
132
132
|
});
|
|
133
133
|
envsBuildContext[executionContext.id] = buildContext;
|
|
134
134
|
});
|
|
135
|
-
const buildPipe = new (_buildPipe().BuildPipe)(tasksQueue, envsBuildContext, this.logger, this.artifactFactory, options.previousTasksResults
|
|
135
|
+
const buildPipe = new (_buildPipe().BuildPipe)(tasksQueue, envsBuildContext, this.logger, this.artifactFactory, options.previousTasksResults, {
|
|
136
|
+
exitOnFirstFailedTask: options.exitOnFirstFailedTask
|
|
137
|
+
});
|
|
136
138
|
const buildResults = await buildPipe.execute();
|
|
137
139
|
longProcessLogger.end();
|
|
138
140
|
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","pMapSeries","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","laneId","legacyScope","currentLaneId","buildPipe","BuildPipe","buildResults","execute","end","hasErrors","consoleFailure","consoleSuccess","render","env","pipes","getDescriptor","BuilderAspect","renderOnePipe","transform","envContext","build","undefined","pipeline","compute","tag","snap","task","index","keys","pipeFuncName","getTasksNamesByPipeFunc","BuildTaskHelper","serializeId","getCurrentPipeTasks"],"sources":["builder.service.tsx"],"sourcesContent":["import { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport React from 'react';\nimport { ScopeMain } from '@teambit/scope';\nimport pMapSeries from 'p-map-series';\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, BuildTask, 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\ntype BuilderTransformationMap = ServiceTransformationMap & {\n getBuildPipe: () => BuildTask[];\n getTagPipe: () => BuildTask[];\n getSnapPipe: () => BuildTask[];\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 pMapSeries(envsExecutionContext, 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 laneId: this.scope.legacyScope.currentLaneId,\n });\n envsBuildContext[executionContext.id] = buildContext;\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 transform(env: Env, envContext: EnvContext): BuilderTransformationMap | undefined {\n if (!env?.build) return undefined;\n return {\n getBuildPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.build();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getTagPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.tag();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getSnapPipe: () => {\n const pipeline = env.snap();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\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;AACA;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;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AA0BA,MAAMA,SAAS,GAAG;EAChBC,YAAY,EAAE,OAAO;EACrBC,UAAU,EAAE,KAAK;EACjBC,WAAW,EAAE;AACf,CAAC;AAOM,MAAMC,cAAc,CAA+D;EAGxFC,WAAW;EACT;AACJ;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AAC,CAAC;IACF,OAAOE,KAAK;EACd;EAEQkE,uBAAuB,CAACjB,GAAkB,EAAEgB,YAA+B,EAAY;IAC7F,MAAMnE,UAAU,GAAG,IAAAC,4CAAsB,EAAC,IAAI,CAACb,QAAQ,EAAE,CAAC+D,GAAG,CAAC,EAAEgB,YAAY,CAAC,CAACtE,GAAG,CAAC,CAAC;MAAEmE;IAAK,CAAC,KACzFK,4BAAe,CAACC,WAAW,CAACN,IAAI,CAAC,CAClC;IACD,OAAOhE,UAAU;EACnB;EAEAuE,mBAAmB,CAACpB,GAAkB,EAAE;IACtC,OAAO,IAAI,CAACiB,uBAAuB,CAACjB,GAAG,EAAE,IAAI,CAAC9D,aAAa,CAAC;EAC9D;AACF;AAAC"}
|
|
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","pMapSeries","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","laneId","legacyScope","currentLaneId","buildPipe","BuildPipe","exitOnFirstFailedTask","buildResults","execute","end","hasErrors","consoleFailure","consoleSuccess","render","env","pipes","getDescriptor","BuilderAspect","renderOnePipe","transform","envContext","build","undefined","pipeline","compute","tag","snap","task","index","keys","pipeFuncName","getTasksNamesByPipeFunc","BuildTaskHelper","serializeId","getCurrentPipeTasks"],"sources":["builder.service.tsx"],"sourcesContent":["import { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport React from 'react';\nimport { ScopeMain } from '@teambit/scope';\nimport pMapSeries from 'p-map-series';\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, BuildTask, 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 exitOnFirstFailedTask?: boolean;\n};\n\ntype BuilderTransformationMap = ServiceTransformationMap & {\n getBuildPipe: () => BuildTask[];\n getTagPipe: () => BuildTask[];\n getSnapPipe: () => BuildTask[];\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 pMapSeries(envsExecutionContext, 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 laneId: this.scope.legacyScope.currentLaneId,\n });\n envsBuildContext[executionContext.id] = buildContext;\n });\n const buildPipe = new BuildPipe(\n tasksQueue,\n envsBuildContext,\n this.logger,\n this.artifactFactory,\n options.previousTasksResults,\n { exitOnFirstFailedTask: options.exitOnFirstFailedTask }\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 transform(env: Env, envContext: EnvContext): BuilderTransformationMap | undefined {\n if (!env?.build) return undefined;\n return {\n getBuildPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.build();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getTagPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.tag();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getSnapPipe: () => {\n const pipeline = env.snap();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\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;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kBACrB,+BAAC,WAAI;MAAC,GAAG,EAAEA;IAAM,gBACf,+BAAC,WAAI,QACFA,KAAK,GAAG,CAAC,QAAID,IAAI,CACb,eACP,+BAAC,cAAO,OAAG,CAEd,CAAC,eACF,+BAAC,cAAO,OAAG,CACN;EAEX;EAEAX,aAAa,CAACF,GAAkB,EAAE;IAChC;IACA,MAAMlD,KAAK,GAAGgC,MAAM,CAACiC,IAAI,CAACvF,SAAS,CAAC,CAACiB,GAAG,CAAEuE,YAA+B,IAAK;MAC5E,MAAMpE,UAAU,GAAG,IAAI,CAACqE,uBAAuB,CAACjB,GAAG,EAAEgB,YAAY,CAAC;MAClE,OAAO;QAAE/B,QAAQ,EAAEzD,SAAS,CAACwF,YAAY,CAAC;QAAElE,KAAK,EAAEF;MAAW,CAAC;IACjE,CAAC,CAAC;IACF,OAAOE,KAAK;EACd;EAEQmE,uBAAuB,CAACjB,GAAkB,EAAEgB,YAA+B,EAAY;IAC7F,MAAMpE,UAAU,GAAG,IAAAC,4CAAsB,EAAC,IAAI,CAACb,QAAQ,EAAE,CAACgE,GAAG,CAAC,EAAEgB,YAAY,CAAC,CAACvE,GAAG,CAAC,CAAC;MAAEoE;IAAK,CAAC,KACzFK,4BAAe,CAACC,WAAW,CAACN,IAAI,CAAC,CAClC;IACD,OAAOjE,UAAU;EACnB;EAEAwE,mBAAmB,CAACpB,GAAkB,EAAE;IACtC,OAAO,IAAI,CAACiB,uBAAuB,CAACjB,GAAG,EAAE,IAAI,CAAC/D,aAAa,CAAC;EAC9D;AACF;AAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.1063/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.1063/dist/builder.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1063",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/pipelines/builder",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.pipelines",
|
|
8
8
|
"name": "builder",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.1063"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"p-map-series": "2.1.0",
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
"@teambit/graph.cleargraph": "0.0.1",
|
|
28
28
|
"@teambit/harmony": "0.4.6",
|
|
29
29
|
"@teambit/component-id": "0.0.427",
|
|
30
|
-
"@teambit/component": "0.0.
|
|
31
|
-
"@teambit/envs": "0.0.
|
|
32
|
-
"@teambit/logger": "0.0.
|
|
33
|
-
"@teambit/tester": "0.0.
|
|
34
|
-
"@teambit/isolator": "0.0.
|
|
35
|
-
"@teambit/lane-id": "0.0.
|
|
36
|
-
"@teambit/cli": "0.0.
|
|
37
|
-
"@teambit/workspace": "0.0.
|
|
38
|
-
"@teambit/aspect-loader": "0.0.
|
|
39
|
-
"@teambit/aspect": "0.0.
|
|
40
|
-
"@teambit/generator": "0.0.
|
|
41
|
-
"@teambit/graphql": "0.0.
|
|
42
|
-
"@teambit/scope": "0.0.
|
|
43
|
-
"@teambit/ui": "0.0.
|
|
44
|
-
"@teambit/express": "0.0.
|
|
30
|
+
"@teambit/component": "0.0.1063",
|
|
31
|
+
"@teambit/envs": "0.0.1063",
|
|
32
|
+
"@teambit/logger": "0.0.809",
|
|
33
|
+
"@teambit/tester": "0.0.1063",
|
|
34
|
+
"@teambit/isolator": "0.0.1063",
|
|
35
|
+
"@teambit/lane-id": "0.0.233",
|
|
36
|
+
"@teambit/cli": "0.0.716",
|
|
37
|
+
"@teambit/workspace": "0.0.1063",
|
|
38
|
+
"@teambit/aspect-loader": "0.0.1063",
|
|
39
|
+
"@teambit/aspect": "0.0.1063",
|
|
40
|
+
"@teambit/generator": "0.0.1063",
|
|
41
|
+
"@teambit/graphql": "0.0.1063",
|
|
42
|
+
"@teambit/scope": "0.0.1063",
|
|
43
|
+
"@teambit/ui": "0.0.1063",
|
|
44
|
+
"@teambit/express": "0.0.814",
|
|
45
45
|
"@teambit/bit-error": "0.0.402"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@teambit/pipelines.aspect-docs.builder": "0.0.153"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@teambit/legacy": "1.0.
|
|
62
|
+
"@teambit/legacy": "1.0.496",
|
|
63
63
|
"react": "^16.8.0 || ^17.0.0",
|
|
64
64
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
65
65
|
},
|
|
Binary file
|