@uipath/solution-packager 1.202.0-preview.139 → 1.202.0-preview.140
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
CHANGED
|
@@ -410,6 +410,9 @@ import {
|
|
|
410
410
|
} from "@uipath/solutionpackager-tool-core";
|
|
411
411
|
|
|
412
412
|
// src/services/options-builder.ts
|
|
413
|
+
import {
|
|
414
|
+
ProjectLoader
|
|
415
|
+
} from "@uipath/project-packager";
|
|
413
416
|
import {
|
|
414
417
|
Path,
|
|
415
418
|
translate
|
|
@@ -425,6 +428,8 @@ class OptionsBuilder {
|
|
|
425
428
|
this.fileSystem = fileSystem;
|
|
426
429
|
}
|
|
427
430
|
static FILES_DIRECTORY_NAME = "files";
|
|
431
|
+
static DEFAULT_AUTHOR = "UiPath";
|
|
432
|
+
static DEFAULT_DESCRIPTION = "Created by UiPath";
|
|
428
433
|
async buildSolutionPackOptions(parameters, solution) {
|
|
429
434
|
if (!parameters.outputPath) {
|
|
430
435
|
throw new Error(translate.t("solutionpackager.optionsBuilder.errors.outputPathRequired"));
|
|
@@ -443,16 +448,34 @@ class OptionsBuilder {
|
|
|
443
448
|
projectsToBuild: solution.Projects.map((p) => p.Id)
|
|
444
449
|
};
|
|
445
450
|
}
|
|
451
|
+
async resolveMemberMetadataAsync(solutionOptions, projectPath) {
|
|
452
|
+
const declared = await this.loadDeclaredMetadataAsync(projectPath);
|
|
453
|
+
return {
|
|
454
|
+
author: solutionOptions.package.author?.trim() || declared?.author || OptionsBuilder.DEFAULT_AUTHOR,
|
|
455
|
+
description: solutionOptions.package.description?.trim() || declared?.description || OptionsBuilder.DEFAULT_DESCRIPTION
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
async loadDeclaredMetadataAsync(projectPath) {
|
|
459
|
+
try {
|
|
460
|
+
const loaded = await new ProjectLoader(this.fileSystem).loadProject(projectPath);
|
|
461
|
+
return {
|
|
462
|
+
author: loaded.author,
|
|
463
|
+
description: loaded.description
|
|
464
|
+
};
|
|
465
|
+
} catch {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
446
469
|
async createOutputFilesDirectoryAsync(outputPath) {
|
|
447
470
|
const filesDir = Path.join(outputPath, OptionsBuilder.FILES_DIRECTORY_NAME);
|
|
448
471
|
await this.fileSystem.mkdir(filesDir);
|
|
449
472
|
}
|
|
450
|
-
async buildProjectPackOptions(solutionOptions, project) {
|
|
473
|
+
async buildProjectPackOptions(solutionOptions, project, solutionName) {
|
|
451
474
|
const projectPath = this.resolveProjectPath(solutionOptions, project);
|
|
452
|
-
const solutionName = solutionOptions.package.id || undefined;
|
|
453
475
|
const packageInfo = {
|
|
454
476
|
...solutionOptions.package,
|
|
455
|
-
id: await this.packageIdReader.read(project, solutionOptions.inputPath, solutionName) || ""
|
|
477
|
+
id: await this.packageIdReader.read(project, solutionOptions.inputPath, solutionName) || "",
|
|
478
|
+
...await this.resolveMemberMetadataAsync(solutionOptions, projectPath)
|
|
456
479
|
};
|
|
457
480
|
if (!solutionOptions.outputPath) {
|
|
458
481
|
throw new Error(translate.t("solutionpackager.optionsBuilder.errors.outputPathRequired"));
|
|
@@ -924,7 +947,7 @@ class SolutionPackService {
|
|
|
924
947
|
return await this.telemetry.trackDependencyOperation("SolutionPackager.Solution.Pack" /* SolutionPack */, "pack", async () => {
|
|
925
948
|
const [restoreResult, ...projectResults] = await Promise.all([
|
|
926
949
|
solutionTool.restoreAsync(solutionOptions, cancellationToken),
|
|
927
|
-
...this.packAllProjectsAsync(parameters, solution.Projects, context, cancellationToken)
|
|
950
|
+
...this.packAllProjectsAsync(parameters, solution.Projects, solution.Name, context, cancellationToken)
|
|
928
951
|
]);
|
|
929
952
|
const restoreAndPackResults = [
|
|
930
953
|
restoreResult,
|
|
@@ -956,12 +979,12 @@ class SolutionPackService {
|
|
|
956
979
|
}
|
|
957
980
|
}
|
|
958
981
|
}
|
|
959
|
-
packAllProjectsAsync(parameters, projects, context, cancellationToken) {
|
|
960
|
-
return projects.map((project) => this.packSingleProjectAsync(parameters, project, context, cancellationToken));
|
|
982
|
+
packAllProjectsAsync(parameters, projects, solutionName, context, cancellationToken) {
|
|
983
|
+
return projects.map((project) => this.packSingleProjectAsync(parameters, project, solutionName, context, cancellationToken));
|
|
961
984
|
}
|
|
962
|
-
async packSingleProjectAsync(parameters, project, context, cancellationToken) {
|
|
985
|
+
async packSingleProjectAsync(parameters, project, solutionName, context, cancellationToken) {
|
|
963
986
|
try {
|
|
964
|
-
const projectOptions = await this.optionsBuilder.buildProjectPackOptions(parameters, project);
|
|
987
|
+
const projectOptions = await this.optionsBuilder.buildProjectPackOptions(parameters, project, solutionName);
|
|
965
988
|
return await this.projectExecutor.packAsync(projectOptions, project, context, cancellationToken);
|
|
966
989
|
} catch (error) {
|
|
967
990
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -1386,4 +1409,4 @@ export {
|
|
|
1386
1409
|
createBrowserSolutionPackager
|
|
1387
1410
|
};
|
|
1388
1411
|
|
|
1389
|
-
//# debugId=
|
|
1412
|
+
//# debugId=E42C0DAAD1D016BD64756E2164756E21
|
package/dist/node.js
CHANGED
|
@@ -440,6 +440,9 @@ import {
|
|
|
440
440
|
} from "@uipath/solutionpackager-tool-core";
|
|
441
441
|
|
|
442
442
|
// src/services/options-builder.ts
|
|
443
|
+
import {
|
|
444
|
+
ProjectLoader
|
|
445
|
+
} from "@uipath/project-packager";
|
|
443
446
|
import {
|
|
444
447
|
Path,
|
|
445
448
|
translate
|
|
@@ -455,6 +458,8 @@ class OptionsBuilder {
|
|
|
455
458
|
this.fileSystem = fileSystem;
|
|
456
459
|
}
|
|
457
460
|
static FILES_DIRECTORY_NAME = "files";
|
|
461
|
+
static DEFAULT_AUTHOR = "UiPath";
|
|
462
|
+
static DEFAULT_DESCRIPTION = "Created by UiPath";
|
|
458
463
|
async buildSolutionPackOptions(parameters, solution) {
|
|
459
464
|
if (!parameters.outputPath) {
|
|
460
465
|
throw new Error(translate.t("solutionpackager.optionsBuilder.errors.outputPathRequired"));
|
|
@@ -473,16 +478,34 @@ class OptionsBuilder {
|
|
|
473
478
|
projectsToBuild: solution.Projects.map((p) => p.Id)
|
|
474
479
|
};
|
|
475
480
|
}
|
|
481
|
+
async resolveMemberMetadataAsync(solutionOptions, projectPath) {
|
|
482
|
+
const declared = await this.loadDeclaredMetadataAsync(projectPath);
|
|
483
|
+
return {
|
|
484
|
+
author: solutionOptions.package.author?.trim() || declared?.author || OptionsBuilder.DEFAULT_AUTHOR,
|
|
485
|
+
description: solutionOptions.package.description?.trim() || declared?.description || OptionsBuilder.DEFAULT_DESCRIPTION
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
async loadDeclaredMetadataAsync(projectPath) {
|
|
489
|
+
try {
|
|
490
|
+
const loaded = await new ProjectLoader(this.fileSystem).loadProject(projectPath);
|
|
491
|
+
return {
|
|
492
|
+
author: loaded.author,
|
|
493
|
+
description: loaded.description
|
|
494
|
+
};
|
|
495
|
+
} catch {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
476
499
|
async createOutputFilesDirectoryAsync(outputPath) {
|
|
477
500
|
const filesDir = Path.join(outputPath, OptionsBuilder.FILES_DIRECTORY_NAME);
|
|
478
501
|
await this.fileSystem.mkdir(filesDir);
|
|
479
502
|
}
|
|
480
|
-
async buildProjectPackOptions(solutionOptions, project) {
|
|
503
|
+
async buildProjectPackOptions(solutionOptions, project, solutionName) {
|
|
481
504
|
const projectPath = this.resolveProjectPath(solutionOptions, project);
|
|
482
|
-
const solutionName = solutionOptions.package.id || undefined;
|
|
483
505
|
const packageInfo = {
|
|
484
506
|
...solutionOptions.package,
|
|
485
|
-
id: await this.packageIdReader.read(project, solutionOptions.inputPath, solutionName) || ""
|
|
507
|
+
id: await this.packageIdReader.read(project, solutionOptions.inputPath, solutionName) || "",
|
|
508
|
+
...await this.resolveMemberMetadataAsync(solutionOptions, projectPath)
|
|
486
509
|
};
|
|
487
510
|
if (!solutionOptions.outputPath) {
|
|
488
511
|
throw new Error(translate.t("solutionpackager.optionsBuilder.errors.outputPathRequired"));
|
|
@@ -954,7 +977,7 @@ class SolutionPackService {
|
|
|
954
977
|
return await this.telemetry.trackDependencyOperation("SolutionPackager.Solution.Pack" /* SolutionPack */, "pack", async () => {
|
|
955
978
|
const [restoreResult, ...projectResults] = await Promise.all([
|
|
956
979
|
solutionTool.restoreAsync(solutionOptions, cancellationToken),
|
|
957
|
-
...this.packAllProjectsAsync(parameters, solution.Projects, context, cancellationToken)
|
|
980
|
+
...this.packAllProjectsAsync(parameters, solution.Projects, solution.Name, context, cancellationToken)
|
|
958
981
|
]);
|
|
959
982
|
const restoreAndPackResults = [
|
|
960
983
|
restoreResult,
|
|
@@ -986,12 +1009,12 @@ class SolutionPackService {
|
|
|
986
1009
|
}
|
|
987
1010
|
}
|
|
988
1011
|
}
|
|
989
|
-
packAllProjectsAsync(parameters, projects, context, cancellationToken) {
|
|
990
|
-
return projects.map((project) => this.packSingleProjectAsync(parameters, project, context, cancellationToken));
|
|
1012
|
+
packAllProjectsAsync(parameters, projects, solutionName, context, cancellationToken) {
|
|
1013
|
+
return projects.map((project) => this.packSingleProjectAsync(parameters, project, solutionName, context, cancellationToken));
|
|
991
1014
|
}
|
|
992
|
-
async packSingleProjectAsync(parameters, project, context, cancellationToken) {
|
|
1015
|
+
async packSingleProjectAsync(parameters, project, solutionName, context, cancellationToken) {
|
|
993
1016
|
try {
|
|
994
|
-
const projectOptions = await this.optionsBuilder.buildProjectPackOptions(parameters, project);
|
|
1017
|
+
const projectOptions = await this.optionsBuilder.buildProjectPackOptions(parameters, project, solutionName);
|
|
995
1018
|
return await this.projectExecutor.packAsync(projectOptions, project, context, cancellationToken);
|
|
996
1019
|
} catch (error) {
|
|
997
1020
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -1387,4 +1410,4 @@ export {
|
|
|
1387
1410
|
createNodeSolutionPackager
|
|
1388
1411
|
};
|
|
1389
1412
|
|
|
1390
|
-
//# debugId=
|
|
1413
|
+
//# debugId=0773CC8956B6196964756E2164756E21
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IPackService, type UiPathProject } from "@uipath/project-packager";
|
|
2
2
|
import { type IFileSystem, type IProjectCleanupOptions, type IProjectPackOptions, type IProjectRestoreOptions, type IProjectValidateOptions, type ISolutionPackOptions } from "@uipath/solutionpackager-tool-core";
|
|
3
3
|
import type { LoadedUiPathSolution } from "../models/loaded-uipath-solution.js";
|
|
4
4
|
import type { SolutionPackOptions } from "../models/solution-pack-options.js";
|
|
@@ -13,8 +13,11 @@ export interface IOptionsBuilder {
|
|
|
13
13
|
buildSolutionPackOptions(parameters: SolutionPackOptions, solution: LoadedUiPathSolution): Promise<ISolutionPackOptions>;
|
|
14
14
|
/**
|
|
15
15
|
* Build project pack options from solution parameters, for a specific project
|
|
16
|
+
*
|
|
17
|
+
* @param solutionName The solution's own name — its `.uipx` basename. Anchors
|
|
18
|
+
* the member's package id; see `buildProjectPackOptions`.
|
|
16
19
|
*/
|
|
17
|
-
buildProjectPackOptions(options: SolutionPackOptions, project: UiPathProject): Promise<IProjectPackOptions>;
|
|
20
|
+
buildProjectPackOptions(options: SolutionPackOptions, project: UiPathProject, solutionName: string): Promise<IProjectPackOptions>;
|
|
18
21
|
/**
|
|
19
22
|
* Build project validate options from solution parameters, for a specific project
|
|
20
23
|
*/
|
|
@@ -34,12 +37,39 @@ export declare class OptionsBuilder implements IOptionsBuilder {
|
|
|
34
37
|
private readonly fileSystem;
|
|
35
38
|
constructor(packageIdReader: IPackageIdReader, packService: IPackService, fileSystem: IFileSystem);
|
|
36
39
|
private static readonly FILES_DIRECTORY_NAME;
|
|
40
|
+
/**
|
|
41
|
+
* Last-resort package metadata, matching what `packager-core` applies.
|
|
42
|
+
* Kept here because a member's `<authors>`/`<description>` must be
|
|
43
|
+
* non-empty by the time it reaches the packer — the WorkflowCompiler
|
|
44
|
+
* rejects a NuGet manifest missing either — and the RPA path builds its
|
|
45
|
+
* manifest itself rather than going through `packager-core`.
|
|
46
|
+
*/
|
|
47
|
+
private static readonly DEFAULT_AUTHOR;
|
|
48
|
+
private static readonly DEFAULT_DESCRIPTION;
|
|
37
49
|
buildSolutionPackOptions(parameters: SolutionPackOptions, solution: LoadedUiPathSolution): Promise<ISolutionPackOptions>;
|
|
50
|
+
/**
|
|
51
|
+
* The `<authors>` and `<description>` one member ships with.
|
|
52
|
+
*
|
|
53
|
+
* A solution-wide flag wins, then what the member's own project file
|
|
54
|
+
* declares, then the packager literal. Substituting the literal before
|
|
55
|
+
* this point — which `solution pack` used to do — made the field
|
|
56
|
+
* permanently non-empty and so discarded every member's declared
|
|
57
|
+
* description, applying one value across the whole solution (STUD-81311).
|
|
58
|
+
*/
|
|
59
|
+
private resolveMemberMetadataAsync;
|
|
60
|
+
/**
|
|
61
|
+
* Read the member's declared author and description, or undefined.
|
|
62
|
+
*
|
|
63
|
+
* Best-effort on purpose: this is metadata, so a project file the loader
|
|
64
|
+
* cannot read must fail in the packer that actually needs it, with that
|
|
65
|
+
* packer's error, rather than here while looking up a description.
|
|
66
|
+
*/
|
|
67
|
+
private loadDeclaredMetadataAsync;
|
|
38
68
|
private createOutputFilesDirectoryAsync;
|
|
39
69
|
/**
|
|
40
70
|
* Build project pack options from solution parameters for a specific project
|
|
41
71
|
*/
|
|
42
|
-
buildProjectPackOptions(solutionOptions: SolutionPackOptions, project: UiPathProject): Promise<IProjectPackOptions>;
|
|
72
|
+
buildProjectPackOptions(solutionOptions: SolutionPackOptions, project: UiPathProject, solutionName: string): Promise<IProjectPackOptions>;
|
|
43
73
|
buildProjectValidateOptions(solutionOptions: SolutionPackOptions, project: UiPathProject): IProjectValidateOptions;
|
|
44
74
|
buildProjectRestoreOptions(solutionOptions: SolutionPackOptions, project: UiPathProject): Promise<IProjectRestoreOptions>;
|
|
45
75
|
buildProjectCleanupOptions(solutionOptions: SolutionPackOptions, project: UiPathProject): IProjectCleanupOptions;
|
|
@@ -26,6 +26,7 @@ export declare class SolutionPackService implements ISolutionPackService {
|
|
|
26
26
|
* Pack all projects in parallel
|
|
27
27
|
* @param parameters Solution pack parameters
|
|
28
28
|
* @param projects Array of projects to pack
|
|
29
|
+
* @param solutionName The solution's `.uipx` basename, anchoring member package ids
|
|
29
30
|
* @param cancellationToken Optional cancellation token
|
|
30
31
|
* @returns Array of promises for packing each project
|
|
31
32
|
*/
|
|
@@ -34,6 +35,7 @@ export declare class SolutionPackService implements ISolutionPackService {
|
|
|
34
35
|
* Pack a single project
|
|
35
36
|
* @param parameters Solution pack parameters
|
|
36
37
|
* @param project Project to pack
|
|
38
|
+
* @param solutionName The solution's `.uipx` basename, anchoring the member package id
|
|
37
39
|
* @param cancellationToken Optional cancellation token
|
|
38
40
|
* @param context Optional operation context
|
|
39
41
|
* @returns Result of the pack operation
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/solution-packager",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.202.0-preview.
|
|
4
|
+
"version": "1.202.0-preview.140",
|
|
5
5
|
"description": "UiPath Solution Packager - core library for packing UiPath solutions",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"fflate": "^0.8.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "1861498d8a158a710a718c04614523ba59c93781"
|
|
38
38
|
}
|