@teambit/builder 1.0.667 → 1.0.669
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifact/artifact-definition.ts +1 -1
- package/artifact/artifact-extractor.ts +7 -5
- package/artifact/artifact-factory.ts +5 -3
- package/artifact/artifact-list.ts +7 -12
- package/artifact/artifacts.cmd.ts +5 -4
- package/artifact/extension-artifact.ts +1 -1
- package/artifact/fs-artifact.ts +1 -1
- package/dist/artifact/artifact-definition.d.ts +1 -1
- package/dist/artifact/artifact-definition.js.map +1 -1
- package/dist/artifact/artifact-extractor.d.ts +4 -4
- package/dist/artifact/artifact-extractor.js.map +1 -1
- package/dist/artifact/artifact-factory.d.ts +3 -2
- package/dist/artifact/artifact-factory.js.map +1 -1
- package/dist/artifact/artifact-list.d.ts +4 -5
- package/dist/artifact/artifact-list.js.map +1 -1
- package/dist/artifact/artifacts.cmd.d.ts +3 -3
- package/dist/artifact/artifacts.cmd.js.map +1 -1
- package/dist/artifact/extension-artifact.d.ts +1 -1
- package/dist/artifact/extension-artifact.js.map +1 -1
- package/dist/artifact/fs-artifact.d.ts +1 -1
- package/dist/artifact/fs-artifact.js.map +1 -1
- package/dist/build-pipe.d.ts +8 -8
- package/dist/build-pipe.js.map +1 -1
- package/dist/build-pipeline-order.d.ts +2 -2
- package/dist/build-pipeline-order.js.map +1 -1
- package/dist/build-pipeline-result-list.d.ts +3 -3
- package/dist/build-pipeline-result-list.js.map +1 -1
- package/dist/build-task.d.ts +5 -5
- package/dist/build-task.js.map +1 -1
- package/dist/build.cmd.d.ts +4 -4
- package/dist/build.cmd.js.map +1 -1
- package/dist/builder-env-type.d.ts +1 -1
- package/dist/builder-env-type.js.map +1 -1
- package/dist/builder.graphql.d.ts +4 -4
- package/dist/builder.graphql.js.map +1 -1
- package/dist/builder.main.runtime.d.ts +23 -21
- package/dist/builder.main.runtime.js.map +1 -1
- package/dist/builder.route.d.ts +4 -4
- package/dist/builder.route.js.map +1 -1
- package/dist/builder.service.d.ts +11 -11
- package/dist/builder.service.js.map +1 -1
- package/dist/exceptions/capsule-not-found.d.ts +1 -1
- package/dist/exceptions/capsule-not-found.js.map +1 -1
- package/dist/exceptions/components-have-issues.d.ts +1 -1
- package/dist/exceptions/components-have-issues.js.map +1 -1
- package/dist/pipeline.d.ts +3 -3
- package/dist/pipeline.js.map +1 -1
- package/dist/{preview-1753809186996.js → preview-1753848836384.js} +2 -2
- package/dist/storage/default-resolver.d.ts +3 -3
- package/dist/storage/default-resolver.js.map +1 -1
- package/dist/storage/storage-resolver.d.ts +3 -3
- package/dist/storage/storage-resolver.js.map +1 -1
- package/dist/task-results-list.d.ts +3 -3
- package/dist/task-results-list.js.map +1 -1
- package/dist/task.d.ts +2 -2
- package/dist/task.js.map +1 -1
- package/dist/tasks-queue.d.ts +2 -2
- package/dist/tasks-queue.js.map +1 -1
- package/dist/templates/build-task/files/index-file.d.ts +1 -1
- package/dist/templates/build-task/files/index-file.js.map +1 -1
- package/dist/templates/build-task/files/task-file.d.ts +1 -1
- package/dist/templates/build-task/files/task-file.js.map +1 -1
- package/dist/templates/build-task/index.d.ts +1 -1
- package/dist/templates/build-task/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js.map +1 -1
- package/exceptions/capsule-not-found.ts +1 -1
- package/exceptions/components-have-issues.ts +1 -1
- package/package.json +21 -21
- package/storage/default-resolver.ts +3 -3
- package/storage/storage-resolver.ts +3 -3
- package/templates/build-task/files/index-file.ts +1 -1
- package/templates/build-task/files/task-file.ts +1 -1
- package/templates/build-task/index.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","_buildTask","e","__esModule","default","TaskResultsList","constructor","tasksQueue","tasksResults","capsuleRootDir","logger","getTasksResults","loose","filter","taskResult","isTestOrLintTask","includes","task","aspectId","hasErrors","some","componentsResults","find","c","errors","length","throwErrorsIfExist","logStackTrace","errorMessage","getErrorMessageFormatted","BitError","tasksErrors","totalErrors","forEach","compsWithErrors","title","chalk","bold","BuildTaskHelper","serializeId","env","id","errorsStr","map","compWithErrors","aggregateTaskErrorsToOneString","join","taskErrors","reduce","acc","current","summery","push","totalTasks","totalFailed","totalSucceed","totalSkipped","componentResult","rawErrors","toString","component","error","Error","name","exports"],"sources":["task-results-list.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\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 private logger: Logger\n ) {}\n\n getTasksResults(loose?: boolean) {\n if (loose) {\n // In loose mode, we filter out test/lint tasks\n return this.tasksResults.filter((taskResult) => {\n const isTestOrLintTask = ['teambit.defender/tester', 'teambit.defender/linter'].includes(\n taskResult.task.aspectId\n );\n return !isTestOrLintTask;\n });\n }\n return this.tasksResults;\n }\n\n hasErrors(loose?: boolean): boolean {\n const tasksResults = this.getTasksResults(loose);\n return tasksResults.some((taskResult) => taskResult.componentsResults.find((c) => c.errors?.length));\n }\n\n throwErrorsIfExist(loose?: boolean) {\n this.logStackTrace();\n const errorMessage = this.getErrorMessageFormatted(loose);\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 getErrorMessageFormatted(loose?: boolean): string | null {\n const tasksErrors: string[] = [];\n let totalErrors = 0;\n const tasksResults = this.getTasksResults(loose);\n 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 private logStackTrace() {\n this.tasksResults.forEach((taskResult) => {\n taskResult.componentsResults.forEach((componentResult) => {\n componentResult.errors?.forEach((error) => {\n if (error instanceof Error) {\n this.logger.error(\n `failed running task ${taskResult.task.name} on ${componentResult.component.id.toString()}`,\n error\n );\n }\n });\n });\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAA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AAC,CAAC,EAAE,EAC3FE,KACF,CAAC;UACH;QACF,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AAACG,OAAA,CAAA3D,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","_buildTask","e","__esModule","default","TaskResultsList","constructor","tasksQueue","tasksResults","capsuleRootDir","logger","getTasksResults","loose","filter","taskResult","isTestOrLintTask","includes","task","aspectId","hasErrors","some","componentsResults","find","c","errors","length","throwErrorsIfExist","logStackTrace","errorMessage","getErrorMessageFormatted","BitError","tasksErrors","totalErrors","forEach","compsWithErrors","title","chalk","bold","BuildTaskHelper","serializeId","env","id","errorsStr","map","compWithErrors","aggregateTaskErrorsToOneString","join","taskErrors","reduce","acc","current","summery","push","totalTasks","totalFailed","totalSucceed","totalSkipped","componentResult","rawErrors","toString","component","error","Error","name","exports"],"sources":["task-results-list.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { BuildTaskHelper } from './build-task';\nimport type { TasksQueue } from './tasks-queue';\nimport type { TaskResults } from './build-pipe';\nimport type { 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 private logger: Logger\n ) {}\n\n getTasksResults(loose?: boolean) {\n if (loose) {\n // In loose mode, we filter out test/lint tasks\n return this.tasksResults.filter((taskResult) => {\n const isTestOrLintTask = ['teambit.defender/tester', 'teambit.defender/linter'].includes(\n taskResult.task.aspectId\n );\n return !isTestOrLintTask;\n });\n }\n return this.tasksResults;\n }\n\n hasErrors(loose?: boolean): boolean {\n const tasksResults = this.getTasksResults(loose);\n return tasksResults.some((taskResult) => taskResult.componentsResults.find((c) => c.errors?.length));\n }\n\n throwErrorsIfExist(loose?: boolean) {\n this.logStackTrace();\n const errorMessage = this.getErrorMessageFormatted(loose);\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 getErrorMessageFormatted(loose?: boolean): string | null {\n const tasksErrors: string[] = [];\n let totalErrors = 0;\n const tasksResults = this.getTasksResults(loose);\n 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 private logStackTrace() {\n this.tasksResults.forEach((taskResult) => {\n taskResult.componentsResults.forEach((componentResult) => {\n componentResult.errors?.forEach((error) => {\n if (error instanceof Error) {\n this.logger.error(\n `failed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AEQnB,aAAaA,CAAA,EAAG;IACtB,IAAI,CAACnB,YAAY,CAACyB,OAAO,CAAEnB,UAAU,IAAK;MACxCA,UAAU,CAACO,iBAAiB,CAACY,OAAO,CAAEwB,eAAe,IAAK;QACxDA,eAAe,CAACjC,MAAM,EAAES,OAAO,CAAE4B,KAAK,IAAK;UACzC,IAAIA,KAAK,YAAYC,KAAK,EAAE;YAC1B,IAAI,CAACpD,MAAM,CAACmD,KAAK,CACf,uBAAuB/C,UAAU,CAACG,IAAI,CAAC8C,IAAI,OAAON,eAAe,CAACG,SAAS,CAACnB,EAAE,CAACkB,QAAQ,CAAC,CAAC,EAAE,EAC3FE,KACF,CAAC;UACH;QACF,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AAACG,OAAA,CAAA3D,eAAA,GAAAA,eAAA","ignoreList":[]}
|
package/dist/task.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BuildContext, BuiltTaskResult } from './build-task';
|
|
2
|
-
import { TaskResultsList } from './task-results-list';
|
|
1
|
+
import type { BuildContext, BuiltTaskResult } from './build-task';
|
|
2
|
+
import type { TaskResultsList } from './task-results-list';
|
|
3
3
|
/**
|
|
4
4
|
* this is the external interface for task. please make
|
|
5
5
|
* sure to use only this interface outside of this builder
|
package/dist/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["task.ts"],"sourcesContent":["import { BuildContext, BuiltTaskResult } from './build-task';\nimport { TaskResultsList } from './task-results-list';\n\n/**\n * this is the external interface for task. please make\n * sure to use only this interface outside of this builder\n * aspect.\n */\nexport interface Task {\n /**\n * names ideally with dashes 'typescript'\n */\n name: string;\n\n /**\n * description of what the task does.\n */\n description?: string;\n\n /**\n * execute a task in a build context\n */\n execute(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n * e.g. typescript compiler needs to write the tsconfig file. doing it during the task, will\n * cause dependencies from other envs to get this tsconfig written.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for doing some cleanup on the\n * capsules before the deployment starts.\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * needed if you want the task to be running only after the dependencies were completed\n * for *all* envs.\n * normally this is not needed because the build-pipeline runs the tasks in the same order\n * they're located in the `getBuildPipe()` array and according to the task.location.\n * the case where this is useful is when a task not only needs to be after another task, but also\n * after all environments were running that task.\n * a dependency is task.aspectId. if an aspect has multiple tasks, to be more specific, use\n * \"aspectId:name\", e.g. \"teambit.compilation/compiler:TypescriptCompiler\".\n */\n dependencies?: string[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["task.ts"],"sourcesContent":["import type { BuildContext, BuiltTaskResult } from './build-task';\nimport type { TaskResultsList } from './task-results-list';\n\n/**\n * this is the external interface for task. please make\n * sure to use only this interface outside of this builder\n * aspect.\n */\nexport interface Task {\n /**\n * names ideally with dashes 'typescript'\n */\n name: string;\n\n /**\n * description of what the task does.\n */\n description?: string;\n\n /**\n * execute a task in a build context\n */\n execute(context: BuildContext): Promise<BuiltTaskResult>;\n\n /**\n * run before the build pipeline has started. this is useful when some preparation are needed to\n * be done on all envs before the build starts.\n * e.g. typescript compiler needs to write the tsconfig file. doing it during the task, will\n * cause dependencies from other envs to get this tsconfig written.\n */\n preBuild?(context: BuildContext): Promise<void>;\n\n /**\n * run after the build pipeline completed for all envs. useful for doing some cleanup on the\n * capsules before the deployment starts.\n */\n postBuild?(context: BuildContext, tasksResults: TaskResultsList): Promise<void>;\n\n /**\n * needed if you want the task to be running only after the dependencies were completed\n * for *all* envs.\n * normally this is not needed because the build-pipeline runs the tasks in the same order\n * they're located in the `getBuildPipe()` array and according to the task.location.\n * the case where this is useful is when a task not only needs to be after another task, but also\n * after all environments were running that task.\n * a dependency is task.aspectId. if an aspect has multiple tasks, to be more specific, use\n * \"aspectId:name\", e.g. \"teambit.compilation/compiler:TypescriptCompiler\".\n */\n dependencies?: string[];\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/tasks-queue.d.ts
CHANGED
package/dist/tasks-queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_buildTask","data","require","_exceptions","TasksQueue","Array","toString","map","env","task","id","BuildTaskHelper","serializeId","join","validate","forEach","validateTaskName","validateDuplications","name","InvalidTask","aspectId","regexWord","isValid","test","uniqueTasks","uniqTask","filter","u","length","exports"],"sources":["tasks-queue.ts"],"sourcesContent":["import { EnvDefinition } from '@teambit/envs';\nimport { BuildTask
|
|
1
|
+
{"version":3,"names":["_buildTask","data","require","_exceptions","TasksQueue","Array","toString","map","env","task","id","BuildTaskHelper","serializeId","join","validate","forEach","validateTaskName","validateDuplications","name","InvalidTask","aspectId","regexWord","isValid","test","uniqueTasks","uniqTask","filter","u","length","exports"],"sources":["tasks-queue.ts"],"sourcesContent":["import type { EnvDefinition } from '@teambit/envs';\nimport type { BuildTask } from './build-task';\nimport { BuildTaskHelper } from './build-task';\nimport { InvalidTask } from './exceptions';\n\ntype EnvTask = { env: EnvDefinition; task: BuildTask };\n\nexport class TasksQueue extends Array<EnvTask> {\n toString() {\n return this.map(({ env, task }) => `env ${env.id}, task ${BuildTaskHelper.serializeId(task)}`).join('\\n');\n }\n /**\n * make sure tasks names are valid and there are no duplications\n */\n validate() {\n this.forEach(({ task }) => {\n this.validateTaskName(task);\n });\n this.validateDuplications();\n }\n\n private validateTaskName(task: BuildTask) {\n if (!task.name) throw new InvalidTask(task.aspectId, 'name is missing');\n const regexWord = /^\\w+$/; // match any word: a-zA-Z0-9 and underscore.\n const isValid = regexWord.test(task.name);\n if (!isValid)\n throw new InvalidTask(task.aspectId, `name \"${task.name}\" is invalid, only alphanumeric characters are allowed`);\n }\n\n private validateDuplications() {\n const uniqueTasks = this.map(({ env, task }) => `${env.id} ${task.aspectId}:${task.name}`);\n uniqueTasks.forEach((uniqTask) => {\n if (uniqueTasks.filter((u) => u === uniqTask).length > 1) {\n throw new InvalidTask(\n uniqTask,\n 'there are two or more tasks with the same name and aspectId in the same environment'\n );\n }\n });\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,MAAMG,UAAU,SAASC,KAAK,CAAU;EAC7CC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAI,CAACC,GAAG,CAAC,CAAC;MAAEC,GAAG;MAAEC;IAAK,CAAC,KAAK,OAAOD,GAAG,CAACE,EAAE,UAAUC,4BAAe,CAACC,WAAW,CAACH,IAAI,CAAC,EAAE,CAAC,CAACI,IAAI,CAAC,IAAI,CAAC;EAC3G;EACA;AACF;AACA;EACEC,QAAQA,CAAA,EAAG;IACT,IAAI,CAACC,OAAO,CAAC,CAAC;MAAEN;IAAK,CAAC,KAAK;MACzB,IAAI,CAACO,gBAAgB,CAACP,IAAI,CAAC;IAC7B,CAAC,CAAC;IACF,IAAI,CAACQ,oBAAoB,CAAC,CAAC;EAC7B;EAEQD,gBAAgBA,CAACP,IAAe,EAAE;IACxC,IAAI,CAACA,IAAI,CAACS,IAAI,EAAE,MAAM,KAAIC,yBAAW,EAACV,IAAI,CAACW,QAAQ,EAAE,iBAAiB,CAAC;IACvE,MAAMC,SAAS,GAAG,OAAO,CAAC,CAAC;IAC3B,MAAMC,OAAO,GAAGD,SAAS,CAACE,IAAI,CAACd,IAAI,CAACS,IAAI,CAAC;IACzC,IAAI,CAACI,OAAO,EACV,MAAM,KAAIH,yBAAW,EAACV,IAAI,CAACW,QAAQ,EAAE,SAASX,IAAI,CAACS,IAAI,wDAAwD,CAAC;EACpH;EAEQD,oBAAoBA,CAAA,EAAG;IAC7B,MAAMO,WAAW,GAAG,IAAI,CAACjB,GAAG,CAAC,CAAC;MAAEC,GAAG;MAAEC;IAAK,CAAC,KAAK,GAAGD,GAAG,CAACE,EAAE,IAAID,IAAI,CAACW,QAAQ,IAAIX,IAAI,CAACS,IAAI,EAAE,CAAC;IAC1FM,WAAW,CAACT,OAAO,CAAEU,QAAQ,IAAK;MAChC,IAAID,WAAW,CAACE,MAAM,CAAEC,CAAC,IAAKA,CAAC,KAAKF,QAAQ,CAAC,CAACG,MAAM,GAAG,CAAC,EAAE;QACxD,MAAM,KAAIT,yBAAW,EACnBM,QAAQ,EACR,qFACF,CAAC;MACH;IACF,CAAC,CAAC;EACJ;AACF;AAACI,OAAA,CAAAzB,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ComponentContext } from '@teambit/generator';
|
|
1
|
+
import type { ComponentContext } from '@teambit/generator';
|
|
2
2
|
export declare function indexFile({ namePascalCase, name }: ComponentContext): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `export { ${namePascalCase} } from './${name}.task'`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,cAAcC,IAAI,QAAQ;AAC7D","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["indexFile","namePascalCase","name"],"sources":["index-file.ts"],"sourcesContent":["import type { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase, name }: ComponentContext) {\n return `export { ${namePascalCase} } from './${name}.task'`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAO,YAAYD,cAAc,cAAcC,IAAI,QAAQ;AAC7D","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ComponentContext } from '@teambit/generator';
|
|
1
|
+
import type { ComponentContext } from '@teambit/generator';
|
|
2
2
|
export declare function taskFile({ namePascalCase }: ComponentContext): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["taskFile","namePascalCase"],"sources":["task-file.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function taskFile({ namePascalCase }: ComponentContext) {\n return `import {\n BuildTask,\n BuildContext,\n BuiltTaskResult,\n ComponentResult,\n} from '@teambit/builder';\nimport path from 'path';\nimport fs from 'fs';\n\nexport class ${namePascalCase} implements BuildTask {\n constructor(readonly aspectId: string) {}\n readonly name = '${namePascalCase}';\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n // Prepare the component results array which will be used to report back the components processed\n // as well as any additional data regarding this build task execution\n const componentsResults: ComponentResult[] = [];\n // The 'seeder capsules' are capsules for components that are built for their own sake - \n // not for the sake of other components that have them as their dependencies\n const capsules = context.capsuleNetwork.seedersCapsules;\n capsules.forEach((capsule) => {\n // Prepare an 'errors' array to report back of any errors during execution (this will be part of the 'Component Results' data)\n const errors: Error[] = [];\n // Each 'capsule' provides data regarding the component as well as the capsule itself\n const componentName = capsule.component.id.name;\n const capsuleDir = capsule.path;\n\n const artifactContent = \\`The component name is \\${componentName}\\`\n\n try {\n // Generate the artifact inside the capsule's directory\n fs.writeFileSync(\n path.join(capsuleDir, 'output.my-artifact.txt'),\n artifactContent\n );\n } catch (err: any) {\n errors.push(err);\n }\n componentsResults.push({ component: capsule.component, errors });\n });\n\n return {\n artifacts: [\n {\n generatedBy: this.aspectId,\n name: this.name,\n // The glob pattern for artifacts to include in the component version\n globPatterns: ['**/*.my-artifact.txt'],\n },\n ],\n componentsResults,\n };\n }\n}`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQA,CAAC;EAAEC;AAAiC,CAAC,EAAE;EAC7D,OAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,cAAc;AAC7B;AACA,qBAAqBA,cAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["taskFile","namePascalCase"],"sources":["task-file.ts"],"sourcesContent":["import type { ComponentContext } from '@teambit/generator';\n\nexport function taskFile({ namePascalCase }: ComponentContext) {\n return `import {\n BuildTask,\n BuildContext,\n BuiltTaskResult,\n ComponentResult,\n} from '@teambit/builder';\nimport path from 'path';\nimport fs from 'fs';\n\nexport class ${namePascalCase} implements BuildTask {\n constructor(readonly aspectId: string) {}\n readonly name = '${namePascalCase}';\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n // Prepare the component results array which will be used to report back the components processed\n // as well as any additional data regarding this build task execution\n const componentsResults: ComponentResult[] = [];\n // The 'seeder capsules' are capsules for components that are built for their own sake - \n // not for the sake of other components that have them as their dependencies\n const capsules = context.capsuleNetwork.seedersCapsules;\n capsules.forEach((capsule) => {\n // Prepare an 'errors' array to report back of any errors during execution (this will be part of the 'Component Results' data)\n const errors: Error[] = [];\n // Each 'capsule' provides data regarding the component as well as the capsule itself\n const componentName = capsule.component.id.name;\n const capsuleDir = capsule.path;\n\n const artifactContent = \\`The component name is \\${componentName}\\`\n\n try {\n // Generate the artifact inside the capsule's directory\n fs.writeFileSync(\n path.join(capsuleDir, 'output.my-artifact.txt'),\n artifactContent\n );\n } catch (err: any) {\n errors.push(err);\n }\n componentsResults.push({ component: capsule.component, errors });\n });\n\n return {\n artifacts: [\n {\n generatedBy: this.aspectId,\n name: this.name,\n // The glob pattern for artifacts to include in the component version\n globPatterns: ['**/*.my-artifact.txt'],\n },\n ],\n componentsResults,\n };\n }\n}`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQA,CAAC;EAAEC;AAAiC,CAAC,EAAE;EAC7D,OAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,cAAc;AAC7B;AACA,qBAAqBA,cAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ComponentTemplate } from '@teambit/generator';
|
|
1
|
+
import type { ComponentTemplate } from '@teambit/generator';
|
|
2
2
|
export declare const buildTaskTemplate: ComponentTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_indexFile","data","require","_taskFile","buildTaskTemplate","exports","name","hidden","description","generateFiles","context","relativePath","content","indexFile","isMain","taskFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index-file';\nimport { taskFile } from './files/task-file';\n\nexport const buildTaskTemplate: ComponentTemplate = {\n name: 'build-task',\n hidden: true,\n description: 'create a custom build task for your component pipelines',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.task.ts`,\n content: taskFile(context),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,iBAAoC,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAClDE,IAAI,EAAE,YAAY;EAClBC,MAAM,EAAE,IAAI;EACZC,WAAW,EAAE,yDAAyD;EACtEC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,sBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,UAAU;MACvCM,OAAO,EAAE,IAAAG,oBAAQ,EAACL,OAAO;IAC3B,CAAC,CACF;EACH,CAAC;EACDM,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_indexFile","data","require","_taskFile","buildTaskTemplate","exports","name","hidden","description","generateFiles","context","relativePath","content","indexFile","isMain","taskFile","config","env"],"sources":["index.ts"],"sourcesContent":["import type { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index-file';\nimport { taskFile } from './files/task-file';\n\nexport const buildTaskTemplate: ComponentTemplate = {\n name: 'build-task',\n hidden: true,\n description: 'create a custom build task for your component pipelines',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.task.ts`,\n content: taskFile(context),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,iBAAoC,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAClDE,IAAI,EAAE,YAAY;EAClBC,MAAM,EAAE,IAAI;EACZC,WAAW,EAAE,yDAAyD;EACtEC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,sBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAE,GAAGD,OAAO,CAACJ,IAAI,UAAU;MACvCM,OAAO,EAAE,IAAAG,oBAAQ,EAACL,OAAO;IAC3B,CAAC,CACF;EACH,CAAC;EACDM,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC","ignoreList":[]}
|
package/dist/types.d.ts
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Component } from '@teambit/component';\n\nexport type TaskMetadata = { [key: string]: any };\n\nexport type ComponentResult = {\n /**\n * instance of the component\n */\n component: Component;\n\n /**\n * metadata generated during component build.\n * this eventually gets saved into `aspectsData` prop of the builder aspect data.\n * it can be retrieved later on by `builder.getDataByAspect()` method.\n */\n metadata?: TaskMetadata;\n\n /**\n * returning errors from build tasks will cause a pipeline failure and logs all returned errors.\n */\n errors?: Array<Error | string>;\n\n /**\n * warnings generated throughout the build task.\n */\n warnings?: string[];\n\n /**\n * timestamp in milliseconds when the task started\n */\n startTime?: number;\n\n /**\n * timestamp in milliseconds when the task ended\n */\n endTime?: number;\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\n\nexport type TaskMetadata = { [key: string]: any };\n\nexport type ComponentResult = {\n /**\n * instance of the component\n */\n component: Component;\n\n /**\n * metadata generated during component build.\n * this eventually gets saved into `aspectsData` prop of the builder aspect data.\n * it can be retrieved later on by `builder.getDataByAspect()` method.\n */\n metadata?: TaskMetadata;\n\n /**\n * returning errors from build tasks will cause a pipeline failure and logs all returned errors.\n */\n errors?: Array<Error | string>;\n\n /**\n * warnings generated throughout the build task.\n */\n warnings?: string[];\n\n /**\n * timestamp in milliseconds when the task started\n */\n startTime?: number;\n\n /**\n * timestamp in milliseconds when the task ended\n */\n endTime?: number;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BitError } from '@teambit/bit-error';
|
|
2
2
|
import { IssuesAspect } from '@teambit/issues';
|
|
3
|
-
import { ConsumerComponent } from '@teambit/legacy.consumer-component';
|
|
3
|
+
import type { ConsumerComponent } from '@teambit/legacy.consumer-component';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { uniq } from 'lodash';
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.669",
|
|
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.669"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -23,34 +23,34 @@
|
|
|
23
23
|
"globby": "11.0.1",
|
|
24
24
|
"@teambit/toolbox.string.capitalize": "0.0.500",
|
|
25
25
|
"@teambit/graph.cleargraph": "0.0.11",
|
|
26
|
-
"@teambit/component.sources": "0.0.
|
|
26
|
+
"@teambit/component.sources": "0.0.110",
|
|
27
27
|
"@teambit/lane-id": "0.0.312",
|
|
28
28
|
"@teambit/component-issues": "0.0.160",
|
|
29
29
|
"@teambit/legacy.constants": "0.0.13",
|
|
30
30
|
"@teambit/harmony": "0.4.7",
|
|
31
31
|
"@teambit/bit-error": "0.0.404",
|
|
32
32
|
"@teambit/bit.get-bit-version": "0.0.6",
|
|
33
|
-
"@teambit/legacy.consumer-component": "0.0.
|
|
33
|
+
"@teambit/legacy.consumer-component": "0.0.59",
|
|
34
34
|
"@teambit/toolbox.array.duplications-finder": "0.0.3",
|
|
35
35
|
"@teambit/component-id": "1.2.4",
|
|
36
36
|
"@teambit/legacy.utils": "0.0.22",
|
|
37
|
-
"@teambit/legacy.scope": "0.0.
|
|
38
|
-
"@teambit/component": "1.0.
|
|
39
|
-
"@teambit/envs": "1.0.
|
|
40
|
-
"@teambit/logger": "0.0.
|
|
41
|
-
"@teambit/tester": "1.0.
|
|
42
|
-
"@teambit/isolator": "1.0.
|
|
43
|
-
"@teambit/cli": "0.0.
|
|
44
|
-
"@teambit/workspace": "1.0.
|
|
45
|
-
"@teambit/aspect-loader": "1.0.
|
|
46
|
-
"@teambit/aspect": "1.0.
|
|
47
|
-
"@teambit/config-store": "0.0.
|
|
48
|
-
"@teambit/generator": "1.0.
|
|
49
|
-
"@teambit/graphql": "1.0.
|
|
50
|
-
"@teambit/issues": "1.0.
|
|
51
|
-
"@teambit/scope": "1.0.
|
|
52
|
-
"@teambit/ui": "1.0.
|
|
53
|
-
"@teambit/express": "0.0.
|
|
37
|
+
"@teambit/legacy.scope": "0.0.58",
|
|
38
|
+
"@teambit/component": "1.0.669",
|
|
39
|
+
"@teambit/envs": "1.0.669",
|
|
40
|
+
"@teambit/logger": "0.0.1339",
|
|
41
|
+
"@teambit/tester": "1.0.669",
|
|
42
|
+
"@teambit/isolator": "1.0.669",
|
|
43
|
+
"@teambit/cli": "0.0.1246",
|
|
44
|
+
"@teambit/workspace": "1.0.669",
|
|
45
|
+
"@teambit/aspect-loader": "1.0.669",
|
|
46
|
+
"@teambit/aspect": "1.0.669",
|
|
47
|
+
"@teambit/config-store": "0.0.126",
|
|
48
|
+
"@teambit/generator": "1.0.670",
|
|
49
|
+
"@teambit/graphql": "1.0.669",
|
|
50
|
+
"@teambit/issues": "1.0.669",
|
|
51
|
+
"@teambit/scope": "1.0.669",
|
|
52
|
+
"@teambit/ui": "1.0.669",
|
|
53
|
+
"@teambit/express": "0.0.1345"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/pretty-time": "^1.1.5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
import { FsArtifact } from '../artifact';
|
|
3
|
-
import { WholeArtifactStorageResolver } from './storage-resolver';
|
|
1
|
+
import type { Component } from '@teambit/component';
|
|
2
|
+
import type { FsArtifact } from '../artifact';
|
|
3
|
+
import type { WholeArtifactStorageResolver } from './storage-resolver';
|
|
4
4
|
|
|
5
5
|
export class DefaultResolver implements WholeArtifactStorageResolver {
|
|
6
6
|
name = 'default';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
import { ArtifactVinyl } from '@teambit/component.sources';
|
|
3
|
-
import { FsArtifact } from '../artifact';
|
|
1
|
+
import type { Component } from '@teambit/component';
|
|
2
|
+
import type { ArtifactVinyl } from '@teambit/component.sources';
|
|
3
|
+
import type { FsArtifact } from '../artifact';
|
|
4
4
|
|
|
5
5
|
export type StoreResult = {
|
|
6
6
|
[path: string]: string;
|