@teambit/builder 1.0.410 → 1.0.412
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.
|
@@ -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.412" 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={15259:(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},99357:(e,n,t)=>{Object.defineProperty(n,"M",{enumerable:!0,get:function(){return i.default}});var i=a(t(15259));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}},29726:(e,n,t)=>{var i={id:"teambit.pipelines/builder@1.0.410",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(29726),o=(t(41594),t(5016));const l=TeambitMdxUiMdxScopeContext;var s=t(99357),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={84107:(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},92173:(e,n,t)=>{Object.defineProperty(n,"M",{enumerable:!0,get:function(){return i.default}});var i=a(t(84107));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}},26436:(e,n,t)=>{var i={id:"teambit.pipelines/builder@1.0.412",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(26436),o=(t(41594),t(5016));const l=TeambitMdxUiMdxScopeContext;var s=t(92173),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
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"line": 3,
|
|
21
21
|
"character": 10
|
|
22
22
|
},
|
|
23
|
+
"signature": "export { ArtifactVinyl };\n\nArtifactVinyl",
|
|
23
24
|
"name": "ArtifactVinyl",
|
|
24
25
|
"exportNode": {
|
|
25
26
|
"__schema": "TypeRefSchema",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"componentId": {
|
|
33
34
|
"scope": "teambit.component",
|
|
34
35
|
"name": "sources",
|
|
35
|
-
"version": "0.0.
|
|
36
|
+
"version": "0.0.30"
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
},
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"line": 4,
|
|
44
45
|
"character": 10
|
|
45
46
|
},
|
|
47
|
+
"signature": "class BuildPipe",
|
|
46
48
|
"name": "BuildPipe",
|
|
47
49
|
"exportNode": {
|
|
48
50
|
"__schema": "ClassSchema",
|
|
@@ -288,6 +290,7 @@
|
|
|
288
290
|
"line": 5,
|
|
289
291
|
"character": 15
|
|
290
292
|
},
|
|
293
|
+
"signature": "type TaskResults = {\n task: BuildTask;\n env: EnvDefinition;\n componentsResults: ComponentResult[];\n artifacts: ComponentMap<ArtifactList<FsArtifact>> | undefined;\n startTime: number;\n endTime: number;\n}",
|
|
291
294
|
"name": "TaskResults",
|
|
292
295
|
"exportNode": {
|
|
293
296
|
"__schema": "TypeSchema",
|
|
@@ -556,6 +559,7 @@
|
|
|
556
559
|
"line": 6,
|
|
557
560
|
"character": 15
|
|
558
561
|
},
|
|
562
|
+
"signature": "type ComponentResult = {\n component: Component;\n metadata?: TaskMetadata | undefined;\n errors?: (string | Error)[] | undefined;\n warnings?: string[] | undefined;\n startTime?: number | undefined;\n endTime?: number | undefined;\n}",
|
|
559
563
|
"name": "ComponentResult",
|
|
560
564
|
"exportNode": {
|
|
561
565
|
"__schema": "TypeSchema",
|
|
@@ -813,6 +817,7 @@
|
|
|
813
817
|
"line": 6,
|
|
814
818
|
"character": 32
|
|
815
819
|
},
|
|
820
|
+
"signature": "type TaskMetadata = {\n [key: string]: any;\n}",
|
|
816
821
|
"name": "TaskMetadata",
|
|
817
822
|
"exportNode": {
|
|
818
823
|
"__schema": "TypeSchema",
|
|
@@ -879,6 +884,7 @@
|
|
|
879
884
|
"line": 7,
|
|
880
885
|
"character": 15
|
|
881
886
|
},
|
|
887
|
+
"signature": "interface BuildContext",
|
|
882
888
|
"name": "BuildContext",
|
|
883
889
|
"exportNode": {
|
|
884
890
|
"__schema": "InterfaceSchema",
|
|
@@ -1119,7 +1125,7 @@
|
|
|
1119
1125
|
"_legacy": {
|
|
1120
1126
|
"scope": "teambit.pipelines",
|
|
1121
1127
|
"name": "builder",
|
|
1122
|
-
"version": "1.0.
|
|
1128
|
+
"version": "1.0.412"
|
|
1123
1129
|
},
|
|
1124
1130
|
"_scope": "teambit.pipelines"
|
|
1125
1131
|
}
|
|
@@ -1135,6 +1141,7 @@
|
|
|
1135
1141
|
"line": 7,
|
|
1136
1142
|
"character": 29
|
|
1137
1143
|
},
|
|
1144
|
+
"signature": "interface BuildTask",
|
|
1138
1145
|
"name": "BuildTask",
|
|
1139
1146
|
"exportNode": {
|
|
1140
1147
|
"__schema": "InterfaceSchema",
|
|
@@ -1532,6 +1539,7 @@
|
|
|
1532
1539
|
"line": 7,
|
|
1533
1540
|
"character": 40
|
|
1534
1541
|
},
|
|
1542
|
+
"signature": "interface BuiltTaskResult",
|
|
1535
1543
|
"name": "BuiltTaskResult",
|
|
1536
1544
|
"exportNode": {
|
|
1537
1545
|
"__schema": "InterfaceSchema",
|
|
@@ -1632,6 +1640,7 @@
|
|
|
1632
1640
|
"line": 7,
|
|
1633
1641
|
"character": 57
|
|
1634
1642
|
},
|
|
1643
|
+
"signature": "type TaskLocation = \"end\" | \"start\"",
|
|
1635
1644
|
"name": "TaskLocation",
|
|
1636
1645
|
"exportNode": {
|
|
1637
1646
|
"__schema": "TypeSchema",
|
|
@@ -1679,6 +1688,7 @@
|
|
|
1679
1688
|
"line": 8,
|
|
1680
1689
|
"character": 10
|
|
1681
1690
|
},
|
|
1691
|
+
"signature": "const CAPSULE_ARTIFACTS_DIR: \"artifacts\"",
|
|
1682
1692
|
"name": "CAPSULE_ARTIFACTS_DIR",
|
|
1683
1693
|
"exportNode": {
|
|
1684
1694
|
"__schema": "VariableLikeSchema",
|
|
@@ -1709,6 +1719,7 @@
|
|
|
1709
1719
|
"line": 9,
|
|
1710
1720
|
"character": 15
|
|
1711
1721
|
},
|
|
1722
|
+
"signature": "type PipeName = \"tag\" | \"build\" | \"snap\"",
|
|
1712
1723
|
"name": "PipeName",
|
|
1713
1724
|
"exportNode": {
|
|
1714
1725
|
"__schema": "TypeSchema",
|
|
@@ -1765,6 +1776,7 @@
|
|
|
1765
1776
|
"line": 10,
|
|
1766
1777
|
"character": 15
|
|
1767
1778
|
},
|
|
1779
|
+
"signature": "class BuilderMain",
|
|
1768
1780
|
"name": "BuilderMain",
|
|
1769
1781
|
"exportNode": {
|
|
1770
1782
|
"__schema": "ClassSchema",
|
|
@@ -4310,6 +4322,7 @@
|
|
|
4310
4322
|
"line": 10,
|
|
4311
4323
|
"character": 28
|
|
4312
4324
|
},
|
|
4325
|
+
"signature": "type RawBuilderData = {\n pipeline: PipelineReport[];\n artifacts?: ArtifactObject[] | undefined;\n aspectsData: AspectData[];\n bitVersion?: string | undefined;\n}",
|
|
4313
4326
|
"name": "RawBuilderData",
|
|
4314
4327
|
"exportNode": {
|
|
4315
4328
|
"__schema": "TypeSchema",
|
|
@@ -4454,6 +4467,7 @@
|
|
|
4454
4467
|
"line": 10,
|
|
4455
4468
|
"character": 44
|
|
4456
4469
|
},
|
|
4470
|
+
"signature": "type BuilderData = Omit<RawBuilderData, \"artifacts\"> & {\n artifacts: ArtifactList<Artifact>;\n}",
|
|
4457
4471
|
"name": "BuilderData",
|
|
4458
4472
|
"exportNode": {
|
|
4459
4473
|
"__schema": "TypeSchema",
|
|
@@ -4564,6 +4578,7 @@
|
|
|
4564
4578
|
"line": 10,
|
|
4565
4579
|
"character": 57
|
|
4566
4580
|
},
|
|
4581
|
+
"signature": "type OnTagOpts = {\n disableTagAndSnapPipelines?: boolean | undefined;\n throwOnError?: boolean | undefined;\n forceDeploy?: boolean | undefined;\n populateArtifactsFrom?: ComponentID[] | undefined;\n isSnap?: boolean | undefined;\n}",
|
|
4567
4582
|
"name": "OnTagOpts",
|
|
4568
4583
|
"exportNode": {
|
|
4569
4584
|
"__schema": "TypeSchema",
|
|
@@ -4701,6 +4716,7 @@
|
|
|
4701
4716
|
"line": 11,
|
|
4702
4717
|
"character": 15
|
|
4703
4718
|
},
|
|
4719
|
+
"signature": "type TaskHandler = {\n handler: EnvHandler<Task>;\n name: string;\n}",
|
|
4704
4720
|
"name": "TaskHandler",
|
|
4705
4721
|
"exportNode": {
|
|
4706
4722
|
"__schema": "TypeSchema",
|
|
@@ -4781,6 +4797,7 @@
|
|
|
4781
4797
|
"line": 12,
|
|
4782
4798
|
"character": 10
|
|
4783
4799
|
},
|
|
4800
|
+
"signature": "class Pipeline",
|
|
4784
4801
|
"name": "Pipeline",
|
|
4785
4802
|
"exportNode": {
|
|
4786
4803
|
"__schema": "ClassSchema",
|
|
@@ -5253,6 +5270,7 @@
|
|
|
5253
5270
|
"line": 13,
|
|
5254
5271
|
"character": 15
|
|
5255
5272
|
},
|
|
5273
|
+
"signature": "type PipelineReport = {\n taskId: string;\n taskName: string;\n taskDescription?: string | undefined;\n startTime?: number | undefined;\n endTime?: number | undefined;\n errors?: (string | Error)[] | undefined;\n warnings?: string[] | undefined;\n}",
|
|
5256
5274
|
"name": "PipelineReport",
|
|
5257
5275
|
"exportNode": {
|
|
5258
5276
|
"__schema": "TypeSchema",
|
|
@@ -5460,6 +5478,7 @@
|
|
|
5460
5478
|
"line": 14,
|
|
5461
5479
|
"character": 15
|
|
5462
5480
|
},
|
|
5481
|
+
"signature": "interface BuilderEnv",
|
|
5463
5482
|
"name": "BuilderEnv",
|
|
5464
5483
|
"exportNode": {
|
|
5465
5484
|
"__schema": "InterfaceSchema",
|
|
@@ -5578,6 +5597,7 @@
|
|
|
5578
5597
|
"line": 15,
|
|
5579
5598
|
"character": 15
|
|
5580
5599
|
},
|
|
5600
|
+
"signature": "interface WholeArtifactStorageResolver",
|
|
5581
5601
|
"name": "WholeArtifactStorageResolver",
|
|
5582
5602
|
"exportNode": {
|
|
5583
5603
|
"__schema": "InterfaceSchema",
|
|
@@ -5767,6 +5787,7 @@
|
|
|
5767
5787
|
"line": 15,
|
|
5768
5788
|
"character": 45
|
|
5769
5789
|
},
|
|
5790
|
+
"signature": "interface FileStorageResolver",
|
|
5770
5791
|
"name": "FileStorageResolver",
|
|
5771
5792
|
"exportNode": {
|
|
5772
5793
|
"__schema": "InterfaceSchema",
|
|
@@ -5976,6 +5997,7 @@
|
|
|
5976
5997
|
"line": 15,
|
|
5977
5998
|
"character": 66
|
|
5978
5999
|
},
|
|
6000
|
+
"signature": "type ArtifactStorageResolver = WholeArtifactStorageResolver | FileStorageResolver",
|
|
5979
6001
|
"name": "ArtifactStorageResolver",
|
|
5980
6002
|
"exportNode": {
|
|
5981
6003
|
"__schema": "TypeSchema",
|
|
@@ -6023,6 +6045,7 @@
|
|
|
6023
6045
|
"line": 16,
|
|
6024
6046
|
"character": 15
|
|
6025
6047
|
},
|
|
6048
|
+
"signature": "type ArtifactDefinition = {\n name: string;\n generatedBy?: string | undefined;\n description?: string | undefined;\n globPatterns?: string[] | undefined;\n directories?: string[] | undefined;\n rootDir?: string | undefined;\n dirPrefix?: string | undefined;\n context?: \"component\" | ... 1 more ... | undefined;\n storageResolver?: ArtifactStorageResolver | undefined;\n}",
|
|
6026
6049
|
"name": "ArtifactDefinition",
|
|
6027
6050
|
"exportNode": {
|
|
6028
6051
|
"__schema": "TypeSchema",
|
|
@@ -6399,6 +6422,7 @@
|
|
|
6399
6422
|
"line": 16,
|
|
6400
6423
|
"character": 35
|
|
6401
6424
|
},
|
|
6425
|
+
"signature": "type ArtifactModelDefinition = Omit<ArtifactDefinition, \"storageResolver\"> & {\n storageResolver?: string | undefined;\n}",
|
|
6402
6426
|
"name": "ArtifactModelDefinition",
|
|
6403
6427
|
"exportNode": {
|
|
6404
6428
|
"__schema": "TypeSchema",
|
|
@@ -6487,6 +6511,7 @@
|
|
|
6487
6511
|
"line": 17,
|
|
6488
6512
|
"character": 10
|
|
6489
6513
|
},
|
|
6514
|
+
"signature": "class Artifact",
|
|
6490
6515
|
"name": "Artifact",
|
|
6491
6516
|
"exportNode": {
|
|
6492
6517
|
"__schema": "ClassSchema",
|
|
@@ -6808,7 +6833,7 @@
|
|
|
6808
6833
|
"componentId": {
|
|
6809
6834
|
"scope": "teambit.component",
|
|
6810
6835
|
"name": "sources",
|
|
6811
|
-
"version": "0.0.
|
|
6836
|
+
"version": "0.0.30"
|
|
6812
6837
|
}
|
|
6813
6838
|
},
|
|
6814
6839
|
"modifiers": []
|
|
@@ -6869,6 +6894,7 @@
|
|
|
6869
6894
|
"line": 17,
|
|
6870
6895
|
"character": 20
|
|
6871
6896
|
},
|
|
6897
|
+
"signature": "class ArtifactList<T extends Artifact>",
|
|
6872
6898
|
"name": "ArtifactList",
|
|
6873
6899
|
"exportNode": {
|
|
6874
6900
|
"__schema": "ClassSchema",
|
|
@@ -7576,7 +7602,7 @@
|
|
|
7576
7602
|
"_legacy": {
|
|
7577
7603
|
"scope": "teambit.pipelines",
|
|
7578
7604
|
"name": "builder",
|
|
7579
|
-
"version": "1.0.
|
|
7605
|
+
"version": "1.0.412"
|
|
7580
7606
|
},
|
|
7581
7607
|
"_scope": "teambit.pipelines"
|
|
7582
7608
|
}
|
|
@@ -7593,6 +7619,7 @@
|
|
|
7593
7619
|
"line": 17,
|
|
7594
7620
|
"character": 34
|
|
7595
7621
|
},
|
|
7622
|
+
"signature": "class ArtifactFactory",
|
|
7596
7623
|
"name": "ArtifactFactory",
|
|
7597
7624
|
"exportNode": {
|
|
7598
7625
|
"__schema": "ClassSchema",
|
|
@@ -7992,6 +8019,7 @@
|
|
|
7992
8019
|
"line": 18,
|
|
7993
8020
|
"character": 15
|
|
7994
8021
|
},
|
|
8022
|
+
"signature": "interface Task",
|
|
7995
8023
|
"name": "Task",
|
|
7996
8024
|
"exportNode": {
|
|
7997
8025
|
"__schema": "InterfaceSchema",
|
|
@@ -8338,6 +8366,7 @@
|
|
|
8338
8366
|
"line": 19,
|
|
8339
8367
|
"character": 10
|
|
8340
8368
|
},
|
|
8369
|
+
"signature": "class TaskResultsList",
|
|
8341
8370
|
"name": "TaskResultsList",
|
|
8342
8371
|
"exportNode": {
|
|
8343
8372
|
"__schema": "ClassSchema",
|
|
@@ -8564,6 +8593,7 @@
|
|
|
8564
8593
|
"line": 20,
|
|
8565
8594
|
"character": 10
|
|
8566
8595
|
},
|
|
8596
|
+
"signature": "const BuilderAspect: Aspect",
|
|
8567
8597
|
"name": "BuilderAspect",
|
|
8568
8598
|
"exportNode": {
|
|
8569
8599
|
"__schema": "VariableLikeSchema",
|
|
@@ -8599,6 +8629,7 @@
|
|
|
8599
8629
|
"line": 20,
|
|
8600
8630
|
"character": 42
|
|
8601
8631
|
},
|
|
8632
|
+
"signature": "const BuilderAspect: Aspect",
|
|
8602
8633
|
"name": "BuilderAspect",
|
|
8603
8634
|
"exportNode": {
|
|
8604
8635
|
"__schema": "VariableLikeSchema",
|
|
@@ -9862,7 +9893,7 @@
|
|
|
9862
9893
|
"_legacy": {
|
|
9863
9894
|
"scope": "teambit.pipelines",
|
|
9864
9895
|
"name": "builder",
|
|
9865
|
-
"version": "1.0.
|
|
9896
|
+
"version": "1.0.412"
|
|
9866
9897
|
},
|
|
9867
9898
|
"_scope": "teambit.pipelines"
|
|
9868
9899
|
}
|
|
@@ -15211,7 +15242,7 @@
|
|
|
15211
15242
|
"componentId": {
|
|
15212
15243
|
"scope": "teambit.component",
|
|
15213
15244
|
"name": "sources",
|
|
15214
|
-
"version": "0.0.
|
|
15245
|
+
"version": "0.0.30"
|
|
15215
15246
|
}
|
|
15216
15247
|
},
|
|
15217
15248
|
"modifiers": []
|
|
@@ -16509,7 +16540,7 @@
|
|
|
16509
16540
|
"_legacy": {
|
|
16510
16541
|
"scope": "teambit.pipelines",
|
|
16511
16542
|
"name": "builder",
|
|
16512
|
-
"version": "1.0.
|
|
16543
|
+
"version": "1.0.412"
|
|
16513
16544
|
},
|
|
16514
16545
|
"_scope": "teambit.pipelines"
|
|
16515
16546
|
}
|
|
@@ -16790,7 +16821,7 @@
|
|
|
16790
16821
|
"componentId": {
|
|
16791
16822
|
"scope": "teambit.pipelines",
|
|
16792
16823
|
"name": "builder",
|
|
16793
|
-
"version": "1.0.
|
|
16824
|
+
"version": "1.0.412"
|
|
16794
16825
|
},
|
|
16795
16826
|
"taggedModuleExports": []
|
|
16796
16827
|
}
|
|
@@ -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.412/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pipelines_builder@1.0.412/dist/builder.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.412",
|
|
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.412"
|
|
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.0",
|
|
29
|
-
"@teambit/component": "1.0.
|
|
30
|
-
"@teambit/envs": "1.0.
|
|
31
|
-
"@teambit/logger": "0.0.
|
|
29
|
+
"@teambit/component": "1.0.412",
|
|
30
|
+
"@teambit/envs": "1.0.412",
|
|
31
|
+
"@teambit/logger": "0.0.1082",
|
|
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.412",
|
|
34
|
+
"@teambit/component.sources": "0.0.30",
|
|
35
|
+
"@teambit/isolator": "1.0.412",
|
|
36
|
+
"@teambit/cli": "0.0.989",
|
|
37
37
|
"@teambit/component-issues": "0.0.150",
|
|
38
|
-
"@teambit/workspace": "1.0.
|
|
39
|
-
"@teambit/aspect-loader": "1.0.
|
|
40
|
-
"@teambit/aspect": "1.0.
|
|
38
|
+
"@teambit/workspace": "1.0.412",
|
|
39
|
+
"@teambit/aspect-loader": "1.0.412",
|
|
40
|
+
"@teambit/aspect": "1.0.412",
|
|
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.413",
|
|
43
|
+
"@teambit/global-config": "0.0.992",
|
|
44
|
+
"@teambit/graphql": "1.0.412",
|
|
45
|
+
"@teambit/issues": "1.0.412",
|
|
46
|
+
"@teambit/scope": "1.0.412",
|
|
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.412",
|
|
49
|
+
"@teambit/express": "0.0.1088",
|
|
50
50
|
"@teambit/legacy.utils": "0.0.5"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -56,8 +56,7 @@
|
|
|
56
56
|
"@types/fs-extra": "9.0.7",
|
|
57
57
|
"@types/minimatch": "3.0.4",
|
|
58
58
|
"@types/mocha": "9.1.0",
|
|
59
|
-
"
|
|
60
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.47",
|
|
59
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.59",
|
|
61
60
|
"@teambit/pipelines.aspect-docs.builder": "0.0.168"
|
|
62
61
|
},
|
|
63
62
|
"peerDependencies": {
|