@uipath/packager-tool-workflowcompiler 0.0.15 → 1.195.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.
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/index.js +87 -42
- package/dist/output-entry.d.ts +1 -0
- package/dist/workflow-compiler-config.d.ts +4 -4
- package/dist/workflow-compiler-path-resolver.d.ts +5 -3
- package/dist/workflow-compiler-tool-factory.d.ts +7 -0
- package/package.json +31 -53
- package/src/i18n/locales/de.json +2 -1
- package/src/i18n/locales/en.ts +2 -0
- package/src/i18n/locales/es-MX.json +2 -1
- package/src/i18n/locales/es.json +2 -1
- package/src/i18n/locales/fr.json +2 -1
- package/src/i18n/locales/ja.json +2 -1
- package/src/i18n/locales/ko.json +2 -1
- package/src/i18n/locales/pt-BR.json +2 -1
- package/src/i18n/locales/pt.json +2 -1
- package/src/i18n/locales/ro.json +2 -1
- package/src/i18n/locales/ru.json +2 -1
- package/src/i18n/locales/tr.json +2 -1
- package/src/i18n/locales/zh-CN.json +2 -1
- package/src/i18n/locales/zh-TW.json +2 -1
- package/src/i18n/locales/zu.json +2 -1
- package/src/output-entry.ts +1 -0
- package/src/workflow-compiler-config.ts +4 -4
- package/src/workflow-compiler-executor.ts +42 -13
- package/src/workflow-compiler-path-resolver.ts +25 -33
- package/src/workflow-compiler-tool-factory.ts +29 -0
|
@@ -16,6 +16,7 @@ export declare const en: {
|
|
|
16
16
|
readonly processError: "[WorkflowCompiler] Process error: {message}";
|
|
17
17
|
readonly startFailed: "Failed to start workflow compiler: {message}";
|
|
18
18
|
readonly operationCancelled: "Operation cancelled";
|
|
19
|
+
readonly dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command.";
|
|
19
20
|
};
|
|
20
21
|
readonly pathResolver: {
|
|
21
22
|
readonly info: {
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,8 @@ var de_default = {
|
|
|
14
14
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
15
15
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
16
16
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
17
|
-
operationCancelled: "Operation cancelled"
|
|
17
|
+
operationCancelled: "Operation cancelled",
|
|
18
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
18
19
|
},
|
|
19
20
|
pathResolver: {
|
|
20
21
|
info: {
|
|
@@ -56,7 +57,8 @@ var en = {
|
|
|
56
57
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
57
58
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
58
59
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
59
|
-
operationCancelled: "Operation cancelled"
|
|
60
|
+
operationCancelled: "Operation cancelled",
|
|
61
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
60
62
|
},
|
|
61
63
|
pathResolver: {
|
|
62
64
|
info: {
|
|
@@ -97,7 +99,8 @@ var es_default = {
|
|
|
97
99
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
98
100
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
99
101
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
100
|
-
operationCancelled: "Operation cancelled"
|
|
102
|
+
operationCancelled: "Operation cancelled",
|
|
103
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
101
104
|
},
|
|
102
105
|
pathResolver: {
|
|
103
106
|
info: {
|
|
@@ -138,7 +141,8 @@ var es_MX_default = {
|
|
|
138
141
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
139
142
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
140
143
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
141
|
-
operationCancelled: "Operation cancelled"
|
|
144
|
+
operationCancelled: "Operation cancelled",
|
|
145
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
142
146
|
},
|
|
143
147
|
pathResolver: {
|
|
144
148
|
info: {
|
|
@@ -179,7 +183,8 @@ var fr_default = {
|
|
|
179
183
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
180
184
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
181
185
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
182
|
-
operationCancelled: "Operation cancelled"
|
|
186
|
+
operationCancelled: "Operation cancelled",
|
|
187
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
183
188
|
},
|
|
184
189
|
pathResolver: {
|
|
185
190
|
info: {
|
|
@@ -220,7 +225,8 @@ var ja_default = {
|
|
|
220
225
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
221
226
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
222
227
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
223
|
-
operationCancelled: "Operation cancelled"
|
|
228
|
+
operationCancelled: "Operation cancelled",
|
|
229
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
224
230
|
},
|
|
225
231
|
pathResolver: {
|
|
226
232
|
info: {
|
|
@@ -261,7 +267,8 @@ var ko_default = {
|
|
|
261
267
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
262
268
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
263
269
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
264
|
-
operationCancelled: "Operation cancelled"
|
|
270
|
+
operationCancelled: "Operation cancelled",
|
|
271
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
265
272
|
},
|
|
266
273
|
pathResolver: {
|
|
267
274
|
info: {
|
|
@@ -302,7 +309,8 @@ var pt_default = {
|
|
|
302
309
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
303
310
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
304
311
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
305
|
-
operationCancelled: "Operation cancelled"
|
|
312
|
+
operationCancelled: "Operation cancelled",
|
|
313
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
306
314
|
},
|
|
307
315
|
pathResolver: {
|
|
308
316
|
info: {
|
|
@@ -343,7 +351,8 @@ var pt_BR_default = {
|
|
|
343
351
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
344
352
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
345
353
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
346
|
-
operationCancelled: "Operation cancelled"
|
|
354
|
+
operationCancelled: "Operation cancelled",
|
|
355
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
347
356
|
},
|
|
348
357
|
pathResolver: {
|
|
349
358
|
info: {
|
|
@@ -384,7 +393,8 @@ var ro_default = {
|
|
|
384
393
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
385
394
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
386
395
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
387
|
-
operationCancelled: "Operation cancelled"
|
|
396
|
+
operationCancelled: "Operation cancelled",
|
|
397
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
388
398
|
},
|
|
389
399
|
pathResolver: {
|
|
390
400
|
info: {
|
|
@@ -425,7 +435,8 @@ var ru_default = {
|
|
|
425
435
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
426
436
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
427
437
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
428
|
-
operationCancelled: "Operation cancelled"
|
|
438
|
+
operationCancelled: "Operation cancelled",
|
|
439
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
429
440
|
},
|
|
430
441
|
pathResolver: {
|
|
431
442
|
info: {
|
|
@@ -466,7 +477,8 @@ var tr_default = {
|
|
|
466
477
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
467
478
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
468
479
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
469
|
-
operationCancelled: "Operation cancelled"
|
|
480
|
+
operationCancelled: "Operation cancelled",
|
|
481
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
470
482
|
},
|
|
471
483
|
pathResolver: {
|
|
472
484
|
info: {
|
|
@@ -507,7 +519,8 @@ var zh_CN_default = {
|
|
|
507
519
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
508
520
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
509
521
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
510
|
-
operationCancelled: "Operation cancelled"
|
|
522
|
+
operationCancelled: "Operation cancelled",
|
|
523
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
511
524
|
},
|
|
512
525
|
pathResolver: {
|
|
513
526
|
info: {
|
|
@@ -548,7 +561,8 @@ var zh_TW_default = {
|
|
|
548
561
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
549
562
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
550
563
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
551
|
-
operationCancelled: "Operation cancelled"
|
|
564
|
+
operationCancelled: "Operation cancelled",
|
|
565
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
552
566
|
},
|
|
553
567
|
pathResolver: {
|
|
554
568
|
info: {
|
|
@@ -589,7 +603,8 @@ var zu_default = {
|
|
|
589
603
|
failed: "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
590
604
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
591
605
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
592
|
-
operationCancelled: "Operation cancelled"
|
|
606
|
+
operationCancelled: "Operation cancelled",
|
|
607
|
+
dotnetNotAvailable: "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
593
608
|
},
|
|
594
609
|
pathResolver: {
|
|
595
610
|
info: {
|
|
@@ -638,8 +653,10 @@ I18nManager.registerTranslations("zu", zu_default);
|
|
|
638
653
|
import { toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
|
|
639
654
|
|
|
640
655
|
// src/workflow-compiler-tool-factory.ts
|
|
656
|
+
import { execSync } from "node:child_process";
|
|
641
657
|
import {
|
|
642
|
-
ProjectTypes
|
|
658
|
+
ProjectTypes,
|
|
659
|
+
translate as translate3
|
|
643
660
|
} from "@uipath/solutionpackager-tool-core";
|
|
644
661
|
|
|
645
662
|
// src/workflow-compiler-tool.ts
|
|
@@ -666,7 +683,7 @@ import {
|
|
|
666
683
|
} from "@uipath/solutionpackager-tool-core";
|
|
667
684
|
|
|
668
685
|
// src/workflow-compiler-config.ts
|
|
669
|
-
var DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.
|
|
686
|
+
var DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.195-alpha.23402";
|
|
670
687
|
var workflowCompilerConfig = {
|
|
671
688
|
workflowCompilerPath: undefined,
|
|
672
689
|
workflowCompilerVersion: DEFAULT_WORKFLOW_COMPILER_VERSION
|
|
@@ -682,19 +699,11 @@ function setupWorkflowCompiler(options) {
|
|
|
682
699
|
|
|
683
700
|
// src/workflow-compiler-path-resolver.ts
|
|
684
701
|
var NUGET_FEED_URL = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json";
|
|
685
|
-
var
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
darwin: {
|
|
691
|
-
packageId: "UiPath.WorkflowCompiler.macOS",
|
|
692
|
-
compilerFileName: "UiPath.WorkflowCompiler.dll"
|
|
693
|
-
},
|
|
694
|
-
linux: {
|
|
695
|
-
packageId: "UiPath.WorkflowCompiler.Linux",
|
|
696
|
-
compilerFileName: "UiPath.WorkflowCompiler.dll"
|
|
697
|
-
}
|
|
702
|
+
var WORKFLOW_COMPILER_DLL_NAME = "UiPath.WorkflowCompiler.dll";
|
|
703
|
+
var PLATFORM_PACKAGE_IDS = {
|
|
704
|
+
win32: "UiPath.WorkflowCompiler.Windows",
|
|
705
|
+
darwin: "UiPath.WorkflowCompiler.macOS",
|
|
706
|
+
linux: "UiPath.WorkflowCompiler.Linux"
|
|
698
707
|
};
|
|
699
708
|
var RESTORE_CSPROJ_TEMPLATE = `<Project Sdk="Microsoft.NET.Sdk">
|
|
700
709
|
<PropertyGroup>
|
|
@@ -766,14 +775,14 @@ class WorkflowCompilerPathResolver {
|
|
|
766
775
|
if (!location)
|
|
767
776
|
return null;
|
|
768
777
|
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.checkingEnvVar", { path: location }));
|
|
769
|
-
if (
|
|
778
|
+
if (location.endsWith(".dll") && await this.fileSystem.exists(location)) {
|
|
770
779
|
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.foundViaEnv"));
|
|
771
780
|
return location;
|
|
772
781
|
}
|
|
773
782
|
return null;
|
|
774
783
|
}
|
|
775
784
|
async restoreAndResolve(compilerPath, version) {
|
|
776
|
-
const
|
|
785
|
+
const packageId = this.getPackageId();
|
|
777
786
|
const tempDir = await this.tempStorage.getTempFolderPath();
|
|
778
787
|
try {
|
|
779
788
|
this.logger.info(translate.t("toolWorkflowcompiler.pathResolver.info.restoringPackage", { packageName: packageId, version, platform: platform() }));
|
|
@@ -810,17 +819,16 @@ class WorkflowCompilerPathResolver {
|
|
|
810
819
|
await this.tempStorage.cleanup();
|
|
811
820
|
}
|
|
812
821
|
}
|
|
813
|
-
|
|
814
|
-
const
|
|
815
|
-
if (!
|
|
822
|
+
getPackageId() {
|
|
823
|
+
const packageId = PLATFORM_PACKAGE_IDS[platform()];
|
|
824
|
+
if (!packageId) {
|
|
816
825
|
throw new Error(translate.t("toolWorkflowcompiler.pathResolver.errors.unsupportedPlatform", { platform: platform() }));
|
|
817
826
|
}
|
|
818
|
-
return
|
|
827
|
+
return packageId;
|
|
819
828
|
}
|
|
820
829
|
getNuGetCompilerPath(version) {
|
|
821
830
|
const cacheRoot = process.env.NUGET_PACKAGES ?? Path.join(homedir(), ".nuget", "packages");
|
|
822
|
-
|
|
823
|
-
return Path.join(cacheRoot, packageId.toLowerCase(), version.toLowerCase(), "WorkflowCompiler", compilerFileName);
|
|
831
|
+
return Path.join(cacheRoot, this.getPackageId().toLowerCase(), version.toLowerCase(), "WorkflowCompiler", WORKFLOW_COMPILER_DLL_NAME);
|
|
824
832
|
}
|
|
825
833
|
}
|
|
826
834
|
|
|
@@ -850,9 +858,8 @@ class WorkflowCompilerExecutor {
|
|
|
850
858
|
async executeAsync(operation, args, cancellationToken) {
|
|
851
859
|
const startTime = Date.now();
|
|
852
860
|
const compilerPath = await this.pathResolver.getCompilerPathAsync();
|
|
853
|
-
const
|
|
854
|
-
const
|
|
855
|
-
const commandArgs = isDll ? [compilerPath, operation, ...args] : [operation, ...args];
|
|
861
|
+
const executable = WorkflowCompilerExecutor.DOTNET_EXECUTABLE;
|
|
862
|
+
const commandArgs = [compilerPath, operation, ...args];
|
|
856
863
|
this.logCommandStart(operation, executable, commandArgs);
|
|
857
864
|
return new Promise((resolve) => {
|
|
858
865
|
let result = null;
|
|
@@ -871,7 +878,9 @@ class WorkflowCompilerExecutor {
|
|
|
871
878
|
elapsed: elapsed.toString(),
|
|
872
879
|
errorCode: result.errorCode
|
|
873
880
|
}));
|
|
874
|
-
|
|
881
|
+
const toolResult = new ToolResult(result.errorCode, result.message, result.outputPackages);
|
|
882
|
+
toolResult.details = getAdditionalResultDetails(result);
|
|
883
|
+
resolve(toolResult);
|
|
875
884
|
} else {
|
|
876
885
|
const exitCode = childProcess.exitCode ?? -1;
|
|
877
886
|
const errorMessage = fallbackErrors.join(`
|
|
@@ -1049,6 +1058,24 @@ class WorkflowCompilerExecutor {
|
|
|
1049
1058
|
}
|
|
1050
1059
|
}
|
|
1051
1060
|
}
|
|
1061
|
+
var KNOWN_ENVELOPE_KEYS = new Set([
|
|
1062
|
+
"elapsed",
|
|
1063
|
+
"errorCode",
|
|
1064
|
+
"inputId",
|
|
1065
|
+
"message",
|
|
1066
|
+
"outputPackages",
|
|
1067
|
+
"toolId",
|
|
1068
|
+
"type"
|
|
1069
|
+
]);
|
|
1070
|
+
function getAdditionalResultDetails(result) {
|
|
1071
|
+
const details = {};
|
|
1072
|
+
for (const key of Object.keys(result)) {
|
|
1073
|
+
if (!KNOWN_ENVELOPE_KEYS.has(key)) {
|
|
1074
|
+
details[key] = result[key];
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
return Object.keys(details).length > 0 ? details : undefined;
|
|
1078
|
+
}
|
|
1052
1079
|
|
|
1053
1080
|
// src/workflow-compiler-tool.ts
|
|
1054
1081
|
class WorkflowCompilerTool extends ProjectTool {
|
|
@@ -1197,6 +1224,7 @@ class WorkflowCompilerTool extends ProjectTool {
|
|
|
1197
1224
|
|
|
1198
1225
|
// src/workflow-compiler-tool-factory.ts
|
|
1199
1226
|
class WorkflowCompilerToolFactory {
|
|
1227
|
+
static cachedDotnetAvailable;
|
|
1200
1228
|
supportedTypes = [
|
|
1201
1229
|
ProjectTypes.Process,
|
|
1202
1230
|
ProjectTypes.Library,
|
|
@@ -1204,8 +1232,25 @@ class WorkflowCompilerToolFactory {
|
|
|
1204
1232
|
ProjectTypes.WebApp
|
|
1205
1233
|
];
|
|
1206
1234
|
async createAsync(logger, fileSystem) {
|
|
1235
|
+
if (!this.isDotnetAvailable()) {
|
|
1236
|
+
throw new Error(translate3.t("toolWorkflowcompiler.errors.dotnetNotAvailable"));
|
|
1237
|
+
}
|
|
1207
1238
|
return new WorkflowCompilerTool(fileSystem, logger);
|
|
1208
1239
|
}
|
|
1240
|
+
isDotnetAvailable() {
|
|
1241
|
+
if (WorkflowCompilerToolFactory.cachedDotnetAvailable !== undefined) {
|
|
1242
|
+
return WorkflowCompilerToolFactory.cachedDotnetAvailable;
|
|
1243
|
+
}
|
|
1244
|
+
try {
|
|
1245
|
+
execSync("dotnet --version", {
|
|
1246
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
1247
|
+
});
|
|
1248
|
+
WorkflowCompilerToolFactory.cachedDotnetAvailable = true;
|
|
1249
|
+
return true;
|
|
1250
|
+
} catch {
|
|
1251
|
+
return false;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1209
1254
|
}
|
|
1210
1255
|
|
|
1211
1256
|
// src/index.ts
|
package/dist/output-entry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.
|
|
1
|
+
export declare const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.195-alpha.23402";
|
|
2
2
|
export declare const workflowCompilerConfig: {
|
|
3
3
|
workflowCompilerPath: string | undefined;
|
|
4
4
|
workflowCompilerVersion: string;
|
|
@@ -6,15 +6,15 @@ export declare const workflowCompilerConfig: {
|
|
|
6
6
|
/**
|
|
7
7
|
* Configure the workflow compiler tool.
|
|
8
8
|
*
|
|
9
|
-
* @param options.compilerPath - Explicit path to
|
|
9
|
+
* @param options.compilerPath - Explicit path to UiPath.WorkflowCompiler.dll (skips all resolution logic).
|
|
10
10
|
* @param options.version - NuGet package version to download. Defaults to {@link DEFAULT_WORKFLOW_COMPILER_VERSION}.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
14
|
* import { setupWorkflowCompiler } from "@uipath/packager-tool-workflowcompiler";
|
|
15
15
|
*
|
|
16
|
-
* setupWorkflowCompiler({ compilerPath: "/path/to/UiPath.WorkflowCompiler.
|
|
17
|
-
* setupWorkflowCompiler({ version: "26.0.
|
|
16
|
+
* setupWorkflowCompiler({ compilerPath: "/path/to/UiPath.WorkflowCompiler.dll" });
|
|
17
|
+
* setupWorkflowCompiler({ version: "26.0.195-alpha.23402" });
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export declare function setupWorkflowCompiler(options: {
|
|
@@ -3,12 +3,14 @@ export interface IWorkflowCompilerPathResolver {
|
|
|
3
3
|
getCompilerPathAsync(): Promise<string>;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* Resolves and caches the workflow compiler
|
|
6
|
+
* Resolves and caches the workflow compiler DLL path. The executor always
|
|
7
|
+
* launches `dotnet <dll>`, so the resolved path must point at a managed
|
|
8
|
+
* assembly (UiPath.WorkflowCompiler.dll) on every platform.
|
|
7
9
|
*
|
|
8
10
|
* Resolution chain:
|
|
9
11
|
* 1. In-memory cache (subsequent calls)
|
|
10
12
|
* 2. Explicit config path (`workflowCompilerConfig.workflowCompilerPath`)
|
|
11
|
-
* 3. `UIPATH_WORKFLOWCOMPILER_LOCATION` env var — full
|
|
13
|
+
* 3. `UIPATH_WORKFLOWCOMPILER_LOCATION` env var — full path to .dll (pipelines / offline)
|
|
12
14
|
* 4. NuGet global packages cache
|
|
13
15
|
* 5. `dotnet restore` to populate NuGet cache, then (4) again
|
|
14
16
|
*/
|
|
@@ -25,6 +27,6 @@ export declare class WorkflowCompilerPathResolver implements IWorkflowCompilerPa
|
|
|
25
27
|
private resolveCompilerPath;
|
|
26
28
|
private findInEnvLocation;
|
|
27
29
|
private restoreAndResolve;
|
|
28
|
-
private
|
|
30
|
+
private getPackageId;
|
|
29
31
|
private getNuGetCompilerPath;
|
|
30
32
|
}
|
|
@@ -4,6 +4,13 @@ import { type IFileSystem, type IProjectToolFactory, type IToolLogger, type Proj
|
|
|
4
4
|
* Handles Process, Library, WebApp, and Tests project types.
|
|
5
5
|
*/
|
|
6
6
|
export declare class WorkflowCompilerToolFactory implements IProjectToolFactory {
|
|
7
|
+
/**
|
|
8
|
+
* Process-lifetime cache of a successful `dotnet --version` lookup.
|
|
9
|
+
* Negative results are not cached so a one-off failure does not pin
|
|
10
|
+
* the factory across the rest of the process.
|
|
11
|
+
*/
|
|
12
|
+
private static cachedDotnetAvailable;
|
|
7
13
|
readonly supportedTypes: readonly ProjectType[];
|
|
8
14
|
createAsync(logger: IToolLogger, fileSystem: IFileSystem): Promise<ProjectTool>;
|
|
15
|
+
private isDotnetAvailable;
|
|
9
16
|
}
|
package/package.json
CHANGED
|
@@ -1,55 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"version:major": "bun version major --no-git-tag-version",
|
|
34
|
-
"lint": "biome check ."
|
|
35
|
-
},
|
|
36
|
-
"files": [
|
|
37
|
-
"dist",
|
|
38
|
-
"!dist/**/*.map",
|
|
39
|
-
"src"
|
|
40
|
-
],
|
|
41
|
-
"author": "",
|
|
42
|
-
"license": "ISC",
|
|
43
|
-
"peerDependencies": {
|
|
44
|
-
"@uipath/solutionpackager-tool-core": "0.0.33"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/node": "^25.5.0",
|
|
48
|
-
"@uipath/solutionpackager-tool-core": "0.0.33",
|
|
49
|
-
"@vitest/coverage-v8": "^4.0.14",
|
|
50
|
-
"typescript": "^5.9.3",
|
|
51
|
-
"vitest": "^4.0.14"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {},
|
|
54
|
-
"gitHead": "3f1b4d8e9f910be81e4cab956537f21dbd5d63ac"
|
|
2
|
+
"name": "@uipath/packager-tool-workflowcompiler",
|
|
3
|
+
"version": "1.195.0",
|
|
4
|
+
"description": "UiPath Workflow Compiler tool implementation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"source": "./src/index.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/UiPath/cli.git",
|
|
15
|
+
"directory": "packages/packager/packager-tool-workflowcompiler"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
},
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"!dist/**/*.map",
|
|
24
|
+
"src"
|
|
25
|
+
],
|
|
26
|
+
"author": "",
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@uipath/solutionpackager-tool-core": "1.195.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {},
|
|
32
|
+
"gitHead": "eecf5713cd579b15783c770d1923e44e730271ea"
|
|
55
33
|
}
|
package/src/i18n/locales/de.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/en.ts
CHANGED
|
@@ -18,6 +18,8 @@ export const en = {
|
|
|
18
18
|
processError: "[WorkflowCompiler] Process error: {message}",
|
|
19
19
|
startFailed: "Failed to start workflow compiler: {message}",
|
|
20
20
|
operationCancelled: "Operation cancelled",
|
|
21
|
+
dotnetNotAvailable:
|
|
22
|
+
"The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command.",
|
|
21
23
|
},
|
|
22
24
|
pathResolver: {
|
|
23
25
|
info: {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/es.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/fr.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/ja.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/ko.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/pt.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/ro.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/ru.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/tr.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/i18n/locales/zu.json
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"failed": "[WorkflowCompiler] {operation} failed: {errorMessage}",
|
|
12
12
|
"processError": "[WorkflowCompiler] Process error: {message}",
|
|
13
13
|
"startFailed": "Failed to start workflow compiler: {message}",
|
|
14
|
-
"operationCancelled": "Operation cancelled"
|
|
14
|
+
"operationCancelled": "Operation cancelled",
|
|
15
|
+
"dotnetNotAvailable": "The .NET SDK 8.0 is required by the workflow compiler, but the 'dotnet' CLI was not found on PATH. Install SDK 8.0 from https://dotnet.microsoft.com/download/dotnet/8.0, then re-run this command."
|
|
15
16
|
},
|
|
16
17
|
"pathResolver": {
|
|
17
18
|
"info": {
|
package/src/output-entry.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.
|
|
1
|
+
export const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.195-alpha.23402";
|
|
2
2
|
|
|
3
3
|
export const workflowCompilerConfig = {
|
|
4
4
|
workflowCompilerPath: undefined as string | undefined,
|
|
@@ -8,15 +8,15 @@ export const workflowCompilerConfig = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Configure the workflow compiler tool.
|
|
10
10
|
*
|
|
11
|
-
* @param options.compilerPath - Explicit path to
|
|
11
|
+
* @param options.compilerPath - Explicit path to UiPath.WorkflowCompiler.dll (skips all resolution logic).
|
|
12
12
|
* @param options.version - NuGet package version to download. Defaults to {@link DEFAULT_WORKFLOW_COMPILER_VERSION}.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
16
16
|
* import { setupWorkflowCompiler } from "@uipath/packager-tool-workflowcompiler";
|
|
17
17
|
*
|
|
18
|
-
* setupWorkflowCompiler({ compilerPath: "/path/to/UiPath.WorkflowCompiler.
|
|
19
|
-
* setupWorkflowCompiler({ version: "26.0.
|
|
18
|
+
* setupWorkflowCompiler({ compilerPath: "/path/to/UiPath.WorkflowCompiler.dll" });
|
|
19
|
+
* setupWorkflowCompiler({ version: "26.0.195-alpha.23402" });
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export function setupWorkflowCompiler(options: {
|
|
@@ -64,13 +64,8 @@ export class WorkflowCompilerExecutor {
|
|
|
64
64
|
): Promise<ToolResult> {
|
|
65
65
|
const startTime = Date.now();
|
|
66
66
|
const compilerPath = await this.pathResolver.getCompilerPathAsync();
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
? WorkflowCompilerExecutor.DOTNET_EXECUTABLE
|
|
70
|
-
: compilerPath;
|
|
71
|
-
const commandArgs = isDll
|
|
72
|
-
? [compilerPath, operation, ...args]
|
|
73
|
-
: [operation, ...args];
|
|
67
|
+
const executable = WorkflowCompilerExecutor.DOTNET_EXECUTABLE;
|
|
68
|
+
const commandArgs = [compilerPath, operation, ...args];
|
|
74
69
|
|
|
75
70
|
this.logCommandStart(operation, executable, commandArgs);
|
|
76
71
|
|
|
@@ -101,13 +96,13 @@ export class WorkflowCompilerExecutor {
|
|
|
101
96
|
},
|
|
102
97
|
),
|
|
103
98
|
);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
result.outputPackages,
|
|
109
|
-
),
|
|
99
|
+
const toolResult = new ToolResult(
|
|
100
|
+
result.errorCode,
|
|
101
|
+
result.message,
|
|
102
|
+
result.outputPackages,
|
|
110
103
|
);
|
|
104
|
+
toolResult.details = getAdditionalResultDetails(result);
|
|
105
|
+
resolve(toolResult);
|
|
111
106
|
} else {
|
|
112
107
|
const exitCode = childProcess.exitCode ?? -1;
|
|
113
108
|
const errorMessage =
|
|
@@ -384,3 +379,37 @@ export class WorkflowCompilerExecutor {
|
|
|
384
379
|
}
|
|
385
380
|
}
|
|
386
381
|
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Allow-list-driven copy of any *extra* fields the WorkflowCompiler emits on
|
|
385
|
+
* its result envelope (e.g. analyzer `findings`) into `ToolResult.details`,
|
|
386
|
+
* so downstream callers can read structured data without the executor having
|
|
387
|
+
* to know what each consumer needs.
|
|
388
|
+
*
|
|
389
|
+
* Known envelope fields (already exposed as first-class on `ToolResult` or
|
|
390
|
+
* intentionally internal) are excluded; anything else is copied through.
|
|
391
|
+
* Adding the new field to `KNOWN_ENVELOPE_KEYS` is what keeps it out of
|
|
392
|
+
* `details` — leaving it absent surfaces it, which is the safer default.
|
|
393
|
+
*/
|
|
394
|
+
const KNOWN_ENVELOPE_KEYS = new Set<keyof IOutputResult>([
|
|
395
|
+
"elapsed",
|
|
396
|
+
"errorCode",
|
|
397
|
+
"inputId",
|
|
398
|
+
"message",
|
|
399
|
+
"outputPackages",
|
|
400
|
+
"toolId",
|
|
401
|
+
"type",
|
|
402
|
+
]);
|
|
403
|
+
|
|
404
|
+
function getAdditionalResultDetails(
|
|
405
|
+
result: IOutputResult,
|
|
406
|
+
): Record<string, unknown> | undefined {
|
|
407
|
+
const details: Record<string, unknown> = {};
|
|
408
|
+
for (const key of Object.keys(result)) {
|
|
409
|
+
if (!KNOWN_ENVELOPE_KEYS.has(key as keyof IOutputResult)) {
|
|
410
|
+
details[key] = (result as Record<string, unknown>)[key];
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return Object.keys(details).length > 0 ? details : undefined;
|
|
415
|
+
}
|
|
@@ -14,22 +14,12 @@ import { workflowCompilerConfig } from "./workflow-compiler-config.js";
|
|
|
14
14
|
const NUGET_FEED_URL =
|
|
15
15
|
"https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json";
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
compilerFileName: "UiPath.WorkflowCompiler.exe",
|
|
24
|
-
},
|
|
25
|
-
darwin: {
|
|
26
|
-
packageId: "UiPath.WorkflowCompiler.macOS",
|
|
27
|
-
compilerFileName: "UiPath.WorkflowCompiler.dll",
|
|
28
|
-
},
|
|
29
|
-
linux: {
|
|
30
|
-
packageId: "UiPath.WorkflowCompiler.Linux",
|
|
31
|
-
compilerFileName: "UiPath.WorkflowCompiler.dll",
|
|
32
|
-
},
|
|
17
|
+
const WORKFLOW_COMPILER_DLL_NAME = "UiPath.WorkflowCompiler.dll";
|
|
18
|
+
|
|
19
|
+
const PLATFORM_PACKAGE_IDS: Record<string, string> = {
|
|
20
|
+
win32: "UiPath.WorkflowCompiler.Windows",
|
|
21
|
+
darwin: "UiPath.WorkflowCompiler.macOS",
|
|
22
|
+
linux: "UiPath.WorkflowCompiler.Linux",
|
|
33
23
|
};
|
|
34
24
|
|
|
35
25
|
const RESTORE_CSPROJ_TEMPLATE = `<Project Sdk="Microsoft.NET.Sdk">
|
|
@@ -50,12 +40,14 @@ export interface IWorkflowCompilerPathResolver {
|
|
|
50
40
|
}
|
|
51
41
|
|
|
52
42
|
/**
|
|
53
|
-
* Resolves and caches the workflow compiler
|
|
43
|
+
* Resolves and caches the workflow compiler DLL path. The executor always
|
|
44
|
+
* launches `dotnet <dll>`, so the resolved path must point at a managed
|
|
45
|
+
* assembly (UiPath.WorkflowCompiler.dll) on every platform.
|
|
54
46
|
*
|
|
55
47
|
* Resolution chain:
|
|
56
48
|
* 1. In-memory cache (subsequent calls)
|
|
57
49
|
* 2. Explicit config path (`workflowCompilerConfig.workflowCompilerPath`)
|
|
58
|
-
* 3. `UIPATH_WORKFLOWCOMPILER_LOCATION` env var — full
|
|
50
|
+
* 3. `UIPATH_WORKFLOWCOMPILER_LOCATION` env var — full path to .dll (pipelines / offline)
|
|
59
51
|
* 4. NuGet global packages cache
|
|
60
52
|
* 5. `dotnet restore` to populate NuGet cache, then (4) again
|
|
61
53
|
*/
|
|
@@ -97,8 +89,10 @@ export class WorkflowCompilerPathResolver
|
|
|
97
89
|
return this.cachedPath;
|
|
98
90
|
}
|
|
99
91
|
|
|
100
|
-
//
|
|
101
|
-
//
|
|
92
|
+
// In-process coalescing only: dedupes concurrent callers within this
|
|
93
|
+
// Node process. Parallel `uip` invocations each run their own restore;
|
|
94
|
+
// NuGet's own per-package lock handles cross-process coordination of
|
|
95
|
+
// the cache.
|
|
102
96
|
if (this.pendingResolution) {
|
|
103
97
|
return this.pendingResolution;
|
|
104
98
|
}
|
|
@@ -170,9 +164,11 @@ export class WorkflowCompilerPathResolver
|
|
|
170
164
|
),
|
|
171
165
|
);
|
|
172
166
|
|
|
173
|
-
// Env var must point to
|
|
167
|
+
// Env var must point to UiPath.WorkflowCompiler.dll. The executor
|
|
168
|
+
// always launches via `dotnet <dll>`; .exe apphost paths are not
|
|
169
|
+
// accepted because they cannot be loaded as managed assemblies.
|
|
174
170
|
if (
|
|
175
|
-
|
|
171
|
+
location.endsWith(".dll") &&
|
|
176
172
|
(await this.fileSystem.exists(location))
|
|
177
173
|
) {
|
|
178
174
|
this.logger.info(
|
|
@@ -190,7 +186,7 @@ export class WorkflowCompilerPathResolver
|
|
|
190
186
|
compilerPath: string,
|
|
191
187
|
version: string,
|
|
192
188
|
): Promise<string> {
|
|
193
|
-
const
|
|
189
|
+
const packageId = this.getPackageId();
|
|
194
190
|
const tempDir = await this.tempStorage.getTempFolderPath();
|
|
195
191
|
|
|
196
192
|
try {
|
|
@@ -279,12 +275,9 @@ export class WorkflowCompilerPathResolver
|
|
|
279
275
|
}
|
|
280
276
|
}
|
|
281
277
|
|
|
282
|
-
private
|
|
283
|
-
packageId
|
|
284
|
-
|
|
285
|
-
} {
|
|
286
|
-
const info = PLATFORM_PACKAGES[platform()];
|
|
287
|
-
if (!info) {
|
|
278
|
+
private getPackageId(): string {
|
|
279
|
+
const packageId = PLATFORM_PACKAGE_IDS[platform()];
|
|
280
|
+
if (!packageId) {
|
|
288
281
|
throw new Error(
|
|
289
282
|
translate.t(
|
|
290
283
|
"toolWorkflowcompiler.pathResolver.errors.unsupportedPlatform",
|
|
@@ -292,20 +285,19 @@ export class WorkflowCompilerPathResolver
|
|
|
292
285
|
),
|
|
293
286
|
);
|
|
294
287
|
}
|
|
295
|
-
return
|
|
288
|
+
return packageId;
|
|
296
289
|
}
|
|
297
290
|
|
|
298
291
|
private getNuGetCompilerPath(version: string): string {
|
|
299
292
|
const cacheRoot =
|
|
300
293
|
process.env.NUGET_PACKAGES ??
|
|
301
294
|
Path.join(homedir(), ".nuget", "packages");
|
|
302
|
-
const { packageId, compilerFileName } = this.getPlatformInfo();
|
|
303
295
|
return Path.join(
|
|
304
296
|
cacheRoot,
|
|
305
|
-
|
|
297
|
+
this.getPackageId().toLowerCase(),
|
|
306
298
|
version.toLowerCase(),
|
|
307
299
|
"WorkflowCompiler",
|
|
308
|
-
|
|
300
|
+
WORKFLOW_COMPILER_DLL_NAME,
|
|
309
301
|
);
|
|
310
302
|
}
|
|
311
303
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
1
2
|
import {
|
|
2
3
|
type IFileSystem,
|
|
3
4
|
type IProjectToolFactory,
|
|
@@ -5,6 +6,7 @@ import {
|
|
|
5
6
|
type ProjectTool,
|
|
6
7
|
type ProjectType,
|
|
7
8
|
ProjectTypes,
|
|
9
|
+
translate,
|
|
8
10
|
} from "@uipath/solutionpackager-tool-core";
|
|
9
11
|
import { WorkflowCompilerTool } from "./workflow-compiler-tool.js";
|
|
10
12
|
|
|
@@ -13,6 +15,13 @@ import { WorkflowCompilerTool } from "./workflow-compiler-tool.js";
|
|
|
13
15
|
* Handles Process, Library, WebApp, and Tests project types.
|
|
14
16
|
*/
|
|
15
17
|
export class WorkflowCompilerToolFactory implements IProjectToolFactory {
|
|
18
|
+
/**
|
|
19
|
+
* Process-lifetime cache of a successful `dotnet --version` lookup.
|
|
20
|
+
* Negative results are not cached so a one-off failure does not pin
|
|
21
|
+
* the factory across the rest of the process.
|
|
22
|
+
*/
|
|
23
|
+
private static cachedDotnetAvailable: boolean | undefined;
|
|
24
|
+
|
|
16
25
|
readonly supportedTypes: readonly ProjectType[] = [
|
|
17
26
|
ProjectTypes.Process,
|
|
18
27
|
ProjectTypes.Library,
|
|
@@ -24,6 +33,26 @@ export class WorkflowCompilerToolFactory implements IProjectToolFactory {
|
|
|
24
33
|
logger: IToolLogger,
|
|
25
34
|
fileSystem: IFileSystem,
|
|
26
35
|
): Promise<ProjectTool> {
|
|
36
|
+
if (!this.isDotnetAvailable()) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
translate.t("toolWorkflowcompiler.errors.dotnetNotAvailable"),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
27
41
|
return new WorkflowCompilerTool(fileSystem, logger);
|
|
28
42
|
}
|
|
43
|
+
|
|
44
|
+
private isDotnetAvailable(): boolean {
|
|
45
|
+
if (WorkflowCompilerToolFactory.cachedDotnetAvailable !== undefined) {
|
|
46
|
+
return WorkflowCompilerToolFactory.cachedDotnetAvailable;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
execSync("dotnet --version", {
|
|
50
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
51
|
+
});
|
|
52
|
+
WorkflowCompilerToolFactory.cachedDotnetAvailable = true;
|
|
53
|
+
return true;
|
|
54
|
+
} catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
29
58
|
}
|