@teambit/builder 0.0.919 → 0.0.921

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.
@@ -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;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,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.919/dist/builder.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.919/dist/builder.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.921/dist/builder.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@0.0.921/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.919",
3
+ "version": "0.0.921",
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.919"
9
+ "version": "0.0.921"
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.919",
30
- "@teambit/envs": "0.0.919",
31
- "@teambit/logger": "0.0.708",
32
- "@teambit/tester": "0.0.919",
33
- "@teambit/isolator": "0.0.919",
34
- "@teambit/lane-id": "0.0.133",
35
- "@teambit/cli": "0.0.615",
36
- "@teambit/workspace": "0.0.919",
37
- "@teambit/aspect-loader": "0.0.919",
38
- "@teambit/aspect": "0.0.919",
39
- "@teambit/generator": "0.0.919",
40
- "@teambit/graphql": "0.0.919",
41
- "@teambit/scope": "0.0.919",
42
- "@teambit/express": "0.0.713",
29
+ "@teambit/component": "0.0.921",
30
+ "@teambit/envs": "0.0.921",
31
+ "@teambit/logger": "0.0.709",
32
+ "@teambit/tester": "0.0.921",
33
+ "@teambit/isolator": "0.0.921",
34
+ "@teambit/lane-id": "0.0.134",
35
+ "@teambit/cli": "0.0.616",
36
+ "@teambit/workspace": "0.0.921",
37
+ "@teambit/aspect-loader": "0.0.921",
38
+ "@teambit/aspect": "0.0.921",
39
+ "@teambit/generator": "0.0.921",
40
+ "@teambit/graphql": "0.0.921",
41
+ "@teambit/scope": "0.0.921",
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.396",
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
  },