@teambit/builder 1.0.227 → 1.0.229
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_pipelines_builder-preview.js +1 -1
- package/artifacts/schema.json +708 -182
- package/dist/artifact/artifact-definition.d.ts +65 -0
- package/dist/artifact/artifact-extractor.d.ts +35 -0
- package/dist/artifact/artifact-factory.d.ts +20 -0
- package/dist/artifact/artifact-list.d.ts +52 -0
- package/dist/artifact/artifact.d.ts +59 -0
- package/dist/artifact/artifacts.cmd.d.ts +26 -0
- package/dist/artifact/extension-artifact.d.ts +10 -0
- package/dist/artifact/fs-artifact.d.ts +18 -0
- package/dist/artifact/index.d.ts +6 -0
- package/dist/build-pipe.d.ts +75 -0
- package/dist/build-pipe.js +0 -13
- package/dist/build-pipe.js.map +1 -1
- package/dist/build-pipeline-order.d.ts +35 -0
- package/dist/build-pipeline-result-list.d.ts +34 -0
- package/dist/build-task.d.ts +128 -0
- package/dist/build.cmd.d.ts +39 -0
- package/dist/builder-env-type.d.ts +15 -0
- package/dist/builder.aspect.d.ts +2 -0
- package/dist/builder.composition.d.ts +1 -0
- package/dist/builder.graphql.d.ts +102 -0
- package/dist/builder.main.runtime.d.ts +153 -0
- package/dist/builder.route.d.ts +20 -0
- package/dist/builder.service.d.ts +105 -0
- package/dist/exceptions/artifact-definition-no-glob.d.ts +3 -0
- package/dist/exceptions/artifact-storage-error.d.ts +7 -0
- package/dist/exceptions/capsule-not-found.d.ts +5 -0
- package/dist/exceptions/index.d.ts +3 -0
- package/dist/exceptions/invalid-task.d.ts +5 -0
- package/dist/index.d.ts +19 -0
- package/dist/pipeline/index.d.ts +1 -0
- package/dist/pipeline/pipeline-results.d.ts +2 -0
- package/dist/pipeline.d.ts +43 -0
- package/dist/{preview-1712719054377.js → preview-1712822929999.js} +2 -2
- package/dist/storage/default-resolver.d.ts +7 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/s3-resolver.d.ts +0 -0
- package/dist/storage/storage-resolver.d.ts +26 -0
- package/dist/task-results-list.d.ts +22 -0
- package/dist/task.d.ts +44 -0
- package/dist/tasks-queue.d.ts +16 -0
- package/dist/templates/build-task/files/index-file.d.ts +2 -0
- package/dist/templates/build-task/files/task-file.d.ts +2 -0
- package/dist/templates/build-task/index.d.ts +2 -0
- package/dist/types.d.ts +32 -0
- package/package.json +18 -18
- package/tsconfig.json +1 -49
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.229/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.229/dist/builder.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Component } from '@teambit/component';
|
|
2
|
+
import { FsArtifact } from '../artifact';
|
|
3
|
+
import { WholeArtifactStorageResolver } from './storage-resolver';
|
|
4
|
+
export declare class DefaultResolver implements WholeArtifactStorageResolver {
|
|
5
|
+
name: string;
|
|
6
|
+
store(component: Component, artifact: FsArtifact): Promise<void>;
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Component } from '@teambit/component';
|
|
2
|
+
import { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';
|
|
3
|
+
import { FsArtifact } from '../artifact';
|
|
4
|
+
export type StoreResult = {
|
|
5
|
+
[path: string]: string;
|
|
6
|
+
};
|
|
7
|
+
interface BaseStorageResolver {
|
|
8
|
+
/**
|
|
9
|
+
* name of the storage resolver.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WholeArtifactStorageResolver extends BaseStorageResolver {
|
|
14
|
+
/**
|
|
15
|
+
* store artifacts in the storage.
|
|
16
|
+
*/
|
|
17
|
+
store(component: Component, artifact: FsArtifact): Promise<StoreResult | undefined | void>;
|
|
18
|
+
}
|
|
19
|
+
export interface FileStorageResolver extends BaseStorageResolver {
|
|
20
|
+
/**
|
|
21
|
+
* store artifacts in the storage.
|
|
22
|
+
*/
|
|
23
|
+
storeFile(component: Component, artifact: FsArtifact, file: ArtifactVinyl): Promise<string | undefined | void>;
|
|
24
|
+
}
|
|
25
|
+
export type ArtifactStorageResolver = FileStorageResolver | WholeArtifactStorageResolver;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TasksQueue } from './tasks-queue';
|
|
2
|
+
import { TaskResults } from './build-pipe';
|
|
3
|
+
export declare class TaskResultsList {
|
|
4
|
+
tasksQueue: TasksQueue;
|
|
5
|
+
/**
|
|
6
|
+
* results of all tasks executed in the build pipeline.
|
|
7
|
+
*/
|
|
8
|
+
tasksResults: TaskResults[];
|
|
9
|
+
capsuleRootDir: string;
|
|
10
|
+
constructor(tasksQueue: TasksQueue,
|
|
11
|
+
/**
|
|
12
|
+
* results of all tasks executed in the build pipeline.
|
|
13
|
+
*/
|
|
14
|
+
tasksResults: TaskResults[], capsuleRootDir: string);
|
|
15
|
+
hasErrors(): boolean;
|
|
16
|
+
throwErrorsIfExist(): void;
|
|
17
|
+
/**
|
|
18
|
+
* group errors from all tasks and show them nicely to the user
|
|
19
|
+
*/
|
|
20
|
+
getErrorMessageFormatted(): string | null;
|
|
21
|
+
private aggregateTaskErrorsToOneString;
|
|
22
|
+
}
|
package/dist/task.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BuildContext, BuiltTaskResult } from './build-task';
|
|
2
|
+
import { TaskResultsList } from './task-results-list';
|
|
3
|
+
/**
|
|
4
|
+
* this is the external interface for task. please make
|
|
5
|
+
* sure to use only this interface outside of this builder
|
|
6
|
+
* aspect.
|
|
7
|
+
*/
|
|
8
|
+
export interface Task {
|
|
9
|
+
/**
|
|
10
|
+
* names ideally with dashes 'typescript'
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* description of what the task does.
|
|
15
|
+
*/
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* execute a task in a build context
|
|
19
|
+
*/
|
|
20
|
+
execute(context: BuildContext): Promise<BuiltTaskResult>;
|
|
21
|
+
/**
|
|
22
|
+
* run before the build pipeline has started. this is useful when some preparation are needed to
|
|
23
|
+
* be done on all envs before the build starts.
|
|
24
|
+
* e.g. typescript compiler needs to write the tsconfig file. doing it during the task, will
|
|
25
|
+
* cause dependencies from other envs to get this tsconfig written.
|
|
26
|
+
*/
|
|
27
|
+
preBuild?(context: BuildContext): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* run after the build pipeline completed for all envs. useful for doing some cleanup on the
|
|
30
|
+
* capsules before the deployment starts.
|
|
31
|
+
*/
|
|
32
|
+
postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* needed if you want the task to be running only after the dependencies were completed
|
|
35
|
+
* for *all* envs.
|
|
36
|
+
* normally this is not needed because the build-pipeline runs the tasks in the same order
|
|
37
|
+
* they're located in the `getBuildPipe()` array and according to the task.location.
|
|
38
|
+
* the case where this is useful is when a task not only needs to be after another task, but also
|
|
39
|
+
* after all environments were running that task.
|
|
40
|
+
* a dependency is task.aspectId. if an aspect has multiple tasks, to be more specific, use
|
|
41
|
+
* "aspectId:name", e.g. "teambit.compilation/compiler:TypescriptCompiler".
|
|
42
|
+
*/
|
|
43
|
+
dependencies?: string[];
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EnvDefinition } from '@teambit/envs';
|
|
2
|
+
import { BuildTask } from './build-task';
|
|
3
|
+
type EnvTask = {
|
|
4
|
+
env: EnvDefinition;
|
|
5
|
+
task: BuildTask;
|
|
6
|
+
};
|
|
7
|
+
export declare class TasksQueue extends Array<EnvTask> {
|
|
8
|
+
toString(): string;
|
|
9
|
+
/**
|
|
10
|
+
* make sure tasks names are valid and there are no duplications
|
|
11
|
+
*/
|
|
12
|
+
validate(): void;
|
|
13
|
+
private validateTaskName;
|
|
14
|
+
private validateDuplications;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Component } from '@teambit/component';
|
|
2
|
+
export type TaskMetadata = {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
export type ComponentResult = {
|
|
6
|
+
/**
|
|
7
|
+
* instance of the component
|
|
8
|
+
*/
|
|
9
|
+
component: Component;
|
|
10
|
+
/**
|
|
11
|
+
* metadata generated during component build.
|
|
12
|
+
* this eventually gets saved into `aspectsData` prop of the builder aspect data.
|
|
13
|
+
* it can be retrieved later on by `builder.getDataByAspect()` method.
|
|
14
|
+
*/
|
|
15
|
+
metadata?: TaskMetadata;
|
|
16
|
+
/**
|
|
17
|
+
* returning errors from build tasks will cause a pipeline failure and logs all returned errors.
|
|
18
|
+
*/
|
|
19
|
+
errors?: Array<Error | string>;
|
|
20
|
+
/**
|
|
21
|
+
* warnings generated throughout the build task.
|
|
22
|
+
*/
|
|
23
|
+
warnings?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* timestamp in milliseconds when the task started
|
|
26
|
+
*/
|
|
27
|
+
startTime?: number;
|
|
28
|
+
/**
|
|
29
|
+
* timestamp in milliseconds when the task ended
|
|
30
|
+
*/
|
|
31
|
+
endTime?: number;
|
|
32
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.229",
|
|
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": "1.0.
|
|
9
|
+
"version": "1.0.229"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -26,23 +26,23 @@
|
|
|
26
26
|
"@teambit/harmony": "0.4.6",
|
|
27
27
|
"@teambit/bit-error": "0.0.404",
|
|
28
28
|
"@teambit/component-id": "1.2.0",
|
|
29
|
-
"@teambit/component": "1.0.
|
|
30
|
-
"@teambit/envs": "1.0.
|
|
31
|
-
"@teambit/logger": "0.0.
|
|
29
|
+
"@teambit/component": "1.0.229",
|
|
30
|
+
"@teambit/envs": "1.0.229",
|
|
31
|
+
"@teambit/logger": "0.0.955",
|
|
32
32
|
"@teambit/toolbox.string.capitalize": "0.0.496",
|
|
33
|
-
"@teambit/tester": "1.0.
|
|
34
|
-
"@teambit/isolator": "1.0.
|
|
35
|
-
"@teambit/cli": "0.0.
|
|
36
|
-
"@teambit/workspace": "1.0.
|
|
37
|
-
"@teambit/aspect-loader": "1.0.
|
|
38
|
-
"@teambit/aspect": "1.0.
|
|
39
|
-
"@teambit/generator": "1.0.
|
|
40
|
-
"@teambit/global-config": "0.0.
|
|
41
|
-
"@teambit/graphql": "1.0.
|
|
42
|
-
"@teambit/scope": "1.0.
|
|
33
|
+
"@teambit/tester": "1.0.229",
|
|
34
|
+
"@teambit/isolator": "1.0.229",
|
|
35
|
+
"@teambit/cli": "0.0.862",
|
|
36
|
+
"@teambit/workspace": "1.0.229",
|
|
37
|
+
"@teambit/aspect-loader": "1.0.229",
|
|
38
|
+
"@teambit/aspect": "1.0.229",
|
|
39
|
+
"@teambit/generator": "1.0.230",
|
|
40
|
+
"@teambit/global-config": "0.0.865",
|
|
41
|
+
"@teambit/graphql": "1.0.229",
|
|
42
|
+
"@teambit/scope": "1.0.229",
|
|
43
43
|
"@teambit/toolbox.array.duplications-finder": "0.0.1",
|
|
44
|
-
"@teambit/ui": "1.0.
|
|
45
|
-
"@teambit/express": "0.0.
|
|
44
|
+
"@teambit/ui": "1.0.229",
|
|
45
|
+
"@teambit/express": "0.0.961"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/lodash": "4.14.165",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/minimatch": "3.0.4",
|
|
53
53
|
"@types/mocha": "9.1.0",
|
|
54
54
|
"chai": "4.3.0",
|
|
55
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
55
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.33",
|
|
56
56
|
"@teambit/pipelines.aspect-docs.builder": "0.0.167"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
package/tsconfig.json
CHANGED
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"emitDeclarationOnly": true,
|
|
21
21
|
"strict": true,
|
|
22
22
|
"strictPropertyInitialization": false,
|
|
23
|
-
"noImplicitAny": false
|
|
24
|
-
"composite": true
|
|
23
|
+
"noImplicitAny": false
|
|
25
24
|
},
|
|
26
25
|
"exclude": [
|
|
27
26
|
"artifacts",
|
|
@@ -36,52 +35,5 @@
|
|
|
36
35
|
"include": [
|
|
37
36
|
"**/*",
|
|
38
37
|
"**/*.json"
|
|
39
|
-
],
|
|
40
|
-
"references": [
|
|
41
|
-
{
|
|
42
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.227"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@1.0.227"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.953"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_tester@1.0.227"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_isolator@1.0.227"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.860"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.227"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_aspect-loader@1.0.227"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_aspect@1.0.227"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.generator_generator@1.0.228"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_global-config@0.0.863"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_graphql@1.0.227"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.scope_scope@1.0.227"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@1.0.227"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_express@0.0.959"
|
|
85
|
-
}
|
|
86
38
|
]
|
|
87
39
|
}
|