@uipath/solutionpackager-tool-core 1.197.0 → 1.198.0-preview.80
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/index.js +30 -1
- package/dist/models/index.d.ts +4 -1
- package/dist/models/project-cleanup-info.d.ts +21 -0
- package/dist/models/project-options.d.ts +13 -0
- package/dist/models/workflow-compiler-cleanup-info.d.ts +39 -0
- package/dist/services/project-operation-context.d.ts +12 -0
- package/dist/services/project-tool.d.ts +6 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1152,6 +1152,29 @@ class ToolResult {
|
|
|
1152
1152
|
return new ToolResult(errorCode, message);
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
|
+
// src/models/workflow-compiler-cleanup-info.ts
|
|
1156
|
+
function toProjectCleanupInfo(raw) {
|
|
1157
|
+
return createProjectCleanupInfo(raw.unusedDependencies ?? [], raw.cleanedWorkflows ?? []);
|
|
1158
|
+
}
|
|
1159
|
+
function toProjectCleanupInfoFromRemote(raw) {
|
|
1160
|
+
const cleanedWorkflows = (raw.CleanedWorkflows ?? []).map((w) => ({
|
|
1161
|
+
workflow: w.Workflow,
|
|
1162
|
+
removedNamespaces: w.RemovedNamespaces ?? []
|
|
1163
|
+
}));
|
|
1164
|
+
return createProjectCleanupInfo(raw.UnusedDependencies ?? [], cleanedWorkflows);
|
|
1165
|
+
}
|
|
1166
|
+
function createProjectCleanupInfo(unusedItems, cleanedWorkflows) {
|
|
1167
|
+
const info = {
|
|
1168
|
+
unusedItems,
|
|
1169
|
+
cleanedFiles: cleanedWorkflows.map((w) => w.workflow)
|
|
1170
|
+
};
|
|
1171
|
+
if (cleanedWorkflows.length > 0) {
|
|
1172
|
+
info.toolDetails = {
|
|
1173
|
+
cleanedWorkflows
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
return info;
|
|
1177
|
+
}
|
|
1155
1178
|
// src/package-descriptor/project-bindings-file-model.ts
|
|
1156
1179
|
function createDefaultBindingsVersion() {
|
|
1157
1180
|
return { major: 2, minor: 0 };
|
|
@@ -1436,6 +1459,10 @@ class ProjectTool {
|
|
|
1436
1459
|
this.logger.info("Pack operation is a noop");
|
|
1437
1460
|
return ToolResult.success();
|
|
1438
1461
|
}
|
|
1462
|
+
async cleanupAsync(_options, _cancellationToken) {
|
|
1463
|
+
this.logger.info("Cleanup operation is a noop");
|
|
1464
|
+
return ToolResult.success();
|
|
1465
|
+
}
|
|
1439
1466
|
async getUiProjectAsync(projectPath) {
|
|
1440
1467
|
const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
|
|
1441
1468
|
if (!await this.fileSystem.exists(filePath)) {
|
|
@@ -1528,6 +1555,8 @@ export {
|
|
|
1528
1555
|
translate,
|
|
1529
1556
|
toolsFactoryRepository,
|
|
1530
1557
|
toRelativeUrl,
|
|
1558
|
+
toProjectCleanupInfoFromRemote,
|
|
1559
|
+
toProjectCleanupInfo,
|
|
1531
1560
|
ensureProjectIdInOperateFile,
|
|
1532
1561
|
ensureProjectId,
|
|
1533
1562
|
ensureContentOperateFile,
|
|
@@ -1551,4 +1580,4 @@ export {
|
|
|
1551
1580
|
BuildConfiguration
|
|
1552
1581
|
};
|
|
1553
1582
|
|
|
1554
|
-
//# debugId=
|
|
1583
|
+
//# debugId=FE11526B2B389B0464756E2164756E21
|
package/dist/models/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export { NugetConstants } from "./nuget-constants.js";
|
|
|
6
6
|
export type { NugetFeedModel } from "./nuget-feed-model.js";
|
|
7
7
|
export type { NugetDependency, NugetPackageInfo, } from "./nuget-package-info.js";
|
|
8
8
|
export type { PackageInfo } from "./package-info.js";
|
|
9
|
-
export type {
|
|
9
|
+
export type { ProjectCleanupInfo } from "./project-cleanup-info.js";
|
|
10
|
+
export type { IProjectBuildOptions, IProjectCleanupOptions, IProjectOptions, IProjectPackOptions, IProjectRestoreOptions, IProjectValidateOptions, } from "./project-options.js";
|
|
10
11
|
export type { ProjectType } from "./project-type.js";
|
|
11
12
|
export { ProjectTypes } from "./project-type.js";
|
|
12
13
|
export type { ISolutionBuildOptions, ISolutionOptions, ISolutionPackOptions, ISolutionRestoreOptions, ISolutionValidateOptions, } from "./solution-options.js";
|
|
@@ -17,3 +18,5 @@ export { ToolResult } from "./tool-result.js";
|
|
|
17
18
|
export type { UiProject } from "./ui-project.js";
|
|
18
19
|
export type { UiPathProject } from "./uipath-project.js";
|
|
19
20
|
export type { UiPathSolution } from "./uipath-solution.js";
|
|
21
|
+
export type { CleanedWorkflowDetail, RemoteCleanedWorkflow, RemoteWorkflowCompilerCleanupPayload, WorkflowCleanupDetails, WorkflowCompilerCleanupPayload, } from "./workflow-compiler-cleanup-info.js";
|
|
22
|
+
export { toProjectCleanupInfo, toProjectCleanupInfoFromRemote, } from "./workflow-compiler-cleanup-info.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General result of a project cleanup operation: the items detected as unused
|
|
3
|
+
* and the files the cleanup modified. Any tool that implements cleanup produces
|
|
4
|
+
* this shape; general consumers (solution-packager, CLI output) read only these
|
|
5
|
+
* fields and never need to know which tool ran.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProjectCleanupInfo {
|
|
8
|
+
/**
|
|
9
|
+
* Ids of the items detected as unused. On a real run these were removed from
|
|
10
|
+
* the project; on a detection-only run they are only reported. An empty list
|
|
11
|
+
* means nothing was unused.
|
|
12
|
+
*/
|
|
13
|
+
unusedItems: string[];
|
|
14
|
+
/** Paths, relative to the project root, of the files the cleanup modified. */
|
|
15
|
+
cleanedFiles: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Optional, tool-specific cleanup detail. The producing tool defines and
|
|
18
|
+
* owns this type; general consumers treat it as opaque and pass it through.
|
|
19
|
+
*/
|
|
20
|
+
toolDetails?: unknown;
|
|
21
|
+
}
|
|
@@ -66,6 +66,19 @@ export interface IProjectValidateOptions extends IProjectOptions {
|
|
|
66
66
|
*/
|
|
67
67
|
policyFileType?: RulesConfigFileType;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Project cleanup options
|
|
71
|
+
*/
|
|
72
|
+
export interface IProjectCleanupOptions extends IProjectOptions {
|
|
73
|
+
/**
|
|
74
|
+
* Detect unused items without modifying the project.
|
|
75
|
+
*/
|
|
76
|
+
dryRun: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Do not clean up now-unused references to removed items in the project's files.
|
|
79
|
+
*/
|
|
80
|
+
skipImports: boolean;
|
|
81
|
+
}
|
|
69
82
|
/**
|
|
70
83
|
* Project build options
|
|
71
84
|
*/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ProjectCleanupInfo } from "./project-cleanup-info.js";
|
|
2
|
+
/**
|
|
3
|
+
* WorkflowCompiler-specific cleanup detail, surfaced via
|
|
4
|
+
* `ProjectCleanupInfo.toolDetails`. The generic cleanup pipeline treats this as
|
|
5
|
+
* opaque; WorkflowCompiler-aware consumers can opt into this type.
|
|
6
|
+
*/
|
|
7
|
+
export interface WorkflowCleanupDetails {
|
|
8
|
+
/** Workflows whose imports were rewritten, with the namespaces removed from each. */
|
|
9
|
+
cleanedWorkflows: CleanedWorkflowDetail[];
|
|
10
|
+
}
|
|
11
|
+
/** A single workflow whose imports the WorkflowCompiler rewrote during cleanup. */
|
|
12
|
+
export interface CleanedWorkflowDetail {
|
|
13
|
+
/** Path of the workflow, relative to the project root. */
|
|
14
|
+
workflow: string;
|
|
15
|
+
/** Namespaces removed from this workflow's imports. */
|
|
16
|
+
removedNamespaces: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Raw cleanup payload after the local WorkflowCompiler executor normalizes
|
|
20
|
+
* output casing.
|
|
21
|
+
*/
|
|
22
|
+
export interface WorkflowCompilerCleanupPayload {
|
|
23
|
+
unusedDependencies?: string[];
|
|
24
|
+
cleanedWorkflows?: CleanedWorkflowDetail[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Raw per-project cleanup payload returned by the remote agent. SignalR JSON is
|
|
28
|
+
* parsed as-is, so the payload keeps the PascalCase wire shape.
|
|
29
|
+
*/
|
|
30
|
+
export interface RemoteWorkflowCompilerCleanupPayload {
|
|
31
|
+
UnusedDependencies?: string[];
|
|
32
|
+
CleanedWorkflows?: RemoteCleanedWorkflow[];
|
|
33
|
+
}
|
|
34
|
+
export interface RemoteCleanedWorkflow {
|
|
35
|
+
Workflow: string;
|
|
36
|
+
RemovedNamespaces?: string[];
|
|
37
|
+
}
|
|
38
|
+
export declare function toProjectCleanupInfo(raw: WorkflowCompilerCleanupPayload): ProjectCleanupInfo;
|
|
39
|
+
export declare function toProjectCleanupInfoFromRemote(raw: RemoteWorkflowCompilerCleanupPayload): ProjectCleanupInfo;
|
|
@@ -18,6 +18,14 @@ export interface ProjectOperationContext {
|
|
|
18
18
|
* URL to download the snapshot for remote packing
|
|
19
19
|
*/
|
|
20
20
|
downloadUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* StudioWeb solution identifier for downloaded solution workspaces.
|
|
23
|
+
*/
|
|
24
|
+
solutionId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* StudioWeb project identifier for downloaded standalone project workspaces.
|
|
27
|
+
*/
|
|
28
|
+
projectId?: string;
|
|
21
29
|
/**
|
|
22
30
|
* Build configuration (e.g. "Debug", "Release").
|
|
23
31
|
* Only used for pack operations; required when packing a solution.
|
|
@@ -39,4 +47,8 @@ export interface ProjectOperationContext {
|
|
|
39
47
|
* Version of the workflow compiler to use for remote packing
|
|
40
48
|
*/
|
|
41
49
|
workflowCompilerVersion?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Lock key of the editing session that triggered the operation.
|
|
52
|
+
*/
|
|
53
|
+
lockKey?: string;
|
|
42
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IFileSystem } from "../filesystem/file-system.js";
|
|
2
|
-
import type { IProjectBuildOptions, IProjectPackOptions, IProjectRestoreOptions, IProjectValidateOptions } from "../models/project-options.js";
|
|
2
|
+
import type { IProjectBuildOptions, IProjectCleanupOptions, IProjectPackOptions, IProjectRestoreOptions, IProjectValidateOptions } from "../models/project-options.js";
|
|
3
3
|
import { ToolResult } from "../models/tool-result.js";
|
|
4
4
|
import type { UiProject } from "../models/ui-project.js";
|
|
5
5
|
import type { IToolLogger } from "./tool-logger.js";
|
|
@@ -27,6 +27,11 @@ export declare abstract class ProjectTool {
|
|
|
27
27
|
* Pack project
|
|
28
28
|
*/
|
|
29
29
|
packAsync(_options: IProjectPackOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Clean up the project (e.g. remove unused items). Default is a noop;
|
|
32
|
+
* tools that support cleanup (e.g. the WorkflowCompiler tool) override this.
|
|
33
|
+
*/
|
|
34
|
+
cleanupAsync(_options: IProjectCleanupOptions, _cancellationToken?: AbortSignal): Promise<ToolResult>;
|
|
30
35
|
/**
|
|
31
36
|
* Read and parse `project.uiproj` from the project folder.
|
|
32
37
|
* Returns `undefined` for project types that do not have a `project.uiproj`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/solutionpackager-tool-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.198.0-preview.80",
|
|
4
4
|
"description": "UiPath contracts for solution packager tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"registry": "https://registry.npmjs.org/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@uipath/filesystem": "1.
|
|
27
|
+
"@uipath/filesystem": "1.198.0",
|
|
28
28
|
"fflate": "^0.8.2"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "9b2c3c0f21a256d2f38dd28bc97e72e6f7b10a9c"
|
|
31
31
|
}
|