@teambit/builder 1.0.425 → 1.0.427
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/artifact/artifacts.cmd.ts +4 -1
- package/artifact/extension-artifact.ts +4 -1
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_pipelines_builder-preview.js +1 -1
- package/artifacts/schema.json +28 -28
- package/dist/artifact/artifacts.cmd.js.map +1 -1
- package/dist/artifact/extension-artifact.js.map +1 -1
- package/dist/build-pipeline-result-list.js.map +1 -1
- package/dist/build.cmd.js.map +1 -1
- package/dist/builder.main.runtime.js.map +1 -1
- package/dist/builder.route.js.map +1 -1
- package/dist/exceptions/invalid-task.js.map +1 -1
- package/dist/{preview-1728184966899.js → preview-1728271406903.js} +2 -2
- package/exceptions/invalid-task.ts +4 -1
- package/package.json +20 -20
|
@@ -43,7 +43,10 @@ and a package.tgz file generated by pkg aspect.
|
|
|
43
43
|
['', 'out-dir <string>', 'download the files to the specified dir'],
|
|
44
44
|
] as CommandOptions;
|
|
45
45
|
|
|
46
|
-
constructor(
|
|
46
|
+
constructor(
|
|
47
|
+
private builder: BuilderMain,
|
|
48
|
+
private componentMain: ComponentMain
|
|
49
|
+
) {}
|
|
47
50
|
|
|
48
51
|
async report([componentPattern]: [string], artifactsOpts: ArtifactsOpts): Promise<string> {
|
|
49
52
|
const artifactExtractor = new ArtifactExtractor(this.componentMain, this.builder, componentPattern, artifactsOpts);
|
|
@@ -2,7 +2,10 @@ import type { AspectDescriptor } from '@teambit/aspect-loader';
|
|
|
2
2
|
import { AbstractVinyl } from '@teambit/component.sources';
|
|
3
3
|
|
|
4
4
|
export class ExtensionArtifact {
|
|
5
|
-
constructor(
|
|
5
|
+
constructor(
|
|
6
|
+
readonly files: AbstractVinyl[],
|
|
7
|
+
readonly extensionDescriptor: AspectDescriptor
|
|
8
|
+
) {}
|
|
6
9
|
|
|
7
10
|
toObject() {
|
|
8
11
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.pipelines/builder@1.0.
|
|
3
|
+
<testsuite name="teambit.pipelines/builder@1.0.427" tests="0" failures="0" errors="0" skipped="0"/>
|
|
4
4
|
</testsuites>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.pipelines/builder-preview"]=n():e["teambit.pipelines/builder-preview"]=n()}(self,(()=>(()=>{"use strict";var e={54200:(e,n,t)=>{var i={id:"teambit.pipelines/aspect-docs/builder@0.0.168",homepage:"https://bit.cloud/teambit/pipelines/aspect-docs/builder",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=u,o(t(41594));var a=t(5016),r=["components"];function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},l.apply(null,arguments)}function s(e,n){if(null==e)return{};var t,i,a=d(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)t=r[i],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function d(e,n){if(null==e)return{};var t={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;t[i]=e[i]}return t}o.__bit_component=i,l.__bit_component=i,s.__bit_component=i,d.__bit_component=i;var p={},m="wrapper";function u(e){var n=e.components,t=s(e,r);return(0,a.mdx)(m,l({},p,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)("h2",null,"Background"),(0,a.mdx)("p",null,"Bit's build process is an extensible CI for independent components. It validates a component is not dependent on its context (the workspace), tests it, and generates all artifacts necessary for it to be viewed and consumed as an independent module (its distributable code, bundled preview, etc.)."),(0,a.mdx)("p",null,"The Build Pipeline is an Environment Service responsible for sequencing and executing a component's Build Tasks. As mentioned earlier, these tasks are performed on a component only after it's been isolated from the rest of the workspace."),(0,a.mdx)("p",null,"A component's default series of Build Tasks is composed of tasks set by Bit and by its environment."),(0,a.mdx)("h2",null,"Isolated builds"),(0,a.mdx)("p",null,"Components authored in a Bit workspace are created to be completely portable, and thus independent. To address that, the build process starts by creating a component 'capsule' which is an isolated instance of a component, generated in a separate directory in your filesystem."),(0,a.mdx)("p",null,'As part of the capsule creation, all packages listed as dependencies of that component will be installed. This step is necessary to validate there are no dependency-graph issues (a component that is not totally isolated will be able to use packages installed in parent directories in your workspace, by other components. This will translate into a "false positive" result when testing for dependency-graph issues in a non-isolated location).'),(0,a.mdx)("h2",null,"Incremental builds"),(0,a.mdx)("p",null,'When a component "goes through" the build pipeline, all of its dependencies are built as well. If a dependency has not changed since its last build, the build process will use its artifacts from the previous build (and will not process it again). This optimization to the build process supplements the "innate optimization" that naturally comes from developing (and building) independent components instead of a single monolithic codebase.'),(0,a.mdx)("h2",null,"Environment-specific builds"),(0,a.mdx)("p",null,"Each Bit environment determines its own build pipeline. That means, a single workspace that uses multiple environments will run a different set of build tasks on different components depending on their associated environment. This is another Bit feature that enables seamless transitioning between different development environments, all in the same workspace. It also makes it much easier to integrate the Build Pipeline in your (remote) CI, as it only requires executing the build step - all other per-component build configurations are already set by the various environments being used."),(0,a.mdx)("p",null,"Since environments are extensible, so are the build pipelines configured by them."),(0,a.mdx)("h2",null,"Build task"),(0,a.mdx)("p",null,"An example of a build-task is ",(0,a.mdx)("inlineCode",{parentName:"p"},"compile"),", it's written in the compiler aspect and is running on each one of the capsules created by the build process. build-tasks in many cases generate artifacts, in this case, the compiler generates ",(0,a.mdx)("inlineCode",{parentName:"p"},"dists")," files and write them on the isolated capsules. There artifacts files are used later for example when creating packages."),(0,a.mdx)("h2",null,"Pipelines"),(0,a.mdx)("p",null,"There are three pipelines: ",(0,a.mdx)("inlineCode",{parentName:"p"},"build"),", ",(0,a.mdx)("inlineCode",{parentName:"p"},"tag")," and ",(0,a.mdx)("inlineCode",{parentName:"p"},"snap"),"."),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit build")," runs the build pipeline."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit tag")," runs the build pipeline and then the tag pipeline."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit snap")," runs the build pipeline and then the snap pipeline.")),(0,a.mdx)("h2",null,"List Build Tasks"),(0,a.mdx)("p",null,"To get a list of all the tasks that will be running per pipeline on a specific component, run ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit build --list-tasks <id>"),".\nHere is an example of the relevant part from the output:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre"},"➜ bit build --list-tasks ui/tooltip\nTasks List\nid: teambit.design/ui/tooltip@0.0.347\nenvId: teambit.react/react\n\nBuild Pipeline Tasks:\nteambit.harmony/aspect:CoreExporter\nteambit.compilation/compiler:TSCompiler\nteambit.defender/tester:TestComponents\nteambit.pkg/pkg:PreparePackages\nteambit.pkg/pkg:PublishDryRun\nteambit.preview/preview:GeneratePreview\n\nTag Pipeline Tasks:\nteambit.harmony/application:build_ui_application\nteambit.pkg/pkg:PublishComponents\n\nSnap Pipeline Tasks:\n<N/A>\n")),(0,a.mdx)("h2",null,"Implementing Build Tasks"),(0,a.mdx)("p",null,"The ",(0,a.mdx)("inlineCode",{parentName:"p"},"BuildTask")," interface is a good start to understand how to implement a new build-task.\nWhen writing a build task, the ",(0,a.mdx)("inlineCode",{parentName:"p"},"Network")," object is passed and it includes the seeders capsules, as well as the entire graph including the dependencies.\nKeep in mind that the entire graph may contain components from other envs."),(0,a.mdx)("p",null,"Some tasks, such as, compiling in typescript and bundling with Webpack, need the entire graph.\nOthers, such as, Babel, need only the seeders. However, normally, the bundling is running after the compilation and it expects to have the dependencies compiled, so you might need the entire graph regardless."),(0,a.mdx)("h2",null,"Adding Tasks to a pipeline"),(0,a.mdx)("p",null,"There are two ways of adding tasks to the build pipeline."),(0,a.mdx)("ol",null,(0,a.mdx)("li",{parentName:"ol"},(0,a.mdx)("inlineCode",{parentName:"li"},"getBuildPipe()")," method of the env. (or ",(0,a.mdx)("inlineCode",{parentName:"li"},"getTagPipe()")," and ",(0,a.mdx)("inlineCode",{parentName:"li"},"getSnapPipe()"),")"),(0,a.mdx)("li",{parentName:"ol"},"registering to the slot via ",(0,a.mdx)("inlineCode",{parentName:"li"},"builder.registerBuildTask()"),". (or ",(0,a.mdx)("inlineCode",{parentName:"li"},"registerTagTask()")," and ",(0,a.mdx)("inlineCode",{parentName:"li"},"registerSnapTask()"),")")),(0,a.mdx)("p",null,"in the option #1, it's possible to determine the order. e.g. ",(0,a.mdx)("inlineCode",{parentName:"p"},"getBuildPipe() { return [taskA, taskB, taskC]; }"),"\nin the option #2, the register happens once the extension is loaded, so there is no way to put\none task before/after another task as of now."),(0,a.mdx)("h2",null,"Sequencing the build tasks"),(0,a.mdx)("p",null,"The Build Pipeline takes into consideration the following factors when deciding the order of which to execute each task:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("strong",{parentName:"li"},"Location"),": A task can be executed either at the start or end of the build pipeline. This can be explicitly configured by the task itself."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("strong",{parentName:"li"},"Dependencies"),": A task can depend on other tasks. That means, the dependencies must be completed successfully for all envs before this task starts. The dependencies are applicable inside a location and not across locations. This is configured by the task itself."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("strong",{parentName:"li"},"An environment's list of build tasks"),": This is the array of tasks as it is defined by an environment")),(0,a.mdx)("h2",null,"Executing the pipelines"),(0,a.mdx)("p",null,"Commands that trigger the build pipeline:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit build")," - runs the build pipeline on your local machine, for the entire workspace. The output data will not persist. - That is most often used for testing and debugging the build process."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit tag")," - runs the tag pipeline in addition to the build pipeline, before creating a new component release version. The output data will persist."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit snap")," - runs the snap pipeline in addition to the build pipeline. The output data will persist.")),(0,a.mdx)("p",null,"Build pipelines are determined by the environments in use. That means, in order to override the default pipeline, we need to create a new environment extension or modify an existing one."),(0,a.mdx)("p",null,"The example task below, shown being used by a customized environment, prints out the component name of every component handled by it. In addition to that, the task returns the component name as custom metadata to be logged and/or stored in the component tagged version. ",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/teambit/harmony-build-examples"},"See a demo project here"),"."),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"Information returned by a build task will only persist if the build-pipeline was triggered by the 'hard-tag' command (",(0,a.mdx)("inlineCode",{parentName:"p"},"bit tag <component-id>"),").")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="print-cmp-name-task.ts"',title:'"print-cmp-name-task.ts"'},"import { BuildTask, BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\n\n// A task is an implementation of 'BuildTask' provided by the 'builder' aspect\nexport class PrintCmpNameTask implements BuildTask {\n // The constructor leaves these properties up to the hands of the environment using this task\n constructor(readonly aspectId: string, readonly name: string) {}\n\n // This is where the task logic is placed. It will be executed by the build pipeline\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults: ComponentResult[] = [];\n\n // Go through every isolated component instance\n context.capsuleNetwork.seedersCapsules.forEach((capsule) => {\n console.log(`The current component name is: ${capsule.component.id.name}`);\n\n componentsResults.push({\n component: capsule.component,\n metadata: { customProp: capsule.component.id.name },\n });\n });\n return {\n // An array of component objects, enriched with additional data produced by the task\n componentsResults,\n };\n }\n}\n")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="customized-react.extension.ts"',title:'"customized-react.extension.ts"'},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { ReactAspect, ReactMain } from '@teambit/react';\n\n// Import the task\nimport { PrintCmpNameTask } from './print-cmp-name-task';\n\nexport class CustomReact {\n constructor(private react: ReactMain) {}\n\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n static async provider([envs, react]: [EnvsMain, ReactMain]) {\n // Get the environment's default build pipeline\n const reactPipe = react.env.getBuildPipe();\n\n // Add the custom task to the end of the build tasks sequence.\n // Provide the task with the component ID of the extension using it.\n // Provide the ask with a name.\n const tasks = [...reactPipe, new PrintCompTask('extensions/custom-react', 'PrintCmpNameTask')];\n\n // Create a new environment by merging these configurations with the env's default ones\n const customReactEnv = react.compose([react.overrideBuildPipe(tasks)]);\n\n // register the extension as an environment\n envs.registerEnv(customReactEnv);\n return new CustomReact(react);\n }\n}\n")),(0,a.mdx)("h2",null,"Positioning a build task in the pipeline"),(0,a.mdx)("p",null,"A build task is positioned in the build pipeline sequence either by overriding the entire ",(0,a.mdx)("em",{parentName:"p"},"customizable")," pipeline or, by registering it to a location in the pipeline using the designated builder slot."),(0,a.mdx)("h3",null,"Override the build pipeline sequence"),(0,a.mdx)("p",null,"This methodology leaves the task completely agnostic as to its position in the build pipeline. Instead, the task position is determined by the environment using the ",(0,a.mdx)("inlineCode",{parentName:"p"},"getBuildPipe")," Environment Handler."),(0,a.mdx)("p",null,"The example above shows the React environment ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideBuildPipe")," method being used to override its default pipeline. This method uses the ",(0,a.mdx)("inlineCode",{parentName:"p"},"getBuildPipe()")," Environment Handler, internally."),(0,a.mdx)("h3",null,"Append to the start or end of the pipeline, in relation to other tasks"),(0,a.mdx)("p",null,"This methodology places the task at the start or end of the build pipeline sequence, and lists all other tasks needed to run successfully before it is executed."),(0,a.mdx)("p",null,"Example:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="print-cmp-name-task.ts"',title:'"print-cmp-name-task.ts"'},"import { BuildTask, BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\n\nexport class PrintCmpNameTask implements BuildTask {\n constructor(readonly aspectId: string, readonly name: string) {}\n\n // Place the task at the end of the build pipeline\n readonly location = 'end';\n\n // Run this task only after the '@teambit/preview' task is completed successfully\n readonly dependencies = ['@teambit/preview'];\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults: ComponentResult[] = [];\n context.capsuleNetwork.seedersCapsules.forEach((capsule) => {\n console.log(`The current component name is: ${capsule.component.id.name}`);\n\n componentsResults.push({\n component: capsule.component,\n metadata: { customProp: capsule.component.id.name },\n });\n });\n return {\n componentsResults,\n };\n }\n}\n")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="customized-react.extension.ts"',title:'"customized-react.extension.ts"'},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { ReactAspect, ReactMain } from '@teambit/react';\nimport { BuilderMain } from '@teambit/builder';\n\n// Import the task (in reality, it should be an independent component)\nimport { PrintCmpNameTask } from './print-cmp-name-task';\n\nexport class CustomReact {\n constructor(private react: ReactMain) {}\n\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n // Inject the builder\n static async provider([envs, react, builder]: [EnvsMain, ReactMain, BuilderMain]) {\n // Register this task using the registration slot, made available by the 'builder'.\n // Here, the environment has no say in the positioning of the task\n builder.registerBuildTasks([new ExampleTask('extensions/custom-react', 'PrintCmpNameTask')]);\n\n const customReactEnv = react.compose([]);\n\n envs.registerEnv(customReactEnv);\n return new CustomReact(react);\n }\n}\n")),(0,a.mdx)("h2",null,"A build task anatomy"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"aspectId")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"aspectId: string"),(0,a.mdx)("br",null),"\nThe component ID of the environment using this task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"name")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"name: string")," ",(0,a.mdx)("br",null),"\nA name for this task. Only alphanumerical characters are allowed. PascalCase should be used as a convention.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"location")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"location?: 'start' | 'end'")," ",(0,a.mdx)("br",null),"\nThe section of the build-pipeline to which to append this task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"dependencies")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"dependencies?: string[]")," ",(0,a.mdx)("br",null),"\nAn list of tasks that must be completed before this task gets executed. ",(0,a.mdx)("br",null),"\nFor example ",(0,a.mdx)("inlineCode",{parentName:"p"},"dependencies = ['@teambit/preview']"),".")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"execute")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"execute(context: BuildContext): Promise<BuiltTaskResult>")," ",(0,a.mdx)("br",null),"\nThe execute method is where all the task logic is placed."),(0,a.mdx)("ul",{parentName:"li"},(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"context")," (argument) ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"context: BuildContext")," ",(0,a.mdx)("br",null),"\nThe context of the build pipeline. Use this object (provided by the build pipeline) to get information regarding all components handled by the build pipeline. ",(0,a.mdx)("br",null),(0,a.mdx)("br",null),"\nFor example, ",(0,a.mdx)("inlineCode",{parentName:"p"},"context.capsuleNetwork.seedersCapsules")," are models representing isolated instances of components handled by the build pipeline. These isolated instances are independent projects, generated in your local filesystem (by the build pipeline).")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"return")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"Promise<BuiltTaskResult>")," ",(0,a.mdx)("br",null),"\nA ",(0,a.mdx)("inlineCode",{parentName:"p"},"context")," method returns an object with data regarding the build task process, additional data regarding the components handled by the task and, if available, data regarding the different artifacts generated by this task.",(0,a.mdx)("br",null),"\nThe returned object has the following attributes:"),(0,a.mdx)("ul",{parentName:"li"},(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"componentsResults")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"componentsResults: ComponentResult[]"),"\nAn array of objects, each containing an instance of an object handled the task and additional information regarding the process and the component itself.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"component")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"component: Component")," ",(0,a.mdx)("br",null),"\nAn instance of the component handled by the task (see the above task example).")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"metadata")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"metadata?: { [key: string]: Serializable }")," ",(0,a.mdx)("br",null),"\nComponent metadata generated during the build task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"errors")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"errors?: Array<Error | string>")," ",(0,a.mdx)("br",null),"\nBuild task errors. A task returning errors will abort the build pipeline and log the returned errors.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"warnings")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"warnings?: string[]")," ",(0,a.mdx)("br",null),"\nwarnings generated throughout the build task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"startTime")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"startTime?: number")," ",(0,a.mdx)("br",null),"\nA timestamp (in milliseconds) of when the task started")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"endTime")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"endTime?: number")," ",(0,a.mdx)("br",null),"\nA timestamp (in milliseconds) of when the task ended")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"artifacts")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"artifacts?: ArtifactDefinition[]")," ",(0,a.mdx)("br",null),"\nAn array of artifact definitions to generate after a successful build")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"name")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"name: string")," ",(0,a.mdx)("br",null),"\nThe name of the artifact. ",(0,a.mdx)("br",null),"\nFor example, a project might utilize two different artifacts for the same typescript compiler, one that generates ES5 files and another for ES6. This prop helps to distinguish between the two.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"generatedBy")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"generatedBy?: string;")," ",(0,a.mdx)("br",null),"\nId of the component that generated this artifact.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"description")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"description?: string")," ",(0,a.mdx)("br",null),"\nA description of the artifact. ",(0,a.mdx)("br",null))),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"globPatterns")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"globPatterns: string[]")," ",(0,a.mdx)("br",null),"\nGlob patterns of files to include upon artifact creation. Minimatch is used to match the patterns. ",(0,a.mdx)("br",null),"\nFor example, ",(0,a.mdx)("inlineCode",{parentName:"p"},"['*.ts', '!foo.ts']")," matches all ts files but ignores ",(0,a.mdx)("inlineCode",{parentName:"p"},"foo.ts"),".")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"rootDir")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"rootDir?: string")," ",(0,a.mdx)("br",null),"\nDefines the root directory of the artifacts in the capsule file system. The rootDir must be unique for every artifact, otherwise data might be overridden.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"dirPrefix")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"dirPrefix?: string")," ",(0,a.mdx)("br",null),"\nAdds a directory prefix for all artifact files.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"context")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"context?: 'component' | 'env'")," ",(0,a.mdx)("br",null),"\nDetermine the context of the artifact. The default artifact context is ",(0,a.mdx)("inlineCode",{parentName:"p"},"component"),". ",(0,a.mdx)("inlineCode",{parentName:"p"},"env"),' is useful when the same file is generated for all components, for example, a "preview" task may create the same webpack file for all components of that env.')),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"storageResolver")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"storageResolver?: string")," ",(0,a.mdx)("br",null),"\nUsed to replace the location of the stored artifacts. The default resolver persists artifacts on scope (that's not recommended for large files).")))))),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"preBuild")," (advanced) ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"preBuild?(context: BuildContext): Promise<void>")," ",(0,a.mdx)("br",null),"\nRuns before the build pipeline has started. This method should only be used when preparations are needed to be done on all environments before the build starts.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"postBuild")," (advanced) ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>")," ",(0,a.mdx)("br",null),"\nRuns after the dependencies were completed for all environments."))))}u.__bit_component=i,u.isMDXComponent=!0},494:(e,n,t)=>{Object.defineProperty(n,"M",{enumerable:!0,get:function(){return i.default}});var i=a(t(54200));function a(e){return e&&e.__esModule?e:{default:e}}a.__bit_component={id:"teambit.pipelines/aspect-docs/builder@0.0.168",homepage:"https://bit.cloud/teambit/pipelines/aspect-docs/builder",exported:!0}},12945:(e,n,t)=>{var i={id:"teambit.pipelines/builder@1.0.425",homepage:"https://bit.cloud/teambit/pipelines/builder",exported:!0};function a(){const e=r(t(41594));return a=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,a.__bit_component=i,r.__bit_component=i;const o=()=>a().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},a().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/builder.svg"}));o.__bit_component=i,n.Logo=o},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},n={};function t(i){var a=n[i];if(void 0!==a)return a.exports;var r=n[i]={exports:{}};return e[i](r,r.exports,t),r.exports}t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};t.r(i),t.d(i,{compositions:()=>h,compositions_metadata:()=>b,overview:()=>x});var a={};t.r(a),t.d(a,{default:()=>c});var r=t(12945),o=(t(41594),t(5016));const l=TeambitMdxUiMdxScopeContext;var s=t(494),d=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},p.apply(null,arguments)}var m={},u="wrapper";function c(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,i,a=function(e,n){if(null==e)return{};var t={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;t[i]=e[i]}return t}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)t=r[i],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,d);return(0,o.mdx)(u,p({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(l.MDXScopeProvider,{components:{Builder:s.M},mdxType:"MDXScopeProvider"},(0,o.mdx)(s.M,{mdxType:"Builder"})))}c.isMDXComponent=!0;const h=[r],x=[a],b={compositions:[{displayName:"Logo",identifier:"Logo"}]};return i})()));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["teambit.pipelines/builder-preview"]=n():e["teambit.pipelines/builder-preview"]=n()}(self,(()=>(()=>{"use strict";var e={5009:(e,n,t)=>{var i={id:"teambit.pipelines/aspect-docs/builder@0.0.169",homepage:"https://bit.cloud/teambit/pipelines/aspect-docs/builder",exported:!0};Object.defineProperty(n,"__esModule",{value:!0}),n.default=u,o(t(1594));var a=t(5016),r=["components"];function o(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},l.apply(null,arguments)}function s(e,n){if(null==e)return{};var t,i,a=d(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)t=r[i],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function d(e,n){if(null==e)return{};var t={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;t[i]=e[i]}return t}o.__bit_component=i,l.__bit_component=i,s.__bit_component=i,d.__bit_component=i;var p={},m="wrapper";function u(e){var n=e.components,t=s(e,r);return(0,a.mdx)(m,l({},p,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)("h2",null,"Background"),(0,a.mdx)("p",null,"Bit's build process is an extensible CI for independent components. It validates a component is not dependent on its context (the workspace), tests it, and generates all artifacts necessary for it to be viewed and consumed as an independent module (its distributable code, bundled preview, etc.)."),(0,a.mdx)("p",null,"The Build Pipeline is an Environment Service responsible for sequencing and executing a component's Build Tasks. As mentioned earlier, these tasks are performed on a component only after it's been isolated from the rest of the workspace."),(0,a.mdx)("p",null,"A component's default series of Build Tasks is composed of tasks set by Bit and by its environment."),(0,a.mdx)("h2",null,"Isolated builds"),(0,a.mdx)("p",null,"Components authored in a Bit workspace are created to be completely portable, and thus independent. To address that, the build process starts by creating a component 'capsule' which is an isolated instance of a component, generated in a separate directory in your filesystem."),(0,a.mdx)("p",null,'As part of the capsule creation, all packages listed as dependencies of that component will be installed. This step is necessary to validate there are no dependency-graph issues (a component that is not totally isolated will be able to use packages installed in parent directories in your workspace, by other components. This will translate into a "false positive" result when testing for dependency-graph issues in a non-isolated location).'),(0,a.mdx)("h2",null,"Incremental builds"),(0,a.mdx)("p",null,'When a component "goes through" the build pipeline, all of its dependencies are built as well. If a dependency has not changed since its last build, the build process will use its artifacts from the previous build (and will not process it again). This optimization to the build process supplements the "innate optimization" that naturally comes from developing (and building) independent components instead of a single monolithic codebase.'),(0,a.mdx)("h2",null,"Environment-specific builds"),(0,a.mdx)("p",null,"Each Bit environment determines its own build pipeline. That means, a single workspace that uses multiple environments will run a different set of build tasks on different components depending on their associated environment. This is another Bit feature that enables seamless transitioning between different development environments, all in the same workspace. It also makes it much easier to integrate the Build Pipeline in your (remote) CI, as it only requires executing the build step - all other per-component build configurations are already set by the various environments being used."),(0,a.mdx)("p",null,"Since environments are extensible, so are the build pipelines configured by them."),(0,a.mdx)("h2",null,"Build task"),(0,a.mdx)("p",null,"An example of a build-task is ",(0,a.mdx)("inlineCode",{parentName:"p"},"compile"),", it's written in the compiler aspect and is running on each one of the capsules created by the build process. build-tasks in many cases generate artifacts, in this case, the compiler generates ",(0,a.mdx)("inlineCode",{parentName:"p"},"dists")," files and write them on the isolated capsules. There artifacts files are used later for example when creating packages."),(0,a.mdx)("h2",null,"Pipelines"),(0,a.mdx)("p",null,"There are three pipelines: ",(0,a.mdx)("inlineCode",{parentName:"p"},"build"),", ",(0,a.mdx)("inlineCode",{parentName:"p"},"tag")," and ",(0,a.mdx)("inlineCode",{parentName:"p"},"snap"),"."),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit build")," runs the build pipeline."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit tag")," runs the build pipeline and then the tag pipeline."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit snap")," runs the build pipeline and then the snap pipeline.")),(0,a.mdx)("h2",null,"List Build Tasks"),(0,a.mdx)("p",null,"To get a list of all the tasks that will be running per pipeline on a specific component, run ",(0,a.mdx)("inlineCode",{parentName:"p"},"bit build --list-tasks <id>"),".\nHere is an example of the relevant part from the output:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre"},"➜ bit build --list-tasks ui/tooltip\nTasks List\nid: teambit.design/ui/tooltip@0.0.347\nenvId: teambit.react/react\n\nBuild Pipeline Tasks:\nteambit.harmony/aspect:CoreExporter\nteambit.compilation/compiler:TSCompiler\nteambit.defender/tester:TestComponents\nteambit.pkg/pkg:PreparePackages\nteambit.pkg/pkg:PublishDryRun\nteambit.preview/preview:GeneratePreview\n\nTag Pipeline Tasks:\nteambit.harmony/application:build_ui_application\nteambit.pkg/pkg:PublishComponents\n\nSnap Pipeline Tasks:\n<N/A>\n")),(0,a.mdx)("h2",null,"Implementing Build Tasks"),(0,a.mdx)("p",null,"The ",(0,a.mdx)("inlineCode",{parentName:"p"},"BuildTask")," interface is a good start to understand how to implement a new build-task.\nWhen writing a build task, the ",(0,a.mdx)("inlineCode",{parentName:"p"},"Network")," object is passed and it includes the seeders capsules, as well as the entire graph including the dependencies.\nKeep in mind that the entire graph may contain components from other envs."),(0,a.mdx)("p",null,"Some tasks, such as, compiling in typescript and bundling with Webpack, need the entire graph.\nOthers, such as, Babel, need only the seeders. However, normally, the bundling is running after the compilation and it expects to have the dependencies compiled, so you might need the entire graph regardless."),(0,a.mdx)("h2",null,"Adding Tasks to a pipeline"),(0,a.mdx)("p",null,"There are two ways of adding tasks to the build pipeline."),(0,a.mdx)("ol",null,(0,a.mdx)("li",{parentName:"ol"},(0,a.mdx)("inlineCode",{parentName:"li"},"getBuildPipe()")," method of the env. (or ",(0,a.mdx)("inlineCode",{parentName:"li"},"getTagPipe()")," and ",(0,a.mdx)("inlineCode",{parentName:"li"},"getSnapPipe()"),")"),(0,a.mdx)("li",{parentName:"ol"},"registering to the slot via ",(0,a.mdx)("inlineCode",{parentName:"li"},"builder.registerBuildTask()"),". (or ",(0,a.mdx)("inlineCode",{parentName:"li"},"registerTagTask()")," and ",(0,a.mdx)("inlineCode",{parentName:"li"},"registerSnapTask()"),")")),(0,a.mdx)("p",null,"in the option #1, it's possible to determine the order. e.g. ",(0,a.mdx)("inlineCode",{parentName:"p"},"getBuildPipe() { return [taskA, taskB, taskC]; }"),"\nin the option #2, the register happens once the extension is loaded, so there is no way to put\none task before/after another task as of now."),(0,a.mdx)("h2",null,"Sequencing the build tasks"),(0,a.mdx)("p",null,"The Build Pipeline takes into consideration the following factors when deciding the order of which to execute each task:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("strong",{parentName:"li"},"Location"),": A task can be executed either at the start or end of the build pipeline. This can be explicitly configured by the task itself."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("strong",{parentName:"li"},"Dependencies"),": A task can depend on other tasks. That means, the dependencies must be completed successfully for all envs before this task starts. The dependencies are applicable inside a location and not across locations. This is configured by the task itself."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("strong",{parentName:"li"},"An environment's list of build tasks"),": This is the array of tasks as it is defined by an environment")),(0,a.mdx)("h2",null,"Executing the pipelines"),(0,a.mdx)("p",null,"Commands that trigger the build pipeline:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit build")," - runs the build pipeline on your local machine, for the entire workspace. The output data will not persist. - That is most often used for testing and debugging the build process."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit tag")," - runs the tag pipeline in addition to the build pipeline, before creating a new component release version. The output data will persist."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"bit snap")," - runs the snap pipeline in addition to the build pipeline. The output data will persist.")),(0,a.mdx)("p",null,"Build pipelines are determined by the environments in use. That means, in order to override the default pipeline, we need to create a new environment extension or modify an existing one."),(0,a.mdx)("p",null,"The example task below, shown being used by a customized environment, prints out the component name of every component handled by it. In addition to that, the task returns the component name as custom metadata to be logged and/or stored in the component tagged version. ",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/teambit/harmony-build-examples"},"See a demo project here"),"."),(0,a.mdx)("blockquote",null,(0,a.mdx)("p",{parentName:"blockquote"},"Information returned by a build task will only persist if the build-pipeline was triggered by the 'hard-tag' command (",(0,a.mdx)("inlineCode",{parentName:"p"},"bit tag <component-id>"),").")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="print-cmp-name-task.ts"',title:'"print-cmp-name-task.ts"'},"import { BuildTask, BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\n\n// A task is an implementation of 'BuildTask' provided by the 'builder' aspect\nexport class PrintCmpNameTask implements BuildTask {\n // The constructor leaves these properties up to the hands of the environment using this task\n constructor(\n readonly aspectId: string,\n readonly name: string\n ) {}\n\n // This is where the task logic is placed. It will be executed by the build pipeline\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults: ComponentResult[] = [];\n\n // Go through every isolated component instance\n context.capsuleNetwork.seedersCapsules.forEach((capsule) => {\n console.log(`The current component name is: ${capsule.component.id.name}`);\n\n componentsResults.push({\n component: capsule.component,\n metadata: { customProp: capsule.component.id.name },\n });\n });\n return {\n // An array of component objects, enriched with additional data produced by the task\n componentsResults,\n };\n }\n}\n")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="customized-react.extension.ts"',title:'"customized-react.extension.ts"'},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { ReactAspect, ReactMain } from '@teambit/react';\n\n// Import the task\nimport { PrintCmpNameTask } from './print-cmp-name-task';\n\nexport class CustomReact {\n constructor(private react: ReactMain) {}\n\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n static async provider([envs, react]: [EnvsMain, ReactMain]) {\n // Get the environment's default build pipeline\n const reactPipe = react.env.getBuildPipe();\n\n // Add the custom task to the end of the build tasks sequence.\n // Provide the task with the component ID of the extension using it.\n // Provide the ask with a name.\n const tasks = [...reactPipe, new PrintCompTask('extensions/custom-react', 'PrintCmpNameTask')];\n\n // Create a new environment by merging these configurations with the env's default ones\n const customReactEnv = react.compose([react.overrideBuildPipe(tasks)]);\n\n // register the extension as an environment\n envs.registerEnv(customReactEnv);\n return new CustomReact(react);\n }\n}\n")),(0,a.mdx)("h2",null,"Positioning a build task in the pipeline"),(0,a.mdx)("p",null,"A build task is positioned in the build pipeline sequence either by overriding the entire ",(0,a.mdx)("em",{parentName:"p"},"customizable")," pipeline or, by registering it to a location in the pipeline using the designated builder slot."),(0,a.mdx)("h3",null,"Override the build pipeline sequence"),(0,a.mdx)("p",null,"This methodology leaves the task completely agnostic as to its position in the build pipeline. Instead, the task position is determined by the environment using the ",(0,a.mdx)("inlineCode",{parentName:"p"},"getBuildPipe")," Environment Handler."),(0,a.mdx)("p",null,"The example above shows the React environment ",(0,a.mdx)("inlineCode",{parentName:"p"},"overrideBuildPipe")," method being used to override its default pipeline. This method uses the ",(0,a.mdx)("inlineCode",{parentName:"p"},"getBuildPipe()")," Environment Handler, internally."),(0,a.mdx)("h3",null,"Append to the start or end of the pipeline, in relation to other tasks"),(0,a.mdx)("p",null,"This methodology places the task at the start or end of the build pipeline sequence, and lists all other tasks needed to run successfully before it is executed."),(0,a.mdx)("p",null,"Example:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="print-cmp-name-task.ts"',title:'"print-cmp-name-task.ts"'},"import { BuildTask, BuildContext, BuiltTaskResult, ComponentResult } from '@teambit/builder';\n\nexport class PrintCmpNameTask implements BuildTask {\n constructor(\n readonly aspectId: string,\n readonly name: string\n ) {}\n\n // Place the task at the end of the build pipeline\n readonly location = 'end';\n\n // Run this task only after the '@teambit/preview' task is completed successfully\n readonly dependencies = ['@teambit/preview'];\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const componentsResults: ComponentResult[] = [];\n context.capsuleNetwork.seedersCapsules.forEach((capsule) => {\n console.log(`The current component name is: ${capsule.component.id.name}`);\n\n componentsResults.push({\n component: capsule.component,\n metadata: { customProp: capsule.component.id.name },\n });\n });\n return {\n componentsResults,\n };\n }\n}\n")),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ts",metastring:'title="customized-react.extension.ts"',title:'"customized-react.extension.ts"'},"import { EnvsMain, EnvsAspect } from '@teambit/envs';\nimport { ReactAspect, ReactMain } from '@teambit/react';\nimport { BuilderMain } from '@teambit/builder';\n\n// Import the task (in reality, it should be an independent component)\nimport { PrintCmpNameTask } from './print-cmp-name-task';\n\nexport class CustomReact {\n constructor(private react: ReactMain) {}\n\n static dependencies: any = [EnvsAspect, ReactAspect];\n\n // Inject the builder\n static async provider([envs, react, builder]: [EnvsMain, ReactMain, BuilderMain]) {\n // Register this task using the registration slot, made available by the 'builder'.\n // Here, the environment has no say in the positioning of the task\n builder.registerBuildTasks([new ExampleTask('extensions/custom-react', 'PrintCmpNameTask')]);\n\n const customReactEnv = react.compose([]);\n\n envs.registerEnv(customReactEnv);\n return new CustomReact(react);\n }\n}\n")),(0,a.mdx)("h2",null,"A build task anatomy"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"aspectId")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"aspectId: string"),(0,a.mdx)("br",null),"\nThe component ID of the environment using this task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"name")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"name: string")," ",(0,a.mdx)("br",null),"\nA name for this task. Only alphanumerical characters are allowed. PascalCase should be used as a convention.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"location")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"location?: 'start' | 'end'")," ",(0,a.mdx)("br",null),"\nThe section of the build-pipeline to which to append this task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"dependencies")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"dependencies?: string[]")," ",(0,a.mdx)("br",null),"\nAn list of tasks that must be completed before this task gets executed. ",(0,a.mdx)("br",null),"\nFor example ",(0,a.mdx)("inlineCode",{parentName:"p"},"dependencies = ['@teambit/preview']"),".")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"execute")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"execute(context: BuildContext): Promise<BuiltTaskResult>")," ",(0,a.mdx)("br",null),"\nThe execute method is where all the task logic is placed."),(0,a.mdx)("ul",{parentName:"li"},(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"context")," (argument) ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"context: BuildContext")," ",(0,a.mdx)("br",null),"\nThe context of the build pipeline. Use this object (provided by the build pipeline) to get information regarding all components handled by the build pipeline. ",(0,a.mdx)("br",null),(0,a.mdx)("br",null),"\nFor example, ",(0,a.mdx)("inlineCode",{parentName:"p"},"context.capsuleNetwork.seedersCapsules")," are models representing isolated instances of components handled by the build pipeline. These isolated instances are independent projects, generated in your local filesystem (by the build pipeline).")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"return")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"Promise<BuiltTaskResult>")," ",(0,a.mdx)("br",null),"\nA ",(0,a.mdx)("inlineCode",{parentName:"p"},"context")," method returns an object with data regarding the build task process, additional data regarding the components handled by the task and, if available, data regarding the different artifacts generated by this task.",(0,a.mdx)("br",null),"\nThe returned object has the following attributes:"),(0,a.mdx)("ul",{parentName:"li"},(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"componentsResults")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"componentsResults: ComponentResult[]"),"\nAn array of objects, each containing an instance of an object handled the task and additional information regarding the process and the component itself.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"component")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"component: Component")," ",(0,a.mdx)("br",null),"\nAn instance of the component handled by the task (see the above task example).")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"metadata")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"metadata?: { [key: string]: Serializable }")," ",(0,a.mdx)("br",null),"\nComponent metadata generated during the build task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"errors")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"errors?: Array<Error | string>")," ",(0,a.mdx)("br",null),"\nBuild task errors. A task returning errors will abort the build pipeline and log the returned errors.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"warnings")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"warnings?: string[]")," ",(0,a.mdx)("br",null),"\nwarnings generated throughout the build task.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"startTime")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"startTime?: number")," ",(0,a.mdx)("br",null),"\nA timestamp (in milliseconds) of when the task started")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"endTime")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"endTime?: number")," ",(0,a.mdx)("br",null),"\nA timestamp (in milliseconds) of when the task ended")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"artifacts")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"artifacts?: ArtifactDefinition[]")," ",(0,a.mdx)("br",null),"\nAn array of artifact definitions to generate after a successful build")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"name")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"name: string")," ",(0,a.mdx)("br",null),"\nThe name of the artifact. ",(0,a.mdx)("br",null),"\nFor example, a project might utilize two different artifacts for the same typescript compiler, one that generates ES5 files and another for ES6. This prop helps to distinguish between the two.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"generatedBy")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"generatedBy?: string;")," ",(0,a.mdx)("br",null),"\nId of the component that generated this artifact.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"description")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"description?: string")," ",(0,a.mdx)("br",null),"\nA description of the artifact. ",(0,a.mdx)("br",null))),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"globPatterns")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"globPatterns: string[]")," ",(0,a.mdx)("br",null),"\nGlob patterns of files to include upon artifact creation. Minimatch is used to match the patterns. ",(0,a.mdx)("br",null),"\nFor example, ",(0,a.mdx)("inlineCode",{parentName:"p"},"['*.ts', '!foo.ts']")," matches all ts files but ignores ",(0,a.mdx)("inlineCode",{parentName:"p"},"foo.ts"),".")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"rootDir")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"rootDir?: string")," ",(0,a.mdx)("br",null),"\nDefines the root directory of the artifacts in the capsule file system. The rootDir must be unique for every artifact, otherwise data might be overridden.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"dirPrefix")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"dirPrefix?: string")," ",(0,a.mdx)("br",null),"\nAdds a directory prefix for all artifact files.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"context")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"context?: 'component' | 'env'")," ",(0,a.mdx)("br",null),"\nDetermine the context of the artifact. The default artifact context is ",(0,a.mdx)("inlineCode",{parentName:"p"},"component"),". ",(0,a.mdx)("inlineCode",{parentName:"p"},"env"),' is useful when the same file is generated for all components, for example, a "preview" task may create the same webpack file for all components of that env.')),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"storageResolver")," ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"storageResolver?: string")," ",(0,a.mdx)("br",null),"\nUsed to replace the location of the stored artifacts. The default resolver persists artifacts on scope (that's not recommended for large files).")))))),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"preBuild")," (advanced) ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"preBuild?(context: BuildContext): Promise<void>")," ",(0,a.mdx)("br",null),"\nRuns before the build pipeline has started. This method should only be used when preparations are needed to be done on all environments before the build starts.")),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("p",{parentName:"li"},(0,a.mdx)("strong",{parentName:"p"},"postBuild")," (advanced) ",(0,a.mdx)("br",null),"\n",(0,a.mdx)("inlineCode",{parentName:"p"},"postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>")," ",(0,a.mdx)("br",null),"\nRuns after the dependencies were completed for all environments."))))}u.__bit_component=i,u.isMDXComponent=!0},4603:(e,n,t)=>{Object.defineProperty(n,"M",{enumerable:!0,get:function(){return i.default}});var i=a(t(5009));function a(e){return e&&e.__esModule?e:{default:e}}a.__bit_component={id:"teambit.pipelines/aspect-docs/builder@0.0.169",homepage:"https://bit.cloud/teambit/pipelines/aspect-docs/builder",exported:!0}},403:(e,n,t)=>{var i={id:"teambit.pipelines/builder@1.0.427",homepage:"https://bit.cloud/teambit/pipelines/builder",exported:!0};function a(){const e=r(t(1594));return a=function(){return e},e}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.Logo=void 0,a.__bit_component=i,r.__bit_component=i;const o=()=>a().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},a().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/builder.svg"}));o.__bit_component=i,n.Logo=o},5016:e=>{e.exports=MdxJsReact},1594:e=>{e.exports=React}},n={};function t(i){var a=n[i];if(void 0!==a)return a.exports;var r=n[i]={exports:{}};return e[i](r,r.exports,t),r.exports}t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};t.r(i),t.d(i,{compositions:()=>h,compositions_metadata:()=>b,overview:()=>x});var a={};t.r(a),t.d(a,{default:()=>c});var r=t(403),o=(t(1594),t(5016));const l=TeambitMdxUiMdxScopeContext;var s=t(4603),d=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},p.apply(null,arguments)}var m={},u="wrapper";function c(e){var n=e.components,t=function(e,n){if(null==e)return{};var t,i,a=function(e,n){if(null==e)return{};var t={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;t[i]=e[i]}return t}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)t=r[i],n.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}(e,d);return(0,o.mdx)(u,p({},m,t,{components:n,mdxType:"MDXLayout"}),(0,o.mdx)(l.MDXScopeProvider,{components:{Builder:s.M},mdxType:"MDXScopeProvider"},(0,o.mdx)(s.M,{mdxType:"Builder"})))}c.isMDXComponent=!0;const h=[r],x=[a],b={compositions:[{displayName:"Logo",identifier:"Logo"}]};return i})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"componentId": {
|
|
34
34
|
"scope": "teambit.component",
|
|
35
35
|
"name": "sources",
|
|
36
|
-
"version": "0.0.
|
|
36
|
+
"version": "0.0.34"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
},
|
|
@@ -1146,7 +1146,7 @@
|
|
|
1146
1146
|
"_legacy": {
|
|
1147
1147
|
"scope": "teambit.pipelines",
|
|
1148
1148
|
"name": "builder",
|
|
1149
|
-
"version": "1.0.
|
|
1149
|
+
"version": "1.0.427"
|
|
1150
1150
|
},
|
|
1151
1151
|
"_scope": "teambit.pipelines"
|
|
1152
1152
|
}
|
|
@@ -2555,7 +2555,7 @@
|
|
|
2555
2555
|
"componentId": {
|
|
2556
2556
|
"scope": "teambit.component",
|
|
2557
2557
|
"name": "sources",
|
|
2558
|
-
"version": "0.0.
|
|
2558
|
+
"version": "0.0.34"
|
|
2559
2559
|
}
|
|
2560
2560
|
}
|
|
2561
2561
|
}
|
|
@@ -2667,7 +2667,7 @@
|
|
|
2667
2667
|
"componentId": {
|
|
2668
2668
|
"scope": "teambit.component",
|
|
2669
2669
|
"name": "sources",
|
|
2670
|
-
"version": "0.0.
|
|
2670
|
+
"version": "0.0.34"
|
|
2671
2671
|
}
|
|
2672
2672
|
}
|
|
2673
2673
|
}
|
|
@@ -2779,7 +2779,7 @@
|
|
|
2779
2779
|
"componentId": {
|
|
2780
2780
|
"scope": "teambit.component",
|
|
2781
2781
|
"name": "sources",
|
|
2782
|
-
"version": "0.0.
|
|
2782
|
+
"version": "0.0.34"
|
|
2783
2783
|
}
|
|
2784
2784
|
}
|
|
2785
2785
|
}
|
|
@@ -4633,7 +4633,7 @@
|
|
|
4633
4633
|
"componentId": {
|
|
4634
4634
|
"scope": "teambit.component",
|
|
4635
4635
|
"name": "sources",
|
|
4636
|
-
"version": "0.0.
|
|
4636
|
+
"version": "0.0.34"
|
|
4637
4637
|
}
|
|
4638
4638
|
}
|
|
4639
4639
|
},
|
|
@@ -6134,7 +6134,7 @@
|
|
|
6134
6134
|
"componentId": {
|
|
6135
6135
|
"scope": "teambit.component",
|
|
6136
6136
|
"name": "sources",
|
|
6137
|
-
"version": "0.0.
|
|
6137
|
+
"version": "0.0.34"
|
|
6138
6138
|
}
|
|
6139
6139
|
},
|
|
6140
6140
|
"isOptional": false,
|
|
@@ -6832,7 +6832,7 @@
|
|
|
6832
6832
|
"componentId": {
|
|
6833
6833
|
"scope": "teambit.component",
|
|
6834
6834
|
"name": "sources",
|
|
6835
|
-
"version": "0.0.
|
|
6835
|
+
"version": "0.0.34"
|
|
6836
6836
|
}
|
|
6837
6837
|
},
|
|
6838
6838
|
"isOptional": false,
|
|
@@ -7099,7 +7099,7 @@
|
|
|
7099
7099
|
"componentId": {
|
|
7100
7100
|
"scope": "teambit.component",
|
|
7101
7101
|
"name": "sources",
|
|
7102
|
-
"version": "0.0.
|
|
7102
|
+
"version": "0.0.34"
|
|
7103
7103
|
}
|
|
7104
7104
|
},
|
|
7105
7105
|
"modifiers": []
|
|
@@ -7133,7 +7133,7 @@
|
|
|
7133
7133
|
"componentId": {
|
|
7134
7134
|
"scope": "teambit.component",
|
|
7135
7135
|
"name": "sources",
|
|
7136
|
-
"version": "0.0.
|
|
7136
|
+
"version": "0.0.34"
|
|
7137
7137
|
}
|
|
7138
7138
|
},
|
|
7139
7139
|
"isOptional": false,
|
|
@@ -7560,7 +7560,7 @@
|
|
|
7560
7560
|
"componentId": {
|
|
7561
7561
|
"scope": "teambit.component",
|
|
7562
7562
|
"name": "sources",
|
|
7563
|
-
"version": "0.0.
|
|
7563
|
+
"version": "0.0.34"
|
|
7564
7564
|
}
|
|
7565
7565
|
}
|
|
7566
7566
|
},
|
|
@@ -7671,7 +7671,7 @@
|
|
|
7671
7671
|
"componentId": {
|
|
7672
7672
|
"scope": "teambit.component",
|
|
7673
7673
|
"name": "sources",
|
|
7674
|
-
"version": "0.0.
|
|
7674
|
+
"version": "0.0.34"
|
|
7675
7675
|
}
|
|
7676
7676
|
}
|
|
7677
7677
|
}
|
|
@@ -7776,7 +7776,7 @@
|
|
|
7776
7776
|
"componentId": {
|
|
7777
7777
|
"scope": "teambit.component",
|
|
7778
7778
|
"name": "sources",
|
|
7779
|
-
"version": "0.0.
|
|
7779
|
+
"version": "0.0.34"
|
|
7780
7780
|
}
|
|
7781
7781
|
}
|
|
7782
7782
|
},
|
|
@@ -7899,7 +7899,7 @@
|
|
|
7899
7899
|
"_legacy": {
|
|
7900
7900
|
"scope": "teambit.pipelines",
|
|
7901
7901
|
"name": "builder",
|
|
7902
|
-
"version": "1.0.
|
|
7902
|
+
"version": "1.0.427"
|
|
7903
7903
|
},
|
|
7904
7904
|
"_scope": "teambit.pipelines"
|
|
7905
7905
|
}
|
|
@@ -10226,7 +10226,7 @@
|
|
|
10226
10226
|
"_legacy": {
|
|
10227
10227
|
"scope": "teambit.pipelines",
|
|
10228
10228
|
"name": "builder",
|
|
10229
|
-
"version": "1.0.
|
|
10229
|
+
"version": "1.0.427"
|
|
10230
10230
|
},
|
|
10231
10231
|
"_scope": "teambit.pipelines"
|
|
10232
10232
|
}
|
|
@@ -11481,7 +11481,7 @@
|
|
|
11481
11481
|
"componentId": {
|
|
11482
11482
|
"scope": "teambit.component",
|
|
11483
11483
|
"name": "sources",
|
|
11484
|
-
"version": "0.0.
|
|
11484
|
+
"version": "0.0.34"
|
|
11485
11485
|
}
|
|
11486
11486
|
}
|
|
11487
11487
|
},
|
|
@@ -12396,7 +12396,7 @@
|
|
|
12396
12396
|
"componentId": {
|
|
12397
12397
|
"scope": "teambit.component",
|
|
12398
12398
|
"name": "sources",
|
|
12399
|
-
"version": "0.0.
|
|
12399
|
+
"version": "0.0.34"
|
|
12400
12400
|
}
|
|
12401
12401
|
}
|
|
12402
12402
|
}
|
|
@@ -12508,7 +12508,7 @@
|
|
|
12508
12508
|
"componentId": {
|
|
12509
12509
|
"scope": "teambit.component",
|
|
12510
12510
|
"name": "sources",
|
|
12511
|
-
"version": "0.0.
|
|
12511
|
+
"version": "0.0.34"
|
|
12512
12512
|
}
|
|
12513
12513
|
}
|
|
12514
12514
|
}
|
|
@@ -12620,7 +12620,7 @@
|
|
|
12620
12620
|
"componentId": {
|
|
12621
12621
|
"scope": "teambit.component",
|
|
12622
12622
|
"name": "sources",
|
|
12623
|
-
"version": "0.0.
|
|
12623
|
+
"version": "0.0.34"
|
|
12624
12624
|
}
|
|
12625
12625
|
}
|
|
12626
12626
|
}
|
|
@@ -15294,7 +15294,7 @@
|
|
|
15294
15294
|
"componentId": {
|
|
15295
15295
|
"scope": "teambit.component",
|
|
15296
15296
|
"name": "sources",
|
|
15297
|
-
"version": "0.0.
|
|
15297
|
+
"version": "0.0.34"
|
|
15298
15298
|
}
|
|
15299
15299
|
},
|
|
15300
15300
|
"isOptional": false,
|
|
@@ -15562,7 +15562,7 @@
|
|
|
15562
15562
|
"componentId": {
|
|
15563
15563
|
"scope": "teambit.component",
|
|
15564
15564
|
"name": "sources",
|
|
15565
|
-
"version": "0.0.
|
|
15565
|
+
"version": "0.0.34"
|
|
15566
15566
|
}
|
|
15567
15567
|
},
|
|
15568
15568
|
"isOptional": false,
|
|
@@ -15829,7 +15829,7 @@
|
|
|
15829
15829
|
"componentId": {
|
|
15830
15830
|
"scope": "teambit.component",
|
|
15831
15831
|
"name": "sources",
|
|
15832
|
-
"version": "0.0.
|
|
15832
|
+
"version": "0.0.34"
|
|
15833
15833
|
}
|
|
15834
15834
|
},
|
|
15835
15835
|
"modifiers": []
|
|
@@ -15863,7 +15863,7 @@
|
|
|
15863
15863
|
"componentId": {
|
|
15864
15864
|
"scope": "teambit.component",
|
|
15865
15865
|
"name": "sources",
|
|
15866
|
-
"version": "0.0.
|
|
15866
|
+
"version": "0.0.34"
|
|
15867
15867
|
}
|
|
15868
15868
|
},
|
|
15869
15869
|
"isOptional": false,
|
|
@@ -16834,7 +16834,7 @@
|
|
|
16834
16834
|
"componentId": {
|
|
16835
16835
|
"scope": "teambit.component",
|
|
16836
16836
|
"name": "sources",
|
|
16837
|
-
"version": "0.0.
|
|
16837
|
+
"version": "0.0.34"
|
|
16838
16838
|
}
|
|
16839
16839
|
}
|
|
16840
16840
|
},
|
|
@@ -16945,7 +16945,7 @@
|
|
|
16945
16945
|
"componentId": {
|
|
16946
16946
|
"scope": "teambit.component",
|
|
16947
16947
|
"name": "sources",
|
|
16948
|
-
"version": "0.0.
|
|
16948
|
+
"version": "0.0.34"
|
|
16949
16949
|
}
|
|
16950
16950
|
}
|
|
16951
16951
|
}
|
|
@@ -17050,7 +17050,7 @@
|
|
|
17050
17050
|
"componentId": {
|
|
17051
17051
|
"scope": "teambit.component",
|
|
17052
17052
|
"name": "sources",
|
|
17053
|
-
"version": "0.0.
|
|
17053
|
+
"version": "0.0.34"
|
|
17054
17054
|
}
|
|
17055
17055
|
}
|
|
17056
17056
|
},
|
|
@@ -17173,7 +17173,7 @@
|
|
|
17173
17173
|
"_legacy": {
|
|
17174
17174
|
"scope": "teambit.pipelines",
|
|
17175
17175
|
"name": "builder",
|
|
17176
|
-
"version": "1.0.
|
|
17176
|
+
"version": "1.0.427"
|
|
17177
17177
|
},
|
|
17178
17178
|
"_scope": "teambit.pipelines"
|
|
17179
17179
|
}
|
|
@@ -17459,7 +17459,7 @@
|
|
|
17459
17459
|
"componentId": {
|
|
17460
17460
|
"scope": "teambit.pipelines",
|
|
17461
17461
|
"name": "builder",
|
|
17462
|
-
"version": "1.0.
|
|
17462
|
+
"version": "1.0.427"
|
|
17463
17463
|
},
|
|
17464
17464
|
"taggedModuleExports": []
|
|
17465
17465
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_constants","_artifactExtractor","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","INDENT_TITLE","repeat","INDENT_SUB_TITLE","INDENT_FILES","ArtifactsCmd","constructor","builder","componentMain","name","description","COMPONENT_PATTERN_HELP","report","componentPattern","artifactsOpts","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","keys","footer","outDir","exports"],"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 { ComponentMain } from '@teambit/component';\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 component 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
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_constants","_artifactExtractor","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","INDENT_TITLE","repeat","INDENT_SUB_TITLE","INDENT_FILES","ArtifactsCmd","constructor","builder","componentMain","name","description","COMPONENT_PATTERN_HELP","report","componentPattern","artifactsOpts","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","keys","footer","outDir","exports"],"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 { ComponentMain } from '@teambit/component';\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 component 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(\n private builder: BuilderMain,\n private componentMain: ComponentMain\n ) {}\n\n async report([componentPattern]: [string], artifactsOpts: ArtifactsOpts): Promise<string> {\n const artifactExtractor = new ArtifactExtractor(this.componentMain, 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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAA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AAQ,KAAKH,QAAQ,CAACI,YAAY,GAAG,CAAC;QAC/E,MAAMC,KAAK,GAAGL,QAAQ,CAACK,KAAK,CAACN,GAAG,CAAEO,CAAC,IAAK9B,YAAY,GAAGoB,gBAAK,CAACW,GAAG,CAACD,CAAC,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;QAC/E,OAAO,GAAGjC,gBAAgB,GAAG0B,QAAQ,KAAKI,KAAK,EAAE;MACnD,CAAC,CAAC,CACDG,IAAI,CAAC,IAAI,CAAC;MACb,OAAO,GAAGnC,YAAY,GAAGsB,KAAK,KAAKG,eAAe,EAAE;IACtD,CAAC;IACD,MAAMW,YAAY,GAAIC,MAA8B,IAAK;MACvD,MAAMC,KAAK,GAAGf,gBAAK,CAACgB,IAAI,CAACF,MAAM,CAACG,EAAE,CAACC,QAAQ,CAAC,CAAC,CAAC;MAC9C,MAAMC,SAAS,GAAGxD,MAAM,CAACyD,IAAI,CAACN,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,OAAO,GAAGG,KAAK,KAAKI,SAAS,EAAE;IACjC,CAAC;IACD,MAAME,MAAM,GAAG/B,aAAa,CAACgC,MAAM,GAC/BtB,gBAAK,CAACC,KAAK,CAAC,gEAAgE,CAAC,GAC7E,EAAE;IACN,OAAOP,OAAO,CAACS,GAAG,CAACU,YAAY,CAAC,CAACD,IAAI,CAAC,MAAM,CAAC,GAAGS,MAAM;EACxD;AACF;AAACE,OAAA,CAAA1C,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ExtensionArtifact","constructor","files","extensionDescriptor","toObject","exports"],"sources":["extension-artifact.ts"],"sourcesContent":["import type { AspectDescriptor } from '@teambit/aspect-loader';\nimport { AbstractVinyl } from '@teambit/component.sources';\n\nexport class ExtensionArtifact {\n constructor(readonly files: AbstractVinyl[]
|
|
1
|
+
{"version":3,"names":["ExtensionArtifact","constructor","files","extensionDescriptor","toObject","exports"],"sources":["extension-artifact.ts"],"sourcesContent":["import type { AspectDescriptor } from '@teambit/aspect-loader';\nimport { AbstractVinyl } from '@teambit/component.sources';\n\nexport class ExtensionArtifact {\n constructor(\n readonly files: AbstractVinyl[],\n readonly extensionDescriptor: AspectDescriptor\n ) {}\n\n toObject() {\n return {\n extensionDescriptor: this.extensionDescriptor,\n };\n }\n}\n"],"mappings":";;;;;;AAGO,MAAMA,iBAAiB,CAAC;EAC7BC,WAAWA,CACAC,KAAsB,EACtBC,mBAAqC,EAC9C;IAAA,KAFSD,KAAsB,GAAtBA,KAAsB;IAAA,KACtBC,mBAAqC,GAArCA,mBAAqC;EAC7C;EAEHC,QAAQA,CAAA,EAAG;IACT,OAAO;MACLD,mBAAmB,EAAE,IAAI,CAACA;IAC5B,CAAC;EACH;AACF;AAACE,OAAA,CAAAL,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_component","data","require","_lodash","_artifact","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BuildPipelineResultList","constructor","tasksResults","components","artifactListsMap","getFlattenedArtifactListsMapFromAllTasks","artifactListsMaps","flatMap","artifacts","ComponentMap","as","component","artifactListMap","artifactList","getValueByComponentId","id","ArtifactList","fromArray","getMetadataFromTaskResults","componentId","compResults","reduce","acc","current","foundComponent","componentsResults","find","c","isEqual","taskId","task","aspectId","metadata","mergeDataIfPossible","getPipelineReportOfComponent","map","taskResults","pipelineReport","taskName","name","taskDescription","description","errors","warnings","startTime","endTime","compact","getDataOfComponent","tasksData","getArtifactsDataOfComponent","toObject","currentData","existingData","isEmpty","Error","Array","isArray","exports"],"sources":["build-pipeline-result-list.ts"],"sourcesContent":["import { ComponentID, ComponentMap, Component } from '@teambit/component';\nimport { isEmpty, compact } from 'lodash';\nimport type { ArtifactObject } from '@teambit/component.sources';\nimport { Artifact, ArtifactList } from './artifact';\nimport { TaskResults } from './build-pipe';\nimport { TaskMetadata } from './types';\n\nexport type PipelineReport = {\n taskId: string; // task aspect-id\n taskName: string;\n taskDescription?: string;\n startTime?: number;\n endTime?: number;\n errors?: Array<Error | string>;\n warnings?: string[];\n};\n\nexport type AspectData = {\n aspectId: string;\n data: TaskMetadata;\n};\n\n/**\n * Helper to get the data and artifacts from the TasksResultsList before saving during the tag\n */\nexport class BuildPipelineResultList {\n private artifactListsMap: ComponentMap<ArtifactList<Artifact>>;\n constructor(private tasksResults: TaskResults[]
|
|
1
|
+
{"version":3,"names":["_component","data","require","_lodash","_artifact","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BuildPipelineResultList","constructor","tasksResults","components","artifactListsMap","getFlattenedArtifactListsMapFromAllTasks","artifactListsMaps","flatMap","artifacts","ComponentMap","as","component","artifactListMap","artifactList","getValueByComponentId","id","ArtifactList","fromArray","getMetadataFromTaskResults","componentId","compResults","reduce","acc","current","foundComponent","componentsResults","find","c","isEqual","taskId","task","aspectId","metadata","mergeDataIfPossible","getPipelineReportOfComponent","map","taskResults","pipelineReport","taskName","name","taskDescription","description","errors","warnings","startTime","endTime","compact","getDataOfComponent","tasksData","getArtifactsDataOfComponent","toObject","currentData","existingData","isEmpty","Error","Array","isArray","exports"],"sources":["build-pipeline-result-list.ts"],"sourcesContent":["import { ComponentID, ComponentMap, Component } from '@teambit/component';\nimport { isEmpty, compact } from 'lodash';\nimport type { ArtifactObject } from '@teambit/component.sources';\nimport { Artifact, ArtifactList } from './artifact';\nimport { TaskResults } from './build-pipe';\nimport { TaskMetadata } from './types';\n\nexport type PipelineReport = {\n taskId: string; // task aspect-id\n taskName: string;\n taskDescription?: string;\n startTime?: number;\n endTime?: number;\n errors?: Array<Error | string>;\n warnings?: string[];\n};\n\nexport type AspectData = {\n aspectId: string;\n data: TaskMetadata;\n};\n\n/**\n * Helper to get the data and artifacts from the TasksResultsList before saving during the tag\n */\nexport class BuildPipelineResultList {\n private artifactListsMap: ComponentMap<ArtifactList<Artifact>>;\n constructor(\n private tasksResults: TaskResults[],\n private components: Component[]\n ) {\n this.artifactListsMap = this.getFlattenedArtifactListsMapFromAllTasks();\n }\n\n private getFlattenedArtifactListsMapFromAllTasks(): ComponentMap<ArtifactList<Artifact>> {\n const artifactListsMaps = this.tasksResults.flatMap((t) => (t.artifacts ? [t.artifacts] : []));\n return ComponentMap.as<ArtifactList<Artifact>>(this.components, (component) => {\n const artifacts: Artifact[] = [];\n artifactListsMaps.forEach((artifactListMap) => {\n const artifactList = artifactListMap.getValueByComponentId(component.id);\n if (artifactList) artifacts.push(...artifactList);\n });\n return ArtifactList.fromArray(artifacts);\n });\n }\n\n public getMetadataFromTaskResults(componentId: ComponentID): { [taskId: string]: TaskMetadata } {\n const compResults = this.tasksResults.reduce((acc, current: TaskResults) => {\n const foundComponent = current.componentsResults.find((c) => c.component.id.isEqual(componentId));\n const taskId = current.task.aspectId;\n if (foundComponent && foundComponent.metadata) {\n acc[taskId] = this.mergeDataIfPossible(foundComponent.metadata, acc[taskId], taskId);\n }\n return acc;\n }, {});\n return compResults;\n }\n\n public getPipelineReportOfComponent(componentId: ComponentID): PipelineReport[] {\n const compResults = this.tasksResults.map((taskResults: TaskResults) => {\n const foundComponent = taskResults.componentsResults.find((c) => c.component.id.isEqual(componentId));\n if (!foundComponent) return null;\n const pipelineReport: PipelineReport = {\n taskId: taskResults.task.aspectId,\n taskName: taskResults.task.name,\n taskDescription: taskResults.task.description,\n errors: foundComponent.errors,\n warnings: foundComponent.warnings,\n startTime: foundComponent.startTime,\n endTime: foundComponent.endTime,\n };\n return pipelineReport;\n });\n return compact(compResults);\n }\n\n public getDataOfComponent(componentId: ComponentID): AspectData[] {\n const tasksData = this.getMetadataFromTaskResults(componentId);\n return Object.keys(tasksData).map((taskId) => ({\n aspectId: taskId,\n data: tasksData[taskId],\n }));\n }\n\n public getArtifactsDataOfComponent(componentId: ComponentID): ArtifactObject[] | undefined {\n return this.artifactListsMap.getValueByComponentId(componentId)?.toObject();\n }\n\n private mergeDataIfPossible(currentData: TaskMetadata, existingData: TaskMetadata | undefined, taskId: string) {\n if (!existingData || isEmpty(existingData)) return currentData;\n // both exist\n if (typeof currentData !== 'object') {\n throw new Error(`task data must be \"object\", get ${typeof currentData} for ${taskId}`);\n }\n if (Array.isArray(currentData)) {\n throw new Error(`task data must be \"object\", get Array for ${taskId}`);\n }\n return { ...currentData, ...existingData };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoD,SAAAI,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAA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ACD,OAAOR,cAAc;IACvB,CAAC,CAAC;IACF,OAAO,IAAAS,iBAAO,EAAC1B,WAAW,CAAC;EAC7B;EAEO2B,kBAAkBA,CAAC5B,WAAwB,EAAgB;IAChE,MAAM6B,SAAS,GAAG,IAAI,CAAC9B,0BAA0B,CAACC,WAAW,CAAC;IAC9D,OAAOhD,MAAM,CAACC,IAAI,CAAC4E,SAAS,CAAC,CAACb,GAAG,CAAEN,MAAM,KAAM;MAC7CE,QAAQ,EAAEF,MAAM;MAChBlE,IAAI,EAAEqF,SAAS,CAACnB,MAAM;IACxB,CAAC,CAAC,CAAC;EACL;EAEOoB,2BAA2BA,CAAC9B,WAAwB,EAAgC;IACzF,OAAO,IAAI,CAACf,gBAAgB,CAACU,qBAAqB,CAACK,WAAW,CAAC,EAAE+B,QAAQ,CAAC,CAAC;EAC7E;EAEQjB,mBAAmBA,CAACkB,WAAyB,EAAEC,YAAsC,EAAEvB,MAAc,EAAE;IAC7G,IAAI,CAACuB,YAAY,IAAI,IAAAC,iBAAO,EAACD,YAAY,CAAC,EAAE,OAAOD,WAAW;IAC9D;IACA,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;MACnC,MAAM,IAAIG,KAAK,CAAC,mCAAmC,OAAOH,WAAW,QAAQtB,MAAM,EAAE,CAAC;IACxF;IACA,IAAI0B,KAAK,CAACC,OAAO,CAACL,WAAW,CAAC,EAAE;MAC9B,MAAM,IAAIG,KAAK,CAAC,6CAA6CzB,MAAM,EAAE,CAAC;IACxE;IACA,OAAAjD,aAAA,CAAAA,aAAA,KAAYuE,WAAW,GAAKC,YAAY;EAC1C;AACF;AAACK,OAAA,CAAAzD,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
package/dist/build.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_prettyTime","data","_interopRequireDefault","require","_workspace","_constants","_chalk","_componentIssues","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BuilderCmd","constructor","builder","workspace","logger","name","description","COMPONENT_PATTERN_HELP","cmd","keys","IssuesClasses","join","report","pattern","unmodified","dev","install","cachePackagesOnCapsulesRoot","reuseCapsules","rewrite","reinstall","tasks","listTasks","skipTests","skipTasks","failFast","includeSnap","includeTag","ignoreIssues","Error","OutsideWorkspaceError","getListTasks","setStatusLine","start","process","hrtime","components","getComponentsByUserInput","length","chalk","bold","skipTasksParsed","split","map","trim","undefined","envsExecutionResults","build","installOptions","installTeambitBit","packageManagerConfigRootDir","path","installPackages","linkingOptions","linkTeambitBit","emptyRootDir","getExistingAsIs","task","exitOnFirstFailedTask","console","capsuleRootDir","duration","prettyTime","succeedOrFailed","hasErrors","msg","consoleFailure","throwErrorsIfExist","green","componentIdStr","compId","resolveComponentId","component","get","results","id","toString","envId","buildTasks","tagTasks","snapTasks","exports"],"sources":["build.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport prettyTime from 'pretty-time';\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';\nimport { IssuesClasses } from '@teambit/component-issues';\n\ntype BuildOpts = {\n unmodified?: boolean;\n dev: boolean;\n rebuild: boolean;\n install: boolean;\n cachePackagesOnCapsulesRoot: boolean;\n reuseCapsules: boolean;\n rewrite?: boolean; //relevant only when reuseCapsules is set\n reinstall?: boolean; //relevant only when reuseCapsules is set\n tasks: string;\n listTasks?: string;\n skipTests?: boolean;\n skipTasks?: string;\n failFast?: boolean;\n includeSnap?: boolean;\n includeTag?: boolean;\n ignoreIssues?: string;\n};\n\nexport class BuilderCmd implements Command {\n name = 'build [component-pattern]';\n description = 'run set of tasks for build.';\n extendedDescription = `by default, only new and modified components are built.\nthe build takes place in an isolated directories on the filesystem (called \"capsules\"). the component files are copied to these directories\nand the package-manager installs the dependencies in the capsules root. once done, the build pipeline is running.\nbecause this process can take a while on a large workspace, some flags are available to shorten the process. See the example section for more info.\n `;\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n examples = [\n {\n cmd: 'build --reuse-capsules --tasks \"custom-task\"',\n description: 'helps to debug this \"custom-task\" without recreating the capsules from scratch',\n },\n {\n cmd: 'build --reuse-capsules --rewrite --tasks \"BabelCompile,MochaTest\"',\n description: `helpful when for example the tests are failing and code changes are needed to debug it.\nthe \"--rewrite\" flag ensures the component files are fresh, and the \"--tasks\" ensures to re-compile them and then run the tests`,\n },\n ];\n helpUrl = 'reference/build-pipeline/builder-overview';\n alias = '';\n group = 'development';\n options = [\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 ['', 'rewrite', 'use only with --reuse-capsules. rewrite the component files'],\n ['', 'reinstall', 'use only with --reuse-capsules. rerun the installation'],\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 build process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\n specify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n ['', 'include-snap', 'include snap pipeline tasks. Warning: this may deploy/publish if you have such tasks'],\n ['', 'include-tag', 'include tag pipeline tasks. Warning: this may deploy/publish if you have such tasks'],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\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 unmodified = false,\n dev = false,\n install = false,\n cachePackagesOnCapsulesRoot = false,\n reuseCapsules = false,\n rewrite = false,\n reinstall = false,\n tasks,\n listTasks,\n skipTests,\n skipTasks,\n failFast,\n includeSnap,\n includeTag,\n ignoreIssues,\n }: BuildOpts\n ): Promise<string> {\n if (rewrite && !reuseCapsules) throw new Error('cannot use --rewrite without --reuse-capsules');\n if (reinstall && !reuseCapsules) throw new Error('cannot use --reinstall without --reuse-capsules');\n if (!this.workspace) throw new OutsideWorkspaceError();\n if (listTasks) {\n return this.getListTasks(listTasks);\n }\n\n this.logger.setStatusLine('build');\n const start = process.hrtime();\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\n const skipTasksParsed = skipTasks ? skipTasks.split(',').map((t) => t.trim()) : undefined;\n\n const envsExecutionResults = await this.builder.build(\n components,\n {\n installOptions: {\n installTeambitBit: install,\n packageManagerConfigRootDir: this.workspace.path,\n installPackages: rewrite && !reinstall ? false : true,\n },\n linkingOptions: { linkTeambitBit: !install },\n emptyRootDir: !reuseCapsules,\n getExistingAsIs: reuseCapsules && !rewrite && !reinstall,\n cachePackagesOnCapsulesRoot,\n },\n {\n dev,\n tasks: tasks ? tasks.split(',').map((task) => task.trim()) : [],\n skipTests,\n skipTasks: skipTasksParsed,\n exitOnFirstFailedTask: failFast,\n },\n {\n includeSnap,\n includeTag,\n ignoreIssues,\n }\n );\n this.logger.console(`build output can be found in path: ${envsExecutionResults.capsuleRootDir}`);\n const duration = prettyTime(process.hrtime(start));\n const succeedOrFailed = envsExecutionResults.hasErrors() ? 'failed' : 'succeeded';\n const msg = `build ${succeedOrFailed}. completed in ${duration}.`;\n if (envsExecutionResults.hasErrors()) {\n this.logger.consoleFailure(msg);\n }\n envsExecutionResults.throwErrorsIfExist();\n return chalk.green(msg);\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('Task 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,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,iBAAA;EAAA,MAAAN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C,MAAM,GAAG,MAAM,IAAI,CAACnE,SAAS,CAACoE,kBAAkB,CAACF,cAAc,CAAC;IACtE,MAAMG,SAAS,GAAG,MAAM,IAAI,CAACrE,SAAS,CAACsE,GAAG,CAACH,MAAM,CAAC;IAClD,MAAMI,OAAO,GAAG,IAAI,CAACxE,OAAO,CAACoB,SAAS,CAACkD,SAAS,CAAC;IACjD,OAAO,GAAGjC,gBAAK,CAAC6B,KAAK,CAAC,WAAW,CAAC;AACtC,SAASM,OAAO,CAACC,EAAE,CAACC,QAAQ,CAAC,CAAC;AAC9B,SAASF,OAAO,CAACG,KAAK;AACtB;AACA,EAAEtC,gBAAK,CAACC,IAAI,CAAC,uBAAuB,CAAC;AACrC,EAAEkC,OAAO,CAACI,UAAU,CAACnE,IAAI,CAAC,IAAI,CAAC;AAC/B;AACA,EAAE4B,gBAAK,CAACC,IAAI,CAAC,qBAAqB,CAAC;AACnC,EAAEkC,OAAO,CAACK,QAAQ,CAACpE,IAAI,CAAC,IAAI,CAAC;AAC7B;AACA,EAAE4B,gBAAK,CAACC,IAAI,CAAC,sBAAsB,CAAC;AACpC,EAAEkC,OAAO,CAACM,SAAS,CAACrE,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,EAAE;EACzC;AACF;AAACsE,OAAA,CAAAjF,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_prettyTime","data","_interopRequireDefault","require","_workspace","_constants","_chalk","_componentIssues","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BuilderCmd","constructor","builder","workspace","logger","name","description","COMPONENT_PATTERN_HELP","cmd","keys","IssuesClasses","join","report","pattern","unmodified","dev","install","cachePackagesOnCapsulesRoot","reuseCapsules","rewrite","reinstall","tasks","listTasks","skipTests","skipTasks","failFast","includeSnap","includeTag","ignoreIssues","Error","OutsideWorkspaceError","getListTasks","setStatusLine","start","process","hrtime","components","getComponentsByUserInput","length","chalk","bold","skipTasksParsed","split","map","trim","undefined","envsExecutionResults","build","installOptions","installTeambitBit","packageManagerConfigRootDir","path","installPackages","linkingOptions","linkTeambitBit","emptyRootDir","getExistingAsIs","task","exitOnFirstFailedTask","console","capsuleRootDir","duration","prettyTime","succeedOrFailed","hasErrors","msg","consoleFailure","throwErrorsIfExist","green","componentIdStr","compId","resolveComponentId","component","get","results","id","toString","envId","buildTasks","tagTasks","snapTasks","exports"],"sources":["build.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport { Logger } from '@teambit/logger';\nimport prettyTime from 'pretty-time';\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';\nimport { IssuesClasses } from '@teambit/component-issues';\n\ntype BuildOpts = {\n unmodified?: boolean;\n dev: boolean;\n rebuild: boolean;\n install: boolean;\n cachePackagesOnCapsulesRoot: boolean;\n reuseCapsules: boolean;\n rewrite?: boolean; //relevant only when reuseCapsules is set\n reinstall?: boolean; //relevant only when reuseCapsules is set\n tasks: string;\n listTasks?: string;\n skipTests?: boolean;\n skipTasks?: string;\n failFast?: boolean;\n includeSnap?: boolean;\n includeTag?: boolean;\n ignoreIssues?: string;\n};\n\nexport class BuilderCmd implements Command {\n name = 'build [component-pattern]';\n description = 'run set of tasks for build.';\n extendedDescription = `by default, only new and modified components are built.\nthe build takes place in an isolated directories on the filesystem (called \"capsules\"). the component files are copied to these directories\nand the package-manager installs the dependencies in the capsules root. once done, the build pipeline is running.\nbecause this process can take a while on a large workspace, some flags are available to shorten the process. See the example section for more info.\n `;\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n examples = [\n {\n cmd: 'build --reuse-capsules --tasks \"custom-task\"',\n description: 'helps to debug this \"custom-task\" without recreating the capsules from scratch',\n },\n {\n cmd: 'build --reuse-capsules --rewrite --tasks \"BabelCompile,MochaTest\"',\n description: `helpful when for example the tests are failing and code changes are needed to debug it.\nthe \"--rewrite\" flag ensures the component files are fresh, and the \"--tasks\" ensures to re-compile them and then run the tests`,\n },\n ];\n helpUrl = 'reference/build-pipeline/builder-overview';\n alias = '';\n group = 'development';\n options = [\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 ['', 'rewrite', 'use only with --reuse-capsules. rewrite the component files'],\n ['', 'reinstall', 'use only with --reuse-capsules. rerun the installation'],\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 build process'],\n [\n '',\n 'skip-tasks <string>',\n `skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes.\n specify the task-name (e.g. \"TypescriptCompiler\") or the task-aspect-id (e.g. teambit.compilation/compiler)`,\n ],\n [\n '',\n 'fail-fast',\n 'stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)',\n ],\n ['', 'include-snap', 'include snap pipeline tasks. Warning: this may deploy/publish if you have such tasks'],\n ['', 'include-tag', 'include tag pipeline tasks. Warning: this may deploy/publish if you have such tasks'],\n [\n 'i',\n 'ignore-issues <issues>',\n `ignore component issues (shown in \"bit status\" as \"issues found\"), issues to ignore:\n[${Object.keys(IssuesClasses).join(', ')}]\nto ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify \"*\".`,\n ],\n ] as CommandOptions;\n\n constructor(\n private builder: BuilderMain,\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n async report(\n [pattern]: [string],\n {\n unmodified = false,\n dev = false,\n install = false,\n cachePackagesOnCapsulesRoot = false,\n reuseCapsules = false,\n rewrite = false,\n reinstall = false,\n tasks,\n listTasks,\n skipTests,\n skipTasks,\n failFast,\n includeSnap,\n includeTag,\n ignoreIssues,\n }: BuildOpts\n ): Promise<string> {\n if (rewrite && !reuseCapsules) throw new Error('cannot use --rewrite without --reuse-capsules');\n if (reinstall && !reuseCapsules) throw new Error('cannot use --reinstall without --reuse-capsules');\n if (!this.workspace) throw new OutsideWorkspaceError();\n if (listTasks) {\n return this.getListTasks(listTasks);\n }\n\n this.logger.setStatusLine('build');\n const start = process.hrtime();\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\n const skipTasksParsed = skipTasks ? skipTasks.split(',').map((t) => t.trim()) : undefined;\n\n const envsExecutionResults = await this.builder.build(\n components,\n {\n installOptions: {\n installTeambitBit: install,\n packageManagerConfigRootDir: this.workspace.path,\n installPackages: rewrite && !reinstall ? false : true,\n },\n linkingOptions: { linkTeambitBit: !install },\n emptyRootDir: !reuseCapsules,\n getExistingAsIs: reuseCapsules && !rewrite && !reinstall,\n cachePackagesOnCapsulesRoot,\n },\n {\n dev,\n tasks: tasks ? tasks.split(',').map((task) => task.trim()) : [],\n skipTests,\n skipTasks: skipTasksParsed,\n exitOnFirstFailedTask: failFast,\n },\n {\n includeSnap,\n includeTag,\n ignoreIssues,\n }\n );\n this.logger.console(`build output can be found in path: ${envsExecutionResults.capsuleRootDir}`);\n const duration = prettyTime(process.hrtime(start));\n const succeedOrFailed = envsExecutionResults.hasErrors() ? 'failed' : 'succeeded';\n const msg = `build ${succeedOrFailed}. completed in ${duration}.`;\n if (envsExecutionResults.hasErrors()) {\n this.logger.consoleFailure(msg);\n }\n envsExecutionResults.throwErrorsIfExist();\n return chalk.green(msg);\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('Task 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,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,iBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,Y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,KAAK,CAAC,WAAW,CAAC;AACtC,SAASM,OAAO,CAACC,EAAE,CAACC,QAAQ,CAAC,CAAC;AAC9B,SAASF,OAAO,CAACG,KAAK;AACtB;AACA,EAAEtC,gBAAK,CAACC,IAAI,CAAC,uBAAuB,CAAC;AACrC,EAAEkC,OAAO,CAACI,UAAU,CAACnE,IAAI,CAAC,IAAI,CAAC;AAC/B;AACA,EAAE4B,gBAAK,CAACC,IAAI,CAAC,qBAAqB,CAAC;AACnC,EAAEkC,OAAO,CAACK,QAAQ,CAACpE,IAAI,CAAC,IAAI,CAAC;AAC7B;AACA,EAAE4B,gBAAK,CAACC,IAAI,CAAC,sBAAsB,CAAC;AACpC,EAAEkC,OAAO,CAACM,SAAS,CAACrE,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,EAAE;EACzC;AACF;AAACsE,OAAA,CAAAjF,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lodash","data","require","_component","_aspectLoader","_cli","_component2","_envs","_graphql","_harmony","_globalConfig","_logger","_aspect","_scope","_workspace","_isolator","_bit","_toolboxArray","_generator","_ui","_issues","_bitError","_artifact","_artifactFactory","_builder","_builder2","_builder3","_build","_buildTask","_exceptions","_buildPipelineResultList","_artifacts","_buildTask2","_builder4","_componentsHaveIssues","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","FILE_PATH_PARAM_DELIM","exports","BuilderMain","constructor","envs","workspace","buildService","tagService","snapService","scope","isolator","aspectLoader","componentAspect","globalConfig","buildTaskSlot","tagTaskSlot","snapTaskSlot","logger","issues","storeArtifacts","tasksResults","artifacts","flatMap","Promise","all","map","artifactMap","toArray","component","artifactList","store","err","ArtifactStorageError","id","toString","pipelineResultsToBuilderData","components","buildPipelineResults","buildPipelineResultList","BuildPipelineResultList","ComponentMap","as","aspectsData","getDataOfComponent","pipelineReport","getPipelineReportOfComponent","getArtifactsDataOfComponent","pipeline","bitVersion","getBitVersion","tagListener","options","isolateOptions","builderOptions","pipeResults","allTasksResults","throwOnError","forceDeploy","disableTagAndSnapPipelines","isSnap","populateArtifactsFrom","buildEnvsExecutionResults","build","emptyRootDir","tasks","AspectAspect","undefined","ignoreIssues","throwErrorsIfExist","hasErrors","builderOptionsForTagSnap","seedersOnly","previousTasksResults","deployEnvsExecutionResults","runSnapTasks","runTagTasks","builderDataMap","combineBuildDataFrom","validateBuilderDataMap","sanitizePreviewData","harmonyComps","compsBeingTaggedLookup","Set","comp","harmonyCompIdsWithEnvId","envId","getEnvId","isUsingCoreEnv","inWs","lastTaggedEnvHasOnlyOverview","has","isEnvTaggedWithComp","envCompId","ComponentID","fromString","hasId","get","state","aspects","onlyOverview","harmonyCompIdsWithEnvIdMap","Map","compsToDeleteOnlyOverviewPreviewData","envData","previewData","buildData","taskSerializedIds","BuildTaskHelper","serializeId","aspectId","taskId","name","taskName","duplications","findDuplications","Error","join","promises","builderData","populateFrom","find","isEqual","ignoreVersion","idStr","populateFromComp","getHost","version","populateFromBuilderData","getBuilderData","artifact","artifactObj","toObject","a","task","aspectData","p","flattenValue","getArtifactsVinylByAspect","aspectName","getArtifactsByAspect","vinyls","getVinylsAndImportIfMissing","legacyScope","getArtifactsVinylByAspectAndName","getArtifactsByAspectAndName","getArtifactsVinylByAspectAndTaskName","getArtifactsbyAspectAndTaskName","getArtifactsByName","getArtifacts","byAspectNameAndName","byAspectNameAndTaskName","getDataByAspect","ArtifactList","fromArray","BuilderAspect","clonedData","cloneDeep","artifactFiles","files","ArtifactFiles","fromObject","Artifact","assign","fromArtifactObject","extraOptions","throwForVariousIssues","ids","c","capsulesBaseDir","getComponentsCapsulesBaseDir","baseIsolateOpts","baseDir","useHash","mergedIsolateOpts","network","isolateComponents","createEnvironment","graphCapsules","getAllComponents","builderServiceOptions","originalSeeders","consoleTitle","buildResult","runOnce","includeSnap","includeTag","listTasks","compEnv","getEnv","buildTasks","getCurrentPipeTasks","tagTasks","snapTasks","registerBuildTasks","register","registerDeployTasks","registerTagTasks","registerSnapTasks","getDownloadUrlForArtifact","componentId","path","componentsToCheck","isDeleted","throwForComponentIssues","issuesToIgnoreFromFlag","split","issue","trim","issuesToIgnoreFromConfig","getIssuesToIgnoreGlobally","issuesToIgnore","triggerAddComponentIssues","removeIgnoredIssuesFromComponents","legacyComponents","_consumer","componentsWithBlockingIssues","shouldBlockTagging","ComponentsHaveIssues","workspaceIssues","getWorkspaceIssues","issuesStr","issueErr","message","BitError","provider","cli","loggerExt","graphql","generator","ui","config","artifactFactory","ArtifactFactory","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","GlobalConfigAspect","IssuesAspect","addRuntime"],"sources":["builder.main.runtime.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ArtifactVinyl, ArtifactFiles, ArtifactObject } from '@teambit/component.sources';\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 { GlobalConfigAspect, GlobalConfigMain } from '@teambit/global-config';\nimport { Logger, 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 { getBitVersion } from '@teambit/bit.get-bit-version';\nimport { findDuplications } from '@teambit/toolbox.array.duplications-finder';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { UIAspect, UiMain, BundleUiTask } from '@teambit/ui';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { BitError } from '@teambit/bit-error';\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 { TaskMetadata } from './types';\nimport { ArtifactsCmd } from './artifact/artifacts.cmd';\nimport { buildTaskTemplate } from './templates/build-task';\nimport { BuilderRoute } from './builder.route';\nimport { ComponentsHaveIssues } from './exceptions/components-have-issues';\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 populateArtifactsFrom?: ComponentID[]; // helpful for tagging from scope where we want to use the build-artifacts of previous 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 globalConfig: GlobalConfigMain,\n private buildTaskSlot: TaskSlot,\n private tagTaskSlot: TaskSlot,\n private snapTaskSlot: TaskSlot,\n private logger: Logger,\n private issues: IssuesMain\n ) {}\n\n private async storeArtifacts(tasksResults: TaskResults[]) {\n const artifacts = tasksResults.flatMap((t) => (t.artifacts ? [t.artifacts] : []));\n await Promise.all(\n artifacts.map(async (artifactMap: ComponentMap<ArtifactList<FsArtifact>>) => {\n await Promise.all(\n artifactMap.toArray().map(async ([component, artifactList]) => {\n try {\n await artifactList.store(component);\n } catch (err: any) {\n throw new ArtifactStorageError(err, component.id.toString());\n }\n })\n );\n })\n );\n }\n\n 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: getBitVersion() };\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, populateArtifactsFrom } = options;\n if (populateArtifactsFrom) isolateOptions.populateArtifactsFrom = populateArtifactsFrom;\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: populateArtifactsFrom ? [AspectAspect.id] : undefined,\n },\n { ignoreIssues: '*' }\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 (populateArtifactsFrom) await this.combineBuildDataFrom(builderDataMap, populateArtifactsFrom);\n this.validateBuilderDataMap(builderDataMap);\n\n await this.sanitizePreviewData(components);\n\n return { builderDataMap, pipeResults };\n }\n\n /**\n * remove the onlyOverview from the preview data of the component if\n * the env is in the workspace\n * the env is not tagged with the component\n * the last tagged env has onlyOverview undefined in preview data\n *\n * We don't want to do this but have no choice because,\n * when we load components in workspace,\n * we set the onlyOverview to true in the env's preview data\n * which sets the onlyOverview to true in the component's preview data\n * but if you don't tag the env with the component,\n * the onlyOverview will be true in the component's preview data, since its env is in the workspace\n * even though the env it is tagged with doesn't have onlyOverview in its preview data\n * which will result in inconsistent preview data when exported to the scope\n */\n async sanitizePreviewData(harmonyComps: Component[]) {\n const compsBeingTaggedLookup = new Set(harmonyComps.map((comp) => comp.id.toString()));\n\n const harmonyCompIdsWithEnvId = await Promise.all(\n harmonyComps.map(async (comp) => {\n const envId = await this.envs.getEnvId(comp);\n if (this.envs.isUsingCoreEnv(comp)) {\n return [comp.id.toString(), { envId, inWs: false, lastTaggedEnvHasOnlyOverview: false }] as [\n string,\n { envId: string; inWs: boolean; lastTaggedEnvHasOnlyOverview?: boolean; isEnvTaggedWithComp?: boolean }\n ];\n }\n\n // check if the env is tagged with the component\n if (envId && !compsBeingTaggedLookup.has(comp.id.toString())) {\n return [comp.id.toString(), { envId, isEnvTaggedWithComp: false }] as [\n string,\n { envId: string; inWs?: boolean; lastTaggedEnvHasOnlyOverview?: boolean; isEnvTaggedWithComp?: boolean }\n ];\n }\n\n const envCompId = (envId && ComponentID.fromString(envId)) || undefined;\n const inWs = this.workspace && envCompId ? await this.workspace.hasId(envCompId) : false;\n\n const lastTaggedEnvHasOnlyOverview: boolean | undefined =\n envCompId &&\n (await this.scope.get(envCompId, false))?.state.aspects.get('teambit.preview/preview')?.data?.onlyOverview;\n\n return [comp.id.toString(), { envId, inWs, lastTaggedEnvHasOnlyOverview, isEnvTaggedWithComp: true }] as [\n string,\n { envId: string; inWs: boolean; lastTaggedEnvHasOnlyOverview: boolean; isEnvTaggedWithComp?: boolean }\n ];\n })\n );\n\n const harmonyCompIdsWithEnvIdMap = new Map(harmonyCompIdsWithEnvId);\n\n const compsToDeleteOnlyOverviewPreviewData = harmonyComps.filter((comp) => {\n const envData:\n | { envId: string; inWs?: boolean; lastTaggedEnvHasOnlyOverview?: boolean; isEnvTaggedWithComp?: boolean }\n | undefined = harmonyCompIdsWithEnvIdMap.get(comp.id.toString());\n return envData?.inWs && !envData?.lastTaggedEnvHasOnlyOverview && envData?.isEnvTaggedWithComp;\n });\n\n for (const comp of compsToDeleteOnlyOverviewPreviewData) {\n const previewData = comp.state.aspects.get('teambit.preview/preview')?.data;\n // if the env is not tagged with the component remove it from the preview data of the component\n delete previewData?.onlyOverview;\n }\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 combineBuildDataFrom(\n builderDataMap: ComponentMap<RawBuilderData>,\n populateArtifactsFrom: ComponentID[]\n ) {\n const promises = builderDataMap.map(async (builderData, component) => {\n const populateFrom = populateArtifactsFrom.find((id) => id.isEqual(component.id, { ignoreVersion: true }));\n const idStr = component.id.toString();\n if (!populateFrom) {\n throw new Error(`combineBuildDataFromParent: unable to find where to populate the artifacts from for ${idStr}`);\n }\n const populateFromComp = await this.componentAspect.getHost().get(populateFrom);\n if (!populateFromComp)\n throw new Error(\n `combineBuildDataFromParent, unable to load parent component of ${idStr}. hash: ${populateFrom.version}`\n );\n const populateFromBuilderData = this.getBuilderData(populateFromComp);\n if (!populateFromBuilderData) throw new Error(`parent of ${idStr} was not built yet. unable to continue`);\n populateFromBuilderData.artifacts.forEach((artifact) => {\n const artifactObj = artifact.toObject();\n if (!builderData.artifacts) builderData.artifacts = [];\n if (\n builderData.artifacts.find(\n (a) =>\n a.task.id === artifactObj.task.id && a.task.name === artifactObj.task.name && a.name === artifactObj.name\n )\n ) {\n return;\n }\n builderData.artifacts.push(artifactObj);\n });\n populateFromBuilderData.aspectsData.forEach((aspectData) => {\n if (builderData.aspectsData.find((a) => a.aspectId === aspectData.aspectId)) return;\n builderData.aspectsData.push(aspectData);\n });\n populateFromBuilderData.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, 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, 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, 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 /**\n * this is the aspect's data that was generated as \"metadata\" of the task component-result during the build process\n * and saved by the builder aspect in the \"aspectsData\" property.\n * (not to be confused with the data saved in the aspect itself, which is saved in the \"data\" property of the aspect).\n */\n getDataByAspect(component: IComponent, aspectName: string): TaskMetadata | 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 extraOptions?: { includeTag?: boolean; includeSnap?: boolean; ignoreIssues?: string }\n ): Promise<TaskResultsList> {\n await this.throwForVariousIssues(components, extraOptions?.ignoreIssues);\n const ids = components.map((c) => c.id);\n const capsulesBaseDir = this.buildService.getComponentsCapsulesBaseDir();\n const baseIsolateOpts = {\n baseDir: capsulesBaseDir,\n useHash: !capsulesBaseDir,\n };\n const mergedIsolateOpts = {\n ...baseIsolateOpts,\n ...isolateOptions,\n };\n\n const network = await this.isolator.isolateComponents(ids, mergedIsolateOpts, this.scope.legacyScope);\n const envs = await this.envs.createEnvironment(network.graphCapsules.getAllComponents());\n const builderServiceOptions = {\n seedersOnly: isolateOptions?.seedersOnly,\n originalSeeders: ids,\n capsulesBaseDir,\n ...builderOptions,\n };\n this.logger.consoleTitle(`Total ${components.length} components to build`);\n const buildResult: TaskResultsList = await envs.runOnce(this.buildService, builderServiceOptions);\n\n if (extraOptions?.includeSnap || extraOptions?.includeTag) {\n const builderOptionsForTagSnap: BuilderServiceOptions = {\n ...builderServiceOptions,\n previousTasksResults: buildResult.tasksResults,\n };\n const deployEnvsExecutionResults = extraOptions?.includeSnap\n ? await this.runSnapTasks(components, builderOptionsForTagSnap)\n : await this.runTagTasks(components, builderOptionsForTagSnap);\n buildResult.tasksResults.push(...deployEnvsExecutionResults.tasksResults);\n }\n\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 private async throwForVariousIssues(components: Component[], ignoreIssues?: string) {\n const componentsToCheck = components.filter((c) => !c.isDeleted());\n await this.throwForComponentIssues(componentsToCheck, ignoreIssues);\n }\n\n async throwForComponentIssues(components: Component[], ignoreIssues?: string) {\n if (ignoreIssues === '*') {\n // ignore all issues\n return;\n }\n const issuesToIgnoreFromFlag = ignoreIssues?.split(',').map((issue) => issue.trim()) || [];\n const issuesToIgnoreFromConfig = this.issues.getIssuesToIgnoreGlobally();\n const issuesToIgnore = [...issuesToIgnoreFromFlag, ...issuesToIgnoreFromConfig];\n await this.issues.triggerAddComponentIssues(components, issuesToIgnore);\n this.issues.removeIgnoredIssuesFromComponents(components, issuesToIgnore);\n const legacyComponents = components.map((c) => c.state._consumer) as ConsumerComponent[];\n const componentsWithBlockingIssues = legacyComponents.filter((component) => component.issues?.shouldBlockTagging());\n if (componentsWithBlockingIssues.length) {\n throw new ComponentsHaveIssues(componentsWithBlockingIssues);\n }\n\n const workspaceIssues = this.workspace.getWorkspaceIssues();\n if (workspaceIssues.length) {\n const issuesStr = workspaceIssues.map((issueErr) => issueErr.message).join('\\n');\n throw new BitError(`the workspace has the following issues:\\n${issuesStr}`);\n }\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 GlobalConfigAspect,\n IssuesAspect,\n ];\n\n static async provider(\n [\n cli,\n envs,\n workspace,\n scope,\n isolator,\n loggerExt,\n aspectLoader,\n graphql,\n generator,\n component,\n ui,\n globalConfig,\n issues,\n ]: [\n CLIMain,\n EnvsMain,\n Workspace,\n ScopeMain,\n IsolatorMain,\n LoggerMain,\n AspectLoaderMain,\n GraphqlMain,\n GeneratorMain,\n ComponentMain,\n UiMain,\n GlobalConfigMain,\n IssuesMain\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 globalConfig\n );\n envs.registerService(buildService);\n const tagService = new BuilderService(\n isolator,\n logger,\n tagTaskSlot,\n 'getTagPipe',\n 'tag',\n artifactFactory,\n scope,\n globalConfig\n );\n const snapService = new BuilderService(\n isolator,\n logger,\n snapTaskSlot,\n 'getSnapPipe',\n 'snap',\n artifactFactory,\n scope,\n globalConfig\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 globalConfig,\n buildTaskSlot,\n tagTaskSlot,\n snapTaskSlot,\n logger,\n issues\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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IA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AAAAlB,eAAA,CApiBYkB,WAAW,WAqbP,CAACoP,eAAI,CAACC,QAAQ,CAAY,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,CAAC;AAAAvQ,eAAA,CArbxFkB,WAAW,aAubLsP,kBAAW;AAAAxQ,eAAA,CAvbjBkB,WAAW,kBAwbA,CACpBuP,gBAAS,EACTC,kBAAU,EACVC,4BAAe,EACfC,oBAAW,EACXC,0BAAc,EACdC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,4BAAe,EACfC,6BAAe,EACfC,cAAQ,EACRC,kCAAkB,EAClBC,sBAAY,CACb;AAgGH3G,wBAAa,CAAC4G,UAAU,CAACpQ,WAAW,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_lodash","data","require","_component","_aspectLoader","_cli","_component2","_envs","_graphql","_harmony","_globalConfig","_logger","_aspect","_scope","_workspace","_isolator","_bit","_toolboxArray","_generator","_ui","_issues","_bitError","_artifact","_artifactFactory","_builder","_builder2","_builder3","_build","_buildTask","_exceptions","_buildPipelineResultList","_artifacts","_buildTask2","_builder4","_componentsHaveIssues","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","FILE_PATH_PARAM_DELIM","exports","BuilderMain","constructor","envs","workspace","buildService","tagService","snapService","scope","isolator","aspectLoader","componentAspect","globalConfig","buildTaskSlot","tagTaskSlot","snapTaskSlot","logger","issues","storeArtifacts","tasksResults","artifacts","flatMap","Promise","all","map","artifactMap","toArray","component","artifactList","store","err","ArtifactStorageError","id","toString","pipelineResultsToBuilderData","components","buildPipelineResults","buildPipelineResultList","BuildPipelineResultList","ComponentMap","as","aspectsData","getDataOfComponent","pipelineReport","getPipelineReportOfComponent","getArtifactsDataOfComponent","pipeline","bitVersion","getBitVersion","tagListener","options","isolateOptions","builderOptions","pipeResults","allTasksResults","throwOnError","forceDeploy","disableTagAndSnapPipelines","isSnap","populateArtifactsFrom","buildEnvsExecutionResults","build","emptyRootDir","tasks","AspectAspect","undefined","ignoreIssues","throwErrorsIfExist","hasErrors","builderOptionsForTagSnap","seedersOnly","previousTasksResults","deployEnvsExecutionResults","runSnapTasks","runTagTasks","builderDataMap","combineBuildDataFrom","validateBuilderDataMap","sanitizePreviewData","harmonyComps","compsBeingTaggedLookup","Set","comp","harmonyCompIdsWithEnvId","envId","getEnvId","isUsingCoreEnv","inWs","lastTaggedEnvHasOnlyOverview","has","isEnvTaggedWithComp","envCompId","ComponentID","fromString","hasId","get","state","aspects","onlyOverview","harmonyCompIdsWithEnvIdMap","Map","compsToDeleteOnlyOverviewPreviewData","envData","previewData","buildData","taskSerializedIds","BuildTaskHelper","serializeId","aspectId","taskId","name","taskName","duplications","findDuplications","Error","join","promises","builderData","populateFrom","find","isEqual","ignoreVersion","idStr","populateFromComp","getHost","version","populateFromBuilderData","getBuilderData","artifact","artifactObj","toObject","a","task","aspectData","p","flattenValue","getArtifactsVinylByAspect","aspectName","getArtifactsByAspect","vinyls","getVinylsAndImportIfMissing","legacyScope","getArtifactsVinylByAspectAndName","getArtifactsByAspectAndName","getArtifactsVinylByAspectAndTaskName","getArtifactsbyAspectAndTaskName","getArtifactsByName","getArtifacts","byAspectNameAndName","byAspectNameAndTaskName","getDataByAspect","ArtifactList","fromArray","BuilderAspect","clonedData","cloneDeep","artifactFiles","files","ArtifactFiles","fromObject","Artifact","assign","fromArtifactObject","extraOptions","throwForVariousIssues","ids","c","capsulesBaseDir","getComponentsCapsulesBaseDir","baseIsolateOpts","baseDir","useHash","mergedIsolateOpts","network","isolateComponents","createEnvironment","graphCapsules","getAllComponents","builderServiceOptions","originalSeeders","consoleTitle","buildResult","runOnce","includeSnap","includeTag","listTasks","compEnv","getEnv","buildTasks","getCurrentPipeTasks","tagTasks","snapTasks","registerBuildTasks","register","registerDeployTasks","registerTagTasks","registerSnapTasks","getDownloadUrlForArtifact","componentId","path","componentsToCheck","isDeleted","throwForComponentIssues","issuesToIgnoreFromFlag","split","issue","trim","issuesToIgnoreFromConfig","getIssuesToIgnoreGlobally","issuesToIgnore","triggerAddComponentIssues","removeIgnoredIssuesFromComponents","legacyComponents","_consumer","componentsWithBlockingIssues","shouldBlockTagging","ComponentsHaveIssues","workspaceIssues","getWorkspaceIssues","issuesStr","issueErr","message","BitError","provider","cli","loggerExt","graphql","generator","ui","config","artifactFactory","ArtifactFactory","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","GlobalConfigAspect","IssuesAspect","addRuntime"],"sources":["builder.main.runtime.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ArtifactVinyl, ArtifactFiles, ArtifactObject } from '@teambit/component.sources';\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 { GlobalConfigAspect, GlobalConfigMain } from '@teambit/global-config';\nimport { Logger, 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 { getBitVersion } from '@teambit/bit.get-bit-version';\nimport { findDuplications } from '@teambit/toolbox.array.duplications-finder';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { UIAspect, UiMain, BundleUiTask } from '@teambit/ui';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport { BitError } from '@teambit/bit-error';\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 { TaskMetadata } from './types';\nimport { ArtifactsCmd } from './artifact/artifacts.cmd';\nimport { buildTaskTemplate } from './templates/build-task';\nimport { BuilderRoute } from './builder.route';\nimport { ComponentsHaveIssues } from './exceptions/components-have-issues';\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 populateArtifactsFrom?: ComponentID[]; // helpful for tagging from scope where we want to use the build-artifacts of previous 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 globalConfig: GlobalConfigMain,\n private buildTaskSlot: TaskSlot,\n private tagTaskSlot: TaskSlot,\n private snapTaskSlot: TaskSlot,\n private logger: Logger,\n private issues: IssuesMain\n ) {}\n\n private async storeArtifacts(tasksResults: TaskResults[]) {\n const artifacts = tasksResults.flatMap((t) => (t.artifacts ? [t.artifacts] : []));\n await Promise.all(\n artifacts.map(async (artifactMap: ComponentMap<ArtifactList<FsArtifact>>) => {\n await Promise.all(\n artifactMap.toArray().map(async ([component, artifactList]) => {\n try {\n await artifactList.store(component);\n } catch (err: any) {\n throw new ArtifactStorageError(err, component.id.toString());\n }\n })\n );\n })\n );\n }\n\n 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: getBitVersion() };\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, populateArtifactsFrom } = options;\n if (populateArtifactsFrom) isolateOptions.populateArtifactsFrom = populateArtifactsFrom;\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: populateArtifactsFrom ? [AspectAspect.id] : undefined,\n },\n { ignoreIssues: '*' }\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 (populateArtifactsFrom) await this.combineBuildDataFrom(builderDataMap, populateArtifactsFrom);\n this.validateBuilderDataMap(builderDataMap);\n\n await this.sanitizePreviewData(components);\n\n return { builderDataMap, pipeResults };\n }\n\n /**\n * remove the onlyOverview from the preview data of the component if\n * the env is in the workspace\n * the env is not tagged with the component\n * the last tagged env has onlyOverview undefined in preview data\n *\n * We don't want to do this but have no choice because,\n * when we load components in workspace,\n * we set the onlyOverview to true in the env's preview data\n * which sets the onlyOverview to true in the component's preview data\n * but if you don't tag the env with the component,\n * the onlyOverview will be true in the component's preview data, since its env is in the workspace\n * even though the env it is tagged with doesn't have onlyOverview in its preview data\n * which will result in inconsistent preview data when exported to the scope\n */\n async sanitizePreviewData(harmonyComps: Component[]) {\n const compsBeingTaggedLookup = new Set(harmonyComps.map((comp) => comp.id.toString()));\n\n const harmonyCompIdsWithEnvId = await Promise.all(\n harmonyComps.map(async (comp) => {\n const envId = await this.envs.getEnvId(comp);\n if (this.envs.isUsingCoreEnv(comp)) {\n return [comp.id.toString(), { envId, inWs: false, lastTaggedEnvHasOnlyOverview: false }] as [\n string,\n { envId: string; inWs: boolean; lastTaggedEnvHasOnlyOverview?: boolean; isEnvTaggedWithComp?: boolean },\n ];\n }\n\n // check if the env is tagged with the component\n if (envId && !compsBeingTaggedLookup.has(comp.id.toString())) {\n return [comp.id.toString(), { envId, isEnvTaggedWithComp: false }] as [\n string,\n { envId: string; inWs?: boolean; lastTaggedEnvHasOnlyOverview?: boolean; isEnvTaggedWithComp?: boolean },\n ];\n }\n\n const envCompId = (envId && ComponentID.fromString(envId)) || undefined;\n const inWs = this.workspace && envCompId ? await this.workspace.hasId(envCompId) : false;\n\n const lastTaggedEnvHasOnlyOverview: boolean | undefined =\n envCompId &&\n (await this.scope.get(envCompId, false))?.state.aspects.get('teambit.preview/preview')?.data?.onlyOverview;\n\n return [comp.id.toString(), { envId, inWs, lastTaggedEnvHasOnlyOverview, isEnvTaggedWithComp: true }] as [\n string,\n { envId: string; inWs: boolean; lastTaggedEnvHasOnlyOverview: boolean; isEnvTaggedWithComp?: boolean },\n ];\n })\n );\n\n const harmonyCompIdsWithEnvIdMap = new Map(harmonyCompIdsWithEnvId);\n\n const compsToDeleteOnlyOverviewPreviewData = harmonyComps.filter((comp) => {\n const envData:\n | { envId: string; inWs?: boolean; lastTaggedEnvHasOnlyOverview?: boolean; isEnvTaggedWithComp?: boolean }\n | undefined = harmonyCompIdsWithEnvIdMap.get(comp.id.toString());\n return envData?.inWs && !envData?.lastTaggedEnvHasOnlyOverview && envData?.isEnvTaggedWithComp;\n });\n\n for (const comp of compsToDeleteOnlyOverviewPreviewData) {\n const previewData = comp.state.aspects.get('teambit.preview/preview')?.data;\n // if the env is not tagged with the component remove it from the preview data of the component\n delete previewData?.onlyOverview;\n }\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 combineBuildDataFrom(\n builderDataMap: ComponentMap<RawBuilderData>,\n populateArtifactsFrom: ComponentID[]\n ) {\n const promises = builderDataMap.map(async (builderData, component) => {\n const populateFrom = populateArtifactsFrom.find((id) => id.isEqual(component.id, { ignoreVersion: true }));\n const idStr = component.id.toString();\n if (!populateFrom) {\n throw new Error(`combineBuildDataFromParent: unable to find where to populate the artifacts from for ${idStr}`);\n }\n const populateFromComp = await this.componentAspect.getHost().get(populateFrom);\n if (!populateFromComp)\n throw new Error(\n `combineBuildDataFromParent, unable to load parent component of ${idStr}. hash: ${populateFrom.version}`\n );\n const populateFromBuilderData = this.getBuilderData(populateFromComp);\n if (!populateFromBuilderData) throw new Error(`parent of ${idStr} was not built yet. unable to continue`);\n populateFromBuilderData.artifacts.forEach((artifact) => {\n const artifactObj = artifact.toObject();\n if (!builderData.artifacts) builderData.artifacts = [];\n if (\n builderData.artifacts.find(\n (a) =>\n a.task.id === artifactObj.task.id && a.task.name === artifactObj.task.name && a.name === artifactObj.name\n )\n ) {\n return;\n }\n builderData.artifacts.push(artifactObj);\n });\n populateFromBuilderData.aspectsData.forEach((aspectData) => {\n if (builderData.aspectsData.find((a) => a.aspectId === aspectData.aspectId)) return;\n builderData.aspectsData.push(aspectData);\n });\n populateFromBuilderData.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, 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, 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, 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 /**\n * this is the aspect's data that was generated as \"metadata\" of the task component-result during the build process\n * and saved by the builder aspect in the \"aspectsData\" property.\n * (not to be confused with the data saved in the aspect itself, which is saved in the \"data\" property of the aspect).\n */\n getDataByAspect(component: IComponent, aspectName: string): TaskMetadata | 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 extraOptions?: { includeTag?: boolean; includeSnap?: boolean; ignoreIssues?: string }\n ): Promise<TaskResultsList> {\n await this.throwForVariousIssues(components, extraOptions?.ignoreIssues);\n const ids = components.map((c) => c.id);\n const capsulesBaseDir = this.buildService.getComponentsCapsulesBaseDir();\n const baseIsolateOpts = {\n baseDir: capsulesBaseDir,\n useHash: !capsulesBaseDir,\n };\n const mergedIsolateOpts = {\n ...baseIsolateOpts,\n ...isolateOptions,\n };\n\n const network = await this.isolator.isolateComponents(ids, mergedIsolateOpts, this.scope.legacyScope);\n const envs = await this.envs.createEnvironment(network.graphCapsules.getAllComponents());\n const builderServiceOptions = {\n seedersOnly: isolateOptions?.seedersOnly,\n originalSeeders: ids,\n capsulesBaseDir,\n ...builderOptions,\n };\n this.logger.consoleTitle(`Total ${components.length} components to build`);\n const buildResult: TaskResultsList = await envs.runOnce(this.buildService, builderServiceOptions);\n\n if (extraOptions?.includeSnap || extraOptions?.includeTag) {\n const builderOptionsForTagSnap: BuilderServiceOptions = {\n ...builderServiceOptions,\n previousTasksResults: buildResult.tasksResults,\n };\n const deployEnvsExecutionResults = extraOptions?.includeSnap\n ? await this.runSnapTasks(components, builderOptionsForTagSnap)\n : await this.runTagTasks(components, builderOptionsForTagSnap);\n buildResult.tasksResults.push(...deployEnvsExecutionResults.tasksResults);\n }\n\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 private async throwForVariousIssues(components: Component[], ignoreIssues?: string) {\n const componentsToCheck = components.filter((c) => !c.isDeleted());\n await this.throwForComponentIssues(componentsToCheck, ignoreIssues);\n }\n\n async throwForComponentIssues(components: Component[], ignoreIssues?: string) {\n if (ignoreIssues === '*') {\n // ignore all issues\n return;\n }\n const issuesToIgnoreFromFlag = ignoreIssues?.split(',').map((issue) => issue.trim()) || [];\n const issuesToIgnoreFromConfig = this.issues.getIssuesToIgnoreGlobally();\n const issuesToIgnore = [...issuesToIgnoreFromFlag, ...issuesToIgnoreFromConfig];\n await this.issues.triggerAddComponentIssues(components, issuesToIgnore);\n this.issues.removeIgnoredIssuesFromComponents(components, issuesToIgnore);\n const legacyComponents = components.map((c) => c.state._consumer) as ConsumerComponent[];\n const componentsWithBlockingIssues = legacyComponents.filter((component) => component.issues?.shouldBlockTagging());\n if (componentsWithBlockingIssues.length) {\n throw new ComponentsHaveIssues(componentsWithBlockingIssues);\n }\n\n const workspaceIssues = this.workspace.getWorkspaceIssues();\n if (workspaceIssues.length) {\n const issuesStr = workspaceIssues.map((issueErr) => issueErr.message).join('\\n');\n throw new BitError(`the workspace has the following issues:\\n${issuesStr}`);\n }\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 GlobalConfigAspect,\n IssuesAspect,\n ];\n\n static async provider(\n [\n cli,\n envs,\n workspace,\n scope,\n isolator,\n loggerExt,\n aspectLoader,\n graphql,\n generator,\n component,\n ui,\n globalConfig,\n issues,\n ]: [\n CLIMain,\n EnvsMain,\n Workspace,\n ScopeMain,\n IsolatorMain,\n LoggerMain,\n AspectLoaderMain,\n GraphqlMain,\n GeneratorMain,\n ComponentMain,\n UiMain,\n GlobalConfigMain,\n IssuesMain,\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 globalConfig\n );\n envs.registerService(buildService);\n const tagService = new BuilderService(\n isolator,\n logger,\n tagTaskSlot,\n 'getTagPipe',\n 'tag',\n artifactFactory,\n scope,\n globalConfig\n );\n const snapService = new BuilderService(\n isolator,\n logger,\n snapTaskSlot,\n 'getSnapPipe',\n 'snap',\n artifactFactory,\n scope,\n globalConfig\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 globalConfig,\n buildTaskSlot,\n tagTaskSlot,\n snapTaskSlot,\n logger,\n issues\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,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,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QAAQ,CAAY,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAY,CAAC,CAAC;AAAAvQ,eAAA,CArbxFkB,WAAW,aAubLsP,kBAAW;AAAAxQ,eAAA,CAvbjBkB,WAAW,kBAwbA,CACpBuP,gBAAS,EACTC,kBAAU,EACVC,4BAAe,EACfC,oBAAW,EACXC,0BAAc,EACdC,sBAAY,EACZC,kCAAkB,EAClBC,wBAAa,EACbC,4BAAe,EACfC,6BAAe,EACfC,cAAQ,EACRC,kCAAkB,EAClBC,sBAAY,CACb;AAgGH3G,wBAAa,CAAC4G,UAAU,CAACpQ,WAAW,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_archiver","data","_interopRequireDefault","require","_mime","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","routePath","exports","defaultExtension","BuilderRoute","constructor","builder","scope","logger","req","res","component","params","aspectIdStr","filePath","split","aspectId","replace","artifacts","getArtifactsByAspect","getArtifacts","status","jsonp","error","id","extensionsWithArtifacts","Promise","all","map","artifact","files","getVinylsAndImportIfMissing","legacyScope","extensionId","task","filter","file","path","artifactFilesCount","reduce","accum","next","length","extensionWithArtifact","find","fileName","fileContent","contents","fileExt","extname","contentType","mime","getType","set","send","archive","archiver","gzip","on","warn","message","err","forEach","extensionWithArtifacts","append","name","pipe","finalize","attachment","toString"],"sources":["builder.route.ts"],"sourcesContent":["import { Request, Response, Route } from '@teambit/express';\nimport { Component } from '@teambit/component';\nimport archiver from 'archiver';\nimport { Logger } from '@teambit/logger';\nimport { ScopeMain } from '@teambit/scope';\nimport mime from 'mime';\nimport { BuilderMain } from './builder.main.runtime';\n\nexport const routePath = `builder`;\n\nexport type BuilderUrlParams = {\n aspectId?: string;\n filePath?: string;\n};\nexport const defaultExtension = '.tgz';\nexport class BuilderRoute implements Route {\n constructor(private builder: BuilderMain
|
|
1
|
+
{"version":3,"names":["_archiver","data","_interopRequireDefault","require","_mime","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","routePath","exports","defaultExtension","BuilderRoute","constructor","builder","scope","logger","req","res","component","params","aspectIdStr","filePath","split","aspectId","replace","artifacts","getArtifactsByAspect","getArtifacts","status","jsonp","error","id","extensionsWithArtifacts","Promise","all","map","artifact","files","getVinylsAndImportIfMissing","legacyScope","extensionId","task","filter","file","path","artifactFilesCount","reduce","accum","next","length","extensionWithArtifact","find","fileName","fileContent","contents","fileExt","extname","contentType","mime","getType","set","send","archive","archiver","gzip","on","warn","message","err","forEach","extensionWithArtifacts","append","name","pipe","finalize","attachment","toString"],"sources":["builder.route.ts"],"sourcesContent":["import { Request, Response, Route } from '@teambit/express';\nimport { Component } from '@teambit/component';\nimport archiver from 'archiver';\nimport { Logger } from '@teambit/logger';\nimport { ScopeMain } from '@teambit/scope';\nimport mime from 'mime';\nimport { BuilderMain } from './builder.main.runtime';\n\nexport const routePath = `builder`;\n\nexport type BuilderUrlParams = {\n aspectId?: string;\n filePath?: string;\n};\nexport const defaultExtension = '.tgz';\nexport class BuilderRoute implements Route {\n constructor(\n private builder: BuilderMain,\n private scope: ScopeMain,\n private logger: Logger\n ) {}\n route = `/${routePath}/*`;\n method = 'get';\n\n middlewares = [\n async (req: Request<BuilderUrlParams>, res: Response) => {\n // @ts-ignore TODO: @guy please fix.\n const component = req.component as Component;\n const { params } = req;\n const [aspectIdStr, filePath] = params[1].split('~');\n // remove trailing slash\n const aspectId = aspectIdStr.replace(/\\/$/, '');\n const artifacts = aspectId\n ? this.builder.getArtifactsByAspect(component, aspectId)\n : this.builder.getArtifacts(component);\n if (!artifacts)\n return res\n .status(404)\n .jsonp({ error: `no artifacts found for component ${component.id} by aspect ${aspectId}` });\n const extensionsWithArtifacts = await Promise.all(\n artifacts.map(async (artifact) => {\n const files = await artifact.files.getVinylsAndImportIfMissing(component.id, this.scope.legacyScope);\n if (!filePath) return { extensionId: artifact.task.aspectId, files };\n return { extensionId: artifact.task.aspectId, files: files.filter((file) => file.path === filePath) };\n })\n );\n\n const artifactFilesCount = extensionsWithArtifacts.reduce((accum, next) => accum + next.files.length, 0);\n\n if (artifactFilesCount === 0)\n return res\n .status(404)\n .jsonp({ error: `no artifacts found for component ${component.id} by aspect ${aspectId}` });\n\n if (artifactFilesCount === 1) {\n const extensionWithArtifact = extensionsWithArtifacts.find((e) => e.files.length > 0);\n const fileName = `${extensionWithArtifact?.extensionId}_${extensionWithArtifact?.files[0].path}`;\n const fileContent = extensionWithArtifact?.files[0].contents;\n const fileExt = extensionWithArtifact?.files[0].extname || defaultExtension;\n const contentType = mime.getType(fileExt);\n res.set('Content-disposition', `attachment; filename=${fileName}`);\n if (contentType) res.set('Content-Type', contentType);\n return res.send(fileContent);\n }\n\n /**\n * if more than 1 file requested, zip them before sending\n */\n const archive = archiver('tar', { gzip: true });\n\n archive.on('warning', (warn) => {\n this.logger.warn(warn.message);\n });\n\n archive.on('error', (err) => {\n this.logger.error(err.message);\n });\n\n extensionsWithArtifacts.forEach((extensionWithArtifacts) => {\n extensionWithArtifacts.files.forEach((artifact) => {\n archive.append(artifact.contents, { name: `${extensionWithArtifacts.extensionId}_${artifact.path}` });\n });\n });\n\n try {\n archive.pipe(res);\n /**\n * promise that is returned from the await zip.finalize(); is resolved before the archive is actually finalized\n * resolving it results in setting the headers before the stream is finished\n */\n // eslint-disable-next-line no-void\n void archive.finalize();\n return res.attachment(`${aspectId.replace('/', '_')}.tar`);\n } catch (e: any) {\n return res.send({ error: e.toString() });\n }\n },\n ];\n}\n"],"mappings":";;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,MAAA;EAAA,MAAA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QAAEC,IAAI,EAAE;MAAK,CAAC,CAAC;MAE/CF,OAAO,CAACG,EAAE,CAAC,SAAS,EAAGC,IAAI,IAAK;QAC9B,IAAI,CAACnD,MAAM,CAACmD,IAAI,CAACA,IAAI,CAACC,OAAO,CAAC;MAChC,CAAC,CAAC;MAEFL,OAAO,CAACG,EAAE,CAAC,OAAO,EAAGG,GAAG,IAAK;QAC3B,IAAI,CAACrD,MAAM,CAACe,KAAK,CAACsC,GAAG,CAACD,OAAO,CAAC;MAChC,CAAC,CAAC;MAEFnC,uBAAuB,CAACqC,OAAO,CAAEC,sBAAsB,IAAK;QAC1DA,sBAAsB,CAACjC,KAAK,CAACgC,OAAO,CAAEjC,QAAQ,IAAK;UACjD0B,OAAO,CAACS,MAAM,CAACnC,QAAQ,CAACkB,QAAQ,EAAE;YAAEkB,IAAI,EAAE,GAAGF,sBAAsB,CAAC9B,WAAW,IAAIJ,QAAQ,CAACQ,IAAI;UAAG,CAAC,CAAC;QACvG,CAAC,CAAC;MACJ,CAAC,CAAC;MAEF,IAAI;QACFkB,OAAO,CAACW,IAAI,CAACxD,GAAG,CAAC;QACjB;AACR;AACA;AACA;QACQ;QACA,KAAK6C,OAAO,CAACY,QAAQ,CAAC,CAAC;QACvB,OAAOzD,GAAG,CAAC0D,UAAU,CAAC,GAAGpD,QAAQ,CAACC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;MAC5D,CAAC,CAAC,OAAOrC,CAAM,EAAE;QACf,OAAO8B,GAAG,CAAC4C,IAAI,CAAC;UAAE/B,KAAK,EAAE3C,CAAC,CAACyF,QAAQ,CAAC;QAAE,CAAC,CAAC;MAC1C;IACF,CAAC,CACF;EA7EE;AA8EL;AAACnE,OAAA,CAAAE,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","InvalidTask","BitError","constructor","taskAspectId","reason","exports"],"sources":["invalid-task.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class InvalidTask extends BitError {\n constructor(readonly taskAspectId: string
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","InvalidTask","BitError","constructor","taskAspectId","reason","exports"],"sources":["invalid-task.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class InvalidTask extends BitError {\n constructor(\n readonly taskAspectId: string,\n reason: string\n ) {\n super(`task of ${taskAspectId} is invalid, ${reason}`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,WAAW,SAASC,oBAAQ,CAAC;EACxCC,WAAWA,CACAC,YAAoB,EAC7BC,MAAc,EACd;IACA,KAAK,CAAC,WAAWD,YAAY,gBAAgBC,MAAM,EAAE,CAAC;IAAC,KAH9CD,YAAoB,GAApBA,YAAoB;EAI/B;AACF;AAACE,OAAA,CAAAL,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.427/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.427/dist/builder.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { BitError } from '@teambit/bit-error';
|
|
2
2
|
|
|
3
3
|
export class InvalidTask extends BitError {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(
|
|
5
|
+
readonly taskAspectId: string,
|
|
6
|
+
reason: string
|
|
7
|
+
) {
|
|
5
8
|
super(`task of ${taskAspectId} is invalid, ${reason}`);
|
|
6
9
|
}
|
|
7
10
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.427",
|
|
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.427"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -26,27 +26,27 @@
|
|
|
26
26
|
"@teambit/harmony": "0.4.6",
|
|
27
27
|
"@teambit/bit-error": "0.0.404",
|
|
28
28
|
"@teambit/component-id": "1.2.2",
|
|
29
|
-
"@teambit/component": "1.0.
|
|
30
|
-
"@teambit/envs": "1.0.
|
|
31
|
-
"@teambit/logger": "0.0.
|
|
29
|
+
"@teambit/component": "1.0.427",
|
|
30
|
+
"@teambit/envs": "1.0.427",
|
|
31
|
+
"@teambit/logger": "0.0.1097",
|
|
32
32
|
"@teambit/toolbox.string.capitalize": "0.0.496",
|
|
33
|
-
"@teambit/tester": "1.0.
|
|
34
|
-
"@teambit/component.sources": "0.0.
|
|
35
|
-
"@teambit/isolator": "1.0.
|
|
36
|
-
"@teambit/cli": "0.0.
|
|
33
|
+
"@teambit/tester": "1.0.427",
|
|
34
|
+
"@teambit/component.sources": "0.0.34",
|
|
35
|
+
"@teambit/isolator": "1.0.427",
|
|
36
|
+
"@teambit/cli": "0.0.1004",
|
|
37
37
|
"@teambit/component-issues": "0.0.151",
|
|
38
|
-
"@teambit/workspace": "1.0.
|
|
39
|
-
"@teambit/aspect-loader": "1.0.
|
|
40
|
-
"@teambit/aspect": "1.0.
|
|
38
|
+
"@teambit/workspace": "1.0.427",
|
|
39
|
+
"@teambit/aspect-loader": "1.0.427",
|
|
40
|
+
"@teambit/aspect": "1.0.427",
|
|
41
41
|
"@teambit/bit.get-bit-version": "0.0.1",
|
|
42
|
-
"@teambit/generator": "1.0.
|
|
43
|
-
"@teambit/global-config": "0.0.
|
|
44
|
-
"@teambit/graphql": "1.0.
|
|
45
|
-
"@teambit/issues": "1.0.
|
|
46
|
-
"@teambit/scope": "1.0.
|
|
42
|
+
"@teambit/generator": "1.0.428",
|
|
43
|
+
"@teambit/global-config": "0.0.1007",
|
|
44
|
+
"@teambit/graphql": "1.0.427",
|
|
45
|
+
"@teambit/issues": "1.0.427",
|
|
46
|
+
"@teambit/scope": "1.0.427",
|
|
47
47
|
"@teambit/toolbox.array.duplications-finder": "0.0.1",
|
|
48
|
-
"@teambit/ui": "1.0.
|
|
49
|
-
"@teambit/express": "0.0.
|
|
48
|
+
"@teambit/ui": "1.0.427",
|
|
49
|
+
"@teambit/express": "0.0.1103",
|
|
50
50
|
"@teambit/legacy.utils": "0.0.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/minimatch": "3.0.4",
|
|
58
58
|
"@types/mocha": "9.1.0",
|
|
59
59
|
"@teambit/harmony.envs.core-aspect-env": "0.0.60",
|
|
60
|
-
"@teambit/pipelines.aspect-docs.builder": "0.0.
|
|
60
|
+
"@teambit/pipelines.aspect-docs.builder": "0.0.169"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"react": "^17.0.0 || ^18.0.0",
|