@teambit/application 0.0.249 → 0.0.251
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/deploy.task.js
CHANGED
|
@@ -81,10 +81,11 @@ class DeployTask {
|
|
|
81
81
|
const capsules = context.capsuleNetwork.seedersCapsules;
|
|
82
82
|
const capsule = this.getCapsule(capsules, aspectId);
|
|
83
83
|
if (!(capsule !== null && capsule !== void 0 && capsule.component)) return undefined;
|
|
84
|
-
const buildTask = this.getBuildTask(context.previousTasksResults);
|
|
84
|
+
const buildTask = this.getBuildTask(context.previousTasksResults, context.envRuntime.id);
|
|
85
85
|
if (!buildTask) return undefined;
|
|
86
86
|
const componentArtifacts = (_buildTask$artifacts = buildTask.artifacts) === null || _buildTask$artifacts === void 0 ? void 0 : _buildTask$artifacts.get(capsule.component);
|
|
87
87
|
const artifactList = componentArtifacts === null || componentArtifacts === void 0 ? void 0 : componentArtifacts[1];
|
|
88
|
+
if (!artifactList) return undefined;
|
|
88
89
|
const deployContext = Object.assign(context, {
|
|
89
90
|
artifactList
|
|
90
91
|
});
|
|
@@ -106,10 +107,11 @@ class DeployTask {
|
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
getBuildTask(taskResults) {
|
|
110
|
+
getBuildTask(taskResults, runtime) {
|
|
110
111
|
return taskResults.find(({
|
|
111
|
-
task
|
|
112
|
-
|
|
112
|
+
task,
|
|
113
|
+
env
|
|
114
|
+
}) => task.aspectId === _application().ApplicationAspect.id && task.name === _build().BUILD_TASK && env.id === runtime);
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
getCapsule(capsules, aspectId) {
|
package/dist/deploy.task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["deploy.task.ts"],"names":["DEPLOY_TASK","DeployTask","constructor","application","builder","ApplicationAspect","id","execute","context","apps","listApps","componentsResults","app","aspectId","getAppAspect","name","undefined","capsules","capsuleNetwork","seedersCapsules","capsule","getCapsule","component","buildTask","getBuildTask","previousTasksResults","componentArtifacts","artifacts","get","artifactList","deployContext","Object","assign","deploy","componentResult","_componentsResults","map","res","filter","a","taskResults","find","task","BUILD_TASK","aspectCapsuleId","ComponentID","fromString","toStringWithoutVersion"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,WAAW,GAAG,oBAApB;;;AAEA,MAAMC,UAAN,CAAsC;AAI3CC,EAAAA,WAAW,CAASC,WAAT,EAA+CC,OAA/C,EAAqE;AAAA,SAA5DD,WAA4D,GAA5DA,WAA4D;AAAA,SAAtBC,OAAsB,GAAtBA,OAAsB;AAAA,kDAHzEJ,WAGyE;AAAA,sDAFrEK,iCAAkBC,EAEmD;AAAA,sDAD5D,KAC4D;AAAE;;AAErE,QAAPC,OAAO,CAACC,OAAD,EAAsC;AACjD,UAAMC,IAAI,GAAG,KAAKN,WAAL,CAAiBO,QAAjB,EAAb;AACA,UAAMC,iBAAiB,GAAG,MAAM,2BAAUF,IAAV,EAAgB,MAAOG,GAAP,IAA6B;AAAA;;AAC3E,YAAMC,QAAQ,GAAG,KAAKV,WAAL,CAAiBW,YAAjB,CAA8BF,GAAG,CAACG,IAAlC,CAAjB;AACA,UAAI,CAACF,QAAL,EAAe,OAAOG,SAAP;AACf,YAAMC,QAAQ,GAAGT,OAAO,CAACU,cAAR,CAAuBC,eAAxC;AACA,YAAMC,OAAO,GAAG,KAAKC,UAAL,CAAgBJ,QAAhB,EAA0BJ,QAA1B,CAAhB;AACA,UAAI,EAACO,OAAD,aAACA,OAAD,eAACA,OAAO,CAAEE,SAAV,CAAJ,EAAyB,OAAON,SAAP;AACzB,YAAMO,SAAS,GAAG,KAAKC,YAAL,CAAkBhB,OAAO,CAACiB,oBAA1B,CAAlB;AACA,UAAI,
|
|
1
|
+
{"version":3,"sources":["deploy.task.ts"],"names":["DEPLOY_TASK","DeployTask","constructor","application","builder","ApplicationAspect","id","execute","context","apps","listApps","componentsResults","app","aspectId","getAppAspect","name","undefined","capsules","capsuleNetwork","seedersCapsules","capsule","getCapsule","component","buildTask","getBuildTask","previousTasksResults","envRuntime","componentArtifacts","artifacts","get","artifactList","deployContext","Object","assign","deploy","componentResult","_componentsResults","map","res","filter","a","taskResults","runtime","find","task","env","BUILD_TASK","aspectCapsuleId","ComponentID","fromString","toStringWithoutVersion"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,WAAW,GAAG,oBAApB;;;AAEA,MAAMC,UAAN,CAAsC;AAI3CC,EAAAA,WAAW,CAASC,WAAT,EAA+CC,OAA/C,EAAqE;AAAA,SAA5DD,WAA4D,GAA5DA,WAA4D;AAAA,SAAtBC,OAAsB,GAAtBA,OAAsB;AAAA,kDAHzEJ,WAGyE;AAAA,sDAFrEK,iCAAkBC,EAEmD;AAAA,sDAD5D,KAC4D;AAAE;;AAErE,QAAPC,OAAO,CAACC,OAAD,EAAsC;AACjD,UAAMC,IAAI,GAAG,KAAKN,WAAL,CAAiBO,QAAjB,EAAb;AACA,UAAMC,iBAAiB,GAAG,MAAM,2BAAUF,IAAV,EAAgB,MAAOG,GAAP,IAA6B;AAAA;;AAC3E,YAAMC,QAAQ,GAAG,KAAKV,WAAL,CAAiBW,YAAjB,CAA8BF,GAAG,CAACG,IAAlC,CAAjB;AACA,UAAI,CAACF,QAAL,EAAe,OAAOG,SAAP;AACf,YAAMC,QAAQ,GAA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P;AAGD;;AAEOZ,EAAAA,YAAY,CAACiB,WAAD,EAA6BC,OAA7B,EAA8C;AAChE,WAAOD,WAAW,CAACE,IAAZ,CACL,CAAC;AAAEC,MAAAA,IAAF;AAAQC,MAAAA;AAAR,KAAD,KAAmBD,IAAI,CAAC/B,QAAL,KAAkBR,iCAAkBC,EAApC,IAA0CsC,IAAI,CAAC7B,IAAL,KAAc+B,mBAAxD,IAAsED,GAAG,CAACvC,EAAJ,KAAWoC,OAD/F,CAAP;AAGD;;AAEOrB,EAAAA,UAAU,CAACJ,QAAD,EAAsBJ,QAAtB,EAAwC;AACxD,UAAMkC,eAAe,GAAGC,yBAAYC,UAAZ,CAAuBpC,QAAvB,EAAiCqC,sBAAjC,EAAxB;;AACA,WAAOjC,QAAQ,CAAC0B,IAAT,CAAevB,OAAD,IAAaA,OAAO,CAACE,SAAR,CAAkBhB,EAAlB,CAAqB4C,sBAArB,OAAkDH,eAA7E,CAAP;AACD;;AAhD0C","sourcesContent":["import mapSeries from 'p-map-series';\nimport { Capsule } from '@teambit/isolator';\nimport { BuilderMain, BuildTask, BuildContext, ComponentResult, TaskResults } from '@teambit/builder';\nimport { ComponentID } from '@teambit/component';\nimport { ApplicationAspect } from './application.aspect';\nimport { ApplicationMain } from './application.main.runtime';\nimport { BUILD_TASK } from './build.task';\nimport { DeployContext } from './deploy-context';\n\nexport const DEPLOY_TASK = 'deploy_application';\n\nexport class DeployTask implements BuildTask {\n name = DEPLOY_TASK;\n aspectId = ApplicationAspect.id;\n readonly location = 'end';\n constructor(private application: ApplicationMain, private builder: BuilderMain) {}\n\n async execute(context: BuildContext): Promise<any> {\n const apps = this.application.listApps();\n const componentsResults = await mapSeries(apps, async (app): Promise<any> => {\n const aspectId = this.application.getAppAspect(app.name);\n if (!aspectId) return undefined;\n const capsules = context.capsuleNetwork.seedersCapsules;\n const capsule = this.getCapsule(capsules, aspectId);\n if (!capsule?.component) return undefined;\n const buildTask = this.getBuildTask(context.previousTasksResults, context.envRuntime.id);\n if (!buildTask) return undefined;\n const componentArtifacts = buildTask.artifacts?.get(capsule.component);\n const artifactList = componentArtifacts?.[1];\n if (!artifactList) return undefined;\n const deployContext: DeployContext = Object.assign(context, { artifactList });\n if (!capsule || !app.deploy) return undefined;\n await app.deploy(deployContext, capsule);\n\n return {\n componentResult: { component: capsule.component },\n };\n });\n\n const _componentsResults = componentsResults\n .map((res) => {\n return res?.componentResult;\n })\n .filter((a) => !!a) as ComponentResult[];\n\n return {\n componentsResults: _componentsResults,\n };\n }\n\n private getBuildTask(taskResults: TaskResults[], runtime: string) {\n return taskResults.find(\n ({ task, env }) => task.aspectId === ApplicationAspect.id && task.name === BUILD_TASK && env.id === runtime\n );\n }\n\n private getCapsule(capsules: Capsule[], aspectId: string) {\n const aspectCapsuleId = ComponentID.fromString(aspectId).toStringWithoutVersion();\n return capsules.find((capsule) => capsule.component.id.toStringWithoutVersion() === aspectCapsuleId);\n }\n}\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/application",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.251",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/harmony/application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "application",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.251"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"ink": "3.0.8",
|
|
17
17
|
"@babel/runtime": "7.12.18",
|
|
18
18
|
"core-js": "^3.0.0",
|
|
19
|
-
"@teambit/builder": "0.0.
|
|
20
|
-
"@teambit/component": "0.0.
|
|
21
|
-
"@teambit/envs": "0.0.
|
|
19
|
+
"@teambit/builder": "0.0.609",
|
|
20
|
+
"@teambit/component": "0.0.609",
|
|
21
|
+
"@teambit/envs": "0.0.609",
|
|
22
22
|
"@teambit/cli-table": "0.0.33",
|
|
23
23
|
"@teambit/cli": "0.0.419",
|
|
24
|
-
"@teambit/aspect-loader": "0.0.
|
|
24
|
+
"@teambit/aspect-loader": "0.0.609",
|
|
25
25
|
"@teambit/logger": "0.0.508",
|
|
26
|
-
"@teambit/isolator": "0.0.
|
|
26
|
+
"@teambit/isolator": "0.0.609"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/lodash": "4.14.165",
|
|
Binary file
|