@teambit/builder 0.0.918 → 0.0.920

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.
@@ -19,7 +19,7 @@ export type ArtifactsOpts = {
19
19
 
20
20
  export class ArtifactsCmd implements Command {
21
21
  name = 'artifacts <component-pattern>';
22
- description = 'EXPERIMENTAL. list and download components artifacts';
22
+ description = 'list and download components artifacts';
23
23
  extendedDescription = `artifacts are created on isolated capsules during tag or snap commands.
24
24
  example of artifacts are dists files generated by a compiler, a JUnit.xml file generated by a tester
25
25
  and a package.tgz file generated by pkg aspect.
@@ -50,7 +50,7 @@ class ArtifactsCmd {
50
50
  this.builder = builder;
51
51
  this.scope = scope;
52
52
  (0, _defineProperty2().default)(this, "name", 'artifacts <component-pattern>');
53
- (0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL. list and download components artifacts');
53
+ (0, _defineProperty2().default)(this, "description", 'list and download components artifacts');
54
54
  (0, _defineProperty2().default)(this, "extendedDescription", `artifacts are created on isolated capsules during tag or snap commands.
55
55
  example of artifacts are dists files generated by a compiler, a JUnit.xml file generated by a tester
56
56
  and a package.tgz file generated by pkg aspect.
@@ -1 +1 @@
1
- {"version":3,"names":["INDENT_TITLE","repeat","INDENT_SUB_TITLE","INDENT_FILES","ArtifactsCmd","constructor","builder","scope","name","description","COMPONENT_PATTERN_HELP","report","componentPattern","artifactsOpts","BitError","artifactExtractor","ArtifactExtractor","list","grouped","groupResultsByAspect","outputArtifacts","aspectId","artifactData","title","chalk","green","artifactDataStr","map","artifact","subTitle","white","taskName","artifactName","files","f","dim","join","outputResult","result","idStr","cyan","id","toString","artifacts","Object","keys","footer","outDir"],"sources":["artifacts.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport { ScopeMain } from '@teambit/scope';\nimport { BuilderMain } from '../builder.main.runtime';\nimport { ArtifactExtractor, ExtractorArtifactResult, ExtractorResultGrouped } from './artifact-extractor';\n\nconst INDENT_TITLE = ' '.repeat(2);\nconst INDENT_SUB_TITLE = ' '.repeat(4);\nconst INDENT_FILES = ' '.repeat(6);\n\nexport type ArtifactsOpts = {\n aspect?: string;\n task?: string;\n files?: string;\n outDir?: string;\n};\n\nexport class ArtifactsCmd implements Command {\n name = 'artifacts <component-pattern>';\n description = 'EXPERIMENTAL. list and download components artifacts';\n extendedDescription = `artifacts are created on isolated capsules during tag or snap commands.\nexample of artifacts are dists files generated by a compiler, a JUnit.xml file generated by a tester\nand a package.tgz file generated by pkg aspect.\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = '';\n group = 'development';\n helpUrl = 'reference/components/component-artifacts';\n options = [\n ['', 'aspect <aspect-id>', 'show/download only artifacts generated by this aspect-id'],\n ['', 'task <task-id>', 'show/download only artifacts generated by this task-id'],\n [\n '',\n 'files <glob>',\n 'show/download only artifacts matching the given files or the glob pattern (wrap glob patterns in quotes)',\n ],\n ['', 'out-dir <string>', 'download the files to the specified dir'],\n ] as CommandOptions;\n\n constructor(private builder: BuilderMain, private scope: ScopeMain) {}\n\n async report([componentPattern]: [string], artifactsOpts: ArtifactsOpts): Promise<string> {\n if (!this.scope) throw new BitError(`unable to run \"bit artifacts\" outside of a workspace or a scope`);\n const artifactExtractor = new ArtifactExtractor(this.scope, this.builder, componentPattern, artifactsOpts);\n const list = await artifactExtractor.list();\n const grouped = artifactExtractor.groupResultsByAspect(list);\n const outputArtifacts = (aspectId: string, artifactData: ExtractorArtifactResult[]) => {\n const title = chalk.green(aspectId);\n const artifactDataStr = artifactData\n .map((artifact) => {\n const subTitle = chalk.white(`${artifact.taskName} (${artifact.artifactName})`);\n const files = artifact.files.map((f) => INDENT_FILES + chalk.dim(f)).join('\\n');\n return `${INDENT_SUB_TITLE}${subTitle}\\n${files}`;\n })\n .join('\\n');\n return `${INDENT_TITLE}${title}\\n${artifactDataStr}`;\n };\n const outputResult = (result: ExtractorResultGrouped) => {\n const idStr = chalk.cyan(result.id.toString());\n const artifacts = Object.keys(result.artifacts)\n .map((aspectId) => outputArtifacts(aspectId, result.artifacts[aspectId]))\n .join('\\n\\n');\n return `${idStr}\\n${artifacts}`;\n };\n const footer = artifactsOpts.outDir\n ? chalk.green('\\n\\nThe above files were saved successfully to the file system')\n : '';\n return grouped.map(outputResult).join('\\n\\n') + footer;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,YAAY,GAAG,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC;AAClC,MAAMC,gBAAgB,GAAG,GAAG,CAACD,MAAM,CAAC,CAAC,CAAC;AACtC,MAAME,YAAY,GAAG,GAAG,CAACF,MAAM,CAAC,CAAC,CAAC;AAS3B,MAAMG,YAAY,CAAoB;EA2B3CC,WAAW,CAASC,OAAoB,EAAUC,KAAgB,EAAE;IAAA,KAAhDD,OAAoB,GAApBA,OAAoB;IAAA,KAAUC,KAAgB,GAAhBA,KAAgB;IAAA,8CA1B3D,+BAA+B;IAAA,qDACxB,sDAAsD;IAAA,6DAC7C;AACzB;AACA;AACA,CAAC;IAAA,mDACa,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,CACF;IAAA,+CACO,EAAE;IAAA,+CACF,aAAa;IAAA,iDACX,0CAA0C;IAAA,iDAC1C,CACR,CAAC,EAAE,EAAE,oBAAoB,EAAE,0DAA0D,CAAC,EACtF,CAAC,EAAE,EAAE,gBAAgB,EAAE,wDAAwD,CAAC,EAChF,CACE,EAAE,EACF,cAAc,EACd,0GAA0G,CAC3G,E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CAACG,EAAE,CAACC,QAAQ,EAAE,CAAC;MAC9C,MAAMC,SAAS,GAAGC,MAAM,CAACC,IAAI,CAACP,MAAM,CAACK,SAAS,CAAC,CAC5ChB,GAAG,CAAEN,QAAQ,IAAKD,eAAe,CAACC,QAAQ,EAAEiB,MAAM,CAACK,SAAS,CAACtB,QAAQ,CAAC,CAAC,CAAC,CACxEe,IAAI,CAAC,MAAM,CAAC;MACf,OAAQ,GAAEG,KAAM,KAAII,SAAU,EAAC;IACjC,CAAC;IACD,MAAMG,MAAM,GAAGjC,aAAa,CAACkC,MAAM,GAC/BvB,gBAAK,CAACC,KAAK,CAAC,gEAAgE,CAAC,GAC7E,EAAE;IACN,OAAOP,OAAO,CAACS,GAAG,CAACU,YAAY,CAAC,CAACD,IAAI,CAAC,MAAM,CAAC,GAAGU,MAAM;EACxD;AACF;AAAC"}
1
+ {"version":3,"names":["INDENT_TITLE","repeat","INDENT_SUB_TITLE","INDENT_FILES","ArtifactsCmd","constructor","builder","scope","name","description","COMPONENT_PATTERN_HELP","report","componentPattern","artifactsOpts","BitError","artifactExtractor","ArtifactExtractor","list","grouped","groupResultsByAspect","outputArtifacts","aspectId","artifactData","title","chalk","green","artifactDataStr","map","artifact","subTitle","white","taskName","artifactName","files","f","dim","join","outputResult","result","idStr","cyan","id","toString","artifacts","Object","keys","footer","outDir"],"sources":["artifacts.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport { ScopeMain } from '@teambit/scope';\nimport { BuilderMain } from '../builder.main.runtime';\nimport { ArtifactExtractor, ExtractorArtifactResult, ExtractorResultGrouped } from './artifact-extractor';\n\nconst INDENT_TITLE = ' '.repeat(2);\nconst INDENT_SUB_TITLE = ' '.repeat(4);\nconst INDENT_FILES = ' '.repeat(6);\n\nexport type ArtifactsOpts = {\n aspect?: string;\n task?: string;\n files?: string;\n outDir?: string;\n};\n\nexport class ArtifactsCmd implements Command {\n name = 'artifacts <component-pattern>';\n description = 'list and download components artifacts';\n extendedDescription = `artifacts are created on isolated capsules during tag or snap commands.\nexample of artifacts are dists files generated by a compiler, a JUnit.xml file generated by a tester\nand a package.tgz file generated by pkg aspect.\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n alias = '';\n group = 'development';\n helpUrl = 'reference/components/component-artifacts';\n options = [\n ['', 'aspect <aspect-id>', 'show/download only artifacts generated by this aspect-id'],\n ['', 'task <task-id>', 'show/download only artifacts generated by this task-id'],\n [\n '',\n 'files <glob>',\n 'show/download only artifacts matching the given files or the glob pattern (wrap glob patterns in quotes)',\n ],\n ['', 'out-dir <string>', 'download the files to the specified dir'],\n ] as CommandOptions;\n\n constructor(private builder: BuilderMain, private scope: ScopeMain) {}\n\n async report([componentPattern]: [string], artifactsOpts: ArtifactsOpts): Promise<string> {\n if (!this.scope) throw new BitError(`unable to run \"bit artifacts\" outside of a workspace or a scope`);\n const artifactExtractor = new ArtifactExtractor(this.scope, this.builder, componentPattern, artifactsOpts);\n const list = await artifactExtractor.list();\n const grouped = artifactExtractor.groupResultsByAspect(list);\n const outputArtifacts = (aspectId: string, artifactData: ExtractorArtifactResult[]) => {\n const title = chalk.green(aspectId);\n const artifactDataStr = artifactData\n .map((artifact) => {\n const subTitle = chalk.white(`${artifact.taskName} (${artifact.artifactName})`);\n const files = artifact.files.map((f) => INDENT_FILES + chalk.dim(f)).join('\\n');\n return `${INDENT_SUB_TITLE}${subTitle}\\n${files}`;\n })\n .join('\\n');\n return `${INDENT_TITLE}${title}\\n${artifactDataStr}`;\n };\n const outputResult = (result: ExtractorResultGrouped) => {\n const idStr = chalk.cyan(result.id.toString());\n const artifacts = Object.keys(result.artifacts)\n .map((aspectId) => outputArtifacts(aspectId, result.artifacts[aspectId]))\n .join('\\n\\n');\n return `${idStr}\\n${artifacts}`;\n };\n const footer = artifactsOpts.outDir\n ? chalk.green('\\n\\nThe above files were saved successfully to the file system')\n : '';\n return grouped.map(outputResult).join('\\n\\n') + footer;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,YAAY,GAAG,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC;AAClC,MAAMC,gBAAgB,GAAG,GAAG,CAACD,MAAM,CAAC,CAAC,CAAC;AACtC,MAAME,YAAY,GAAG,GAAG,CAACF,MAAM,CAAC,CAAC,CAAC;AAS3B,MAAMG,YAAY,CAAoB;EA2B3CC,WAAW,CAASC,OAAoB,EAAUC,KAAgB,EAAE;IAAA,KAAhDD,OAAoB,GAApBA,OAAoB;IAAA,KAAUC,KAAgB,GAAhBA,KAAgB;IAAA,8CA1B3D,+BAA+B;IAAA,qDACxB,wCAAwC;IAAA,6DAC/B;AACzB;AACA;AACA,CAAC;IAAA,mDACa,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,CACF;IAAA,+CACO,EAAE;IAAA,+CACF,aAAa;IAAA,iDACX,0CAA0C;IAAA,iDAC1C,CACR,CAAC,EAAE,EAAE,oBAAoB,EAAE,0DAA0D,CAAC,EACtF,CAAC,EAAE,EAAE,gBAAgB,EAAE,wDAAwD,CAAC,EAChF,CACE,EAAE,EACF,cAAc,EACd,0GAA0G,CAC3G,EACD,CAAC,EAAE,EAAE,kBAAkB,EAAE,yCAAyC,CAAC,CACpE;EAEoE;EAErE,MAAMC,MAAM,CAAC,CAACC,gBAAgB,CAAW,EAAEC,aAA4B,EAAmB;IACxF,IAAI,CAAC,IAAI,CAACN,KAAK,EAAE,MAAM,KAAIO,oBAAQ,EAAE,iEAAgE,CAAC;IACtG,M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CAAC,CACxEe,IAAI,CAAC,MAAM,CAAC;MACf,OAAQ,GAAEG,KAAM,KAAII,SAAU,EAAC;IACjC,CAAC;IACD,MAAMG,MAAM,GAAGjC,aAAa,CAACkC,MAAM,GAC/BvB,gBAAK,CAACC,KAAK,CAAC,gEAAgE,CAAC,GAC7E,EAAE;IACN,OAAOP,OAAO,CAACS,GAAG,CAACU,YAAY,CAAC,CAACD,IAAI,CAAC,MAAM,CAAC,GAAGU,MAAM;EACxD;AACF;AAAC"}
@@ -0,0 +1,16 @@
1
+ import { EnvHandler } from "@teambit/envs";
2
+ import { Pipeline } from "./pipeline";
3
+ export interface BuilderEnv {
4
+ /**
5
+ * return a build pipeline instance.
6
+ */
7
+ build(): EnvHandler<Pipeline>;
8
+ /**
9
+ * return a snap pipeline instance.
10
+ */
11
+ snap(): EnvHandler<Pipeline>;
12
+ /**
13
+ * return a tag pipeline instance.
14
+ */
15
+ tag(): EnvHandler<Pipeline>;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ //# sourceMappingURL=builder-env-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["builder-env-type.ts"],"sourcesContent":["import { EnvHandler } from \"@teambit/envs\";\nimport { Pipeline } from \"./pipeline\";\n\nexport interface BuilderEnv {\n /**\n * return a build pipeline instance.\n */\n build(): EnvHandler<Pipeline>;\n /**\n * return a snap pipeline instance.\n */\n snap(): EnvHandler<Pipeline>;\n /**\n * return a tag pipeline instance.\n */\n tag(): EnvHandler<Pipeline>;\n}\n"],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -3,7 +3,9 @@ export { ComponentResult, TaskMetadata } from './types';
3
3
  export { BuildContext, BuildTask, BuiltTaskResult, TaskLocation, BuildTaskHelper, CAPSULE_ARTIFACTS_DIR, } from './build-task';
4
4
  export type { PipeName } from './builder.service';
5
5
  export type { BuilderMain, RawBuilderData, BuilderData, OnTagOpts } from './builder.main.runtime';
6
+ export { Pipeline, Task } from './pipeline';
6
7
  export type { PipelineReport } from './build-pipeline-result-list';
8
+ export type { BuilderEnv } from './builder-env-type';
7
9
  export { BuilderAspect } from './builder.aspect';
8
10
  export { WholeArtifactStorageResolver, FileStorageResolver, ArtifactStorageResolver } from './storage';
9
11
  export { Artifact, ArtifactList, ArtifactFactory, ArtifactDefinition, ArtifactModelDefinition } from './artifact';
package/dist/index.js CHANGED
@@ -99,6 +99,18 @@ Object.defineProperty(exports, "FileStorageResolver", {
99
99
  return _storage().FileStorageResolver;
100
100
  }
101
101
  });
102
+ Object.defineProperty(exports, "Pipeline", {
103
+ enumerable: true,
104
+ get: function () {
105
+ return _pipeline().Pipeline;
106
+ }
107
+ });
108
+ Object.defineProperty(exports, "Task", {
109
+ enumerable: true,
110
+ get: function () {
111
+ return _pipeline().Task;
112
+ }
113
+ });
102
114
  Object.defineProperty(exports, "TaskLocation", {
103
115
  enumerable: true,
104
116
  get: function () {
@@ -150,6 +162,13 @@ function _buildTask() {
150
162
  };
151
163
  return data;
152
164
  }
165
+ function _pipeline() {
166
+ const data = require("./pipeline");
167
+ _pipeline = function () {
168
+ return data;
169
+ };
170
+ return data;
171
+ }
153
172
  function _builder() {
154
173
  const data = require("./builder.aspect");
155
174
  _builder = function () {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { BuildPipe, TaskResults } from './build-pipe';\nexport { ComponentResult, TaskMetadata } from './types';\nexport {\n BuildContext,\n BuildTask,\n BuiltTaskResult,\n TaskLocation,\n BuildTaskHelper,\n CAPSULE_ARTIFACTS_DIR,\n} from './build-task';\nexport type { PipeName } from './builder.service';\nexport type { BuilderMain, RawBuilderData, BuilderData, OnTagOpts } from './builder.main.runtime';\nexport type { PipelineReport } from './build-pipeline-result-list';\nexport { BuilderAspect } from './builder.aspect';\nexport { WholeArtifactStorageResolver, FileStorageResolver, ArtifactStorageResolver } from './storage';\nexport { Artifact, ArtifactList, ArtifactFactory, ArtifactDefinition, ArtifactModelDefinition } from './artifact';\nexport { TaskResultsList } from './task-results-list';\nexport { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAWA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { BuildPipe, TaskResults } from './build-pipe';\nexport { ComponentResult, TaskMetadata } from './types';\nexport {\n BuildContext,\n BuildTask,\n BuiltTaskResult,\n TaskLocation,\n BuildTaskHelper,\n CAPSULE_ARTIFACTS_DIR,\n} from './build-task';\nexport type { PipeName } from './builder.service';\nexport type { BuilderMain, RawBuilderData, BuilderData, OnTagOpts } from './builder.main.runtime';\nexport { Pipeline, Task } from './pipeline';\nexport type { PipelineReport } from './build-pipeline-result-list';\nexport type { BuilderEnv } from './builder-env-type';\nexport { BuilderAspect } from './builder.aspect';\nexport { WholeArtifactStorageResolver, FileStorageResolver, ArtifactStorageResolver } from './storage';\nexport { Artifact, ArtifactList, ArtifactFactory, ArtifactDefinition, ArtifactModelDefinition } from './artifact';\nexport { TaskResultsList } from './task-results-list';\nexport { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAUA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;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"}
@@ -0,0 +1,41 @@
1
+ import { BuildTask } from "@teambit/builder";
2
+ import { EnvContext, EnvHandler } from "@teambit/envs";
3
+ export declare type Task = EnvHandler<BuildTask>;
4
+ /**
5
+ * create and maintain build pipelines for component
6
+ * dev environments.
7
+ */
8
+ export declare class Pipeline {
9
+ private _tasks;
10
+ private context;
11
+ constructor(_tasks: BuildTask[], context: EnvContext);
12
+ /**
13
+ * list all tasks in the build pipeline.
14
+ */
15
+ get tasks(): BuildTask[];
16
+ private initiateTasks;
17
+ /**
18
+ * add a build task to the pipeline.
19
+ */
20
+ add(tasks: Task[]): this;
21
+ /**
22
+ * remove a build task from the pipeline.
23
+ */
24
+ remove(taskNames: string[]): void;
25
+ /**
26
+ * replace a build task in the pipeline.
27
+ */
28
+ replace(tasks: Task[]): this;
29
+ /**
30
+ * return a new pipeline with the tasks from the pipeline args added.
31
+ * @param pipeline
32
+ * @returns
33
+ */
34
+ concat(pipeline: Pipeline): Pipeline;
35
+ /**
36
+ * compute the pipeline.
37
+ */
38
+ compute(): BuildTask[];
39
+ static from(tasks: Task[]): (context: EnvContext) => Pipeline;
40
+ static concat(...pipelines: EnvHandler<Pipeline>[]): EnvHandler<Pipeline>;
41
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Pipeline = void 0;
7
+ function _envs() {
8
+ const data = require("@teambit/envs");
9
+ _envs = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ /**
15
+ * create and maintain build pipelines for component
16
+ * dev environments.
17
+ */
18
+ class Pipeline {
19
+ constructor(_tasks, context) {
20
+ this._tasks = _tasks;
21
+ this.context = context;
22
+ }
23
+
24
+ /**
25
+ * list all tasks in the build pipeline.
26
+ */
27
+ get tasks() {
28
+ return this._tasks;
29
+ }
30
+ initiateTasks(tasks) {
31
+ return tasks.map(task => {
32
+ return task(this.context);
33
+ });
34
+ }
35
+
36
+ /**
37
+ * add a build task to the pipeline.
38
+ */
39
+ add(tasks) {
40
+ const buildTasks = this.initiateTasks(tasks);
41
+ this._tasks = this._tasks.concat(buildTasks);
42
+ return this;
43
+ }
44
+
45
+ /**
46
+ * remove a build task from the pipeline.
47
+ */
48
+ remove(taskNames) {
49
+ this._tasks = this._tasks.filter(task => {
50
+ return taskNames.includes(task.name);
51
+ });
52
+ }
53
+
54
+ /**
55
+ * replace a build task in the pipeline.
56
+ */
57
+ replace(tasks) {
58
+ const buildTasks = this.initiateTasks(tasks);
59
+ this.remove(buildTasks.map(task => task.name));
60
+ this.add(tasks);
61
+ return this;
62
+ }
63
+
64
+ /**
65
+ * return a new pipeline with the tasks from the pipeline args added.
66
+ * @param pipeline
67
+ * @returns
68
+ */
69
+ concat(pipeline) {
70
+ return new Pipeline(this._tasks.concat(pipeline.tasks), this.context);
71
+ }
72
+
73
+ /**
74
+ * compute the pipeline.
75
+ */
76
+ compute() {
77
+ return this._tasks;
78
+ }
79
+ static from(tasks) {
80
+ return context => {
81
+ const buildTasks = tasks.map(taskFn => {
82
+ return taskFn(context);
83
+ });
84
+ return new Pipeline(buildTasks, context);
85
+ };
86
+ }
87
+ static concat(...pipelines) {
88
+ return (0, _envs().reduceServiceHandlersFactories)(pipelines, (acc, pipeline) => {
89
+ return acc.concat(pipeline);
90
+ });
91
+ }
92
+ }
93
+ exports.Pipeline = Pipeline;
94
+
95
+ //# sourceMappingURL=pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Pipeline","constructor","_tasks","context","tasks","initiateTasks","map","task","add","buildTasks","concat","remove","taskNames","filter","includes","name","replace","pipeline","compute","from","taskFn","pipelines","reduceServiceHandlersFactories","acc"],"sources":["pipeline.ts"],"sourcesContent":["import { BuildTask } from \"@teambit/builder\";\nimport { EnvContext, EnvHandler, reduceServiceHandlersFactories } from \"@teambit/envs\";\n\nexport type Task = EnvHandler<BuildTask>;\n\n/**\n * create and maintain build pipelines for component\n * dev environments.\n */\nexport class Pipeline {\n constructor(\n private _tasks: BuildTask[],\n private context: EnvContext\n ) {}\n\n /**\n * list all tasks in the build pipeline.\n */\n get tasks() {\n return this._tasks;\n }\n\n private initiateTasks(tasks: Task[]) {\n return tasks.map((task) => {\n return task(this.context);\n });\n }\n\n /**\n * add a build task to the pipeline.\n */\n add(tasks: Task[]) {\n const buildTasks = this.initiateTasks(tasks);\n this._tasks = this._tasks.concat(buildTasks);\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 }\n\n /**\n * replace a build task in the pipeline.\n */\n replace(tasks: Task[]) {\n const buildTasks = this.initiateTasks(tasks);\n this.remove(buildTasks.map((task) => task.name));\n this.add(tasks);\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), this.context);\n }\n\n /**\n * compute the pipeline.\n */\n compute() {\n return this._tasks;\n }\n\n static from(tasks: Task[]) {\n return (context: EnvContext) => {\n const buildTasks = tasks.map((taskFn) => {\n return taskFn(context);\n });\n\n return new Pipeline(buildTasks, context);\n }\n }\n\n static concat(...pipelines: EnvHandler<Pipeline>[]) {\n return reduceServiceHandlersFactories(pipelines, (acc, pipeline) => {\n return acc.concat(pipeline);\n });\n }\n}\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,CAAC;EACpBC,WAAW,CACDC,MAAmB,EACnBC,OAAmB,EAC3B;IAAA,KAFQD,MAAmB,GAAnBA,MAAmB;IAAA,KACnBC,OAAmB,GAAnBA,OAAmB;EAC1B;;EAEH;AACF;AACA;EACE,IAAIC,KAAK,GAAG;IACV,OAAO,IAAI,CAACF,MAAM;EACpB;EAEQG,aAAa,CAACD,KAAa,EAAE;IACnC,OAAOA,KAAK,CAACE,GAAG,CAAEC,IAAI,IAAK;MACzB,OAAOA,IAAI,CAAC,IAAI,CAACJ,OAAO,CAAC;IAC3B,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;EACEK,GAAG,CAACJ,KAAa,EAAE;IACjB,MAAMK,UAAU,GAAG,IAAI,CAACJ,aAAa,CAACD,KAAK,CAAC;IAC5C,IAAI,CAACF,MAAM,GAAG,IAAI,CAACA,MAAM,CAACQ,MAAM,CAACD,UAAU,CAAC;IAC5C,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEE,MAAM,CAACC,SAAmB,EAAE;IAC1B,IAAI,CAACV,MAAM,GAAG,IAAI,CAACA,MAAM,CAACW,MAAM,CAAEN,IAAI,IAAK;MACzC,OAAOK,SAAS,CAACE,QAAQ,CAACP,IAAI,CAACQ,IAAI,CAAC;IACtC,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;EACEC,OAAO,CAACZ,KAAa,EAAE;IACrB,MAAMK,UAAU,GAAG,IAAI,CAACJ,aAAa,CAACD,KAAK,CAAC;IAC5C,IAAI,CAACO,MAAM,CAACF,UAAU,CAACH,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACQ,IAAI,CAAC,CAAC;IAChD,IAAI,CAACP,GAAG,CAACJ,KAAK,CAAC;IACf,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEM,MAAM,CAACO,QAAkB,EAAE;IACzB,OAAO,IAAIjB,QAAQ,CAAC,IAAI,CAACE,MAAM,CAACQ,MAAM,CAACO,QAAQ,CAACb,KAAK,CAAC,EAAE,IAAI,CAACD,OAAO,CAAC;EACvE;;EAEA;AACF;AACA;EACEe,OAAO,GAAG;IACR,OAAO,IAAI,CAAChB,MAAM;EACpB;EAEA,OAAOiB,IAAI,CAACf,KAAa,EAAE;IACzB,OAAQD,OAAmB,IAAK;MAC9B,MAAMM,UAAU,GAAGL,KAAK,CAACE,GAAG,CAAEc,MAAM,IAAK;QACvC,OAAOA,MAAM,CAACjB,OAAO,CAAC;MACxB,CAAC,CAAC;MAEF,OAAO,IAAIH,QAAQ,CAACS,UAAU,EAAEN,OAAO,CAAC;IAC1C,CAAC;EACH;EAEA,OAAOO,MAAM,CAAC,GAAGW,SAAiC,EAAE;IAClD,OAAO,IAAAC,sCAA8B,EAACD,SAAS,EAAE,CAACE,GAAG,EAAEN,QAAQ,KAAK;MAClE,OAAOM,GAAG,CAACb,MAAM,CAACO,QAAQ,CAAC;IAC7B,CAAC,CAAC;EACJ;AACF;AAAC"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.918/dist/builder.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.918/dist/builder.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.920/dist/builder.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.920/dist/builder.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/builder",
3
- "version": "0.0.918",
3
+ "version": "0.0.920",
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.918"
9
+ "version": "0.0.920"
10
10
  },
11
11
  "dependencies": {
12
12
  "p-map-series": "2.1.0",
@@ -26,20 +26,20 @@
26
26
  "core-js": "^3.0.0",
27
27
  "@teambit/graph.cleargraph": "0.0.1",
28
28
  "@teambit/harmony": "0.3.3",
29
- "@teambit/component": "0.0.918",
30
- "@teambit/envs": "0.0.918",
31
- "@teambit/logger": "0.0.707",
32
- "@teambit/tester": "0.0.918",
33
- "@teambit/isolator": "0.0.918",
34
- "@teambit/lane-id": "0.0.132",
35
- "@teambit/cli": "0.0.614",
36
- "@teambit/workspace": "0.0.918",
37
- "@teambit/aspect-loader": "0.0.918",
38
- "@teambit/aspect": "0.0.918",
39
- "@teambit/generator": "0.0.918",
40
- "@teambit/graphql": "0.0.918",
41
- "@teambit/scope": "0.0.918",
42
- "@teambit/express": "0.0.712",
29
+ "@teambit/component": "0.0.920",
30
+ "@teambit/envs": "0.0.920",
31
+ "@teambit/logger": "0.0.709",
32
+ "@teambit/tester": "0.0.920",
33
+ "@teambit/isolator": "0.0.920",
34
+ "@teambit/lane-id": "0.0.134",
35
+ "@teambit/cli": "0.0.616",
36
+ "@teambit/workspace": "0.0.920",
37
+ "@teambit/aspect-loader": "0.0.920",
38
+ "@teambit/aspect": "0.0.920",
39
+ "@teambit/generator": "0.0.920",
40
+ "@teambit/graphql": "0.0.920",
41
+ "@teambit/scope": "0.0.920",
42
+ "@teambit/express": "0.0.714",
43
43
  "@teambit/bit-error": "0.0.402",
44
44
  "@teambit/component-id": "0.0.425"
45
45
  },
@@ -55,10 +55,10 @@
55
55
  "@types/jest": "^26.0.0",
56
56
  "@types/react-dom": "^17.0.5",
57
57
  "@types/node": "12.20.4",
58
- "@teambit/pipelines.aspect-docs.builder": "0.0.148"
58
+ "@teambit/pipelines.aspect-docs.builder": "0.0.149"
59
59
  },
60
60
  "peerDependencies": {
61
- "@teambit/legacy": "1.0.395",
61
+ "@teambit/legacy": "1.0.397",
62
62
  "react-dom": "^16.8.0 || ^17.0.0",
63
63
  "react": "^16.8.0 || ^17.0.0"
64
64
  },