@teambit/builder 1.0.158 → 1.0.160
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-factory.ts +3 -1
- package/artifacts/__bit_junit.xml +2 -2
- package/artifacts/preview/teambit_pipelines_builder-preview.js +1 -1
- package/artifacts/schema.json +16099 -0
- package/dist/artifact/artifact-factory.js +9 -1
- package/dist/artifact/artifact-factory.js.map +1 -1
- package/dist/{preview-1707189367803.js → preview-1707275702806.js} +2 -2
- package/package.json +18 -18
|
@@ -39,6 +39,13 @@ function _component() {
|
|
|
39
39
|
};
|
|
40
40
|
return data;
|
|
41
41
|
}
|
|
42
|
+
function _utils() {
|
|
43
|
+
const data = require("@teambit/legacy/dist/utils");
|
|
44
|
+
_utils = function () {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
42
49
|
function _storage() {
|
|
43
50
|
const data = require("../storage");
|
|
44
51
|
_storage = function () {
|
|
@@ -72,7 +79,8 @@ const DEFAULT_CONTEXT = exports.DEFAULT_CONTEXT = 'component';
|
|
|
72
79
|
class ArtifactFactory {
|
|
73
80
|
resolvePaths(root, def) {
|
|
74
81
|
const patternsFlattened = (0, _lodash().flatten)(def.globPatterns);
|
|
75
|
-
const
|
|
82
|
+
const patternsFlattenedLinux = patternsFlattened.map(_utils().pathNormalizeToLinux);
|
|
83
|
+
const paths = _globby().default.sync(patternsFlattenedLinux, {
|
|
76
84
|
cwd: root
|
|
77
85
|
});
|
|
78
86
|
return paths;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_path","data","require","_globby","_interopRequireDefault","_lodash","_artifactFiles","_component","_storage","_artifactList","_exceptions","_fsArtifact","obj","__esModule","default","DEFAULT_CONTEXT","exports","ArtifactFactory","resolvePaths","root","def","patternsFlattened","flatten","globPatterns","paths","globby","sync","cwd","getArtifactContextPath","context","component","artifactContext","getArtifactContext","capsulePath","capsuleNetwork","graphCapsules","getCapsule","id","path","CapsuleNotFound","capsulesRootDir","createFromComponent","task","contextPath","rootDir","getRootDir","length","undefined","FsArtifact","ArtifactFiles","getStorageResolver","storageResolver","DefaultResolver","toComponentMap","artifactMap","ComponentMap","as","components","toString","artifacts","filter","targetId","
|
|
1
|
+
{"version":3,"names":["_path","data","require","_globby","_interopRequireDefault","_lodash","_artifactFiles","_component","_utils","_storage","_artifactList","_exceptions","_fsArtifact","obj","__esModule","default","DEFAULT_CONTEXT","exports","ArtifactFactory","resolvePaths","root","def","patternsFlattened","flatten","globPatterns","patternsFlattenedLinux","map","pathNormalizeToLinux","paths","globby","sync","cwd","getArtifactContextPath","context","component","artifactContext","getArtifactContext","capsulePath","capsuleNetwork","graphCapsules","getCapsule","id","path","CapsuleNotFound","capsulesRootDir","createFromComponent","task","contextPath","rootDir","getRootDir","length","undefined","FsArtifact","ArtifactFiles","getStorageResolver","storageResolver","DefaultResolver","toComponentMap","artifactMap","ComponentMap","as","components","toString","artifacts","filter","targetId","artifact","ArtifactList","fromArray","join","generate","defs","tupleArr","forEach","capsuleDir","push"],"sources":["artifact-factory.ts"],"sourcesContent":["import { join } from 'path';\nimport globby from 'globby';\nimport { flatten } from 'lodash';\nimport { ArtifactFiles } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { Component, ComponentMap } from '@teambit/component';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { ArtifactDefinition } from './artifact-definition';\nimport { DefaultResolver } from '../storage';\nimport { ArtifactList } from './artifact-list';\nimport type { BuildContext, BuildTask } from '../build-task';\nimport { CapsuleNotFound } from '../exceptions';\nimport { FsArtifact } from './fs-artifact';\n\nexport const DEFAULT_CONTEXT = 'component';\n\nexport type ArtifactMap = ComponentMap<ArtifactList<FsArtifact>>;\n\nexport class ArtifactFactory {\n resolvePaths(root: string, def: ArtifactDefinition): string[] {\n const patternsFlattened = flatten(def.globPatterns);\n const patternsFlattenedLinux = patternsFlattened.map(pathNormalizeToLinux);\n const paths = globby.sync(patternsFlattenedLinux, { cwd: root });\n return paths;\n }\n\n private getArtifactContextPath(context: BuildContext, component: Component, def: ArtifactDefinition) {\n const artifactContext = this.getArtifactContext(def);\n if (artifactContext === 'component') {\n const capsulePath = context.capsuleNetwork.graphCapsules.getCapsule(component.id)?.path;\n if (!capsulePath) throw new CapsuleNotFound(component.id);\n return capsulePath;\n }\n\n return context.capsuleNetwork.capsulesRootDir;\n }\n\n private getArtifactContext(def: ArtifactDefinition) {\n return def.context || DEFAULT_CONTEXT;\n }\n\n createFromComponent(\n context: BuildContext,\n component: Component,\n def: ArtifactDefinition,\n task: BuildTask\n ): FsArtifact | undefined {\n const contextPath = this.getArtifactContextPath(context, component, def);\n const rootDir = this.getRootDir(contextPath, def);\n const paths = this.resolvePaths(rootDir, def);\n if (!paths || !paths.length) {\n return undefined;\n }\n return new FsArtifact(def, new ArtifactFiles(paths), task, rootDir);\n }\n\n private getStorageResolver(def: ArtifactDefinition) {\n return def.storageResolver || new DefaultResolver();\n }\n\n private toComponentMap(context: BuildContext, artifactMap: [string, FsArtifact][]) {\n return ComponentMap.as<ArtifactList<FsArtifact>>(context.components, (component) => {\n const id = component.id.toString();\n const artifacts = artifactMap.filter(([targetId]) => targetId === id).map(([, artifact]) => artifact);\n\n return ArtifactList.fromArray(artifacts);\n });\n }\n\n getRootDir(rootDir: string, def: ArtifactDefinition) {\n if (!def.rootDir) return rootDir;\n return join(rootDir, def.rootDir);\n }\n\n /**\n * generate artifacts from a build context according to the spec defined in the artifact definitions.\n */\n generate(context: BuildContext, defs: ArtifactDefinition[], task: BuildTask): ComponentMap<ArtifactList<FsArtifact>> {\n const tupleArr: [string, FsArtifact][] = [];\n\n defs.forEach((def) => {\n const artifactContext = this.getArtifactContext(def);\n if (artifactContext === 'env') {\n const capsuleDir = context.capsuleNetwork.capsulesRootDir;\n const rootDir = this.getRootDir(capsuleDir, def);\n const paths = this.resolvePaths(rootDir, def);\n if (paths && paths.length) {\n const artifact = new FsArtifact(def, new ArtifactFiles(this.resolvePaths(rootDir, def)), task, rootDir);\n\n return context.components.forEach((component) => {\n tupleArr.push([component.id.toString(), artifact]);\n });\n }\n }\n\n return context.components.forEach((component) => {\n const artifact = this.createFromComponent(context, component, def, task);\n if (artifact) {\n tupleArr.push([component.id.toString(), artifact]);\n }\n });\n });\n\n return this.toComponentMap(context, tupleArr);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,eAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,cAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,MAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,cAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAA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Z,OAAO,EAAEC,SAAS,EAAEb,GAAG,EAAEyB,IAAI,CAAC;QACxE,IAAIoB,QAAQ,EAAE;UACZM,QAAQ,CAACG,IAAI,CAAC,CAACzC,SAAS,CAACO,EAAE,CAACqB,QAAQ,CAAC,CAAC,EAAEI,QAAQ,CAAC,CAAC;QACpD;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,IAAI,CAACT,cAAc,CAACxB,OAAO,EAAEuC,QAAQ,CAAC;EAC/C;AACF;AAACvD,OAAA,CAAAC,eAAA,GAAAA,eAAA"}
|
|
@@ -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.160/dist/builder.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.160/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.160",
|
|
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.160"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
"@teambit/harmony": "0.4.6",
|
|
28
28
|
"@teambit/bit-error": "0.0.404",
|
|
29
29
|
"@teambit/component-id": "1.2.0",
|
|
30
|
-
"@teambit/component": "1.0.
|
|
31
|
-
"@teambit/envs": "1.0.
|
|
32
|
-
"@teambit/logger": "0.0.
|
|
30
|
+
"@teambit/component": "1.0.160",
|
|
31
|
+
"@teambit/envs": "1.0.160",
|
|
32
|
+
"@teambit/logger": "0.0.944",
|
|
33
33
|
"@teambit/toolbox.string.capitalize": "0.0.496",
|
|
34
|
-
"@teambit/tester": "1.0.
|
|
35
|
-
"@teambit/isolator": "1.0.
|
|
36
|
-
"@teambit/cli": "0.0.
|
|
37
|
-
"@teambit/workspace": "1.0.
|
|
38
|
-
"@teambit/aspect-loader": "1.0.
|
|
39
|
-
"@teambit/aspect": "1.0.
|
|
40
|
-
"@teambit/generator": "1.0.
|
|
41
|
-
"@teambit/global-config": "0.0.
|
|
42
|
-
"@teambit/graphql": "1.0.
|
|
43
|
-
"@teambit/scope": "1.0.
|
|
44
|
-
"@teambit/ui": "1.0.
|
|
45
|
-
"@teambit/express": "0.0.
|
|
34
|
+
"@teambit/tester": "1.0.160",
|
|
35
|
+
"@teambit/isolator": "1.0.160",
|
|
36
|
+
"@teambit/cli": "0.0.851",
|
|
37
|
+
"@teambit/workspace": "1.0.160",
|
|
38
|
+
"@teambit/aspect-loader": "1.0.160",
|
|
39
|
+
"@teambit/aspect": "1.0.160",
|
|
40
|
+
"@teambit/generator": "1.0.161",
|
|
41
|
+
"@teambit/global-config": "0.0.854",
|
|
42
|
+
"@teambit/graphql": "1.0.160",
|
|
43
|
+
"@teambit/scope": "1.0.160",
|
|
44
|
+
"@teambit/ui": "1.0.160",
|
|
45
|
+
"@teambit/express": "0.0.950"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/lodash": "4.14.165",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/minimatch": "3.0.4",
|
|
53
53
|
"@types/mocha": "9.1.0",
|
|
54
54
|
"chai": "4.3.0",
|
|
55
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
55
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.25",
|
|
56
56
|
"@teambit/pipelines.aspect-docs.builder": "0.0.167"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|