@teambit/builder 1.0.107 → 1.0.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/preview/teambit_pipelines_builder-preview.js +1 -0
- package/dist/artifact/artifact-definition.d.ts +2 -2
- package/dist/artifact/artifact-extractor.d.ts +3 -3
- package/dist/artifact/artifact-factory.d.ts +1 -1
- package/dist/artifact/artifact-factory.js +1 -2
- package/dist/artifact/artifact-factory.js.map +1 -1
- package/dist/artifact/artifact-list.d.ts +1 -1
- package/dist/artifact/artifact.d.ts +1 -1
- package/dist/artifact/artifacts.cmd.d.ts +1 -1
- package/dist/build-pipe.d.ts +3 -3
- package/dist/build-pipe.js +5 -12
- package/dist/build-pipe.js.map +1 -1
- package/dist/build-pipeline-result-list.d.ts +2 -2
- package/dist/build-pipeline-result-list.js +1 -2
- package/dist/build-pipeline-result-list.js.map +1 -1
- package/dist/build-task.d.ts +1 -1
- package/dist/build.cmd.d.ts +1 -1
- package/dist/builder.composition.d.ts +2 -2
- package/dist/builder.graphql.d.ts +17 -17
- package/dist/builder.graphql.js +4 -8
- package/dist/builder.graphql.js.map +1 -1
- package/dist/builder.main.runtime.d.ts +5 -5
- package/dist/builder.main.runtime.js +11 -14
- package/dist/builder.main.runtime.js.map +1 -1
- package/dist/builder.route.d.ts +1 -1
- package/dist/builder.route.js +3 -3
- package/dist/builder.route.js.map +1 -1
- package/dist/builder.service.d.ts +9 -9
- package/dist/builder.service.js +4 -4
- package/dist/builder.service.js.map +1 -1
- package/dist/pipeline.d.ts +1 -1
- package/dist/{preview-1703590665075.js → preview-1703698405864.js} +2 -2
- package/dist/storage/storage-resolver.d.ts +2 -2
- package/dist/task-results-list.js +2 -8
- package/dist/task-results-list.js.map +1 -1
- package/dist/tasks-queue.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +26 -33
- package/tsconfig.json +16 -21
- package/types/asset.d.ts +15 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_constants","data","require","_react","_interopRequireDefault","_chalk","_lodash","_pMapSeries","_ink","_buildPipe","_buildTask","_buildPipelineOrder","_builder","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","pipeNames","getBuildPipe","getTagPipe","getSnapPipe","BuilderService","constructor","isolator","logger","taskSlot","pipeNameOnEnv","displayPipeName","artifactFactory","scope","globalConfig","runOnce","envsExecutionContext","options","envs","map","executionContext","envDefinition","tasksQueue","calculatePipelineOrder","tasks","skipTests","validate","info","toString","console","title","length","longProcessLogger","createLongProcessLogger","undefined","envsBuildContext","capsulesBaseDir","getComponentsCapsulesBaseDir","baseDir","useHash","isolateOptions","getExistingAsIs","seedersOnly","pMapSeries","componentIds","components","component","id","originalSeeders","originalSeedersOfThisEnv","filter","compId","find","seeder","isEqual","capsuleNetwork","isolateComponents","_originalSeeders","msg","extraDetails","seedersCapsules","graphCapsules","chalk","dim","buildContext","assign","previousTasksResults","pipeName","dev","laneId","legacyScope","getCurrentLaneId","envIdsWithoutVersion","env","split","buildPipe","BuildPipe","exitOnFirstFailedTask","showEnvNameInOutput","showEnvVersionInOutput","uniq","buildResults","execute","end","hasErrors","getSync","CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR","render","descriptor","getDescriptor","createElement","Text","BuilderAspect","Newline","transform","envContext","build","pipeline","compute","tag","snap","getTasksNamesByPipeFunc","pipeFuncName","task","BuildTaskHelper","serializeId","getCurrentPipeTasks","exports"],"sources":["builder.service.tsx"],"sourcesContent":["import { CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR } from '@teambit/legacy/dist/constants';\nimport { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport React from 'react';\nimport chalk from 'chalk';\nimport { uniq } from 'lodash';\nimport { ScopeMain } from '@teambit/scope';\nimport pMapSeries from 'p-map-series';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { Text, Newline } from 'ink';\nimport { Logger } from '@teambit/logger';\nimport { IsolatorMain } from '@teambit/isolator';\nimport { Component, ComponentID } from '@teambit/component';\nimport { BuildPipe, TaskResults } from './build-pipe';\nimport { TaskResultsList } from './task-results-list';\nimport { TaskSlot } from './builder.main.runtime';\nimport { BuildContext, BuildTask, BuildTaskHelper } from './build-task';\nimport { ArtifactFactory } from './artifact';\nimport { calculatePipelineOrder } from './build-pipeline-order';\nimport { BuilderAspect } from './builder.aspect';\n\nexport type BuildServiceResults = {\n id: string;\n buildResults: TaskResultsList;\n components: Component[];\n errors?: [];\n};\n\nexport type BuilderServiceOptions = {\n seedersOnly?: boolean;\n originalSeeders?: ComponentID[];\n tasks?: string[];\n skipTests?: boolean;\n previousTasksResults?: TaskResults[];\n dev?: boolean;\n exitOnFirstFailedTask?: boolean;\n capsulesBaseDir?: string;\n};\n\ntype BuilderTransformationMap = ServiceTransformationMap & {\n getBuildPipe: () => BuildTask[];\n getTagPipe: () => BuildTask[];\n getSnapPipe: () => BuildTask[];\n};\n\nexport type EnvsBuildContext = { [envId: string]: BuildContext };\n\nconst pipeNames = {\n getBuildPipe: 'build',\n getTagPipe: 'tag',\n getSnapPipe: 'snap',\n};\n\nexport type PipeName = 'build' | 'tag' | 'snap';\n\nexport type BuilderDescriptor = Array<{ pipeName: PipeName; tasks: string[] }>;\n\nexport type PipeFunctionNames = keyof typeof pipeNames;\nexport class BuilderService implements EnvService<BuildServiceResults, string> {\n name = 'builder';\n\n constructor(\n /**\n * isolator extension.\n */\n private isolator: IsolatorMain,\n\n /**\n * logger extension.\n */\n private logger: Logger,\n\n /**\n * task slot (e.g tasks registered by other extensions.).\n */\n private taskSlot: TaskSlot,\n\n /**\n * a method with such name should be implemented on the env in order to run the pipe tasks.\n */\n private pipeNameOnEnv: PipeFunctionNames,\n\n /**\n * pipe name to display on the console during the execution\n */\n private displayPipeName: PipeName,\n private artifactFactory: ArtifactFactory,\n private scope: ScopeMain,\n private globalConfig: GlobalConfigMain\n ) {}\n\n /**\n * runs all tasks for all envs\n */\n async runOnce(envsExecutionContext: ExecutionContext[], options: BuilderServiceOptions): Promise<TaskResultsList> {\n const envs = envsExecutionContext.map((executionContext) => executionContext.envDefinition);\n const tasksQueue = calculatePipelineOrder(\n this.taskSlot,\n envs,\n this.pipeNameOnEnv,\n options.tasks,\n options.skipTests\n );\n tasksQueue.validate();\n this.logger.info(`going to run tasks in the following order:\\n${tasksQueue.toString()}`);\n this.logger.console('\\n'); // this is to make is clear separation between the various pipelines (build/snap/tag)\n const title = `Running ${this.displayPipeName} pipeline using ${envs.length} environment(s), total ${tasksQueue.length} tasks`;\n const longProcessLogger = this.logger.createLongProcessLogger(title, undefined, 'title');\n const envsBuildContext: EnvsBuildContext = {};\n const capsulesBaseDir = this.getComponentsCapsulesBaseDir();\n\n const baseDir = options.capsulesBaseDir || capsulesBaseDir;\n const useHash = !baseDir;\n const isolateOptions = {\n baseDir,\n useHash,\n getExistingAsIs: true,\n seedersOnly: options.seedersOnly,\n };\n\n await pMapSeries(envsExecutionContext, async (executionContext) => {\n const componentIds = executionContext.components.map((component) => component.id);\n const { originalSeeders } = options;\n const originalSeedersOfThisEnv = componentIds.filter((compId) =>\n originalSeeders ? originalSeeders.find((seeder) => compId.isEqual(seeder)) : true\n );\n const capsuleNetwork = await this.isolator.isolateComponents(componentIds, isolateOptions);\n capsuleNetwork._originalSeeders = originalSeedersOfThisEnv;\n const msg = `building ${originalSeedersOfThisEnv.length} components of env \"${executionContext.id}\"`;\n const extraDetails = `original seeders of this env: ${originalSeedersOfThisEnv.length}, graph of this env: ${capsuleNetwork.seedersCapsules.length}, graph total (include other envs): ${capsuleNetwork.graphCapsules.length}`;\n this.logger.console(`${msg}. ${chalk.dim(extraDetails)}`);\n const buildContext = Object.assign(executionContext, {\n capsuleNetwork,\n previousTasksResults: [],\n pipeName: this.displayPipeName,\n dev: options.dev,\n laneId: this.scope.legacyScope.getCurrentLaneId(),\n });\n envsBuildContext[executionContext.id] = buildContext;\n });\n const envIdsWithoutVersion = envs.map((env) => env.id.split('@')[0]);\n const buildPipe = new BuildPipe(\n tasksQueue,\n envsBuildContext,\n this.logger,\n this.artifactFactory,\n options.previousTasksResults,\n {\n exitOnFirstFailedTask: options.exitOnFirstFailedTask,\n showEnvNameInOutput: envs.length > 1,\n showEnvVersionInOutput: envIdsWithoutVersion.length > uniq(envIdsWithoutVersion).length,\n }\n );\n const buildResults = await buildPipe.execute();\n longProcessLogger.end(buildResults.hasErrors() ? 'error' : 'success');\n\n return buildResults;\n }\n\n getComponentsCapsulesBaseDir(): string | undefined {\n return this.globalConfig.getSync(CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR);\n }\n\n render() {\n const descriptor = this.getDescriptor();\n\n return (\n <Text key={BuilderAspect.id}>\n {descriptor}\n <Newline />\n <Newline />\n </Text>\n );\n }\n\n transform(env: Env, envContext: EnvContext): BuilderTransformationMap | undefined {\n if (!env?.build) return undefined;\n return {\n getBuildPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.build();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getTagPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.tag();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getSnapPipe: () => {\n const pipeline = env.snap();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n };\n }\n\n getDescriptor() {\n return 'run `bit build --list-tasks <component-id>` to see the tasks list for the pipelines: build, tag and snap';\n }\n\n private getTasksNamesByPipeFunc(env: EnvDefinition, pipeFuncName: PipeFunctionNames): string[] {\n const tasksQueue = calculatePipelineOrder(this.taskSlot, [env], pipeFuncName).map(({ task }) =>\n BuildTaskHelper.serializeId(task)\n );\n return tasksQueue;\n }\n\n getCurrentPipeTasks(env: EnvDefinition) {\n return this.getTasksNamesByPipeFunc(env, this.pipeNameOnEnv);\n }\n}\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IACd,OAAO,0GAA0G;EACnH;EAEQY,uBAAuBA,CAAC5B,GAAkB,EAAE6B,YAA+B,EAAY;IAC7F,MAAMhF,UAAU,GAAG,IAAAC,4CAAsB,EAAC,IAAI,CAACd,QAAQ,EAAE,CAACgE,GAAG,CAAC,EAAE6B,YAAY,CAAC,CAACnF,GAAG,CAAC,CAAC;MAAEoF;IAAK,CAAC,KACzFC,4BAAe,CAACC,WAAW,CAACF,IAAI,CAClC,CAAC;IACD,OAAOjF,UAAU;EACnB;EAEAoF,mBAAmBA,CAACjC,GAAkB,EAAE;IACtC,OAAO,IAAI,CAAC4B,uBAAuB,CAAC5B,GAAG,EAAE,IAAI,CAAC/D,aAAa,CAAC;EAC9D;AACF;AAACiG,OAAA,CAAAtG,cAAA,GAAAA,cAAA"}
|
|
1
|
+
{"version":3,"names":["_constants","data","require","_react","_interopRequireDefault","_chalk","_lodash","_pMapSeries","_ink","_buildPipe","_buildTask","_buildPipelineOrder","_builder","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","pipeNames","getBuildPipe","getTagPipe","getSnapPipe","BuilderService","constructor","isolator","logger","taskSlot","pipeNameOnEnv","displayPipeName","artifactFactory","scope","globalConfig","runOnce","envsExecutionContext","options","envs","map","executionContext","envDefinition","tasksQueue","calculatePipelineOrder","tasks","skipTests","validate","info","toString","console","title","length","longProcessLogger","createLongProcessLogger","undefined","envsBuildContext","capsulesBaseDir","getComponentsCapsulesBaseDir","baseDir","useHash","isolateOptions","getExistingAsIs","seedersOnly","pMapSeries","componentIds","components","component","id","originalSeeders","originalSeedersOfThisEnv","filter","compId","find","seeder","isEqual","capsuleNetwork","isolateComponents","_originalSeeders","msg","extraDetails","seedersCapsules","graphCapsules","chalk","dim","buildContext","assign","previousTasksResults","pipeName","dev","laneId","legacyScope","getCurrentLaneId","envIdsWithoutVersion","env","split","buildPipe","BuildPipe","exitOnFirstFailedTask","showEnvNameInOutput","showEnvVersionInOutput","uniq","buildResults","execute","end","hasErrors","getSync","CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR","render","descriptor","getDescriptor","createElement","Text","BuilderAspect","Newline","transform","envContext","build","pipeline","compute","tag","snap","getTasksNamesByPipeFunc","pipeFuncName","task","BuildTaskHelper","serializeId","getCurrentPipeTasks","exports"],"sources":["builder.service.tsx"],"sourcesContent":["import { CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR } from '@teambit/legacy/dist/constants';\nimport { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport React from 'react';\nimport chalk from 'chalk';\nimport { uniq } from 'lodash';\nimport { ScopeMain } from '@teambit/scope';\nimport pMapSeries from 'p-map-series';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { Text, Newline } from 'ink';\nimport { Logger } from '@teambit/logger';\nimport { IsolatorMain } from '@teambit/isolator';\nimport { Component, ComponentID } from '@teambit/component';\nimport { BuildPipe, TaskResults } from './build-pipe';\nimport { TaskResultsList } from './task-results-list';\nimport { TaskSlot } from './builder.main.runtime';\nimport { BuildContext, BuildTask, BuildTaskHelper } from './build-task';\nimport { ArtifactFactory } from './artifact';\nimport { calculatePipelineOrder } from './build-pipeline-order';\nimport { BuilderAspect } from './builder.aspect';\n\nexport type BuildServiceResults = {\n id: string;\n buildResults: TaskResultsList;\n components: Component[];\n errors?: [];\n};\n\nexport type BuilderServiceOptions = {\n seedersOnly?: boolean;\n originalSeeders?: ComponentID[];\n tasks?: string[];\n skipTests?: boolean;\n previousTasksResults?: TaskResults[];\n dev?: boolean;\n exitOnFirstFailedTask?: boolean;\n capsulesBaseDir?: string;\n};\n\ntype BuilderTransformationMap = ServiceTransformationMap & {\n getBuildPipe: () => BuildTask[];\n getTagPipe: () => BuildTask[];\n getSnapPipe: () => BuildTask[];\n};\n\nexport type EnvsBuildContext = { [envId: string]: BuildContext };\n\nconst pipeNames = {\n getBuildPipe: 'build',\n getTagPipe: 'tag',\n getSnapPipe: 'snap',\n};\n\nexport type PipeName = 'build' | 'tag' | 'snap';\n\nexport type BuilderDescriptor = Array<{ pipeName: PipeName; tasks: string[] }>;\n\nexport type PipeFunctionNames = keyof typeof pipeNames;\nexport class BuilderService implements EnvService<BuildServiceResults, string> {\n name = 'builder';\n\n constructor(\n /**\n * isolator extension.\n */\n private isolator: IsolatorMain,\n\n /**\n * logger extension.\n */\n private logger: Logger,\n\n /**\n * task slot (e.g tasks registered by other extensions.).\n */\n private taskSlot: TaskSlot,\n\n /**\n * a method with such name should be implemented on the env in order to run the pipe tasks.\n */\n private pipeNameOnEnv: PipeFunctionNames,\n\n /**\n * pipe name to display on the console during the execution\n */\n private displayPipeName: PipeName,\n private artifactFactory: ArtifactFactory,\n private scope: ScopeMain,\n private globalConfig: GlobalConfigMain\n ) {}\n\n /**\n * runs all tasks for all envs\n */\n async runOnce(envsExecutionContext: ExecutionContext[], options: BuilderServiceOptions): Promise<TaskResultsList> {\n const envs = envsExecutionContext.map((executionContext) => executionContext.envDefinition);\n const tasksQueue = calculatePipelineOrder(\n this.taskSlot,\n envs,\n this.pipeNameOnEnv,\n options.tasks,\n options.skipTests\n );\n tasksQueue.validate();\n this.logger.info(`going to run tasks in the following order:\\n${tasksQueue.toString()}`);\n this.logger.console('\\n'); // this is to make is clear separation between the various pipelines (build/snap/tag)\n const title = `Running ${this.displayPipeName} pipeline using ${envs.length} environment(s), total ${tasksQueue.length} tasks`;\n const longProcessLogger = this.logger.createLongProcessLogger(title, undefined, 'title');\n const envsBuildContext: EnvsBuildContext = {};\n const capsulesBaseDir = this.getComponentsCapsulesBaseDir();\n\n const baseDir = options.capsulesBaseDir || capsulesBaseDir;\n const useHash = !baseDir;\n const isolateOptions = {\n baseDir,\n useHash,\n getExistingAsIs: true,\n seedersOnly: options.seedersOnly,\n };\n\n await pMapSeries(envsExecutionContext, async (executionContext) => {\n const componentIds = executionContext.components.map((component) => component.id);\n const { originalSeeders } = options;\n const originalSeedersOfThisEnv = componentIds.filter((compId) =>\n originalSeeders ? originalSeeders.find((seeder) => compId.isEqual(seeder)) : true\n );\n const capsuleNetwork = await this.isolator.isolateComponents(componentIds, isolateOptions);\n capsuleNetwork._originalSeeders = originalSeedersOfThisEnv;\n const msg = `building ${originalSeedersOfThisEnv.length} components of env \"${executionContext.id}\"`;\n const extraDetails = `original seeders of this env: ${originalSeedersOfThisEnv.length}, graph of this env: ${capsuleNetwork.seedersCapsules.length}, graph total (include other envs): ${capsuleNetwork.graphCapsules.length}`;\n this.logger.console(`${msg}. ${chalk.dim(extraDetails)}`);\n const buildContext = Object.assign(executionContext, {\n capsuleNetwork,\n previousTasksResults: [],\n pipeName: this.displayPipeName,\n dev: options.dev,\n laneId: this.scope.legacyScope.getCurrentLaneId(),\n });\n envsBuildContext[executionContext.id] = buildContext;\n });\n const envIdsWithoutVersion = envs.map((env) => env.id.split('@')[0]);\n const buildPipe = new BuildPipe(\n tasksQueue,\n envsBuildContext,\n this.logger,\n this.artifactFactory,\n options.previousTasksResults,\n {\n exitOnFirstFailedTask: options.exitOnFirstFailedTask,\n showEnvNameInOutput: envs.length > 1,\n showEnvVersionInOutput: envIdsWithoutVersion.length > uniq(envIdsWithoutVersion).length,\n }\n );\n const buildResults = await buildPipe.execute();\n longProcessLogger.end(buildResults.hasErrors() ? 'error' : 'success');\n\n return buildResults;\n }\n\n getComponentsCapsulesBaseDir(): string | undefined {\n return this.globalConfig.getSync(CFG_CAPSULES_BUILD_COMPONENTS_BASE_DIR);\n }\n\n render() {\n const descriptor = this.getDescriptor();\n\n return (\n <Text key={BuilderAspect.id}>\n {descriptor}\n <Newline />\n <Newline />\n </Text>\n );\n }\n\n transform(env: Env, envContext: EnvContext): BuilderTransformationMap | undefined {\n if (!env?.build) return undefined;\n return {\n getBuildPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.build();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getTagPipe: () => {\n // TODO: refactor after defining for an env property\n const pipeline = env.tag();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n getSnapPipe: () => {\n const pipeline = env.snap();\n if (!pipeline || !pipeline.compute) return [];\n return pipeline?.compute(envContext);\n },\n };\n }\n\n getDescriptor() {\n return 'run `bit build --list-tasks <component-id>` to see the tasks list for the pipelines: build, tag and snap';\n }\n\n private getTasksNamesByPipeFunc(env: EnvDefinition, pipeFuncName: PipeFunctionNames): string[] {\n const tasksQueue = calculatePipelineOrder(this.taskSlot, [env], pipeFuncName).map(({ task }) =>\n BuildTaskHelper.serializeId(task)\n );\n return tasksQueue;\n }\n\n getCurrentPipeTasks(env: EnvDefinition) {\n return this.getTasksNamesByPipeFunc(env, this.pipeNameOnEnv);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,KAAA;EAAA,MAA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Q,IAAI,CAACA,QAAQ,CAACC,OAAO,EAAE,OAAO,EAAE;QAC7C,OAAOD,QAAQ,EAAEC,OAAO,CAACH,UAAU,CAAC;MACtC,CAAC;MACD3F,WAAW,EAAEA,CAAA,KAAM;QACjB,MAAM6F,QAAQ,GAAGxB,GAAG,CAAC2B,IAAI,CAAC,CAAC;QAC3B,IAAI,CAACH,QAAQ,IAAI,CAACA,QAAQ,CAACC,OAAO,EAAE,OAAO,EAAE;QAC7C,OAAOD,QAAQ,EAAEC,OAAO,CAACH,UAAU,CAAC;MACtC;IACF,CAAC;EACH;EAEAN,aAAaA,CAAA,EAAG;IACd,OAAO,0GAA0G;EACnH;EAEQY,uBAAuBA,CAAC5B,GAAkB,EAAE6B,YAA+B,EAAY;IAC7F,MAAMhF,UAAU,GAAG,IAAAC,4CAAsB,EAAC,IAAI,CAACd,QAAQ,EAAE,CAACgE,GAAG,CAAC,EAAE6B,YAAY,CAAC,CAACnF,GAAG,CAAC,CAAC;MAAEoF;IAAK,CAAC,KACzFC,4BAAe,CAACC,WAAW,CAACF,IAAI,CAClC,CAAC;IACD,OAAOjF,UAAU;EACnB;EAEAoF,mBAAmBA,CAACjC,GAAkB,EAAE;IACtC,OAAO,IAAI,CAAC4B,uBAAuB,CAAC5B,GAAG,EAAE,IAAI,CAAC/D,aAAa,CAAC;EAC9D;AACF;AAACiG,OAAA,CAAAtG,cAAA,GAAAA,cAAA"}
|
package/dist/pipeline.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.109/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.109/dist/builder.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component } from '@teambit/component';
|
|
2
2
|
import { ArtifactVinyl } from '@teambit/legacy/dist/consumer/component/sources/artifact';
|
|
3
3
|
import { FsArtifact } from '../artifact';
|
|
4
|
-
export
|
|
4
|
+
export type StoreResult = {
|
|
5
5
|
[path: string]: string;
|
|
6
6
|
};
|
|
7
7
|
interface BaseStorageResolver {
|
|
@@ -22,5 +22,5 @@ export interface FileStorageResolver extends BaseStorageResolver {
|
|
|
22
22
|
*/
|
|
23
23
|
storeFile(component: Component, artifact: FsArtifact, file: ArtifactVinyl): Promise<string | undefined | void>;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type ArtifactStorageResolver = FileStorageResolver | WholeArtifactStorageResolver;
|
|
26
26
|
export {};
|
|
@@ -37,10 +37,7 @@ class TaskResultsList {
|
|
|
37
37
|
this.capsuleRootDir = capsuleRootDir;
|
|
38
38
|
}
|
|
39
39
|
hasErrors() {
|
|
40
|
-
return this.tasksResults.some(taskResult => taskResult.componentsResults.find(c =>
|
|
41
|
-
var _c$errors;
|
|
42
|
-
return (_c$errors = c.errors) === null || _c$errors === void 0 ? void 0 : _c$errors.length;
|
|
43
|
-
}));
|
|
40
|
+
return this.tasksResults.some(taskResult => taskResult.componentsResults.find(c => c.errors?.length));
|
|
44
41
|
}
|
|
45
42
|
throwErrorsIfExist() {
|
|
46
43
|
const errorMessage = this.getErrorMessageFormatted();
|
|
@@ -56,10 +53,7 @@ class TaskResultsList {
|
|
|
56
53
|
const tasksErrors = [];
|
|
57
54
|
let totalErrors = 0;
|
|
58
55
|
this.tasksResults.forEach(taskResult => {
|
|
59
|
-
const compsWithErrors = taskResult.componentsResults.filter(c =>
|
|
60
|
-
var _c$errors2;
|
|
61
|
-
return (_c$errors2 = c.errors) === null || _c$errors2 === void 0 ? void 0 : _c$errors2.length;
|
|
62
|
-
});
|
|
56
|
+
const compsWithErrors = taskResult.componentsResults.filter(c => c.errors?.length);
|
|
63
57
|
if (!compsWithErrors.length) return;
|
|
64
58
|
const title = _chalk().default.bold(`Failed task ${tasksErrors.length + 1}: "${_buildTask().BuildTaskHelper.serializeId(taskResult.task)}" of env "${taskResult.env.id}"\n`);
|
|
65
59
|
const errorsStr = compsWithErrors.map(compWithErrors => this.aggregateTaskErrorsToOneString(compWithErrors)).join('\n\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","_buildTask","obj","__esModule","default","TaskResultsList","constructor","tasksQueue","tasksResults","capsuleRootDir","hasErrors","some","taskResult","componentsResults","find","c","
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","_buildTask","obj","__esModule","default","TaskResultsList","constructor","tasksQueue","tasksResults","capsuleRootDir","hasErrors","some","taskResult","componentsResults","find","c","errors","length","throwErrorsIfExist","errorMessage","getErrorMessageFormatted","BitError","tasksErrors","totalErrors","forEach","compsWithErrors","filter","title","chalk","bold","BuildTaskHelper","serializeId","task","env","id","errorsStr","map","compWithErrors","aggregateTaskErrorsToOneString","join","taskErrors","reduce","acc","current","summery","push","totalTasks","totalFailed","totalSucceed","totalSkipped","componentResult","rawErrors","e","toString","component","exports"],"sources":["task-results-list.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport { BuildTaskHelper } from './build-task';\nimport { TasksQueue } from './tasks-queue';\nimport { TaskResults } from './build-pipe';\nimport { ComponentResult } from './types';\n\nexport class TaskResultsList {\n constructor(\n public tasksQueue: TasksQueue,\n /**\n * results of all tasks executed in the build pipeline.\n */\n public tasksResults: TaskResults[],\n\n public capsuleRootDir: string\n ) {}\n\n hasErrors(): boolean {\n return this.tasksResults.some((taskResult) => taskResult.componentsResults.find((c) => c.errors?.length));\n }\n\n throwErrorsIfExist() {\n const errorMessage = this.getErrorMessageFormatted();\n if (errorMessage) {\n throw new BitError(errorMessage);\n }\n }\n\n /**\n * group errors from all tasks and show them nicely to the user\n */\n public getErrorMessageFormatted(): string | null {\n const tasksErrors: string[] = [];\n let totalErrors = 0;\n this.tasksResults.forEach((taskResult) => {\n const compsWithErrors = taskResult.componentsResults.filter((c) => c.errors?.length);\n if (!compsWithErrors.length) return;\n const title = chalk.bold(\n `Failed task ${tasksErrors.length + 1}: \"${BuildTaskHelper.serializeId(taskResult.task)}\" of env \"${\n taskResult.env.id\n }\"\\n`\n );\n const errorsStr = compsWithErrors\n .map((compWithErrors) => this.aggregateTaskErrorsToOneString(compWithErrors))\n .join('\\n\\n');\n const taskErrors = compsWithErrors.reduce((acc, current) => acc + (current.errors || []).length, 0);\n const summery = `\\n\\nFound ${taskErrors} errors in ${compsWithErrors.length} components`;\n totalErrors += taskErrors;\n tasksErrors.push(title + errorsStr + summery);\n });\n if (!tasksErrors.length) return null;\n const title = `\\nThe following errors were found while running the build pipeline\\n`;\n const errorsStr = tasksErrors.join('\\n\\n');\n const totalTasks = this.tasksQueue.length;\n const totalFailed = tasksErrors.length;\n const totalSucceed = this.tasksResults.length - totalFailed;\n const totalSkipped = totalTasks - this.tasksResults.length;\n const summery = `\\n\\n\\n✖ Total ${totalTasks} tasks. ${totalSucceed} succeeded. ${totalFailed} failed. ${totalSkipped} skipped. Total errors: ${totalErrors}.`;\n return title + errorsStr + summery;\n }\n\n private aggregateTaskErrorsToOneString(componentResult: ComponentResult) {\n const rawErrors = componentResult.errors || [];\n const errors = rawErrors.map((e) => (typeof e === 'string' ? e : e.toString()));\n return `component: ${componentResult.component.id.toString()}\\n${errors.join('\\n')}`;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OA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AU,GAAG,IAAI,CAACtC,YAAY,CAACS,MAAM;IAC1D,MAAM2B,OAAO,GAAI,iBAAgBE,UAAW,WAAUE,YAAa,eAAcD,WAAY,YAAWE,YAAa,2BAA0B1B,WAAY,GAAE;IAC7J,OAAOI,KAAK,GAAGQ,SAAS,GAAGS,OAAO;EACpC;EAEQN,8BAA8BA,CAACY,eAAgC,EAAE;IACvE,MAAMC,SAAS,GAAGD,eAAe,CAAClC,MAAM,IAAI,EAAE;IAC9C,MAAMA,MAAM,GAAGmC,SAAS,CAACf,GAAG,CAAEgB,CAAC,IAAM,OAAOA,CAAC,KAAK,QAAQ,GAAGA,CAAC,GAAGA,CAAC,CAACC,QAAQ,CAAC,CAAE,CAAC;IAC/E,OAAQ,cAAaH,eAAe,CAACI,SAAS,CAACpB,EAAE,CAACmB,QAAQ,CAAC,CAAE,KAAIrC,MAAM,CAACuB,IAAI,CAAC,IAAI,CAAE,EAAC;EACtF;AACF;AAACgB,OAAA,CAAAlD,eAAA,GAAAA,eAAA"}
|
package/dist/tasks-queue.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.109",
|
|
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.109"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -22,48 +22,44 @@
|
|
|
22
22
|
"fs-extra": "10.0.0",
|
|
23
23
|
"minimatch": "3.0.5",
|
|
24
24
|
"globby": "11.0.1",
|
|
25
|
-
"core-js": "^3.0.0",
|
|
26
|
-
"@babel/runtime": "7.20.0",
|
|
27
25
|
"@teambit/graph.cleargraph": "0.0.1",
|
|
28
26
|
"@teambit/lane-id": "0.0.311",
|
|
29
27
|
"@teambit/harmony": "0.4.6",
|
|
30
28
|
"@teambit/bit-error": "0.0.404",
|
|
31
29
|
"@teambit/component-id": "1.2.0",
|
|
32
|
-
"@teambit/component": "1.0.
|
|
33
|
-
"@teambit/envs": "1.0.
|
|
34
|
-
"@teambit/logger": "0.0.
|
|
30
|
+
"@teambit/component": "1.0.109",
|
|
31
|
+
"@teambit/envs": "1.0.109",
|
|
32
|
+
"@teambit/logger": "0.0.934",
|
|
35
33
|
"@teambit/toolbox.string.capitalize": "0.0.494",
|
|
36
|
-
"@teambit/tester": "1.0.
|
|
37
|
-
"@teambit/isolator": "1.0.
|
|
38
|
-
"@teambit/cli": "0.0.
|
|
39
|
-
"@teambit/workspace": "1.0.
|
|
40
|
-
"@teambit/aspect-loader": "1.0.
|
|
41
|
-
"@teambit/aspect": "1.0.
|
|
42
|
-
"@teambit/generator": "1.0.
|
|
43
|
-
"@teambit/global-config": "0.0.
|
|
44
|
-
"@teambit/graphql": "1.0.
|
|
45
|
-
"@teambit/scope": "1.0.
|
|
46
|
-
"@teambit/ui": "1.0.
|
|
47
|
-
"@teambit/express": "0.0.
|
|
34
|
+
"@teambit/tester": "1.0.109",
|
|
35
|
+
"@teambit/isolator": "1.0.109",
|
|
36
|
+
"@teambit/cli": "0.0.841",
|
|
37
|
+
"@teambit/workspace": "1.0.109",
|
|
38
|
+
"@teambit/aspect-loader": "1.0.109",
|
|
39
|
+
"@teambit/aspect": "1.0.109",
|
|
40
|
+
"@teambit/generator": "1.0.110",
|
|
41
|
+
"@teambit/global-config": "0.0.843",
|
|
42
|
+
"@teambit/graphql": "1.0.109",
|
|
43
|
+
"@teambit/scope": "1.0.109",
|
|
44
|
+
"@teambit/ui": "1.0.109",
|
|
45
|
+
"@teambit/express": "0.0.940"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
50
48
|
"@types/lodash": "4.14.165",
|
|
51
|
-
"@types/react": "^17.0.8",
|
|
52
49
|
"@types/archiver": "5.3.1",
|
|
53
50
|
"@types/mime": "2.0.3",
|
|
54
51
|
"@types/fs-extra": "9.0.7",
|
|
55
52
|
"@types/minimatch": "3.0.4",
|
|
56
53
|
"@types/mocha": "9.1.0",
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
59
|
-
"@
|
|
60
|
-
"@types/testing-library__jest-dom": "5.9.5",
|
|
54
|
+
"@types/jest": "^29.2.2",
|
|
55
|
+
"@types/testing-library__jest-dom": "^5.9.5",
|
|
56
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.14",
|
|
61
57
|
"@teambit/pipelines.aspect-docs.builder": "0.0.165"
|
|
62
58
|
},
|
|
63
59
|
"peerDependencies": {
|
|
64
|
-
"
|
|
65
|
-
"react": "^
|
|
66
|
-
"
|
|
60
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
61
|
+
"@types/react": "^18.2.12",
|
|
62
|
+
"@teambit/legacy": "1.0.624"
|
|
67
63
|
},
|
|
68
64
|
"license": "Apache-2.0",
|
|
69
65
|
"optionalDependencies": {},
|
|
@@ -77,7 +73,7 @@
|
|
|
77
73
|
},
|
|
78
74
|
"private": false,
|
|
79
75
|
"engines": {
|
|
80
|
-
"node": ">=
|
|
76
|
+
"node": ">=16.0.0"
|
|
81
77
|
},
|
|
82
78
|
"repository": {
|
|
83
79
|
"type": "git",
|
|
@@ -86,12 +82,9 @@
|
|
|
86
82
|
"keywords": [
|
|
87
83
|
"bit",
|
|
88
84
|
"bit-aspect",
|
|
85
|
+
"bit-core-aspect",
|
|
89
86
|
"components",
|
|
90
87
|
"collaboration",
|
|
91
|
-
"web"
|
|
92
|
-
"react",
|
|
93
|
-
"react-components",
|
|
94
|
-
"angular",
|
|
95
|
-
"angular-components"
|
|
88
|
+
"web"
|
|
96
89
|
]
|
|
97
90
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"lib": [
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"DOM.Iterable",
|
|
8
|
-
"ScriptHost"
|
|
4
|
+
"esnext",
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.Iterable"
|
|
9
7
|
],
|
|
10
|
-
"target": "
|
|
11
|
-
"module": "
|
|
12
|
-
"jsx": "react",
|
|
13
|
-
"allowJs": true,
|
|
14
|
-
"composite": true,
|
|
8
|
+
"target": "es2020",
|
|
9
|
+
"module": "es2020",
|
|
10
|
+
"jsx": "react-jsx",
|
|
15
11
|
"declaration": true,
|
|
16
12
|
"sourceMap": true,
|
|
17
|
-
"skipLibCheck": true,
|
|
18
13
|
"experimentalDecorators": true,
|
|
19
|
-
"
|
|
14
|
+
"skipLibCheck": true,
|
|
20
15
|
"moduleResolution": "node",
|
|
21
16
|
"esModuleInterop": true,
|
|
22
|
-
"rootDir": ".",
|
|
23
17
|
"resolveJsonModule": true,
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"strictPropertyInitialization": false,
|
|
28
|
-
"strict": true,
|
|
29
|
-
"noImplicitAny": false,
|
|
30
|
-
"preserveConstEnums": true
|
|
18
|
+
"allowJs": true,
|
|
19
|
+
"outDir": "dist",
|
|
20
|
+
"emitDeclarationOnly": true
|
|
31
21
|
},
|
|
32
22
|
"exclude": [
|
|
23
|
+
"artifacts",
|
|
24
|
+
"public",
|
|
33
25
|
"dist",
|
|
26
|
+
"node_modules",
|
|
27
|
+
"package.json",
|
|
34
28
|
"esm.mjs",
|
|
35
|
-
"
|
|
29
|
+
"**/*.cjs",
|
|
30
|
+
"./dist"
|
|
36
31
|
],
|
|
37
32
|
"include": [
|
|
38
33
|
"**/*",
|
package/types/asset.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ declare module '*.png' {
|
|
|
5
5
|
declare module '*.svg' {
|
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
7
|
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
9
11
|
const src: string;
|
|
10
12
|
export default src;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
14
|
declare module '*.jpg' {
|
|
15
15
|
const value: any;
|
|
16
16
|
export = value;
|
|
@@ -27,3 +27,15 @@ declare module '*.bmp' {
|
|
|
27
27
|
const value: any;
|
|
28
28
|
export = value;
|
|
29
29
|
}
|
|
30
|
+
declare module '*.otf' {
|
|
31
|
+
const value: any;
|
|
32
|
+
export = value;
|
|
33
|
+
}
|
|
34
|
+
declare module '*.woff' {
|
|
35
|
+
const value: any;
|
|
36
|
+
export = value;
|
|
37
|
+
}
|
|
38
|
+
declare module '*.woff2' {
|
|
39
|
+
const value: any;
|
|
40
|
+
export = value;
|
|
41
|
+
}
|