@uipath/packager-tool-workflowcompiler 0.0.14
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/index.d.ts +7 -0
- package/dist/i18n/locales/en.d.ts +46 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1213 -0
- package/dist/output-entry.d.ts +42 -0
- package/dist/workflow-compiler-config.d.ts +23 -0
- package/dist/workflow-compiler-executor.d.ts +30 -0
- package/dist/workflow-compiler-path-resolver.d.ts +30 -0
- package/dist/workflow-compiler-tool-factory.d.ts +9 -0
- package/dist/workflow-compiler-tool.d.ts +17 -0
- package/package.json +54 -0
- package/src/i18n/index.ts +45 -0
- package/src/i18n/locales/de.json +40 -0
- package/src/i18n/locales/en.ts +60 -0
- package/src/i18n/locales/es-MX.json +40 -0
- package/src/i18n/locales/es.json +40 -0
- package/src/i18n/locales/fr.json +40 -0
- package/src/i18n/locales/ja.json +40 -0
- package/src/i18n/locales/ko.json +40 -0
- package/src/i18n/locales/pt-BR.json +40 -0
- package/src/i18n/locales/pt.json +40 -0
- package/src/i18n/locales/ro.json +40 -0
- package/src/i18n/locales/ru.json +40 -0
- package/src/i18n/locales/tr.json +40 -0
- package/src/i18n/locales/zh-CN.json +40 -0
- package/src/i18n/locales/zh-TW.json +40 -0
- package/src/i18n/locales/zu.json +40 -0
- package/src/index.ts +22 -0
- package/src/output-entry.ts +46 -0
- package/src/workflow-compiler-config.ts +32 -0
- package/src/workflow-compiler-executor.ts +386 -0
- package/src/workflow-compiler-path-resolver.ts +311 -0
- package/src/workflow-compiler-tool-factory.ts +29 -0
- package/src/workflow-compiler-tool.ts +187 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IFileSystem,
|
|
3
|
+
type IProjectToolFactory,
|
|
4
|
+
type IToolLogger,
|
|
5
|
+
type ProjectTool,
|
|
6
|
+
type ProjectType,
|
|
7
|
+
ProjectTypes,
|
|
8
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
9
|
+
import { WorkflowCompilerTool } from "./workflow-compiler-tool.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Factory for creating a workflow compiler tool.
|
|
13
|
+
* Handles Process, Library, WebApp, and Tests project types.
|
|
14
|
+
*/
|
|
15
|
+
export class WorkflowCompilerToolFactory implements IProjectToolFactory {
|
|
16
|
+
readonly supportedTypes: readonly ProjectType[] = [
|
|
17
|
+
ProjectTypes.Process,
|
|
18
|
+
ProjectTypes.Library,
|
|
19
|
+
ProjectTypes.Tests,
|
|
20
|
+
ProjectTypes.WebApp,
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
async createAsync(
|
|
24
|
+
logger: IToolLogger,
|
|
25
|
+
fileSystem: IFileSystem,
|
|
26
|
+
): Promise<ProjectTool> {
|
|
27
|
+
return new WorkflowCompilerTool(fileSystem, logger);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IFileSystem,
|
|
3
|
+
type IProjectBuildOptions,
|
|
4
|
+
type IProjectPackOptions,
|
|
5
|
+
type IProjectRestoreOptions,
|
|
6
|
+
type IProjectValidateOptions,
|
|
7
|
+
type IToolLogger,
|
|
8
|
+
LogLevel,
|
|
9
|
+
ProjectTool,
|
|
10
|
+
type ToolResult,
|
|
11
|
+
} from "@uipath/solutionpackager-tool-core";
|
|
12
|
+
import { WorkflowCompilerExecutor } from "./workflow-compiler-executor.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Workflow compiler tool implementation.
|
|
16
|
+
* Builds commands and delegates execution to WorkflowCompilerExecutor.
|
|
17
|
+
*/
|
|
18
|
+
export class WorkflowCompilerTool extends ProjectTool {
|
|
19
|
+
private readonly executor: WorkflowCompilerExecutor;
|
|
20
|
+
|
|
21
|
+
constructor(fileSystem: IFileSystem, logger: IToolLogger) {
|
|
22
|
+
super(fileSystem, logger);
|
|
23
|
+
this.executor = new WorkflowCompilerExecutor(logger, fileSystem);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async restoreAsync(
|
|
27
|
+
options: IProjectRestoreOptions,
|
|
28
|
+
cancellationToken?: AbortSignal,
|
|
29
|
+
): Promise<ToolResult> {
|
|
30
|
+
const args = [
|
|
31
|
+
`-p`,
|
|
32
|
+
options.projectPath,
|
|
33
|
+
`--log-level`,
|
|
34
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
35
|
+
`--destination`,
|
|
36
|
+
options.outputPath ?? "",
|
|
37
|
+
`--format-logs`,
|
|
38
|
+
`true`,
|
|
39
|
+
`--exclude-configured-sources`,
|
|
40
|
+
`${options.excludeConfiguredSources}`,
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
if (options.nuGetSourcesConfigPath) {
|
|
44
|
+
args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return this.executor.executeAsync("restore", args, cancellationToken);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async validateAsync(
|
|
51
|
+
options: IProjectValidateOptions,
|
|
52
|
+
cancellationToken?: AbortSignal,
|
|
53
|
+
): Promise<ToolResult> {
|
|
54
|
+
const args = [
|
|
55
|
+
`-p`,
|
|
56
|
+
options.projectPath,
|
|
57
|
+
`--log-level`,
|
|
58
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
59
|
+
`--format-logs`,
|
|
60
|
+
`true`,
|
|
61
|
+
`--skip-analyze`,
|
|
62
|
+
`${options.skipAnalyze}`,
|
|
63
|
+
`--exclude-configured-sources`,
|
|
64
|
+
`${options.excludeConfiguredSources}`,
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
if (options.detailedLogPath) {
|
|
68
|
+
args.push(`--detailed`, options.detailedLogPath);
|
|
69
|
+
}
|
|
70
|
+
if (options.defaultSeverity) {
|
|
71
|
+
args.push(`--default-severity`, options.defaultSeverity);
|
|
72
|
+
}
|
|
73
|
+
if (options.policyFilePath) {
|
|
74
|
+
args.push(`--policy-file`, options.policyFilePath);
|
|
75
|
+
}
|
|
76
|
+
if (options.policyFileType) {
|
|
77
|
+
args.push(`--policy-file-type`, `${options.policyFileType}`);
|
|
78
|
+
}
|
|
79
|
+
if (options.nuGetSourcesConfigPath) {
|
|
80
|
+
args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return this.executor.executeAsync("validate", args, cancellationToken);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async buildAsync(
|
|
87
|
+
options: IProjectBuildOptions,
|
|
88
|
+
cancellationToken?: AbortSignal,
|
|
89
|
+
): Promise<ToolResult> {
|
|
90
|
+
const args = [
|
|
91
|
+
`-p`,
|
|
92
|
+
options.projectPath,
|
|
93
|
+
`-o`,
|
|
94
|
+
options.outputPath,
|
|
95
|
+
`--log-level`,
|
|
96
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
97
|
+
`--format-logs`,
|
|
98
|
+
`true`,
|
|
99
|
+
`--skip-analyze`,
|
|
100
|
+
`${options.skipAnalyze}`,
|
|
101
|
+
`--skip-validate`,
|
|
102
|
+
`${options.skipValidate}`,
|
|
103
|
+
`--exclude-configured-sources`,
|
|
104
|
+
`${options.excludeConfiguredSources}`,
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
if (options.detailedLogPath) {
|
|
108
|
+
args.push(`--detailed`, options.detailedLogPath);
|
|
109
|
+
}
|
|
110
|
+
if (options.policyFilePath) {
|
|
111
|
+
args.push(`--policy-file`, options.policyFilePath);
|
|
112
|
+
}
|
|
113
|
+
if (options.policyFileType) {
|
|
114
|
+
args.push(`--policy-file-type`, `${options.policyFileType}`);
|
|
115
|
+
}
|
|
116
|
+
if (options.outputType) {
|
|
117
|
+
const outputType = this.mapOutputType(options.outputType);
|
|
118
|
+
args.push(`--output-type`, outputType);
|
|
119
|
+
}
|
|
120
|
+
if (options.nuGetSourcesConfigPath) {
|
|
121
|
+
args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return this.executor.executeAsync("build", args, cancellationToken);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async packAsync(
|
|
128
|
+
options: IProjectPackOptions,
|
|
129
|
+
cancellationToken?: AbortSignal,
|
|
130
|
+
): Promise<ToolResult> {
|
|
131
|
+
const args: string[] = [
|
|
132
|
+
`-p`,
|
|
133
|
+
options.projectPath,
|
|
134
|
+
`-o`,
|
|
135
|
+
options.outputPath,
|
|
136
|
+
`--build-version`,
|
|
137
|
+
options.package.version,
|
|
138
|
+
`--log-level`,
|
|
139
|
+
String(options.logLevel ?? LogLevel.Info),
|
|
140
|
+
`--format-logs`,
|
|
141
|
+
`true`,
|
|
142
|
+
`--skip-analyze`,
|
|
143
|
+
`${options.skipAnalyze}`,
|
|
144
|
+
`--skip-validate`,
|
|
145
|
+
`${options.skipValidate}`,
|
|
146
|
+
`--no-optimize-deps`,
|
|
147
|
+
`${options.skipDependencyOptimization}`,
|
|
148
|
+
`--include-sources`,
|
|
149
|
+
`${options.includeSources}`,
|
|
150
|
+
`--split-packages`,
|
|
151
|
+
`${options.splitPackages}`,
|
|
152
|
+
`--exclude-configured-sources`,
|
|
153
|
+
`${options.excludeConfiguredSources}`,
|
|
154
|
+
`--pack-options`,
|
|
155
|
+
JSON.stringify(options.package),
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
if (options.package.id) {
|
|
159
|
+
args.push(`--package-name`, options.package.id);
|
|
160
|
+
}
|
|
161
|
+
if (options.detailedLogPath) {
|
|
162
|
+
args.push(`--detailed`, options.detailedLogPath);
|
|
163
|
+
}
|
|
164
|
+
if (options.policyFilePath) {
|
|
165
|
+
args.push(`--policy-file`, options.policyFilePath);
|
|
166
|
+
}
|
|
167
|
+
if (options.policyFileType) {
|
|
168
|
+
args.push(`--policy-file-type`, options.policyFileType);
|
|
169
|
+
}
|
|
170
|
+
if (options.outputType) {
|
|
171
|
+
const outputType = this.mapOutputType(options.outputType);
|
|
172
|
+
args.push(`--output-type`, outputType);
|
|
173
|
+
}
|
|
174
|
+
if (options.nuGetSourcesConfigPath) {
|
|
175
|
+
args.push(`--nuget-config-file`, options.nuGetSourcesConfigPath);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return this.executor.executeAsync("build", args, cancellationToken);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Maps output type for workflow compiler.
|
|
183
|
+
*/
|
|
184
|
+
private mapOutputType(outputType: string): string {
|
|
185
|
+
return outputType === "WebApp" ? "Process" : outputType;
|
|
186
|
+
}
|
|
187
|
+
}
|