@teambit/builder 0.0.592 → 0.0.596

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.
@@ -22,14 +22,14 @@ export class ${namePascalCase} implements BuildTask {
22
22
  readonly name = '${namePascalCase}';
23
23
 
24
24
  async execute(context: BuildContext): Promise<BuiltTaskResult> {
25
- // Prepare the component results array which will be used to report back the components proccessed
25
+ // Prepare the component results array which will be used to report back the components processed
26
26
  // as well as any additional data regarding this build task execution
27
27
  const componentsResults: ComponentResult[] = [];
28
28
  // The 'seeder capsules' are capsules for components that are built for their own sake -
29
29
  // not for the sake of other components that have them as their dependencies
30
30
  const capsules = context.capsuleNetwork.seedersCapsules;
31
31
  capsules.forEach((capsule) => {
32
- // Preprate an 'errors' array to report back of any erros during execution (this will be part of the 'Component Results' data)
32
+ // Prepare an 'errors' array to report back of any errors during execution (this will be part of the 'Component Results' data)
33
33
  const errors: Error[] = [];
34
34
  // Each 'capsule' provides data regarding the component as well as the capsule itself
35
35
  const componentName = capsule.component.id.name;
@@ -38,7 +38,7 @@ export class ${namePascalCase} implements BuildTask {
38
38
  const artifactContent = \`The component name is \${componentName}\`
39
39
 
40
40
  try {
41
- // Generate the artifact inside the capsule's diretory
41
+ // Generate the artifact inside the capsule's directory
42
42
  fs.writeFileSync(
43
43
  path.join(capsuleDir, 'output.my-artifact.txt'),
44
44
  artifactContent
@@ -54,7 +54,7 @@ export class ${namePascalCase} implements BuildTask {
54
54
  {
55
55
  generatedBy: this.aspectId,
56
56
  name: this.name,
57
- // The glob pattern for artifacts to include in the comoponent version
57
+ // The glob pattern for artifacts to include in the component version
58
58
  globPatterns: ['**/*.my-artifact.txt'],
59
59
  },
60
60
  ],
@@ -1 +1 @@
1
- {"version":3,"sources":["task-file.ts"],"names":["taskFile","namePascalCase"],"mappings":";;;;;;;AAEO,SAASA,QAAT,CAAkB;AAAEC,EAAAA;AAAF,CAAlB,EAAwD;AAC7D,SAAQ;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,EArDE;AAsDD","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 proccessed\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 // Preprate an 'errors' array to report back of any erros 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 diretory\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 comoponent version\n globPatterns: ['**/*.my-artifact.txt'],\n },\n ],\n componentsResults,\n };\n }\n}`;\n}\n"]}
1
+ {"version":3,"sources":["task-file.ts"],"names":["taskFile","namePascalCase"],"mappings":";;;;;;;AAEO,SAASA,QAAT,CAAkB;AAAEC,EAAAA;AAAF,CAAlB,EAAwD;AAC7D,SAAQ;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,EArDE;AAsDD","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"]}
@@ -38,6 +38,12 @@ const buildTaskTemplate = {
38
38
  relativePath: `${context.name}.task.ts`,
39
39
  content: (0, _taskFile().taskFile)(context)
40
40
  }];
41
+ },
42
+ config: {
43
+ 'teambit.harmony/aspect': {},
44
+ 'teambit.envs/envs': {
45
+ env: 'teambit.harmony/aspect'
46
+ }
41
47
  }
42
48
  };
43
49
  exports.buildTaskTemplate = buildTaskTemplate;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["buildTaskTemplate","name","description","hidden","generateFiles","context","relativePath","content","isMain"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,iBAAoC,GAAG;AAClDC,EAAAA,IAAI,EAAE,YAD4C;AAElDC,EAAAA,WAAW,EAAE,yDAFqC;AAGlDC,EAAAA,MAAM,EAAE,KAH0C;AAIlDC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CACL;AACEC,MAAAA,YAAY,EAAE,UADhB;AAEEC,MAAAA,OAAO,EAAE,4BAAUF,OAAV,CAFX;AAGEG,MAAAA,MAAM,EAAE;AAHV,KADK,EAML;AACEF,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACJ,IAAK,UADhC;AAEEM,MAAAA,OAAO,EAAE,0BAASF,OAAT;AAFX,KANK,CAAP;AAWD;AAhBiD,CAA7C","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};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["buildTaskTemplate","name","description","hidden","generateFiles","context","relativePath","content","isMain","config","env"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,iBAAoC,GAAG;AAClDC,EAAAA,IAAI,EAAE,YAD4C;AAElDC,EAAAA,WAAW,EAAE,yDAFqC;AAGlDC,EAAAA,MAAM,EAAE,KAH0C;AAIlDC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CACL;AACEC,MAAAA,YAAY,EAAE,UADhB;AAEEC,MAAAA,OAAO,EAAE,4BAAUF,OAAV,CAFX;AAGEG,MAAAA,MAAM,EAAE;AAHV,KADK,EAML;AACEF,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACJ,IAAK,UADhC;AAEEM,MAAAA,OAAO,EAAE,0BAASF,OAAT;AAFX,KANK,CAAP;AAWD,GAhBiD;AAiBlDI,EAAAA,MAAM,EAAE;AACN,8BAA0B,EADpB;AAEN,yBAAqB;AACnBC,MAAAA,GAAG,EAAE;AADc;AAFf;AAjB0C,CAA7C","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"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/builder",
3
- "version": "0.0.592",
3
+ "version": "0.0.596",
4
4
  "homepage": "https://bit.dev/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.592"
9
+ "version": "0.0.596"
10
10
  },
11
11
  "dependencies": {
12
12
  "p-map-series": "2.1.0",
@@ -22,19 +22,19 @@
22
22
  "globby": "11.0.1",
23
23
  "@babel/runtime": "7.12.18",
24
24
  "core-js": "^3.0.0",
25
- "@teambit/component": "0.0.592",
26
- "@teambit/envs": "0.0.592",
27
- "@teambit/logger": "0.0.494",
28
- "@teambit/tester": "0.0.592",
29
- "@teambit/isolator": "0.0.592",
30
- "@teambit/cli": "0.0.406",
31
- "@teambit/workspace": "0.0.592",
32
- "@teambit/aspect-loader": "0.0.592",
33
- "@teambit/generator": "0.0.592",
34
- "@teambit/graphql": "0.0.592",
35
- "@teambit/scope": "0.0.592",
36
- "@teambit/bit-error": "0.0.392",
37
- "@teambit/component-id": "0.0.396"
25
+ "@teambit/component": "0.0.596",
26
+ "@teambit/envs": "0.0.596",
27
+ "@teambit/logger": "0.0.497",
28
+ "@teambit/tester": "0.0.596",
29
+ "@teambit/isolator": "0.0.596",
30
+ "@teambit/cli": "0.0.409",
31
+ "@teambit/workspace": "0.0.596",
32
+ "@teambit/aspect-loader": "0.0.596",
33
+ "@teambit/generator": "0.0.596",
34
+ "@teambit/graphql": "0.0.596",
35
+ "@teambit/scope": "0.0.596",
36
+ "@teambit/bit-error": "0.0.394",
37
+ "@teambit/component-id": "0.0.398"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/lodash": "4.14.165",
@@ -46,10 +46,10 @@
46
46
  "@types/jest": "^26.0.0",
47
47
  "@types/react-dom": "^17.0.5",
48
48
  "@types/node": "12.20.4",
49
- "@teambit/pipelines.aspect-docs.builder": "0.0.128"
49
+ "@teambit/pipelines.aspect-docs.builder": "0.0.130"
50
50
  },
51
51
  "peerDependencies": {
52
- "@teambit/legacy": "1.0.192",
52
+ "@teambit/legacy": "1.0.196",
53
53
  "react-dom": "^16.8.0 || ^17.0.0",
54
54
  "react": "^16.8.0 || ^17.0.0"
55
55
  },
@@ -77,7 +77,7 @@
77
77
  "react": "-"
78
78
  },
79
79
  "peerDependencies": {
80
- "@teambit/legacy": "1.0.192",
80
+ "@teambit/legacy": "1.0.196",
81
81
  "react-dom": "^16.8.0 || ^17.0.0",
82
82
  "react": "^16.8.0 || ^17.0.0"
83
83
  }
@@ -15,14 +15,14 @@ export class ${namePascalCase} implements BuildTask {
15
15
  readonly name = '${namePascalCase}';
16
16
 
17
17
  async execute(context: BuildContext): Promise<BuiltTaskResult> {
18
- // Prepare the component results array which will be used to report back the components proccessed
18
+ // Prepare the component results array which will be used to report back the components processed
19
19
  // as well as any additional data regarding this build task execution
20
20
  const componentsResults: ComponentResult[] = [];
21
21
  // The 'seeder capsules' are capsules for components that are built for their own sake -
22
22
  // not for the sake of other components that have them as their dependencies
23
23
  const capsules = context.capsuleNetwork.seedersCapsules;
24
24
  capsules.forEach((capsule) => {
25
- // Preprate an 'errors' array to report back of any erros during execution (this will be part of the 'Component Results' data)
25
+ // Prepare an 'errors' array to report back of any errors during execution (this will be part of the 'Component Results' data)
26
26
  const errors: Error[] = [];
27
27
  // Each 'capsule' provides data regarding the component as well as the capsule itself
28
28
  const componentName = capsule.component.id.name;
@@ -31,7 +31,7 @@ export class ${namePascalCase} implements BuildTask {
31
31
  const artifactContent = \`The component name is \${componentName}\`
32
32
 
33
33
  try {
34
- // Generate the artifact inside the capsule's diretory
34
+ // Generate the artifact inside the capsule's directory
35
35
  fs.writeFileSync(
36
36
  path.join(capsuleDir, 'output.my-artifact.txt'),
37
37
  artifactContent
@@ -47,7 +47,7 @@ export class ${namePascalCase} implements BuildTask {
47
47
  {
48
48
  generatedBy: this.aspectId,
49
49
  name: this.name,
50
- // The glob pattern for artifacts to include in the comoponent version
50
+ // The glob pattern for artifacts to include in the component version
51
51
  globPatterns: ['**/*.my-artifact.txt'],
52
52
  },
53
53
  ],
@@ -19,4 +19,10 @@ export const buildTaskTemplate: ComponentTemplate = {
19
19
  },
20
20
  ];
21
21
  },
22
+ config: {
23
+ 'teambit.harmony/aspect': {},
24
+ 'teambit.envs/envs': {
25
+ env: 'teambit.harmony/aspect',
26
+ },
27
+ },
22
28
  };