@teambit/builder 0.0.1110 → 0.0.1112
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/dist/artifact/artifact-extractor.js.map +1 -1
- package/dist/artifact/artifact-factory.js.map +1 -1
- package/dist/artifact/artifact-list.js.map +1 -1
- package/dist/artifact/artifact.js.map +1 -1
- package/dist/artifact/artifacts.cmd.js.map +1 -1
- package/dist/artifact/extension-artifact.js.map +1 -1
- package/dist/artifact/fs-artifact.js.map +1 -1
- package/dist/artifact/index.js.map +1 -1
- package/dist/build-pipe.js.map +1 -1
- package/dist/build-pipeline-order.js.map +1 -1
- package/dist/build-pipeline-result-list.js.map +1 -1
- package/dist/build-task.js +0 -2
- package/dist/build-task.js.map +1 -1
- package/dist/build.cmd.js.map +1 -1
- package/dist/builder.aspect.js.map +1 -1
- package/dist/builder.composition.js.map +1 -1
- package/dist/builder.graphql.js.map +1 -1
- package/dist/builder.main.runtime.js +1 -5
- package/dist/builder.main.runtime.js.map +1 -1
- package/dist/builder.route.js.map +1 -1
- package/dist/builder.service.js.map +1 -1
- package/dist/exceptions/artifact-definition-no-glob.js.map +1 -1
- package/dist/exceptions/artifact-storage-error.js.map +1 -1
- package/dist/exceptions/capsule-not-found.js.map +1 -1
- package/dist/exceptions/index.js.map +1 -1
- package/dist/exceptions/invalid-task.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/pipeline-results.js.map +1 -1
- package/dist/pipeline.js.map +1 -1
- package/dist/{preview-1689736586631.js → preview-1689909446382.js} +2 -2
- package/dist/storage/default-resolver.js.map +1 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/task-results-list.js.map +1 -1
- package/dist/tasks-queue.js.map +1 -1
- package/dist/templates/build-task/files/index-file.js.map +1 -1
- package/dist/templates/build-task/files/task-file.js.map +1 -1
- package/dist/templates/build-task/index.js.map +1 -1
- package/package-tar/teambit-builder-0.0.1112.tgz +0 -0
- package/package.json +19 -19
- package/package-tar/teambit-builder-0.0.1110.tgz +0 -0
package/dist/tasks-queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["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"],"sources":["tasks-queue.ts"],"sourcesContent":["import { EnvDefinition } from '@teambit/envs';\nimport { BuildTask, 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":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIO,MAAMA,UAAU,SAASC,KAAK,CAAU;EAC7CC,QAAQ,GAAG;IACT,OAAO,IAAI,CAACC,GAAG,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|
|
|
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,
|
|
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,SAAS,CAAC;EAAEC,cAAc;EAAEC;AAAuB,CAAC,EAAE;EACpE,OAAQ,YAAWD,cAAe,cAAaC,IAAK,QAAO;AAC7D"}
|
|
@@ -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,
|
|
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,QAAQ,CAAC;EAAEC;AAAiC,CAAC,EAAE;EAC7D,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,cAAe;AAC9B;AACA,qBAAqBA,cAAe;AACpC;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["buildTaskTemplate","name","description","hidden","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 description: 'create a custom build task for your component pipelines',\n hidden: false,\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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,iBAAoC,GAAG;EAClDC,IAAI,EAAE,YAAY;EAClBC,WAAW,EAAE,yDAAyD;EACtEC,MAAM,EAAE,KAAK;EACbC,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,EAAG,GAAED,OAAO,CAACJ,IAAK,UAAS;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;AAAC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1112",
|
|
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": "0.0.
|
|
9
|
+
"version": "0.0.1112"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"p-map-series": "2.1.0",
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
"@teambit/graph.cleargraph": "0.0.1",
|
|
28
28
|
"@teambit/harmony": "0.4.6",
|
|
29
29
|
"@teambit/component-id": "0.0.427",
|
|
30
|
-
"@teambit/component": "0.0.
|
|
31
|
-
"@teambit/envs": "0.0.
|
|
32
|
-
"@teambit/logger": "0.0.
|
|
33
|
-
"@teambit/tester": "0.0.
|
|
34
|
-
"@teambit/isolator": "0.0.
|
|
35
|
-
"@teambit/lane-id": "0.0.
|
|
36
|
-
"@teambit/cli": "0.0.
|
|
37
|
-
"@teambit/workspace": "0.0.
|
|
38
|
-
"@teambit/aspect-loader": "0.0.
|
|
39
|
-
"@teambit/aspect": "0.0.
|
|
40
|
-
"@teambit/generator": "0.0.
|
|
41
|
-
"@teambit/global-config": "0.0.
|
|
42
|
-
"@teambit/graphql": "0.0.
|
|
43
|
-
"@teambit/scope": "0.0.
|
|
44
|
-
"@teambit/ui": "0.0.
|
|
45
|
-
"@teambit/express": "0.0.
|
|
30
|
+
"@teambit/component": "0.0.1112",
|
|
31
|
+
"@teambit/envs": "0.0.1112",
|
|
32
|
+
"@teambit/logger": "0.0.837",
|
|
33
|
+
"@teambit/tester": "0.0.1112",
|
|
34
|
+
"@teambit/isolator": "0.0.1112",
|
|
35
|
+
"@teambit/lane-id": "0.0.260",
|
|
36
|
+
"@teambit/cli": "0.0.744",
|
|
37
|
+
"@teambit/workspace": "0.0.1112",
|
|
38
|
+
"@teambit/aspect-loader": "0.0.1112",
|
|
39
|
+
"@teambit/aspect": "0.0.1112",
|
|
40
|
+
"@teambit/generator": "0.0.1112",
|
|
41
|
+
"@teambit/global-config": "0.0.746",
|
|
42
|
+
"@teambit/graphql": "0.0.1112",
|
|
43
|
+
"@teambit/scope": "0.0.1112",
|
|
44
|
+
"@teambit/ui": "0.0.1112",
|
|
45
|
+
"@teambit/express": "0.0.842",
|
|
46
46
|
"@teambit/bit-error": "0.0.402"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@teambit/pipelines.aspect-docs.builder": "0.0.154"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@teambit/legacy": "1.0.
|
|
63
|
+
"@teambit/legacy": "1.0.524",
|
|
64
64
|
"react": "^16.8.0 || ^17.0.0",
|
|
65
65
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
66
66
|
},
|
|
Binary file
|