@nrwl/nx-cloud 13.3.0-beta.1 → 14.0.0

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.
@@ -1,130 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createStartRequest = exports.DistributedExecutionApi = void 0;
13
- const axios_1 = require("../../../utilities/axios");
14
- const environment_1 = require("../../../utilities/environment");
15
- const metric_logger_1 = require("../../../utilities/metric-logger");
16
- const { output, unparse } = require('../../../utilities/nx-imports');
17
- class DistributedExecutionApi {
18
- constructor(options) {
19
- this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
20
- }
21
- start(params) {
22
- var _a;
23
- return __awaiter(this, void 0, void 0, function* () {
24
- const recorder = (0, metric_logger_1.createMetricRecorder)('dteStart');
25
- let resp;
26
- try {
27
- resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/start', params));
28
- recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
29
- }
30
- catch (e) {
31
- recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
32
- ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
33
- : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
34
- throw e;
35
- }
36
- if (!resp.data.enabled) {
37
- throw new Error(`Workspace is disabled. Cannot perform distributed task executions.`);
38
- }
39
- if (resp.data.error) {
40
- throw new Error(resp.data.error);
41
- }
42
- return resp.data.id;
43
- });
44
- }
45
- status(id) {
46
- var _a;
47
- return __awaiter(this, void 0, void 0, function* () {
48
- const recorder = (0, metric_logger_1.createMetricRecorder)('dteStatus');
49
- try {
50
- const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/status', {
51
- id,
52
- }));
53
- recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
54
- return resp.data;
55
- }
56
- catch (e) {
57
- recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
58
- ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
59
- : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
60
- output.error({
61
- title: e.message,
62
- });
63
- process.exit(1);
64
- }
65
- });
66
- }
67
- completeRunGroupWithError(runGroup, error) {
68
- var _a;
69
- return __awaiter(this, void 0, void 0, function* () {
70
- const recorder = (0, metric_logger_1.createMetricRecorder)('completeRunGroup');
71
- try {
72
- const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
73
- runGroup: runGroup,
74
- criticalErrorMessage: error,
75
- }), 3);
76
- recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
77
- }
78
- catch (e) {
79
- recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
80
- ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
81
- : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
82
- }
83
- });
84
- }
85
- }
86
- exports.DistributedExecutionApi = DistributedExecutionApi;
87
- function createStartRequest(runGroup, task, options) {
88
- const tasksToExecute = task.map((arr) => {
89
- return arr.map((t) => {
90
- return {
91
- taskId: t.id,
92
- hash: t.hash,
93
- projectName: t.target.project,
94
- target: t.target.target,
95
- configuration: t.target.configuration || null,
96
- params: unparse(t.overrides).join(' '),
97
- };
98
- });
99
- });
100
- const request = {
101
- command: (0, environment_1.parseCommand)(),
102
- branch: (0, environment_1.getBranch)(),
103
- runGroup,
104
- tasks: tasksToExecute,
105
- maxParallel: calculateMaxParallel(options),
106
- };
107
- if (environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT) {
108
- request.agentCount = environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT;
109
- }
110
- if (!environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE) {
111
- request.stopAgentsOnFailure = false;
112
- }
113
- return request;
114
- }
115
- exports.createStartRequest = createStartRequest;
116
- function calculateMaxParallel(options) {
117
- if (options.parallel === 'false' || options.parallel === false) {
118
- return 1;
119
- }
120
- else if (options.parallel === 'true' || options.parallel === true) {
121
- return Number(options.maxParallel || 3);
122
- }
123
- else if (options.parallel === undefined) {
124
- return options.maxParallel ? Number(options.maxParallel) : 3;
125
- }
126
- else {
127
- return Number(options.parallel) || 3;
128
- }
129
- }
130
- //# sourceMappingURL=distributed-execution.api.js.map
1
+ const a6_0x5121=['configuration','__esModule','parseCommand','target','data','createMetricRecorder','recordMetric','DistributedExecutionApi','parallel','post','message','/nx-cloud/executions/status','start','overrides','axiosException','enabled','map','../../../utilities/environment','/nx-cloud/executions/complete-run-group','dteStatus','RUNNER_FAILURE_PERF_ENTRY','getBranch','then','exit','completeRunGroup','value','join','NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT','done','mapRespToPerfEntry','dteStart','agentCount','apiAxiosInstance','axiosMultipleTries','createStartRequest','response','next','createApiAxiosInstance','error','Workspace\x20is\x20disabled.\x20Cannot\x20perform\x20distributed\x20task\x20executions.','false','/nx-cloud/executions/start','defineProperty','project','completeRunGroupWithError','status','maxParallel','NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE','throw'];(function(_0x36badb,_0x51218e){const _0x264e5c=function(_0x48bed0){while(--_0x48bed0){_0x36badb['push'](_0x36badb['shift']());}};_0x264e5c(++_0x51218e);}(a6_0x5121,0x14a));const a6_0x264e=function(_0x36badb,_0x51218e){_0x36badb=_0x36badb-0x0;let _0x264e5c=a6_0x5121[_0x36badb];return _0x264e5c;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0x27e7df,_0x29c13b,_0x41100a,_0x2d75a7){function _0xd8dc4f(_0x108d2d){return _0x108d2d instanceof _0x41100a?_0x108d2d:new _0x41100a(function(_0x3baef5){_0x3baef5(_0x108d2d);});}return new(_0x41100a||(_0x41100a=Promise))(function(_0x7a0b28,_0x4d6e67){function _0x236aea(_0x1e1402){try{_0x3fcec7(_0x2d75a7[a6_0x264e('0x0')](_0x1e1402));}catch(_0x3d9d4d){_0x4d6e67(_0x3d9d4d);}}function _0x44272d(_0x16a86b){try{_0x3fcec7(_0x2d75a7[a6_0x264e('0xc')](_0x16a86b));}catch(_0x22ffd4){_0x4d6e67(_0x22ffd4);}}function _0x3fcec7(_0x4786e6){_0x4786e6[a6_0x264e('0x29')]?_0x7a0b28(_0x4786e6[a6_0x264e('0x26')]):_0xd8dc4f(_0x4786e6[a6_0x264e('0x26')])[a6_0x264e('0x23')](_0x236aea,_0x44272d);}_0x3fcec7((_0x2d75a7=_0x2d75a7['apply'](_0x27e7df,_0x29c13b||[]))['next']());});};Object[a6_0x264e('0x6')](exports,a6_0x264e('0xe'),{'value':!![]});exports[a6_0x264e('0x2f')]=exports[a6_0x264e('0x14')]=void 0x0;const axios_1=require('../../../utilities/axios');const environment_1=require(a6_0x264e('0x1e'));const metric_logger_1=require('../../../utilities/metric-logger');const {output,unparse}=require('../../../utilities/nx-imports');class DistributedExecutionApi{constructor(_0x2853e5){this[a6_0x264e('0x2d')]=(0x0,axios_1[a6_0x264e('0x1')])(_0x2853e5);}[a6_0x264e('0x19')](_0xfa5beb){var _0x19f4da;return __awaiter(this,void 0x0,void 0x0,function*(){const _0xb7d893=(0x0,metric_logger_1['createMetricRecorder'])(a6_0x264e('0x2b'));let _0x17f615;try{_0x17f615=yield(0x0,axios_1[a6_0x264e('0x2e')])(()=>this[a6_0x264e('0x2d')]['post'](a6_0x264e('0x5'),_0xfa5beb));_0xb7d893['recordMetric']((0x0,metric_logger_1[a6_0x264e('0x2a')])(_0x17f615));}catch(_0x167eee){_0xb7d893['recordMetric'](((_0x19f4da=_0x167eee===null||_0x167eee===void 0x0?void 0x0:_0x167eee[a6_0x264e('0x1b')])===null||_0x19f4da===void 0x0?void 0x0:_0x19f4da[a6_0x264e('0x30')])?(0x0,metric_logger_1[a6_0x264e('0x2a')])(_0x167eee[a6_0x264e('0x1b')][a6_0x264e('0x30')]):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);throw _0x167eee;}if(!_0x17f615['data'][a6_0x264e('0x1c')]){throw new Error(a6_0x264e('0x3'));}if(_0x17f615['data'][a6_0x264e('0x2')]){throw new Error(_0x17f615[a6_0x264e('0x11')]['error']);}return _0x17f615['data']['id'];});}[a6_0x264e('0x9')](_0x1e88a5){var _0x146d74;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x14910b=(0x0,metric_logger_1[a6_0x264e('0x12')])(a6_0x264e('0x20'));try{const _0x4742b5=yield(0x0,axios_1['axiosMultipleTries'])(()=>this[a6_0x264e('0x2d')][a6_0x264e('0x16')](a6_0x264e('0x18'),{'id':_0x1e88a5}));_0x14910b[a6_0x264e('0x13')]((0x0,metric_logger_1[a6_0x264e('0x2a')])(_0x4742b5));return _0x4742b5[a6_0x264e('0x11')];}catch(_0x3e9cbd){_0x14910b[a6_0x264e('0x13')](((_0x146d74=_0x3e9cbd===null||_0x3e9cbd===void 0x0?void 0x0:_0x3e9cbd[a6_0x264e('0x1b')])===null||_0x146d74===void 0x0?void 0x0:_0x146d74['response'])?(0x0,metric_logger_1[a6_0x264e('0x2a')])(_0x3e9cbd[a6_0x264e('0x1b')][a6_0x264e('0x30')]):metric_logger_1[a6_0x264e('0x21')]);output['error']({'title':_0x3e9cbd[a6_0x264e('0x17')]});process[a6_0x264e('0x24')](0x1);}});}[a6_0x264e('0x8')](_0x59416d,_0x31bbc7){var _0x1d2211;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x1d2dc6=(0x0,metric_logger_1['createMetricRecorder'])(a6_0x264e('0x25'));try{const _0x4ae464=yield(0x0,axios_1[a6_0x264e('0x2e')])(()=>this[a6_0x264e('0x2d')][a6_0x264e('0x16')](a6_0x264e('0x1f'),{'runGroup':_0x59416d,'criticalErrorMessage':_0x31bbc7}),0x3);_0x1d2dc6[a6_0x264e('0x13')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x4ae464));}catch(_0x4880ae){_0x1d2dc6[a6_0x264e('0x13')](((_0x1d2211=_0x4880ae===null||_0x4880ae===void 0x0?void 0x0:_0x4880ae[a6_0x264e('0x1b')])===null||_0x1d2211===void 0x0?void 0x0:_0x1d2211[a6_0x264e('0x30')])?(0x0,metric_logger_1[a6_0x264e('0x2a')])(_0x4880ae[a6_0x264e('0x1b')][a6_0x264e('0x30')]):metric_logger_1[a6_0x264e('0x21')]);}});}}exports[a6_0x264e('0x14')]=DistributedExecutionApi;function createStartRequest(_0xa8d649,_0x2ebaa4,_0x116728){const _0x43266d=_0x2ebaa4[a6_0x264e('0x1d')](_0x3dad07=>{return _0x3dad07[a6_0x264e('0x1d')](_0x454318=>{return{'taskId':_0x454318['id'],'hash':_0x454318['hash'],'projectName':_0x454318[a6_0x264e('0x10')][a6_0x264e('0x7')],'target':_0x454318['target'][a6_0x264e('0x10')],'configuration':_0x454318[a6_0x264e('0x10')][a6_0x264e('0xd')]||null,'params':unparse(_0x454318[a6_0x264e('0x1a')])[a6_0x264e('0x27')]('\x20')};});});const _0x3b551b={'command':(0x0,environment_1[a6_0x264e('0xf')])(),'branch':(0x0,environment_1[a6_0x264e('0x22')])(),'runGroup':_0xa8d649,'tasks':_0x43266d,'maxParallel':calculateMaxParallel(_0x116728)};if(environment_1['NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT']){_0x3b551b[a6_0x264e('0x2c')]=environment_1[a6_0x264e('0x28')];}if(!environment_1[a6_0x264e('0xb')]){_0x3b551b['stopAgentsOnFailure']=![];}return _0x3b551b;}exports[a6_0x264e('0x2f')]=createStartRequest;function calculateMaxParallel(_0x534bfd){if(_0x534bfd['parallel']===a6_0x264e('0x4')||_0x534bfd[a6_0x264e('0x15')]===![]){return 0x1;}else if(_0x534bfd[a6_0x264e('0x15')]==='true'||_0x534bfd[a6_0x264e('0x15')]===!![]){return Number(_0x534bfd[a6_0x264e('0xa')]||0x3);}else if(_0x534bfd['parallel']===undefined){return _0x534bfd[a6_0x264e('0xa')]?Number(_0x534bfd['maxParallel']):0x3;}else{return Number(_0x534bfd[a6_0x264e('0x15')])||0x3;}}
@@ -1,306 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TaskGraphCreator = exports.nxCloudDistributedTasksRunner = void 0;
13
- const Observable_1 = require("rxjs/internal/Observable");
14
- const stripJsonComments = require("strip-json-comments");
15
- const fs_1 = require("fs");
16
- const distributed_execution_api_1 = require("./distributed-execution.api");
17
- const file_storage_1 = require("../../file-storage/file-storage");
18
- const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
19
- const waiter_1 = require("../../../utilities/waiter");
20
- const environment_1 = require("../../../utilities/environment");
21
- const print_run_group_error_1 = require("../../error/print-run-group-error");
22
- const create_no_new_messages_timeout_1 = require("../../../utilities/create-no-new-messages-timeout");
23
- const metric_logger_1 = require("../../../utilities/metric-logger");
24
- const { output, getDependencyConfigs, getOutputs, unparse, Cache, } = require('../../../utilities/nx-imports');
25
- class NoopLifeCycle {
26
- scheduleTask(task) { }
27
- startTask(task) { }
28
- endTask(task, code) { }
29
- }
30
- function runDistributedExecution(api, options, context, fileStorage, cache, runGroup, tasks) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- const nxjson = JSON.parse(stripJsonComments((0, fs_1.readFileSync)('nx.json').toString()));
33
- const stages = new TaskOrderer(context.projectGraph, getDefaultDependencyConfigs(nxjson, options)).splitTasksIntoStages(tasks);
34
- const id = yield api.start((0, distributed_execution_api_1.createStartRequest)(runGroup, stages, options));
35
- return yield processTasks(api, fileStorage, cache, options, id, tasks, context);
36
- });
37
- }
38
- function processTasks(api, fileStorage, cache, options, executionId, tasks, context) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- const processedTasks = {};
41
- const failIfNumberOfCompletedTasksDoesNotChangeIn30Mins = (0, create_no_new_messages_timeout_1.createNoNewMessagesTimeout)();
42
- const waiter = new waiter_1.Waiter();
43
- while (true) {
44
- if (environment_1.VERBOSE_LOGGING) {
45
- output.note({
46
- title: 'Waiting...',
47
- });
48
- }
49
- yield waiter.wait();
50
- const r = yield api.status(executionId);
51
- if (environment_1.VERBOSE_LOGGING) {
52
- output.note({
53
- title: `Status update`,
54
- bodyLines: [
55
- `executionId: ${executionId}`,
56
- `executionStatus: ${r.executionStatus}`,
57
- `number of completed tasks: ${r.completedTasks.length}`,
58
- `error: ${r.criticalErrorMessage}`,
59
- ],
60
- });
61
- }
62
- if (r.criticalErrorMessage) {
63
- output.error({
64
- title: 'Distributed Execution Terminated',
65
- bodyLines: ['Error:', r.criticalErrorMessage],
66
- });
67
- process.exit(1);
68
- }
69
- failIfNumberOfCompletedTasksDoesNotChangeIn30Mins(r.completedTasks.length);
70
- for (const t of r.completedTasks) {
71
- if (processedTasks[t.taskId])
72
- continue;
73
- yield processTask(fileStorage, cache, context, options, tasks, t);
74
- waiter.reset();
75
- processedTasks[t.taskId] = true;
76
- }
77
- if (r.executionStatus === 'COMPLETED') {
78
- return { commandStatus: r.commandStatus, runUrl: r.runUrl };
79
- }
80
- }
81
- });
82
- }
83
- function processTask(fileStorage, cache, context, options, tasks, completedTask) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- if (environment_1.VERBOSE_LOGGING) {
86
- output.note({
87
- title: `Processing task ${completedTask.taskId}`,
88
- });
89
- }
90
- const matchingTask = tasks.find((tt) => completedTask.taskId === tt.id);
91
- if (!matchingTask) {
92
- throw new Error(`Found unknown task: ${completedTask.taskId}`);
93
- }
94
- if (environment_1.VERBOSE_LOGGING) {
95
- output.note({
96
- title: `Retrieving artifacts from ${completedTask.url}`,
97
- });
98
- }
99
- yield fileStorage.retrieve(completedTask.hash, completedTask.url, options.cacheDirectory || './node_modules/.cache/nx');
100
- const cachedResult = yield cache.get(Object.assign(Object.assign({}, matchingTask), { hash: completedTask.hash }));
101
- const outputs = getOutputs(context.projectGraph.nodes, matchingTask);
102
- if (environment_1.VERBOSE_LOGGING) {
103
- output.note({
104
- title: `Extracting artifacts`,
105
- bodyLines: outputs,
106
- });
107
- }
108
- yield cache.copyFilesFromCache(completedTask.hash, cachedResult, outputs);
109
- output.logCommand(getCommand(matchingTask));
110
- process.stdout.write(cachedResult.terminalOutput);
111
- output.addVerticalSeparator();
112
- });
113
- }
114
- function getCommand(task) {
115
- const args = unparse(task.overrides || {});
116
- const config = task.target.configuration
117
- ? `:${task.target.configuration}`
118
- : '';
119
- return [
120
- 'nx',
121
- 'run',
122
- `${task.target.project}:${task.target.target}${config}`,
123
- ...args,
124
- ].join(' ');
125
- }
126
- const nxCloudDistributedTasksRunner = (tasks, options, context) => {
127
- if (environment_1.VERBOSE_LOGGING) {
128
- output.note({
129
- title: 'Starting distributed command execution',
130
- });
131
- }
132
- options.lifeCycle = new NoopLifeCycle();
133
- const runGroup = (0, environment_1.getRunGroup)();
134
- if (!runGroup) {
135
- (0, print_run_group_error_1.printRunGroupError)();
136
- return process.exit(1);
137
- }
138
- const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
139
- const fileStorage = new file_storage_1.FileStorage(encryption);
140
- const cache = new Cache(options);
141
- const api = new distributed_execution_api_1.DistributedExecutionApi(options);
142
- runDistributedExecution(api, options, context, fileStorage, cache, runGroup, tasks)
143
- .then((r) => __awaiter(void 0, void 0, void 0, function* () {
144
- if (r.commandStatus === 0) {
145
- output.success({
146
- title: 'Successfully completed running the command.',
147
- bodyLines: [`See run details at ${r.runUrl}`],
148
- });
149
- }
150
- else {
151
- output.error({
152
- title: 'Command execution failed.',
153
- bodyLines: [`See run details at ${r.runUrl}`],
154
- });
155
- }
156
- yield (0, metric_logger_1.submitRunMetrics)(options);
157
- process.exit(r.commandStatus);
158
- }))
159
- .catch((e) => {
160
- output.error({
161
- title: 'Unable to complete a run.',
162
- bodyLines: [e.message],
163
- });
164
- if (e.axiosException) {
165
- console.log(e.axiosException);
166
- }
167
- else {
168
- console.log(e);
169
- }
170
- api
171
- .completeRunGroupWithError(runGroup, `Main job terminated with an error: "${e.message}"`)
172
- .finally(() => process.exit(1));
173
- });
174
- return new Observable_1.Observable(() => { });
175
- };
176
- exports.nxCloudDistributedTasksRunner = nxCloudDistributedTasksRunner;
177
- class TaskOrderer {
178
- constructor(projectGraph, defaultTargetDependencies) {
179
- this.projectGraph = projectGraph;
180
- this.defaultTargetDependencies = defaultTargetDependencies;
181
- }
182
- splitTasksIntoStages(tasks) {
183
- if (tasks.length === 0)
184
- return [];
185
- const stages = [];
186
- const taskGraph = this.createTaskGraph(tasks);
187
- const notStagedTaskIds = new Set(tasks.map((t) => t.id));
188
- let stageIndex = 0;
189
- // Loop through tasks and try to stage them. As tasks are staged, they are removed from the loop
190
- while (notStagedTaskIds.size > 0) {
191
- const currentStage = (stages[stageIndex] = []);
192
- for (const taskId of notStagedTaskIds) {
193
- let ready = true;
194
- for (const dependency of taskGraph.dependencies[taskId]) {
195
- if (notStagedTaskIds.has(dependency)) {
196
- // dependency has not been staged yet, this task is not ready to be staged.
197
- ready = false;
198
- break;
199
- }
200
- }
201
- // Some dependency still has not been staged, skip it for now, it will be processed again
202
- if (!ready) {
203
- continue;
204
- }
205
- // All the dependencies have been staged, let's stage it.
206
- const task = taskGraph.tasks[taskId];
207
- currentStage.push(task);
208
- }
209
- // Remove the entire new stage of tasks from the list
210
- for (const task of currentStage) {
211
- notStagedTaskIds.delete(task.id);
212
- }
213
- stageIndex++;
214
- }
215
- return stages;
216
- }
217
- createTaskGraph(tasks) {
218
- const t = new TaskGraphCreator(this.projectGraph, this.defaultTargetDependencies);
219
- return t.createTaskGraph(tasks);
220
- }
221
- }
222
- class TaskGraphCreator {
223
- constructor(projectGraph, defaultTargetDependencies) {
224
- this.projectGraph = projectGraph;
225
- this.defaultTargetDependencies = defaultTargetDependencies;
226
- }
227
- createTaskGraph(tasks) {
228
- const graph = {
229
- roots: [],
230
- tasks: {},
231
- dependencies: {},
232
- };
233
- for (const task of tasks) {
234
- this.addTaskToGraph(task, graph);
235
- const dependencyConfigs = getDependencyConfigs(task.target, this.defaultTargetDependencies, this.projectGraph);
236
- if (!dependencyConfigs) {
237
- continue;
238
- }
239
- this.addTaskDependencies(task, dependencyConfigs, tasks, graph);
240
- }
241
- graph.roots = Object.keys(graph.dependencies).filter((k) => graph.dependencies[k].length === 0);
242
- return graph;
243
- }
244
- addTaskDependencies(task, dependencyConfigs, tasks, graph) {
245
- for (const dependencyConfig of dependencyConfigs) {
246
- if (dependencyConfig.projects === 'self') {
247
- for (const t of tasks) {
248
- if (t.target.project === task.target.project &&
249
- t.target.target === dependencyConfig.target) {
250
- graph.dependencies[task.id].push(t.id);
251
- }
252
- }
253
- }
254
- else if (dependencyConfig.projects === 'dependencies') {
255
- const seen = new Set();
256
- this.addDependencies(task.target.project, dependencyConfig.target, tasks, graph, task.id, seen);
257
- }
258
- }
259
- }
260
- addDependencies(project, target, tasks, graph, taskId, seen) {
261
- seen.add(project);
262
- const dependencies = this.projectGraph.dependencies[project];
263
- if (dependencies) {
264
- const projectDependencies = dependencies.map((dependency) => dependency.target);
265
- for (const projectDependency of projectDependencies) {
266
- if (seen.has(projectDependency)) {
267
- continue;
268
- }
269
- const dependency = this.findTask({ project: projectDependency, target }, tasks);
270
- if (dependency) {
271
- if (graph.dependencies[taskId].indexOf(dependency.id) === -1) {
272
- graph.dependencies[taskId].push(dependency.id);
273
- }
274
- }
275
- else {
276
- this.addDependencies(projectDependency, target, tasks, graph, taskId, seen);
277
- }
278
- }
279
- }
280
- }
281
- findTask({ project, target }, tasks) {
282
- return tasks.find((t) => t.target.project === project && t.target.target === target);
283
- }
284
- addTaskToGraph(task, graph) {
285
- graph.tasks[task.id] = task;
286
- graph.dependencies[task.id] = [];
287
- }
288
- }
289
- exports.TaskGraphCreator = TaskGraphCreator;
290
- function getDefaultDependencyConfigs(nxJson, runnerOptions) {
291
- var _a, _b;
292
- const defaults = (_a = nxJson.targetDependencies) !== null && _a !== void 0 ? _a : {};
293
- const strictlyOrderedTargets = runnerOptions
294
- ? (_b = runnerOptions.strictlyOrderedTargets) !== null && _b !== void 0 ? _b : ['build']
295
- : [];
296
- // Strictly Ordered Targets depend on their dependencies
297
- for (const target of strictlyOrderedTargets) {
298
- defaults[target] = defaults[target] || [];
299
- defaults[target].push({
300
- target,
301
- projects: 'dependencies',
302
- });
303
- }
304
- return defaults;
305
- }
306
- //# sourceMappingURL=distributed-execution.runner.js.map
1
+ const a7_0x3f4e=['DistributedExecutionApi','toString','note','projectGraph','hash','then','tasks','../../../utilities/create-no-new-messages-timeout','copyFilesFromCache','rxjs/internal/Observable','strip-json-comments','commandStatus','../../../utilities/waiter','defaultTargetDependencies','../../../utilities/nx-imports','build','assign','Command\x20execution\x20failed.','Main\x20job\x20terminated\x20with\x20an\x20error:\x20\x22','See\x20run\x20details\x20at\x20','Found\x20unknown\x20task:\x20','Unable\x20to\x20complete\x20a\x20run.','startTask','finally','runUrl','error:\x20','size','wait','projects','createTaskGraph','map','delete','apply','endTask','throw','E2EEncryption','VERBOSE_LOGGING','configuration','getRunGroup','keys','FileStorage','axiosException','strictlyOrderedTargets','criticalErrorMessage','url','targetDependencies','Retrieving\x20artifacts\x20from\x20','Distributed\x20Execution\x20Terminated','executionId:\x20','log','findTask','message','next','dependencies','completedTasks','addVerticalSeparator','splitTasksIntoStages','Successfully\x20completed\x20running\x20the\x20command.','addTaskToGraph','Waiting...','createStartRequest','../../error/print-run-group-error','defineProperty','executionStatus:\x20','lifeCycle','has','TaskGraphCreator','Extracting\x20artifacts','value','nxCloudDistributedTasksRunner','parse','run','start','readFileSync','taskId','project','self','write','ENCRYPTION_KEY','exit','addTaskDependencies','stdout','target','error','addDependencies','executionStatus','./node_modules/.cache/nx','reset','__esModule','./distributed-execution.api','indexOf','Waiter','find','push','number\x20of\x20completed\x20tasks:\x20','../../../utilities/environment','catch','cacheDirectory','length'];(function(_0x1d7e59,_0x3f4e6f){const _0xf4be07=function(_0x58dab1){while(--_0x58dab1){_0x1d7e59['push'](_0x1d7e59['shift']());}};_0xf4be07(++_0x3f4e6f);}(a7_0x3f4e,0xdf));const a7_0xf4be=function(_0x1d7e59,_0x3f4e6f){_0x1d7e59=_0x1d7e59-0x0;let _0xf4be07=a7_0x3f4e[_0x1d7e59];return _0xf4be07;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0x6047ce,_0xc2ee74,_0x20f7e0,_0x56e927){function _0x54705b(_0xaa4f62){return _0xaa4f62 instanceof _0x20f7e0?_0xaa4f62:new _0x20f7e0(function(_0x395725){_0x395725(_0xaa4f62);});}return new(_0x20f7e0||(_0x20f7e0=Promise))(function(_0x5b31c4,_0x135157){function _0x545a5a(_0x1f44c7){try{_0x33c5cb(_0x56e927[a7_0xf4be('0x1b')](_0x1f44c7));}catch(_0x3a22c7){_0x135157(_0x3a22c7);}}function _0x2044d4(_0x33c400){try{_0x33c5cb(_0x56e927[a7_0xf4be('0x9')](_0x33c400));}catch(_0x162b49){_0x135157(_0x162b49);}}function _0x33c5cb(_0x4d8ee9){_0x4d8ee9['done']?_0x5b31c4(_0x4d8ee9['value']):_0x54705b(_0x4d8ee9[a7_0xf4be('0x2b')])['then'](_0x545a5a,_0x2044d4);}_0x33c5cb((_0x56e927=_0x56e927[a7_0xf4be('0x7')](_0x6047ce,_0xc2ee74||[]))[a7_0xf4be('0x1b')]());});};Object[a7_0xf4be('0x25')](exports,a7_0xf4be('0x3f'),{'value':!![]});exports[a7_0xf4be('0x29')]=exports[a7_0xf4be('0x2c')]=void 0x0;const Observable_1=require(a7_0xf4be('0x53'));const stripJsonComments=require(a7_0xf4be('0x54'));const fs_1=require('fs');const distributed_execution_api_1=require(a7_0xf4be('0x40'));const file_storage_1=require('../../file-storage/file-storage');const e2e_encryption_1=require('../../file-storage/e2e-encryption');const waiter_1=require(a7_0xf4be('0x56'));const environment_1=require(a7_0xf4be('0x46'));const print_run_group_error_1=require(a7_0xf4be('0x24'));const create_no_new_messages_timeout_1=require(a7_0xf4be('0x51'));const metric_logger_1=require('../../../utilities/metric-logger');const {output,getDependencyConfigs,getOutputs,unparse,Cache}=require(a7_0xf4be('0x58'));class NoopLifeCycle{['scheduleTask'](_0x1fb99a){}[a7_0xf4be('0x60')](_0x1e5247){}[a7_0xf4be('0x8')](_0x113a87,_0xc3efe5){}}function runDistributedExecution(_0x3a857e,_0x133e20,_0x2c762,_0x6cff76,_0x3ac3a1,_0x862bac,_0xe49869){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x56f861=JSON[a7_0xf4be('0x2d')](stripJsonComments((0x0,fs_1[a7_0xf4be('0x30')])('nx.json')[a7_0xf4be('0x4b')]()));const _0x16bed1=new TaskOrderer(_0x2c762['projectGraph'],getDefaultDependencyConfigs(_0x56f861,_0x133e20))[a7_0xf4be('0x1f')](_0xe49869);const _0x108314=yield _0x3a857e[a7_0xf4be('0x2f')]((0x0,distributed_execution_api_1[a7_0xf4be('0x23')])(_0x862bac,_0x16bed1,_0x133e20));return yield processTasks(_0x3a857e,_0x6cff76,_0x3ac3a1,_0x133e20,_0x108314,_0xe49869,_0x2c762);});}function processTasks(_0x5d4a2e,_0xf7a3cc,_0xc07abb,_0xb54096,_0xd555e0,_0x390dfd,_0x52009f){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x1faea3={};const _0x5c1248=(0x0,create_no_new_messages_timeout_1['createNoNewMessagesTimeout'])();const _0x2d7fbc=new waiter_1[(a7_0xf4be('0x42'))]();while(!![]){if(environment_1[a7_0xf4be('0xb')]){output['note']({'title':a7_0xf4be('0x22')});}yield _0x2d7fbc[a7_0xf4be('0x2')]();const _0xa7dca=yield _0x5d4a2e['status'](_0xd555e0);if(environment_1['VERBOSE_LOGGING']){output[a7_0xf4be('0x4c')]({'title':'Status\x20update','bodyLines':[a7_0xf4be('0x17')+_0xd555e0,a7_0xf4be('0x26')+_0xa7dca[a7_0xf4be('0x3c')],a7_0xf4be('0x45')+_0xa7dca[a7_0xf4be('0x1d')][a7_0xf4be('0x49')],a7_0xf4be('0x0')+_0xa7dca['criticalErrorMessage']]});}if(_0xa7dca[a7_0xf4be('0x12')]){output[a7_0xf4be('0x3a')]({'title':a7_0xf4be('0x16'),'bodyLines':['Error:',_0xa7dca[a7_0xf4be('0x12')]]});process['exit'](0x1);}_0x5c1248(_0xa7dca['completedTasks'][a7_0xf4be('0x49')]);for(const _0x6038b1 of _0xa7dca[a7_0xf4be('0x1d')]){if(_0x1faea3[_0x6038b1['taskId']])continue;yield processTask(_0xf7a3cc,_0xc07abb,_0x52009f,_0xb54096,_0x390dfd,_0x6038b1);_0x2d7fbc[a7_0xf4be('0x3e')]();_0x1faea3[_0x6038b1[a7_0xf4be('0x31')]]=!![];}if(_0xa7dca[a7_0xf4be('0x3c')]==='COMPLETED'){return{'commandStatus':_0xa7dca[a7_0xf4be('0x55')],'runUrl':_0xa7dca['runUrl']};}}});}function processTask(_0x5afe9d,_0x31f41f,_0x4e19c9,_0x3943ce,_0x42e747,_0x15d15b){return __awaiter(this,void 0x0,void 0x0,function*(){if(environment_1['VERBOSE_LOGGING']){output[a7_0xf4be('0x4c')]({'title':'Processing\x20task\x20'+_0x15d15b[a7_0xf4be('0x31')]});}const _0xc30c3e=_0x42e747[a7_0xf4be('0x43')](_0x41c54c=>_0x15d15b[a7_0xf4be('0x31')]===_0x41c54c['id']);if(!_0xc30c3e){throw new Error(a7_0xf4be('0x5e')+_0x15d15b[a7_0xf4be('0x31')]);}if(environment_1[a7_0xf4be('0xb')]){output[a7_0xf4be('0x4c')]({'title':a7_0xf4be('0x15')+_0x15d15b[a7_0xf4be('0x13')]});}yield _0x5afe9d['retrieve'](_0x15d15b[a7_0xf4be('0x4e')],_0x15d15b[a7_0xf4be('0x13')],_0x3943ce[a7_0xf4be('0x48')]||a7_0xf4be('0x3d'));const _0x12a63d=yield _0x31f41f['get'](Object[a7_0xf4be('0x5a')](Object[a7_0xf4be('0x5a')]({},_0xc30c3e),{'hash':_0x15d15b[a7_0xf4be('0x4e')]}));const _0x1f65df=getOutputs(_0x4e19c9[a7_0xf4be('0x4d')]['nodes'],_0xc30c3e);if(environment_1['VERBOSE_LOGGING']){output[a7_0xf4be('0x4c')]({'title':a7_0xf4be('0x2a'),'bodyLines':_0x1f65df});}yield _0x31f41f[a7_0xf4be('0x52')](_0x15d15b[a7_0xf4be('0x4e')],_0x12a63d,_0x1f65df);output['logCommand'](getCommand(_0xc30c3e));process[a7_0xf4be('0x38')][a7_0xf4be('0x34')](_0x12a63d['terminalOutput']);output[a7_0xf4be('0x1e')]();});}function getCommand(_0x7d0729){const _0x39a5b8=unparse(_0x7d0729['overrides']||{});const _0x5d1963=_0x7d0729[a7_0xf4be('0x39')]['configuration']?':'+_0x7d0729[a7_0xf4be('0x39')][a7_0xf4be('0xc')]:'';return['nx',a7_0xf4be('0x2e'),_0x7d0729['target'][a7_0xf4be('0x32')]+':'+_0x7d0729[a7_0xf4be('0x39')][a7_0xf4be('0x39')]+_0x5d1963,..._0x39a5b8]['join']('\x20');}const nxCloudDistributedTasksRunner=(_0x5c4f42,_0x5ede21,_0x36b762)=>{if(environment_1['VERBOSE_LOGGING']){output[a7_0xf4be('0x4c')]({'title':'Starting\x20distributed\x20command\x20execution'});}_0x5ede21[a7_0xf4be('0x27')]=new NoopLifeCycle();const _0x4a75c5=(0x0,environment_1[a7_0xf4be('0xd')])();if(!_0x4a75c5){(0x0,print_run_group_error_1['printRunGroupError'])();return process['exit'](0x1);}const _0x1fd785=new e2e_encryption_1[(a7_0xf4be('0xa'))](environment_1[a7_0xf4be('0x35')]||_0x5ede21['encryptionKey']);const _0x30420a=new file_storage_1[(a7_0xf4be('0xf'))](_0x1fd785);const _0x507f21=new Cache(_0x5ede21);const _0x39eac7=new distributed_execution_api_1[(a7_0xf4be('0x4a'))](_0x5ede21);runDistributedExecution(_0x39eac7,_0x5ede21,_0x36b762,_0x30420a,_0x507f21,_0x4a75c5,_0x5c4f42)[a7_0xf4be('0x4f')](_0x49e6fb=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){if(_0x49e6fb[a7_0xf4be('0x55')]===0x0){output['success']({'title':a7_0xf4be('0x20'),'bodyLines':[a7_0xf4be('0x5d')+_0x49e6fb[a7_0xf4be('0x62')]]});}else{output[a7_0xf4be('0x3a')]({'title':a7_0xf4be('0x5b'),'bodyLines':['See\x20run\x20details\x20at\x20'+_0x49e6fb[a7_0xf4be('0x62')]]});}yield(0x0,metric_logger_1['submitRunMetrics'])(_0x5ede21);process[a7_0xf4be('0x36')](_0x49e6fb[a7_0xf4be('0x55')]);}))[a7_0xf4be('0x47')](_0x1ead83=>{output[a7_0xf4be('0x3a')]({'title':a7_0xf4be('0x5f'),'bodyLines':[_0x1ead83[a7_0xf4be('0x1a')]]});if(_0x1ead83[a7_0xf4be('0x10')]){console['log'](_0x1ead83[a7_0xf4be('0x10')]);}else{console[a7_0xf4be('0x18')](_0x1ead83);}_0x39eac7['completeRunGroupWithError'](_0x4a75c5,a7_0xf4be('0x5c')+_0x1ead83[a7_0xf4be('0x1a')]+'\x22')[a7_0xf4be('0x61')](()=>process['exit'](0x1));});return new Observable_1['Observable'](()=>{});};exports[a7_0xf4be('0x2c')]=nxCloudDistributedTasksRunner;class TaskOrderer{constructor(_0x29efce,_0x1c9ce2){this[a7_0xf4be('0x4d')]=_0x29efce;this[a7_0xf4be('0x57')]=_0x1c9ce2;}[a7_0xf4be('0x1f')](_0x1af631){if(_0x1af631[a7_0xf4be('0x49')]===0x0)return[];const _0x52e5d1=[];const _0x102fe5=this[a7_0xf4be('0x4')](_0x1af631);const _0x5afcb6=new Set(_0x1af631[a7_0xf4be('0x5')](_0x5aae2a=>_0x5aae2a['id']));let _0x5ceb79=0x0;while(_0x5afcb6[a7_0xf4be('0x1')]>0x0){const _0x138476=_0x52e5d1[_0x5ceb79]=[];for(const _0x2142e4 of _0x5afcb6){let _0x7e9c3=!![];for(const _0xa0ca7f of _0x102fe5[a7_0xf4be('0x1c')][_0x2142e4]){if(_0x5afcb6['has'](_0xa0ca7f)){_0x7e9c3=![];break;}}if(!_0x7e9c3){continue;}const _0x3a3c92=_0x102fe5[a7_0xf4be('0x50')][_0x2142e4];_0x138476[a7_0xf4be('0x44')](_0x3a3c92);}for(const _0x33e810 of _0x138476){_0x5afcb6[a7_0xf4be('0x6')](_0x33e810['id']);}_0x5ceb79++;}return _0x52e5d1;}['createTaskGraph'](_0x5e41c1){const _0xce56de=new TaskGraphCreator(this['projectGraph'],this['defaultTargetDependencies']);return _0xce56de[a7_0xf4be('0x4')](_0x5e41c1);}}class TaskGraphCreator{constructor(_0x26db27,_0x2a79d2){this[a7_0xf4be('0x4d')]=_0x26db27;this[a7_0xf4be('0x57')]=_0x2a79d2;}[a7_0xf4be('0x4')](_0x5cb907){const _0x17e342={'roots':[],'tasks':{},'dependencies':{}};for(const _0x3f2c0c of _0x5cb907){this[a7_0xf4be('0x21')](_0x3f2c0c,_0x17e342);const _0x51874d=getDependencyConfigs(_0x3f2c0c[a7_0xf4be('0x39')],this[a7_0xf4be('0x57')],this[a7_0xf4be('0x4d')]);if(!_0x51874d){continue;}this[a7_0xf4be('0x37')](_0x3f2c0c,_0x51874d,_0x5cb907,_0x17e342);}_0x17e342['roots']=Object[a7_0xf4be('0xe')](_0x17e342[a7_0xf4be('0x1c')])['filter'](_0x362cf7=>_0x17e342['dependencies'][_0x362cf7][a7_0xf4be('0x49')]===0x0);return _0x17e342;}['addTaskDependencies'](_0x7438be,_0x4dec48,_0x530283,_0x5dda61){for(const _0x47da68 of _0x4dec48){if(_0x47da68[a7_0xf4be('0x3')]===a7_0xf4be('0x33')){for(const _0x24f03e of _0x530283){if(_0x24f03e[a7_0xf4be('0x39')][a7_0xf4be('0x32')]===_0x7438be[a7_0xf4be('0x39')][a7_0xf4be('0x32')]&&_0x24f03e[a7_0xf4be('0x39')]['target']===_0x47da68[a7_0xf4be('0x39')]){_0x5dda61[a7_0xf4be('0x1c')][_0x7438be['id']][a7_0xf4be('0x44')](_0x24f03e['id']);}}}else if(_0x47da68[a7_0xf4be('0x3')]===a7_0xf4be('0x1c')){const _0x12ad4d=new Set();this[a7_0xf4be('0x3b')](_0x7438be['target'][a7_0xf4be('0x32')],_0x47da68[a7_0xf4be('0x39')],_0x530283,_0x5dda61,_0x7438be['id'],_0x12ad4d);}}}[a7_0xf4be('0x3b')](_0x1c0c47,_0x4832d6,_0x1ac5e9,_0x321956,_0x388004,_0x380bc3){_0x380bc3['add'](_0x1c0c47);const _0xf62394=this[a7_0xf4be('0x4d')]['dependencies'][_0x1c0c47];if(_0xf62394){const _0x115ba4=_0xf62394[a7_0xf4be('0x5')](_0x330dff=>_0x330dff[a7_0xf4be('0x39')]);for(const _0x2bdc18 of _0x115ba4){if(_0x380bc3[a7_0xf4be('0x28')](_0x2bdc18)){continue;}const _0x3c7dad=this[a7_0xf4be('0x19')]({'project':_0x2bdc18,'target':_0x4832d6},_0x1ac5e9);if(_0x3c7dad){if(_0x321956[a7_0xf4be('0x1c')][_0x388004][a7_0xf4be('0x41')](_0x3c7dad['id'])===-0x1){_0x321956[a7_0xf4be('0x1c')][_0x388004][a7_0xf4be('0x44')](_0x3c7dad['id']);}}else{this[a7_0xf4be('0x3b')](_0x2bdc18,_0x4832d6,_0x1ac5e9,_0x321956,_0x388004,_0x380bc3);}}}}[a7_0xf4be('0x19')]({project,target},_0x54e116){return _0x54e116[a7_0xf4be('0x43')](_0x294134=>_0x294134['target'][a7_0xf4be('0x32')]===project&&_0x294134[a7_0xf4be('0x39')]['target']===target);}['addTaskToGraph'](_0x2314dc,_0x5c6678){_0x5c6678['tasks'][_0x2314dc['id']]=_0x2314dc;_0x5c6678[a7_0xf4be('0x1c')][_0x2314dc['id']]=[];}}exports[a7_0xf4be('0x29')]=TaskGraphCreator;function getDefaultDependencyConfigs(_0x1d1ca9,_0x437115){var _0x353d1d,_0x33d29a;const _0x2ba1a8=(_0x353d1d=_0x1d1ca9[a7_0xf4be('0x14')])!==null&&_0x353d1d!==void 0x0?_0x353d1d:{};const _0x2a0496=_0x437115?(_0x33d29a=_0x437115[a7_0xf4be('0x11')])!==null&&_0x33d29a!==void 0x0?_0x33d29a:[a7_0xf4be('0x59')]:[];for(const _0xb357ee of _0x2a0496){_0x2ba1a8[_0xb357ee]=_0x2ba1a8[_0xb357ee]||[];_0x2ba1a8[_0xb357ee][a7_0xf4be('0x44')]({'target':_0xb357ee,'projects':a7_0xf4be('0x1c')});}return _0x2ba1a8;}
@@ -30,11 +30,18 @@ function updateNxJson(json, token) {
30
30
  },
31
31
  };
32
32
  }
33
- function updateNxJsonUsingDevkit(host, token) {
34
- require('@nrwl/devkit').updateJson(host, 'nx.json', (json) => {
33
+ function updateNxJsonUsingNx(host, token) {
34
+ try {
35
+ const jsonUtils = require('nx/src/utils/json');
36
+ const json = jsonUtils.parseJson(host.read('nx.json', 'utf-8'));
35
37
  updateNxJson(json, token);
36
- return json;
37
- });
38
+ host.write('nx.json', jsonUtils.serializeJson(json));
39
+ }
40
+ catch (ee) {
41
+ const json = JSON.parse(host.read('nx.json', 'utf-8'));
42
+ updateNxJson(json, token);
43
+ host.write('nx.json', JSON.stringify(json, null, 2));
44
+ }
38
45
  }
39
46
  function updateNxJsonUsingNrwlWorkspace(token) {
40
47
  return require('@nrwl/workspace').updateJsonInTree('nx.json', (json) => {
@@ -74,7 +81,7 @@ function printMessage(url) {
74
81
  title: `Nx Cloud has been enabled`,
75
82
  bodyLines: [
76
83
  `Your workspace is currently public. Anybody with code access can view the workspace on ${host}. `,
77
- `You can connect the workspace to your Nx Cloud account at ${url}. (You can do this later.)`,
84
+ `You can connect the workspace to your Nx Cloud account at ${url} (You can do this later.)`,
78
85
  ],
79
86
  });
80
87
  }
@@ -95,7 +102,7 @@ function printMessageTaskExecutor(url) {
95
102
  function generator(host) {
96
103
  return __awaiter(this, void 0, void 0, function* () {
97
104
  const r = yield createNxCloudWorkspace(readNpmScope());
98
- updateNxJsonUsingDevkit(host, r.token);
105
+ updateNxJsonUsingNx(host, r.token);
99
106
  return () => printMessage(r.url);
100
107
  });
101
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/generators/init/init.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2BAAkC;AAClC,+BAAkC;AAElC,SAAS,YAAY,CAAC,IAAI,EAAE,KAAa;;IACvC,MAAM,iBAAiB,GAAG,MAAA,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC;IAE1E,MAAM,OAAO,mCACR,iBAAiB,KACpB,WAAW,EAAE,KAAK,GACnB,CAAC;IAEF,kCAAkC;IAClC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;QACxB,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;KACpC;IACD,IAAI,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SAAS,CAAC,IAAI;;QAClC,MAAM,CAAC,GAAG,MAAM,sBAAsB,CAAC,YAAY,EAAE,CAAC,CAAC;QACvD,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;CAAA;AAJD,8BAIC;AAED,SAAgB,SAAS;IACvB,OAAO,GAAS,EAAE;QAChB,MAAM,CAAC,GAAG,MAAM,sBAAsB,CAAC,YAAY,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,IAAS,EAAE,OAAY,EAAE,EAAE;YACjC,MAAM,UAAU,GAAI,OAAO,CAAC,MAAM,CAAC,QAAgB,CAAC,UAAU,CAAC;YAC/D,UAAU,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACjE,OAAO,CAAC,OAAO,CAAC;gBACd,eAAe;oBACb,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;gBACzC,CAAC;aACF,CAAC,CAAC;YACH,8BAA8B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC,CAAC;IACJ,CAAC,CAAA,CAAC;AACJ,CAAC;AAdD,8BAcC"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/generators/init/init.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2BAAkC;AAClC,+BAAkC;AAGlC,SAAS,YAAY,CAAC,IAAI,EAAE,KAAa;;IACvC,MAAM,iBAAiB,GAAG,MAAA,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,OAAO,0CAAE,OAAO,mCAAI,EAAE,CAAC;IAE1E,MAAM,OAAO,mCACR,iBAAiB,KACpB,WAAW,EAAE,KAAK,GACnB,CAAC;IAEF,kCAAkC;IAClC,IAAI,O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AAC,CAAC;YACH,8BAA8B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC,CAAC;IACJ,CAAC,CAAA,CAAC;AACJ,CAAC;AAdD,8BAcC"}
@@ -78,6 +78,9 @@ function getRunGroup() {
78
78
  if (process.env.BITBUCKET_BUILD_NUMBER !== undefined) {
79
79
  return process.env.BITBUCKET_BUILD_NUMBER;
80
80
  }
81
+ if (process.env.VERCEL_GIT_COMMIT_REF !== undefined) {
82
+ return process.env.VERCEL_GIT_COMMIT_REF;
83
+ }
81
84
  return extractGitSha();
82
85
  }
83
86
  exports.getRunGroup = getRunGroup;
@@ -119,6 +122,9 @@ function getBranch() {
119
122
  if (process.env.BITBUCKET_BRANCH !== undefined) {
120
123
  return process.env.BITBUCKET_BRANCH;
121
124
  }
125
+ if (process.env.VERCEL_GIT_COMMIT_SHA !== undefined) {
126
+ return process.env.VERCEL_GIT_COMMIT_SHA;
127
+ }
122
128
  return null;
123
129
  }
124
130
  exports.getBranch = getBranch;
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/environment.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAEhD,iDAAyC;AACzC,2BAAkC;AAClC,+BAA4B;AAC5B,iCAAiC;AACjC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEnC,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAC5B,QAAA,mBAAmB,GAAG,OAAO,CAAC,CAAC,aAAa;AAC5C,QAAA,mBAAmB,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAC1C,QAAA,uBAAuB,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;AAC5C,QAAA,qDAAqD,GAAG,GAAG,CAAC;AAC5D,QAAA,WAAW,GACtB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM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C,KAAK,SAAS,EAAE;QACjE,OAAO,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC;KACxD;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,SAAS,EAAE;QAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;KACrC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AA1CD,8BA0CC;AAED,SAAgB,cAAc,CAAC,OAA+B;IAC5D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,0BAA0B;IAC1B,IAAI,OAAO,CAAC,iBAAiB,EAAE;QAC7B,IAAI;YACF,SAAS,GAAG,IAAA,+BAAa,GAAE,CAAC;SAC7B;QAAC,WAAM,GAAE;KACX;IAED,OAAO;QACL,SAAS;QACT,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;QACvB,OAAO,EAAG,EAAU,CAAC,OAAO,CAAC,CAAC,CAAE,EAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;QACzD,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM;KAC3B,CAAC;AACJ,CAAC;AAjBD,wCAiBC;AAED,SAAgB,YAAY;;IAC1B,MAAM,GAAG,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAAI,SAAS,CAAC;IACvD,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACpD,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACrC,CAAC;AAJD,oCAIC"}
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/environment.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AA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EAAE,EAAE,CAAC,QAAQ,EAAE;QACvB,OAAO,EAAG,EAAU,CAAC,OAAO,CAAC,CAAC,CAAE,EAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;QACzD,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM;KAC3B,CAAC;AACJ,CAAC;AAjBD,wCAiBC;AAED,SAAgB,YAAY;;IAC1B,MAAM,GAAG,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAAI,SAAS,CAAC;IACvD,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACpD,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACrC,CAAC;AAJD,oCAIC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/nx-cloud",
3
- "version": "13.3.0-beta.1",
3
+ "version": "14.0.0",
4
4
  "description": "Nx Cloud plugin for Nx",
5
5
  "keywords": [
6
6
  "Monorepo",
package/tsconfig.lib.json CHANGED
@@ -6,6 +6,6 @@
6
6
  "declaration": true,
7
7
  "types": ["node"]
8
8
  },
9
- "exclude": ["**/*.spec.ts", "**/*.test.ts"],
9
+ "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"],
10
10
  "include": ["**/*.ts"]
11
11
  }