@teambit/builder 1.0.86 → 1.0.87
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.
|
@@ -3,7 +3,7 @@ import filenamify from 'filenamify';
|
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
4
|
import { ComponentMain } from '@teambit/component';
|
|
5
5
|
import ScopeAspect, { ScopeMain } from '@teambit/scope';
|
|
6
|
-
import { ComponentID } from '@teambit/component-id';
|
|
6
|
+
import { ComponentID, ComponentIdList } from '@teambit/component-id';
|
|
7
7
|
import pMapSeries from 'p-map-series';
|
|
8
8
|
import minimatch from 'minimatch';
|
|
9
9
|
import { ArtifactFiles } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';
|
|
@@ -45,6 +45,9 @@ export class ArtifactExtractor {
|
|
|
45
45
|
async list(): Promise<ExtractorResult[]> {
|
|
46
46
|
const host = this.componentMain.getHost();
|
|
47
47
|
const ids = await host.idsByPattern(this.pattern);
|
|
48
|
+
const scope = this.componentMain.getHost(ScopeAspect.id) as ScopeMain;
|
|
49
|
+
// import in case the components are with build status "pending"
|
|
50
|
+
await scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(ids), { reason: 'artifact' });
|
|
48
51
|
const components = await host.getMany(ids);
|
|
49
52
|
const artifactListPerId: ArtifactListPerId[] = components.map((component) => {
|
|
50
53
|
return {
|
|
@@ -32,6 +32,13 @@ function _scope() {
|
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
|
+
function _componentId() {
|
|
36
|
+
const data = require("@teambit/component-id");
|
|
37
|
+
_componentId = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
35
42
|
function _pMapSeries() {
|
|
36
43
|
const data = _interopRequireDefault(require("p-map-series"));
|
|
37
44
|
_pMapSeries = function () {
|
|
@@ -78,6 +85,11 @@ class ArtifactExtractor {
|
|
|
78
85
|
async list() {
|
|
79
86
|
const host = this.componentMain.getHost();
|
|
80
87
|
const ids = await host.idsByPattern(this.pattern);
|
|
88
|
+
const scope = this.componentMain.getHost(_scope().default.id);
|
|
89
|
+
// import in case the components are with build status "pending"
|
|
90
|
+
await scope.legacyScope.scopeImporter.importWithoutDeps(_componentId().ComponentIdList.fromArray(ids), {
|
|
91
|
+
reason: 'artifact'
|
|
92
|
+
});
|
|
81
93
|
const components = await host.getMany(ids);
|
|
82
94
|
const artifactListPerId = components.map(component => {
|
|
83
95
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_path","data","_interopRequireDefault","require","_filenamify","_fsExtra","_scope","_pMapSeries","_minimatch","_artifactFiles","_artifactList","_artifact","obj","__esModule","default","ArtifactExtractor","constructor","componentMain","builder","pattern","options","list","host","getHost","ids","idsByPattern","components","getMany","artifactListPerId","map","component","id","artifacts","getArtifacts","filterByOptions","saveFilesInFileSystemIfAsked","artifactsObjectsToExtractorResults","groupResultsByAspect","extractorResult","result","reduce","acc","current","aspectId","push","outDir","scope","ScopeAspect","pMapSeries","vinyls","getVinylsAndImportIfMissing","legacyScope","idAsFilename","filenamify","toStringWithoutVersion","replacement","compPath","path","join","Promise","all","vinyl","fs","outputFile","contents","results","artifact","artifactName","name","task","taskName","generatedBy","files","refs","ref","relativePath","aspect","filteredArtifacts","forEach","item","filter","minimatch","Artifact","def","ArtifactFiles","isEmpty","ArtifactList","fromArray","exports"],"sources":["artifact-extractor.ts"],"sourcesContent":["import path from 'path';\nimport filenamify from 'filenamify';\nimport fs from 'fs-extra';\nimport { ComponentMain } from '@teambit/component';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { ComponentID } from '@teambit/component-id';\nimport pMapSeries from 'p-map-series';\nimport minimatch from 'minimatch';\nimport { ArtifactFiles } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { BuilderMain } from '../builder.main.runtime';\nimport { ArtifactsOpts } from './artifacts.cmd';\nimport { ArtifactList } from './artifact-list';\nimport { Artifact } from './artifact';\n\nexport type ExtractorResult = {\n id: ComponentID;\n artifacts: ExtractorArtifactResult[];\n};\n\nexport type ExtractorArtifactResult = {\n artifactName: string;\n aspectId: string;\n taskName: string;\n files: string[];\n};\n\nexport type ExtractorResultGrouped = {\n id: ComponentID;\n artifacts: { [aspectId: string]: ExtractorArtifactResult[] };\n};\n\ntype ArtifactListPerId = {\n id: ComponentID;\n artifacts: ArtifactList<Artifact>;\n};\n\nexport class ArtifactExtractor {\n constructor(\n private componentMain: ComponentMain,\n private builder: BuilderMain,\n private pattern: string,\n private options: ArtifactsOpts\n ) {}\n\n async list(): Promise<ExtractorResult[]> {\n const host = this.componentMain.getHost();\n const ids = await host.idsByPattern(this.pattern);\n const components = await host.getMany(ids);\n const artifactListPerId: ArtifactListPerId[] = components.map((component) => {\n return {\n id: component.id,\n artifacts: this.builder.getArtifacts(component),\n };\n });\n this.filterByOptions(artifactListPerId);\n await this.saveFilesInFileSystemIfAsked(artifactListPerId);\n\n return this.artifactsObjectsToExtractorResults(artifactListPerId);\n }\n\n groupResultsByAspect(extractorResult: ExtractorResult[]) {\n return extractorResult.map((result) => {\n const artifacts = result.artifacts.reduce((acc, current) => {\n (acc[current.aspectId] ||= []).push(current);\n return acc;\n }, {});\n return { id: result.id, artifacts };\n });\n }\n\n private async saveFilesInFileSystemIfAsked(artifactListPerId: ArtifactListPerId[]) {\n const outDir = this.options.outDir;\n if (!outDir) {\n return;\n }\n const scope = this.componentMain.getHost(ScopeAspect.id) as ScopeMain;\n // @todo: optimize this to first import all missing hashes.\n await pMapSeries(artifactListPerId, async ({ id, artifacts }) => {\n const vinyls = await artifacts.getVinylsAndImportIfMissing(id, scope.legacyScope);\n // make sure the component-dir is just one dir. without this, every slash in the component-id will create a new dir.\n const idAsFilename = filenamify(id.toStringWithoutVersion(), { replacement: '_' });\n const compPath = path.join(outDir, idAsFilename);\n await Promise.all(vinyls.map((vinyl) => fs.outputFile(path.join(compPath, vinyl.path), vinyl.contents)));\n });\n }\n\n private artifactsObjectsToExtractorResults(artifactListPerId: ArtifactListPerId[]): ExtractorResult[] {\n return artifactListPerId.map(({ id, artifacts }) => {\n const results: ExtractorArtifactResult[] = artifacts.map((artifact) => {\n return {\n artifactName: artifact.name,\n aspectId: artifact.task.aspectId,\n taskName: artifact.task.name || artifact.generatedBy,\n files: artifact.files.refs.map((ref) => ref.relativePath),\n };\n });\n return {\n id,\n artifacts: results,\n };\n });\n }\n\n private filterByOptions(artifactListPerId: ArtifactListPerId[]) {\n const { aspect, task, files } = this.options;\n let filteredArtifacts: Artifact[] = [];\n\n artifactListPerId.forEach((item) => {\n filteredArtifacts = item.artifacts.filter((artifact) => {\n if (aspect && aspect !== artifact.task.aspectId) return false;\n if (task && task !== artifact.task.name) return false;\n return true;\n });\n if (files) {\n filteredArtifacts = item.artifacts\n .map((artifact) => {\n const refs = artifact.files.refs.filter((ref) => minimatch(ref.relativePath, files));\n return new Artifact(artifact.def, new ArtifactFiles([], [], refs), artifact.task);\n })\n // remove artifacts with no files\n .filter((artifact) => !artifact.isEmpty());\n }\n item.artifacts = ArtifactList.fromArray(filteredArtifacts);\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;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AAEP,IAAI;MAAEG;IAAM,CAAC,GAAG,IAAI,CAACpD,OAAO;IAC5C,IAAIyD,iBAA6B,GAAG,EAAE;IAEtCjD,iBAAiB,CAACkD,OAAO,CAAEC,IAAI,IAAK;MAClCF,iBAAiB,GAAGE,IAAI,CAAC/C,SAAS,CAACgD,MAAM,CAAEd,QAAQ,IAAK;QACtD,IAAIU,MAAM,IAAIA,MAAM,KAAKV,QAAQ,CAACG,IAAI,CAAC1B,QAAQ,EAAE,OAAO,KAAK;QAC7D,IAAI0B,IAAI,IAAIA,IAAI,KAAKH,QAAQ,CAACG,IAAI,CAACD,IAAI,EAAE,OAAO,KAAK;QACrD,OAAO,IAAI;MACb,CAAC,CAAC;MACF,IAAII,KAAK,EAAE;QACTK,iBAAiB,GAAGE,IAAI,CAAC/C,SAAS,CAC/BH,GAAG,CAAEqC,QAAQ,IAAK;UACjB,MAAMO,IAAI,GAAGP,QAAQ,CAACM,KAAK,CAACC,IAAI,CAACO,MAAM,CAAEN,GAAG,IAAK,IAAAO,oBAAS,EAACP,GAAG,CAACC,YAAY,EAAEH,KAAK,CAAC,CAAC;UACpF,OAAO,KAAIU,oBAAQ,EAAChB,QAAQ,CAACiB,GAAG,EAAE,KAAIC,8BAAa,EAAC,EAAE,EAAE,EAAE,EAAEX,IAAI,CAAC,EAAEP,QAAQ,CAACG,IAAI,CAAC;QACnF,CAAC;QACD;QAAA,CACCW,MAAM,CAAEd,QAAQ,IAAK,CAACA,QAAQ,CAACmB,OAAO,CAAC,CAAC,CAAC;MAC9C;MACAN,IAAI,CAAC/C,SAAS,GAAGsD,4BAAY,CAACC,SAAS,CAACV,iBAAiB,CAAC;IAC5D,CAAC,CAAC;EACJ;AACF;AAACW,OAAA,CAAAzE,iBAAA,GAAAA,iBAAA"}
|
|
1
|
+
{"version":3,"names":["_path","data","_interopRequireDefault","require","_filenamify","_fsExtra","_scope","_componentId","_pMapSeries","_minimatch","_artifactFiles","_artifactList","_artifact","obj","__esModule","default","ArtifactExtractor","constructor","componentMain","builder","pattern","options","list","host","getHost","ids","idsByPattern","scope","ScopeAspect","id","legacyScope","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","reason","components","getMany","artifactListPerId","map","component","artifacts","getArtifacts","filterByOptions","saveFilesInFileSystemIfAsked","artifactsObjectsToExtractorResults","groupResultsByAspect","extractorResult","result","reduce","acc","current","aspectId","push","outDir","pMapSeries","vinyls","getVinylsAndImportIfMissing","idAsFilename","filenamify","toStringWithoutVersion","replacement","compPath","path","join","Promise","all","vinyl","fs","outputFile","contents","results","artifact","artifactName","name","task","taskName","generatedBy","files","refs","ref","relativePath","aspect","filteredArtifacts","forEach","item","filter","minimatch","Artifact","def","ArtifactFiles","isEmpty","ArtifactList","exports"],"sources":["artifact-extractor.ts"],"sourcesContent":["import path from 'path';\nimport filenamify from 'filenamify';\nimport fs from 'fs-extra';\nimport { ComponentMain } from '@teambit/component';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport pMapSeries from 'p-map-series';\nimport minimatch from 'minimatch';\nimport { ArtifactFiles } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { BuilderMain } from '../builder.main.runtime';\nimport { ArtifactsOpts } from './artifacts.cmd';\nimport { ArtifactList } from './artifact-list';\nimport { Artifact } from './artifact';\n\nexport type ExtractorResult = {\n id: ComponentID;\n artifacts: ExtractorArtifactResult[];\n};\n\nexport type ExtractorArtifactResult = {\n artifactName: string;\n aspectId: string;\n taskName: string;\n files: string[];\n};\n\nexport type ExtractorResultGrouped = {\n id: ComponentID;\n artifacts: { [aspectId: string]: ExtractorArtifactResult[] };\n};\n\ntype ArtifactListPerId = {\n id: ComponentID;\n artifacts: ArtifactList<Artifact>;\n};\n\nexport class ArtifactExtractor {\n constructor(\n private componentMain: ComponentMain,\n private builder: BuilderMain,\n private pattern: string,\n private options: ArtifactsOpts\n ) {}\n\n async list(): Promise<ExtractorResult[]> {\n const host = this.componentMain.getHost();\n const ids = await host.idsByPattern(this.pattern);\n const scope = this.componentMain.getHost(ScopeAspect.id) as ScopeMain;\n // import in case the components are with build status \"pending\"\n await scope.legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(ids), { reason: 'artifact' });\n const components = await host.getMany(ids);\n const artifactListPerId: ArtifactListPerId[] = components.map((component) => {\n return {\n id: component.id,\n artifacts: this.builder.getArtifacts(component),\n };\n });\n this.filterByOptions(artifactListPerId);\n await this.saveFilesInFileSystemIfAsked(artifactListPerId);\n\n return this.artifactsObjectsToExtractorResults(artifactListPerId);\n }\n\n groupResultsByAspect(extractorResult: ExtractorResult[]) {\n return extractorResult.map((result) => {\n const artifacts = result.artifacts.reduce((acc, current) => {\n (acc[current.aspectId] ||= []).push(current);\n return acc;\n }, {});\n return { id: result.id, artifacts };\n });\n }\n\n private async saveFilesInFileSystemIfAsked(artifactListPerId: ArtifactListPerId[]) {\n const outDir = this.options.outDir;\n if (!outDir) {\n return;\n }\n const scope = this.componentMain.getHost(ScopeAspect.id) as ScopeMain;\n // @todo: optimize this to first import all missing hashes.\n await pMapSeries(artifactListPerId, async ({ id, artifacts }) => {\n const vinyls = await artifacts.getVinylsAndImportIfMissing(id, scope.legacyScope);\n // make sure the component-dir is just one dir. without this, every slash in the component-id will create a new dir.\n const idAsFilename = filenamify(id.toStringWithoutVersion(), { replacement: '_' });\n const compPath = path.join(outDir, idAsFilename);\n await Promise.all(vinyls.map((vinyl) => fs.outputFile(path.join(compPath, vinyl.path), vinyl.contents)));\n });\n }\n\n private artifactsObjectsToExtractorResults(artifactListPerId: ArtifactListPerId[]): ExtractorResult[] {\n return artifactListPerId.map(({ id, artifacts }) => {\n const results: ExtractorArtifactResult[] = artifacts.map((artifact) => {\n return {\n artifactName: artifact.name,\n aspectId: artifact.task.aspectId,\n taskName: artifact.task.name || artifact.generatedBy,\n files: artifact.files.refs.map((ref) => ref.relativePath),\n };\n });\n return {\n id,\n artifacts: results,\n };\n });\n }\n\n private filterByOptions(artifactListPerId: ArtifactListPerId[]) {\n const { aspect, task, files } = this.options;\n let filteredArtifacts: Artifact[] = [];\n\n artifactListPerId.forEach((item) => {\n filteredArtifacts = item.artifacts.filter((artifact) => {\n if (aspect && aspect !== artifact.task.aspectId) return false;\n if (task && task !== artifact.task.name) return false;\n return true;\n });\n if (files) {\n filteredArtifacts = item.artifacts\n .map((artifact) => {\n const refs = artifact.files.refs.filter((ref) => minimatch(ref.relativePath, files));\n return new Artifact(artifact.def, new ArtifactFiles([], [], refs), artifact.task);\n })\n // remove artifacts with no files\n .filter((artifact) => !artifact.isEmpty());\n }\n item.artifacts = ArtifactList.fromArray(filteredArtifacts);\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,WAAA,YAAAA,CAAA;I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/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.87/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.87/dist/builder.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.87",
|
|
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.87"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"@teambit/harmony": "0.4.6",
|
|
30
30
|
"@teambit/bit-error": "0.0.404",
|
|
31
31
|
"@teambit/component-id": "1.2.0",
|
|
32
|
-
"@teambit/component": "1.0.
|
|
33
|
-
"@teambit/envs": "1.0.
|
|
34
|
-
"@teambit/logger": "0.0.
|
|
32
|
+
"@teambit/component": "1.0.87",
|
|
33
|
+
"@teambit/envs": "1.0.87",
|
|
34
|
+
"@teambit/logger": "0.0.924",
|
|
35
35
|
"@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.
|
|
36
|
+
"@teambit/tester": "1.0.87",
|
|
37
|
+
"@teambit/isolator": "1.0.87",
|
|
38
|
+
"@teambit/cli": "0.0.831",
|
|
39
|
+
"@teambit/workspace": "1.0.87",
|
|
40
|
+
"@teambit/aspect-loader": "1.0.87",
|
|
41
|
+
"@teambit/aspect": "1.0.87",
|
|
42
|
+
"@teambit/generator": "1.0.88",
|
|
43
|
+
"@teambit/global-config": "0.0.833",
|
|
44
|
+
"@teambit/graphql": "1.0.87",
|
|
45
|
+
"@teambit/scope": "1.0.87",
|
|
46
|
+
"@teambit/ui": "1.0.87",
|
|
47
|
+
"@teambit/express": "0.0.930"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/lodash": "4.14.165",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@teambit/pipelines.aspect-docs.builder": "0.0.165"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@teambit/legacy": "1.0.
|
|
64
|
+
"@teambit/legacy": "1.0.616",
|
|
65
65
|
"react": "^16.8.0 || ^17.0.0",
|
|
66
66
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
67
67
|
},
|