@teambit/builder 0.0.987 → 0.0.989
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/dist/builder-env-type.d.ts +1 -1
- package/dist/builder-env-type.js.map +1 -1
- package/dist/pipeline.d.ts +2 -2
- package/dist/pipeline.js.map +1 -1
- package/dist/{preview-1676570198614.js → preview-1676777489824.js} +2 -2
- package/dist/task.d.ts +2 -2
- package/dist/task.js.map +1 -1
- package/package-tar/teambit-builder-0.0.989.tgz +0 -0
- package/package.json +18 -18
- package/package-tar/teambit-builder-0.0.987.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["builder-env-type.ts"],"sourcesContent":["import { Pipeline } from
|
|
1
|
+
{"version":3,"names":[],"sources":["builder-env-type.ts"],"sourcesContent":["import { Pipeline } from './pipeline';\n\nexport interface BuilderEnv {\n /**\n * return a build pipeline instance.\n */\n build(): Pipeline;\n /**\n * return a snap pipeline instance.\n */\n snap(): Pipeline;\n /**\n * return a tag pipeline instance.\n */\n tag(): Pipeline;\n}\n"],"mappings":""}
|
package/dist/pipeline.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BuildTask } from
|
|
2
|
-
import { EnvContext, EnvHandler } from
|
|
1
|
+
import { BuildTask } from '@teambit/builder';
|
|
2
|
+
import { EnvContext, EnvHandler } from '@teambit/envs';
|
|
3
3
|
import { Task } from './task';
|
|
4
4
|
export declare type TaskHandler = {
|
|
5
5
|
handler: EnvHandler<Task>;
|
package/dist/pipeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Pipeline","constructor","_tasks","tasks","initiateTasks","context","envId","map","task","handler","buildTasks","aspectId","buildTask","Object","assign","clone","add","concat","remove","taskNames","filter","includes","name","replace","forEach","matchIndex","findIndex","origTask","splice","pipeline","compute","toString","from"],"sources":["pipeline.ts"],"sourcesContent":["import { BuildTask } from
|
|
1
|
+
{"version":3,"names":["Pipeline","constructor","_tasks","tasks","initiateTasks","context","envId","map","task","handler","buildTasks","aspectId","buildTask","Object","assign","clone","add","concat","remove","taskNames","filter","includes","name","replace","forEach","matchIndex","findIndex","origTask","splice","pipeline","compute","toString","from"],"sources":["pipeline.ts"],"sourcesContent":["import { BuildTask } from '@teambit/builder';\nimport { EnvContext, EnvHandler } from '@teambit/envs';\nimport { clone, findIndex } from 'lodash';\nimport { Task } from './task';\n\nexport type TaskHandler = {\n handler: EnvHandler<Task>;\n name: string;\n};\n\n/**\n * create and maintain build pipelines for component\n * dev environments.\n */\nexport class Pipeline {\n constructor(private _tasks: TaskHandler[]) {}\n\n /**\n * list all tasks in the build pipeline.\n */\n get tasks() {\n return this._tasks;\n }\n\n private initiateTasks(tasks: TaskHandler[], context: EnvContext, envId: string) {\n const _tasks = tasks.map((task) => {\n return task.handler(context);\n });\n\n const buildTasks: BuildTask[] = _tasks.map((task) => {\n // @ts-ignore\n const aspectId = task.aspectId || envId;\n const buildTask: BuildTask = Object.assign(clone(task), { aspectId });\n return buildTask;\n });\n\n return buildTasks;\n }\n\n /**\n * add a build task to the pipeline.\n */\n add(tasks: TaskHandler[]) {\n this._tasks = this._tasks.concat(tasks);\n return this;\n }\n\n /**\n * remove a build task from the pipeline.\n */\n remove(taskNames: string[]) {\n this._tasks = this._tasks.filter((task) => {\n return !taskNames.includes(task.name);\n });\n return this;\n }\n\n /**\n * replace a build task in the pipeline.\n */\n replace(tasks: TaskHandler[]) {\n tasks.forEach((task) => {\n // Find task index using _.findIndex\n const matchIndex = findIndex(this._tasks, (origTask) => {\n return origTask.name === task.name;\n });\n if (matchIndex !== -1) {\n // Replace task at index using native splice\n this._tasks.splice(matchIndex, 1, task);\n }\n });\n return this;\n }\n\n /**\n * return a new pipeline with the tasks from the pipeline args added.\n * @param pipeline\n * @returns\n */\n concat(pipeline: Pipeline) {\n return new Pipeline(this._tasks.concat(pipeline.tasks));\n }\n\n /**\n * compute the pipeline.\n */\n compute(context: EnvContext): BuildTask[] {\n const buildTasks = this.initiateTasks(this._tasks, context, context.envId.toString());\n return buildTasks;\n }\n\n static from(tasks: TaskHandler[]) {\n return new Pipeline(tasks);\n }\n\n // static concat(...pipelines: EnvHandler<Pipeline>[]) {\n // return reduceServiceHandlersFactories(pipelines, (acc, pipeline) => {\n // return acc.concat(pipeline);\n // });\n // }\n}\n"],"mappings":";;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,CAAC;EACpBC,WAAW,CAASC,MAAqB,EAAE;IAAA,KAAvBA,MAAqB,GAArBA,MAAqB;EAAG;;EAE5C;AACF;AACA;EACE,IAAIC,KAAK,GAAG;IACV,OAAO,IAAI,CAACD,MAAM;EACpB;EAEQE,aAAa,CAACD,KAAoB,EAAEE,OAAmB,EAAEC,KAAa,EAAE;IAC9E,MAAMJ,MAAM,GAAGC,KAAK,CAACI,GAAG,CAAEC,IAAI,IAAK;MACjC,OAAOA,IAAI,CAACC,OAAO,CAACJ,OAAO,CAAC;IAC9B,CAAC,CAAC;IAEF,MAAMK,UAAuB,GAAGR,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAK;MACnD;MACA,MAAMG,QAAQ,GAAGH,IAAI,CAACG,QAAQ,IAAIL,KAAK;MACvC,MAAMM,SAAoB,GAAGC,MAAM,CAACC,MAAM,CAAC,IAAAC,eAAK,EAACP,IAAI,CAAC,EAAE;QAAEG;MAAS,CAAC,CAAC;MACrE,OAAOC,SAAS;IAClB,CAAC,CAAC;IAEF,OAAOF,UAAU;EACnB;;EAEA;AACF;AACA;EACEM,GAAG,CAACb,KAAoB,EAAE;IACxB,IAAI,CAACD,MAAM,GAAG,IAAI,CAACA,MAAM,CAACe,MAAM,CAACd,KAAK,CAAC;IACvC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEe,MAAM,CAACC,SAAmB,EAAE;IAC1B,IAAI,CAACjB,MAAM,GAAG,IAAI,CAACA,MAAM,CAACkB,MAAM,CAAEZ,IAAI,IAAK;MACzC,OAAO,CAACW,SAAS,CAACE,QAAQ,CAACb,IAAI,CAACc,IAAI,CAAC;IACvC,CAAC,CAAC;IACF,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEC,OAAO,CAACpB,KAAoB,EAAE;IAC5BA,KAAK,CAACqB,OAAO,CAAEhB,IAAI,IAAK;MACtB;MACA,MAAMiB,UAAU,GAAG,IAAAC,mBAAS,EAAC,IAAI,CAACxB,MAAM,EAAGyB,QAAQ,IAAK;QACtD,OAAOA,QAAQ,CAACL,IAAI,KAAKd,IAAI,CAACc,IAAI;MACpC,CAAC,CAAC;MACF,IAAIG,UAAU,KAAK,CAAC,CAAC,EAAE;QACrB;QACA,IAAI,CAACvB,MAAM,CAAC0B,MAAM,CAACH,UAAU,EAAE,CAAC,EAAEjB,IAAI,CAAC;MACzC;IACF,CAAC,CAAC;IACF,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACES,MAAM,CAACY,QAAkB,EAAE;IACzB,OAAO,IAAI7B,QAAQ,CAAC,IAAI,CAACE,MAAM,CAACe,MAAM,CAACY,QAAQ,CAAC1B,KAAK,CAAC,CAAC;EACzD;;EAEA;AACF;AACA;EACE2B,OAAO,CAACzB,OAAmB,EAAe;IACxC,MAAMK,UAAU,GAAG,IAAI,CAACN,aAAa,CAAC,IAAI,CAACF,MAAM,EAAEG,OAAO,EAAEA,OAAO,CAACC,KAAK,CAACyB,QAAQ,EAAE,CAAC;IACrF,OAAOrB,UAAU;EACnB;EAEA,OAAOsB,IAAI,CAAC7B,KAAoB,EAAE;IAChC,OAAO,IAAIH,QAAQ,CAACG,KAAK,CAAC;EAC5B;;EAEA;EACA;EACA;EACA;EACA;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.989/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.989/dist/builder.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/dist/task.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BuildContext, BuiltTaskResult } from
|
|
2
|
-
import { TaskResultsList } from
|
|
1
|
+
import { BuildContext, BuiltTaskResult } from './build-task';
|
|
2
|
+
import { TaskResultsList } from './task-results-list';
|
|
3
3
|
/**
|
|
4
4
|
* this is the external interface for task. please make
|
|
5
5
|
* sure to use only this interface outside of this builder
|
package/dist/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["task.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult } from
|
|
1
|
+
{"version":3,"names":[],"sources":["task.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult } from './build-task';\nimport { TaskResultsList } from './task-results-list';\n\n/**\n * this is the external interface for task. please make\n * sure to use only this interface outside of this builder\n * aspect.\n */\nexport interface Task {\n /**\n * names ideally with dashes 'typescript'\n */\n name: string;\n\n /**\n * description of what the task does.\n */\n description?: string;\n\n /**\n * execute a task in a build context\n */\n execute(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n * e.g. typescript compiler needs to write the tsconfig file. doing it during the task, will\n * cause dependencies from other envs to get this tsconfig written.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for doing some cleanup on the\n * capsules before the deployment starts.\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * needed if you want the task to be running only after the dependencies were completed\n * for *all* envs.\n * normally this is not needed because the build-pipeline runs the tasks in the same order\n * they're located in the `getBuildPipe()` array and according to the task.location.\n * the case where this is useful is when a task not only needs to be after another task, but also\n * after all environments were running that task.\n * a dependency is task.aspectId. if an aspect has multiple tasks, to be more specific, use\n * \"aspectId:name\", e.g. \"teambit.compilation/compiler:TypescriptCompiler\".\n */\n dependencies?: string[];\n}\n"],"mappings":""}
|
|
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.989",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/pipelines/builder",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.pipelines",
|
|
8
8
|
"name": "builder",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.989"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"p-map-series": "2.1.0",
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
"@babel/runtime": "7.20.0",
|
|
27
27
|
"@teambit/graph.cleargraph": "0.0.1",
|
|
28
28
|
"@teambit/harmony": "0.4.6",
|
|
29
|
-
"@teambit/component": "0.0.
|
|
30
|
-
"@teambit/envs": "0.0.
|
|
31
|
-
"@teambit/logger": "0.0.
|
|
32
|
-
"@teambit/tester": "0.0.
|
|
33
|
-
"@teambit/isolator": "0.0.
|
|
34
|
-
"@teambit/lane-id": "0.0.
|
|
35
|
-
"@teambit/cli": "0.0.
|
|
36
|
-
"@teambit/workspace": "0.0.
|
|
37
|
-
"@teambit/aspect-loader": "0.0.
|
|
38
|
-
"@teambit/aspect": "0.0.
|
|
39
|
-
"@teambit/generator": "0.0.
|
|
40
|
-
"@teambit/graphql": "0.0.
|
|
41
|
-
"@teambit/scope": "0.0.
|
|
42
|
-
"@teambit/express": "0.0.
|
|
29
|
+
"@teambit/component": "0.0.989",
|
|
30
|
+
"@teambit/envs": "0.0.989",
|
|
31
|
+
"@teambit/logger": "0.0.757",
|
|
32
|
+
"@teambit/tester": "0.0.989",
|
|
33
|
+
"@teambit/isolator": "0.0.989",
|
|
34
|
+
"@teambit/lane-id": "0.0.181",
|
|
35
|
+
"@teambit/cli": "0.0.664",
|
|
36
|
+
"@teambit/workspace": "0.0.989",
|
|
37
|
+
"@teambit/aspect-loader": "0.0.989",
|
|
38
|
+
"@teambit/aspect": "0.0.989",
|
|
39
|
+
"@teambit/generator": "0.0.989",
|
|
40
|
+
"@teambit/graphql": "0.0.989",
|
|
41
|
+
"@teambit/scope": "0.0.989",
|
|
42
|
+
"@teambit/express": "0.0.762",
|
|
43
43
|
"@teambit/bit-error": "0.0.402",
|
|
44
|
-
"@teambit/component-id": "0.0.
|
|
44
|
+
"@teambit/component-id": "0.0.427"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/lodash": "4.14.165",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@teambit/pipelines.aspect-docs.builder": "0.0.151"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@teambit/legacy": "1.0.
|
|
61
|
+
"@teambit/legacy": "1.0.445",
|
|
62
62
|
"react": "^16.8.0 || ^17.0.0",
|
|
63
63
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
64
64
|
},
|
|
Binary file
|