@uipath/solution-tool 1.202.0-preview.137 → 1.202.0-preview.138

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/deploy.js CHANGED
@@ -5,9 +5,9 @@ import {
5
5
  listPackagesAsync,
6
6
  uninstallDeploymentAsync,
7
7
  upgradeDeploymentAsync
8
- } from "./packager-tool-8cw7djz6.js";
9
- import"./packager-tool-m7vg7dwj.js";
10
- import"./packager-tool-56b5tnnr.js";
8
+ } from "./packager-tool-k2tj5mv2.js";
9
+ import"./packager-tool-vmskhsbr.js";
10
+ import"./packager-tool-zwvkjsmc.js";
11
11
  import"./packager-tool-fjr8yn4g.js";
12
12
  import"./packager-tool-sba5cptt.js";
13
13
  import"./packager-tool-dfrk01gn.js";
package/dist/index.js CHANGED
@@ -2,17 +2,17 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./packager-tool-kjjkk63a.js";
5
+ } from "./packager-tool-htp0xd7c.js";
6
6
  import"./packager-tool-vxthsps3.js";
7
- import"./packager-tool-8cw7djz6.js";
7
+ import"./packager-tool-k2tj5mv2.js";
8
8
  import"./packager-tool-xfg2cveb.js";
9
- import"./packager-tool-6d4e44g7.js";
10
- import"./packager-tool-3hbsdwjm.js";
11
- import"./packager-tool-zz9cxrqw.js";
12
- import"./packager-tool-m7vg7dwj.js";
13
- import"./packager-tool-56b5tnnr.js";
14
- import"./packager-tool-n41f88jn.js";
15
- import"./packager-tool-x3ehbhsn.js";
9
+ import"./packager-tool-p4kjbrrp.js";
10
+ import"./packager-tool-9dx65z2d.js";
11
+ import"./packager-tool-af5hm3yv.js";
12
+ import"./packager-tool-vmskhsbr.js";
13
+ import"./packager-tool-zwvkjsmc.js";
14
+ import"./packager-tool-72345dw7.js";
15
+ import"./packager-tool-nzghfa48.js";
16
16
  import"./packager-tool-fjr8yn4g.js";
17
17
  import {
18
18
  Command
package/dist/init.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  } from "./packager-tool-xfg2cveb.js";
5
5
  import {
6
6
  addProjectArtifactsToSolutionAsync
7
- } from "./packager-tool-n41f88jn.js";
8
- import"./packager-tool-x3ehbhsn.js";
7
+ } from "./packager-tool-72345dw7.js";
8
+ import"./packager-tool-nzghfa48.js";
9
9
  import"./packager-tool-fjr8yn4g.js";
10
10
  import"./packager-tool-sba5cptt.js";
11
11
  import"./packager-tool-dfrk01gn.js";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  getStudioWebSolutionProjects,
7
7
  listStudioWebSolutions
8
- } from "./packager-tool-56b5tnnr.js";
8
+ } from "./packager-tool-zwvkjsmc.js";
9
9
  import {
10
10
  DEFAULT_PAGE_SIZE,
11
11
  OutputFormatter,
package/dist/pack.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  packSolutionAsync
3
- } from "./packager-tool-6d4e44g7.js";
4
- import"./packager-tool-3hbsdwjm.js";
5
- import"./packager-tool-n41f88jn.js";
6
- import"./packager-tool-x3ehbhsn.js";
3
+ } from "./packager-tool-p4kjbrrp.js";
4
+ import"./packager-tool-9dx65z2d.js";
5
+ import"./packager-tool-72345dw7.js";
6
+ import"./packager-tool-nzghfa48.js";
7
7
  import"./packager-tool-fjr8yn4g.js";
8
8
  import"./packager-tool-sba5cptt.js";
9
9
  import"./packager-tool-dfrk01gn.js";
@@ -15670,6 +15670,26 @@ async function findProjectFile(projectDir) {
15670
15670
  null
15671
15671
  ];
15672
15672
  }
15673
+
15674
+ class ProjectManifestError extends Error {
15675
+ __projectManifestError = true;
15676
+ reason;
15677
+ constructor(message, reason) {
15678
+ super(message);
15679
+ this.name = "ProjectManifestError";
15680
+ this.reason = reason;
15681
+ }
15682
+ }
15683
+ function isProjectManifestError(error) {
15684
+ return !!error && typeof error === "object" && error.__projectManifestError === true;
15685
+ }
15686
+ function isMissingProjectTypeError(error) {
15687
+ return isProjectManifestError(error) && error.reason === "no-project-type";
15688
+ }
15689
+ function lastPathSegment(filePath) {
15690
+ const parts = filePath.split(/[/\\]/);
15691
+ return parts[parts.length - 1] ?? filePath;
15692
+ }
15673
15693
  async function readProjectFile(filePath, useProjectJson) {
15674
15694
  const fs = getFileSystem();
15675
15695
  const [readError, rawContent] = await catchError(fs.readFile(filePath, "utf-8"));
@@ -15679,7 +15699,7 @@ async function readProjectFile(filePath, useProjectJson) {
15679
15699
  const [parseError, content] = catchError(() => JSON.parse(rawContent));
15680
15700
  if (parseError) {
15681
15701
  return [
15682
- new Error(`Invalid JSON in project file: ${parseError.message}`),
15702
+ new ProjectManifestError(`Invalid JSON in project file: ${parseError.message}`, "invalid-json"),
15683
15703
  null
15684
15704
  ];
15685
15705
  }
@@ -15694,7 +15714,16 @@ async function readProjectFile(filePath, useProjectJson) {
15694
15714
  }
15695
15715
  ];
15696
15716
  }
15697
- return [new Error(`ProjectType not found in ${filePath}`), null];
15717
+ if (lastPathSegment(filePath) === "uipath.json") {
15718
+ return [
15719
+ new ProjectManifestError(`${filePath} has no 'ProjectType'. A uipath.json is only read as a code-first Functions project, which also needs a 'functions' entry. Other project types are registered from project.uiproj or project.json, not from uipath.json.`, "no-project-type"),
15720
+ null
15721
+ ];
15722
+ }
15723
+ return [
15724
+ new ProjectManifestError(`ProjectType not found in ${filePath}`, "no-project-type"),
15725
+ null
15726
+ ];
15698
15727
  }
15699
15728
  return [null, { content, projectType: normalizeProjectType(projectType) }];
15700
15729
  }
@@ -16513,6 +16542,6 @@ async function resourceRefreshAsync(solutionPath = ".", options = {}) {
16513
16542
  warnings: result.warnings
16514
16543
  };
16515
16544
  }
16516
- export { Tokens, models_BindingsResourceType, getResourceName, getFolderPathProperty, getResourceKindForBinding, applyEntryPointEnhancementAsync, createResourceBuilderServices, findProjectFile, readProjectFile, readSolutionFile, resolveSolutionFilePath, writeSolutionFile, restoreSolutionFile, createProjectInSolutionBuilder, normalizeFolderPath, findMatchingLocalResource, addProjectArtifactsToSolutionAsync, assertSolutionManifest, syncResourcesFromBindings, findResourceByKeyInRcs, searchRcsResources, findResourceInRcs, createResourceKindMetadataResolver, createLocalResource, readUipxProjects, syncAndLog, resourceRefreshAsync };
16545
+ export { Tokens, models_BindingsResourceType, getResourceName, getFolderPathProperty, getResourceKindForBinding, applyEntryPointEnhancementAsync, createResourceBuilderServices, findProjectFile, isProjectManifestError, isMissingProjectTypeError, readProjectFile, readSolutionFile, resolveSolutionFilePath, writeSolutionFile, restoreSolutionFile, createProjectInSolutionBuilder, normalizeFolderPath, findMatchingLocalResource, addProjectArtifactsToSolutionAsync, assertSolutionManifest, syncResourcesFromBindings, findResourceByKeyInRcs, searchRcsResources, findResourceInRcs, createResourceKindMetadataResolver, createLocalResource, readUipxProjects, syncAndLog, resourceRefreshAsync };
16517
16546
 
16518
- //# debugId=BC3A09192B8885E064756E2164756E21
16547
+ //# debugId=C2523648CDA094EE64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  toolsFactoryRepository
3
- } from "./packager-tool-x3ehbhsn.js";
3
+ } from "./packager-tool-nzghfa48.js";
4
4
  import {
5
5
  unzipSync,
6
6
  zipSync
@@ -1420,8 +1420,7 @@ class ToolsFactoryRepository {
1420
1420
  getProjectToolFactory(projectType) {
1421
1421
  const factory = this.projectFactoryMap.get(projectType);
1422
1422
  if (!factory) {
1423
- const known = [...this.projectFactoryMap.keys()].join(", ");
1424
- throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it. ` + `Project types that can be packed: ${known || "none"}.`);
1423
+ throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
1425
1424
  }
1426
1425
  return factory;
1427
1426
  }
@@ -2270,4 +2269,4 @@ function registerPackagerFactories() {
2270
2269
 
2271
2270
  export { Path, TemporaryStorageService, ZipService, I18nManager, translate, BuildConfiguration, LogLevel, LogMessage, TargetFramework, ToolErrorCodes, ToolResult, toolsFactoryRepository2 as toolsFactoryRepository, registerPackagerFactories };
2272
2271
 
2273
- //# debugId=FCA9CE604FDEAF2C64756E2164756E21
2272
+ //# debugId=1698A45CAE5F631764756E2164756E21
@@ -3,11 +3,11 @@ import {
3
3
  PipelinesApi,
4
4
  feedScopeInitOverride,
5
5
  resolveFeedScope
6
- } from "./packager-tool-m7vg7dwj.js";
6
+ } from "./packager-tool-vmskhsbr.js";
7
7
  import {
8
8
  Configuration as Configuration2,
9
9
  PackagesApi
10
- } from "./packager-tool-56b5tnnr.js";
10
+ } from "./packager-tool-zwvkjsmc.js";
11
11
  import {
12
12
  getSolutionAuthContext
13
13
  } from "./packager-tool-fjr8yn4g.js";
@@ -11,7 +11,7 @@ import {
11
11
  listPackagesAsync,
12
12
  uninstallDeploymentAsync,
13
13
  upgradeDeploymentAsync
14
- } from "./packager-tool-8cw7djz6.js";
14
+ } from "./packager-tool-k2tj5mv2.js";
15
15
  import {
16
16
  SolutionInitError,
17
17
  solutionInitAsync
@@ -25,14 +25,15 @@ import {
25
25
  checkSolutionPathAsync,
26
26
  createSolutionPackager,
27
27
  ensurePackagerTools,
28
+ isUnpackableProjectTypeError,
28
29
  packSolutionAsync,
29
30
  readSolutionFileAsUint8Array,
30
31
  resolveSdkLogLevel,
31
32
  validateGovernanceOptions
32
- } from "./packager-tool-6d4e44g7.js";
33
+ } from "./packager-tool-p4kjbrrp.js";
33
34
  import {
34
35
  publishSolutionAsync
35
- } from "./packager-tool-zz9cxrqw.js";
36
+ } from "./packager-tool-af5hm3yv.js";
36
37
  import {
37
38
  Configuration,
38
39
  PipelinesApi,
@@ -40,7 +41,7 @@ import {
40
41
  feedScopeInitOverride,
41
42
  listSelectablePublishLocations,
42
43
  resolveFeedScope
43
- } from "./packager-tool-m7vg7dwj.js";
44
+ } from "./packager-tool-vmskhsbr.js";
44
45
  import {
45
46
  Configuration as Configuration2,
46
47
  DeploymentActivationStatus,
@@ -56,7 +57,7 @@ import {
56
57
  overwriteSolution,
57
58
  searchPackageVersions,
58
59
  solutionExistsOnStudioWeb
59
- } from "./packager-tool-56b5tnnr.js";
60
+ } from "./packager-tool-zwvkjsmc.js";
60
61
  import {
61
62
  Tokens,
62
63
  applyEntryPointEnhancementAsync,
@@ -68,6 +69,8 @@ import {
68
69
  findMatchingLocalResource,
69
70
  findProjectFile,
70
71
  findResourceByKeyInRcs,
72
+ isMissingProjectTypeError,
73
+ isProjectManifestError,
71
74
  normalizeFolderPath,
72
75
  readProjectFile,
73
76
  readSolutionFile,
@@ -78,10 +81,10 @@ import {
78
81
  syncAndLog,
79
82
  syncResourcesFromBindings,
80
83
  writeSolutionFile
81
- } from "./packager-tool-n41f88jn.js";
84
+ } from "./packager-tool-72345dw7.js";
82
85
  import {
83
86
  ToolResult
84
- } from "./packager-tool-x3ehbhsn.js";
87
+ } from "./packager-tool-nzghfa48.js";
85
88
  import {
86
89
  getSolutionAuthContext
87
90
  } from "./packager-tool-fjr8yn4g.js";
@@ -130,7 +133,7 @@ import {
130
133
  var package_default = {
131
134
  name: "@uipath/solution-tool",
132
135
  license: "MIT",
133
- version: "1.202.0-preview.137",
136
+ version: "1.202.0-preview.138",
134
137
  description: "Create, pack, publish, and deploy UiPath Automation Solutions.",
135
138
  repository: {
136
139
  type: "git",
@@ -2479,6 +2482,12 @@ function rejectUnsupportedProjectType(projectType, failureMessage) {
2479
2482
  processContext.exit(1);
2480
2483
  return true;
2481
2484
  }
2485
+ function projectManifestInstructions(fileName, readProjectError, verb) {
2486
+ if (fileName !== "uipath.json" || !isMissingProjectTypeError(readProjectError)) {
2487
+ return readProjectError.message;
2488
+ }
2489
+ return `${readProjectError.message} If this is a coded app, scaffold it with 'uip codedapp init <project-path>' — that writes the project.uiproj this command registers — then run 'uip solution projects ${verb} <project-path>' again.`;
2490
+ }
2482
2491
 
2483
2492
  // src/commands/project-add.ts
2484
2493
  var PROJECT_ADD_EXAMPLES = [
@@ -2563,7 +2572,8 @@ var registerProjectAddCommand = (project) => {
2563
2572
  OutputFormatter.error({
2564
2573
  Result: RESULTS.Failure,
2565
2574
  Message: "Failed to add project to solution",
2566
- Instructions: readProjectError.message
2575
+ ...isProjectManifestError(readProjectError) ? { ErrorCode: "invalid_argument" } : {},
2576
+ Instructions: projectManifestInstructions(projectFileInfo.fileName, readProjectError, "add")
2567
2577
  });
2568
2578
  processContext.exit(1);
2569
2579
  return;
@@ -2709,7 +2719,8 @@ var registerProjectImportCommand = (project) => {
2709
2719
  OutputFormatter.error({
2710
2720
  Result: RESULTS.Failure,
2711
2721
  Message: "Failed to import project into solution",
2712
- Instructions: readProjectError.message
2722
+ ...isProjectManifestError(readProjectError) ? { ErrorCode: "invalid_argument" } : {},
2723
+ Instructions: projectManifestInstructions(projectFileInfo.fileName, readProjectError, "import")
2713
2724
  });
2714
2725
  processContext.exit(1);
2715
2726
  return;
@@ -5053,10 +5064,11 @@ Restoring solution dependencies...
5053
5064
  const msg = error instanceof Error ? error.message : String(error);
5054
5065
  OutputFormatter.error({
5055
5066
  Result: RESULTS.Failure,
5067
+ ...isUnpackableProjectTypeError(error) ? { ErrorCode: "invalid_argument" } : {},
5056
5068
  Message: msg,
5057
5069
  Instructions: carriedInstructions(error) ?? "Check that you are logged in (`uip auth login`) and that the solution path is accessible, then rerun: uip solution restore <solutionPath>"
5058
5070
  });
5059
- if (error instanceof Error && error.stack) {
5071
+ if (error instanceof Error && error.stack && !isUnpackableProjectTypeError(error)) {
5060
5072
  logger.error("Stack trace:");
5061
5073
  logger.error(error.stack);
5062
5074
  }
@@ -6055,7 +6067,7 @@ var registerCommands = async (program) => {
6055
6067
  registerResourceCommand(program);
6056
6068
  registerDeleteCommand(program);
6057
6069
  if (isPreviewBuild()) {
6058
- const { registerListCommand } = await import("./list-484rd8hx.js");
6070
+ const { registerListCommand } = await import("./list-4dbar53b.js");
6059
6071
  registerListCommand(program);
6060
6072
  }
6061
6073
  registerFeedsCommand(program);
@@ -6063,4 +6075,4 @@ var registerCommands = async (program) => {
6063
6075
 
6064
6076
  export { metadata, registerCommands };
6065
6077
 
6066
- //# debugId=53AC8396C5EA789164756E2164756E21
6078
+ //# debugId=1EE3E1E687A49ED364756E2164756E21
@@ -7,7 +7,7 @@ import {
7
7
  listSelectablePublishLocations,
8
8
  resolveFeedScope,
9
9
  resolvePersonalWorkspace
10
- } from "./packager-tool-m7vg7dwj.js";
10
+ } from "./packager-tool-vmskhsbr.js";
11
11
  import {
12
12
  Configuration as Configuration2,
13
13
  DeploymentOperationStatus,
@@ -16,7 +16,7 @@ import {
16
16
  SolutionDeploymentAction,
17
17
  deploymentsAutoInstall,
18
18
  searchPackageVersions
19
- } from "./packager-tool-56b5tnnr.js";
19
+ } from "./packager-tool-zwvkjsmc.js";
20
20
  import {
21
21
  getSolutionAuthContext,
22
22
  resolveFolder
@@ -29,8 +29,7 @@ class ToolsFactoryRepository {
29
29
  getProjectToolFactory(projectType) {
30
30
  const factory = this.projectFactoryMap.get(projectType);
31
31
  if (!factory) {
32
- const known = [...this.projectFactoryMap.keys()].join(", ");
33
- throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it. ` + `Project types that can be packed: ${known || "none"}.`);
32
+ throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
34
33
  }
35
34
  return factory;
36
35
  }
@@ -893,4 +892,4 @@ I18nManager.registerTranslations("zu", zu);
893
892
  I18nManager.setLocale("en");
894
893
  export { ToolResult, toolsFactoryRepository };
895
894
 
896
- //# debugId=EE7F0622AB4476C164756E2164756E21
895
+ //# debugId=C6B394D3F76A061364756E2164756E21
@@ -12,7 +12,7 @@ import {
12
12
  registerPackagerFactories,
13
13
  toolsFactoryRepository,
14
14
  translate
15
- } from "./packager-tool-3hbsdwjm.js";
15
+ } from "./packager-tool-9dx65z2d.js";
16
16
  import {
17
17
  Tokens,
18
18
  createResourceBuilderServices,
@@ -23,11 +23,11 @@ import {
23
23
  models_BindingsResourceType,
24
24
  readUipxProjects,
25
25
  syncAndLog
26
- } from "./packager-tool-n41f88jn.js";
26
+ } from "./packager-tool-72345dw7.js";
27
27
  import {
28
28
  ToolResult as ToolResult2,
29
29
  toolsFactoryRepository as toolsFactoryRepository2
30
- } from "./packager-tool-x3ehbhsn.js";
30
+ } from "./packager-tool-nzghfa48.js";
31
31
  import {
32
32
  OutputFormatter,
33
33
  RESULTS,
@@ -24191,7 +24191,7 @@ var sdkUserAgentHostToken2 = singleton2("SdkUserAgentHostToken");
24191
24191
  var package_default = {
24192
24192
  name: "@uipath/project-packager",
24193
24193
  license: "MIT",
24194
- version: "1.202.0-preview.137",
24194
+ version: "1.202.0-preview.138",
24195
24195
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
24196
24196
  type: "module",
24197
24197
  main: "./dist/index.js",
@@ -37334,7 +37334,7 @@ var sdkUserAgentHostToken22 = singleton22("SdkUserAgentHostToken");
37334
37334
  var package_default2 = {
37335
37335
  name: "@uipath/project-packager",
37336
37336
  license: "MIT",
37337
- version: "1.202.0-preview.137",
37337
+ version: "1.202.0-preview.138",
37338
37338
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
37339
37339
  type: "module",
37340
37340
  main: "./dist/index.js",
@@ -38883,6 +38883,25 @@ var PROJECT_TYPE_TO_TOOL = new Map([
38883
38883
  ["BusinessRules", "maestro"],
38884
38884
  ["Entity", "df"]
38885
38885
  ]);
38886
+ var PACKAGER_OWNED_TYPES = ["Connector"];
38887
+
38888
+ class UnpackableProjectTypeError extends Error {
38889
+ __unpackableType = true;
38890
+ instructions;
38891
+ constructor(projectType, projectPath) {
38892
+ super(`Project '${projectPath}' declares type '${projectType}', which this CLI cannot pack.`);
38893
+ this.name = "UnpackableProjectTypeError";
38894
+ this.instructions = buildUnpackableInstructions(projectType);
38895
+ }
38896
+ }
38897
+ function isUnpackableProjectTypeError(error) {
38898
+ return !!error && typeof error === "object" && error.__unpackableType === true;
38899
+ }
38900
+ function buildUnpackableInstructions(projectType) {
38901
+ const allowed = `Types a solution can contain: ${packableProjectTypes().join(", ")}.`;
38902
+ const codedAppHint = projectType.toLowerCase() === "app" ? " A coded app packs as 'AppV2': scaffold it with 'uip codedapp init <project-path>', which writes project.uiproj and webAppManifest.json and puts the app files under <project-path>/source." : "";
38903
+ return `${allowed}${codedAppHint} Correct the project's Type in the .uipx, or drop the entry with 'uip solution projects remove <project-path>'.`;
38904
+ }
38886
38905
  var TOOL_TO_PACKAGE = new Map([
38887
38906
  ["rpa", "@uipath/rpa-tool"],
38888
38907
  ["codedapp", "@uipath/codedapp-tool"],
@@ -38892,7 +38911,7 @@ var TOOL_TO_PACKAGE = new Map([
38892
38911
  ["function", "@uipath/function-tool"],
38893
38912
  ["df", "@uipath/data-fabric-tool"]
38894
38913
  ]);
38895
- async function readProjectTypes(solutionDir, fs8) {
38914
+ async function readSolutionProjects(solutionDir, fs8) {
38896
38915
  const entries = await fs8.readdir(solutionDir);
38897
38916
  const uipxFile = entries.find((f) => f.endsWith(".uipx"));
38898
38917
  if (!uipxFile)
@@ -38905,27 +38924,42 @@ async function readProjectTypes(solutionDir, fs8) {
38905
38924
  if (parseError) {
38906
38925
  throw new Error(`Failed to parse ${uipxFile}: ${parseError.message}`);
38907
38926
  }
38908
- return (solution.Projects || []).map((p) => p.Type);
38927
+ return (solution.Projects || []).map((p) => ({
38928
+ type: typeof p.Type === "string" ? p.Type : "",
38929
+ path: typeof p.ProjectRelativePath === "string" ? p.ProjectRelativePath : "(no ProjectRelativePath)"
38930
+ }));
38931
+ }
38932
+ function packableProjectTypes() {
38933
+ const types3 = new Set(PROJECT_TYPE_TO_TOOL.keys());
38934
+ for (const type2 of PACKAGER_OWNED_TYPES) {
38935
+ types3.add(type2);
38936
+ }
38937
+ types3.delete("processOrchestration");
38938
+ return [...types3].sort((a, b) => a.localeCompare(b));
38909
38939
  }
38910
38940
  async function ensurePackagerTools(solutionDir, fs8) {
38911
38941
  registerPackagerFactories();
38912
- const projectTypes = await readProjectTypes(solutionDir, fs8);
38913
- if (projectTypes.length === 0)
38942
+ const projects = await readSolutionProjects(solutionDir, fs8);
38943
+ if (projects.length === 0)
38914
38944
  return;
38915
38945
  const neededTools = new Set;
38916
- for (const type2 of projectTypes) {
38946
+ for (const { type: type2, path: path4 } of projects) {
38917
38947
  const unsupported = unsupportedSolutionProjectType(type2);
38918
38948
  if (unsupported) {
38919
38949
  throw new Error(`Project type '${type2}' cannot be packed as part of a solution. ${unsupported} Or drop it with 'uip solution projects remove <project-path>'.`);
38920
38950
  }
38951
+ if (!type2) {
38952
+ logger.warn(`Solution project '${path4}' has no Type. Pack may fail.`);
38953
+ continue;
38954
+ }
38921
38955
  if (toolsFactoryRepository2.canHandleProject(type2))
38922
38956
  continue;
38923
38957
  const toolVerb = PROJECT_TYPE_TO_TOOL.get(type2);
38924
38958
  if (toolVerb) {
38925
38959
  neededTools.add(toolVerb);
38926
- } else {
38927
- logger.warn(`No installable tool packs project type '${type2}'. Pack may fail.`);
38960
+ continue;
38928
38961
  }
38962
+ throw new UnpackableProjectTypeError(type2, path4);
38929
38963
  }
38930
38964
  for (const toolVerb of neededTools) {
38931
38965
  logger.info(`Loading packager factory for '${toolVerb}' to handle project types...`);
@@ -39083,6 +39117,22 @@ class PackCommandService {
39083
39117
  constructor() {
39084
39118
  this.fs = getFileSystem();
39085
39119
  }
39120
+ reportPackThrow(error, dryRun) {
39121
+ const msg = error instanceof Error ? error.message : String(error);
39122
+ const unpackableType = isUnpackableProjectTypeError(error);
39123
+ const dryRunHint = "Inspect the reported error, fix the underlying issue in the solution, then rerun: uip solution pack <solution-path> --dry-run";
39124
+ OutputFormatter.error({
39125
+ Result: RESULTS.Failure,
39126
+ ...unpackableType ? { ErrorCode: "invalid_argument" } : {},
39127
+ Message: msg,
39128
+ Instructions: carriedInstructions(error) ?? (dryRun ? dryRunHint : msg)
39129
+ });
39130
+ if (unpackableType || !(error instanceof Error) || !error.stack) {
39131
+ return;
39132
+ }
39133
+ logger.error("Stack trace:");
39134
+ logger.error(error.stack);
39135
+ }
39086
39136
  async execute(solutionPath, options, context) {
39087
39137
  const check = await checkSolutionPathAsync(this.fs, solutionPath);
39088
39138
  if (!check.ok) {
@@ -39162,16 +39212,7 @@ Packing solution...
39162
39212
  output: resolvedOutput
39163
39213
  }));
39164
39214
  if (error) {
39165
- const msg = error instanceof Error ? error.message : String(error);
39166
- OutputFormatter.error({
39167
- Result: RESULTS.Failure,
39168
- Message: msg,
39169
- Instructions: options.dryRun ? "Inspect the reported error, fix the underlying issue in the solution, then rerun: uip solution pack <solution-path> --dry-run" : msg
39170
- });
39171
- if (error instanceof Error && error.stack) {
39172
- logger.error("Stack trace:");
39173
- logger.error(error.stack);
39174
- }
39215
+ this.reportPackThrow(error, options.dryRun === true);
39175
39216
  context.exit(1);
39176
39217
  return;
39177
39218
  }
@@ -39214,19 +39255,35 @@ Packing solution...
39214
39255
  }
39215
39256
  }
39216
39257
  }
39217
- async executeAsync(solutionPath, options) {
39258
+ async checkPackInputs(solutionPath, options) {
39218
39259
  if (options.output === undefined) {
39219
- return new ToolResult2("INTERNAL_ERROR" /* InternalError */, "Output path is required when invoking executeAsync directly.", []);
39260
+ return {
39261
+ failure: new ToolResult2("INTERNAL_ERROR" /* InternalError */, "Output path is required when invoking executeAsync directly.", [])
39262
+ };
39220
39263
  }
39221
39264
  const governanceError = validateGovernanceOptions(options);
39222
39265
  if (governanceError) {
39223
- return new ToolResult2("INTERNAL_ERROR" /* InternalError */, governanceError, []);
39266
+ return {
39267
+ failure: new ToolResult2("INTERNAL_ERROR" /* InternalError */, governanceError, [])
39268
+ };
39224
39269
  }
39225
- const absoluteOutputPath = this.fs.path.resolve(options.output);
39226
39270
  const check = await checkSolutionPathAsync(this.fs, solutionPath);
39227
39271
  if (!check.ok) {
39228
- return new ToolResult2("INTERNAL_ERROR" /* InternalError */, check.message, []);
39272
+ return {
39273
+ failure: new ToolResult2("INTERNAL_ERROR" /* InternalError */, check.message, [])
39274
+ };
39229
39275
  }
39276
+ return {
39277
+ absoluteOutputPath: this.fs.path.resolve(options.output),
39278
+ check
39279
+ };
39280
+ }
39281
+ async executeAsync(solutionPath, options) {
39282
+ const inputs = await this.checkPackInputs(solutionPath, options);
39283
+ if (inputs.failure) {
39284
+ return inputs.failure;
39285
+ }
39286
+ const { absoluteOutputPath, check } = inputs;
39230
39287
  const { absoluteSolutionPath, isUisFile, stats } = check;
39231
39288
  const isDirectory = stats.isDirectory();
39232
39289
  const packageName = options.name || (isUisFile ? this.fs.path.basename(solutionPath, ".uis") : this.fs.path.basename(solutionPath));
@@ -39261,6 +39318,9 @@ Packing solution...
39261
39318
  return packager.packSolutionAsync(packOptions);
39262
39319
  });
39263
39320
  if (error) {
39321
+ if (isUnpackableProjectTypeError(error)) {
39322
+ throw error;
39323
+ }
39264
39324
  const message = error instanceof Error ? error.message : String(error);
39265
39325
  const instructions = carriedInstructions(error);
39266
39326
  return new ToolResult2("INTERNAL_ERROR" /* InternalError */, instructions ? `${message} ${instructions}` : message, []);
@@ -39406,7 +39466,20 @@ function formatPackFailureInstructions(message, dryRun) {
39406
39466
  // src/services/pack-service.ts
39407
39467
  async function packSolutionAsync(solutionPath, options) {
39408
39468
  const service = new PackCommandService;
39409
- const result = await service.executeAsync(solutionPath, options);
39469
+ const [error, result] = await catchError(service.executeAsync(solutionPath, options));
39470
+ if (error) {
39471
+ if (!isUnpackableProjectTypeError(error)) {
39472
+ throw error;
39473
+ }
39474
+ const message = error instanceof Error ? error.message : String(error);
39475
+ const instructions = carriedInstructions(error);
39476
+ return {
39477
+ ok: false,
39478
+ errorCode: "INTERNAL_ERROR" /* InternalError */,
39479
+ message: instructions ? `${message} ${instructions}` : message,
39480
+ packages: []
39481
+ };
39482
+ }
39410
39483
  return {
39411
39484
  ok: result.errorCode === "SUCCESS" /* Success */,
39412
39485
  errorCode: result.errorCode,
@@ -39415,6 +39488,6 @@ async function packSolutionAsync(solutionPath, options) {
39415
39488
  };
39416
39489
  }
39417
39490
 
39418
- export { SolutionPackOptions, ensurePackagerTools, createSolutionPackager, readSolutionFileAsUint8Array, resolveSdkLogLevel, applyAuthConnection, SOLUTION_PATH_INSTRUCTIONS, checkSolutionPathAsync, GOVERNANCE_OPTION_INSTRUCTIONS, validateGovernanceOptions, PackCommandService, packSolutionAsync };
39491
+ export { SolutionPackOptions, isUnpackableProjectTypeError, ensurePackagerTools, createSolutionPackager, readSolutionFileAsUint8Array, resolveSdkLogLevel, applyAuthConnection, SOLUTION_PATH_INSTRUCTIONS, checkSolutionPathAsync, GOVERNANCE_OPTION_INSTRUCTIONS, validateGovernanceOptions, PackCommandService, packSolutionAsync };
39419
39492
 
39420
- //# debugId=57C636C235AB2E9564756E2164756E21
39493
+ //# debugId=2C5DDB7BE97361C764756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getAvailablePublishLocationsV2
3
- } from "./packager-tool-56b5tnnr.js";
3
+ } from "./packager-tool-zwvkjsmc.js";
4
4
  import {
5
5
  PersonalWorkspacesApi,
6
6
  createOrchestratorConfig
@@ -3103,7 +3103,7 @@ async function listStudioWebSolutions(config, organizationName, options = {}) {
3103
3103
  var package_default = {
3104
3104
  name: "@uipath/solution-sdk",
3105
3105
  license: "MIT",
3106
- version: "1.202.0-preview.137",
3106
+ version: "1.202.0-preview.138",
3107
3107
  repository: {
3108
3108
  type: "git",
3109
3109
  url: "https://github.com/UiPath/cli.git",
@@ -3394,4 +3394,4 @@ async function searchPackageVersions(config, packageKey, filter, feedFolderKey)
3394
3394
  }
3395
3395
  export { Configuration, getAvailablePublishLocationsV2, DeploymentActivationStatus, DeploymentOperationStatus, SolutionDeploymentAction, DeploymentsApi, PackagesApi, SearchApi, StudioWebIncompatibleProjectError, bundleSolution, deploymentsAutoInstall, isDebugProvisioningTerminal, isDebugProvisioningSucceeded, getProjectDebugStatus, searchPackageVersions, getStudioWebSolutionProjects, listStudioWebSolutions, solutionExistsOnStudioWeb, importSolution, overwriteSolution };
3396
3396
 
3397
- //# debugId=1DF7E23CF3FEEFE764756E2164756E21
3397
+ //# debugId=E7F2A66862D9247664756E2164756E21
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  registerPackagerFactories
3
- } from "./packager-tool-3hbsdwjm.js";
4
- import"./packager-tool-x3ehbhsn.js";
3
+ } from "./packager-tool-9dx65z2d.js";
4
+ import"./packager-tool-nzghfa48.js";
5
5
  import"./packager-tool-dfrk01gn.js";
6
6
  import"./packager-tool-1de529jm.js";
7
7
  export {
package/dist/publish.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  publishSolutionAsync
3
- } from "./packager-tool-zz9cxrqw.js";
4
- import"./packager-tool-m7vg7dwj.js";
5
- import"./packager-tool-56b5tnnr.js";
3
+ } from "./packager-tool-af5hm3yv.js";
4
+ import"./packager-tool-vmskhsbr.js";
5
+ import"./packager-tool-zwvkjsmc.js";
6
6
  import"./packager-tool-fjr8yn4g.js";
7
7
  import"./packager-tool-sba5cptt.js";
8
8
  import"./packager-tool-dfrk01gn.js";
package/dist/resource.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resourceRefreshAsync
3
- } from "./packager-tool-n41f88jn.js";
4
- import"./packager-tool-x3ehbhsn.js";
3
+ } from "./packager-tool-72345dw7.js";
4
+ import"./packager-tool-nzghfa48.js";
5
5
  import"./packager-tool-fjr8yn4g.js";
6
6
  import"./packager-tool-sba5cptt.js";
7
7
  import"./packager-tool-dfrk01gn.js";
@@ -18,7 +18,9 @@ export declare const GOVERNANCE_OPTION_INSTRUCTIONS: string;
18
18
  *
19
19
  * Returns the message rather than throwing because the two callers report
20
20
  * failures differently: the command builds an `OutputFormatter.error` envelope,
21
- * while `executeAsync` returns a `ToolResult` and never throws for an expected
22
- * failure. Owning the wording here keeps the two paths from drifting apart.
21
+ * while `executeAsync` returns a `ToolResult` for an expected failure — except
22
+ * `UnpackableProjectTypeError`, which it rethrows so the CLI can split
23
+ * `Message` from `Instructions`. Owning the wording here keeps the two paths
24
+ * from drifting apart.
23
25
  */
24
26
  export declare function validateGovernanceOptions(options: Pick<PackCommandOptions, "governanceFilePath" | "automationOpsProfile">): string | null;
@@ -8,12 +8,27 @@ export declare class PackCommandService {
8
8
  private packager;
9
9
  private readonly fs;
10
10
  constructor();
11
+ /**
12
+ * Report an error thrown out of the pack pipeline, then leave the exit to
13
+ * the caller. Split out of `execute` so the classification and the
14
+ * stack-trace decision do not add to that method's cognitive complexity,
15
+ * which is already well over budget for reasons that predate this.
16
+ */
17
+ private reportPackThrow;
11
18
  /**
12
19
  * Execute the pack command with formatted CLI output and process exit handling.
13
20
  * When `options.dryRun` is true, the pipeline writes to a temporary directory
14
21
  * which is discarded on exit — useful as a pre-deploy validation gate.
15
22
  */
16
23
  execute(solutionPath: string, options: PackCommandOptions, context: CommandContext): Promise<void>;
24
+ /**
25
+ * The entry guards `executeAsync` runs before it touches a packager:
26
+ * a missing output path, bad governance options, and a solution path that
27
+ * is absent or unreadable. Split out so `executeAsync` stays inside the
28
+ * cognitive-complexity budget; each one still returns the `ToolResult`
29
+ * that caller expects rather than throwing.
30
+ */
31
+ private checkPackInputs;
17
32
  /**
18
33
  * Execute the pack command and return result (for programmatic usage and testing)
19
34
  */
@@ -1,4 +1,21 @@
1
1
  import type { IFileSystem } from "@uipath/filesystem";
2
+ /**
3
+ * A `.uipx` names a project type nothing can pack, and no tool provides one.
4
+ *
5
+ * Thrown before the packager runs so the user gets the real problem — the
6
+ * manifest declares a type this CLI does not have — instead of the packager's
7
+ * "install the tool that packs it", which for a type that does not exist
8
+ * sends them looking for a tool that is not there. `instructions` follows the
9
+ * repo-wide convention `carriedInstructions` reads, and `__unpackableType`
10
+ * lets callers duck-type across bundle boundaries where `instanceof` fails.
11
+ */
12
+ export declare class UnpackableProjectTypeError extends Error {
13
+ readonly __unpackableType = true;
14
+ readonly instructions: string;
15
+ constructor(projectType: string, projectPath: string);
16
+ }
17
+ /** True when `error` is an {@link UnpackableProjectTypeError}, duck-typed. */
18
+ export declare function isUnpackableProjectTypeError(error: unknown): boolean;
2
19
  /**
3
20
  * Puts every factory this pack needs in `toolsFactoryRepository`: registers
4
21
  * the ones solution-tool owns, then reads project types from the .uipx and
@@ -77,7 +77,9 @@ Install the skills with `uip skills install`. The general-purpose `uipath-platfo
77
77
 
78
78
  **`Library` is not a project type here.** A library is a reusable `.nupkg` consumed as a NuGet dependency, so `projects add` / `import` reject it and auto-registration returns `SolutionRegistration.Status: "Skipped"`. Publish it on its own (`uip rpa pack <project-dir> <output-path>`, then `uip or libraries upload --file <nupkg-path>`) and either reference it from a project's dependencies or attach it to this solution as a resource: `uip solution resources add --source remote --kind Library --name <library-name>`.
79
79
 
80
- The type lives in either `project.uiproj` (top-level `ProjectType`) or `project.json` (`designOptions.outputType`, falling back to top-level `ProjectType` when `outputType` is absent — read or write either field). The `init` scaffolders above auto-register when run inside a solution directory (unless `--skip-solution-registration` is passed). For other scaffolders, register the project with the solution after scaffolding: use `uip solution projects add <project-path> [<solution-file>]` when the project already lives inside the solution directory (registers in place, no copy), or `uip solution projects import <path>` to copy a project from outside the solution dir into it and register it. If you pass an unknown type to those commands, they reject with the exhaustive accepted list — trust that error over this table.
80
+ The type lives in either `project.uiproj` (top-level `ProjectType`) or `project.json` (`designOptions.outputType`, falling back to top-level `ProjectType` when `outputType` is absent — read or write either field). A third form exists but is narrow: `uipath.json` is read as a project manifest **only** for a code-first Functions project, which is recognised by a `functions` map inside it. Other project kinds keep a `uipath.json` for their own config — a coded app stores its SDK settings there — and that file is not what registers them: a coded app is registered from the `project.uiproj` that `uip codedapp init <path>` writes. Pointing a solution at a coded app's `uipath.json` (or at its `package.json`) fails, because neither carries a `ProjectType`.
81
+
82
+ The `init` scaffolders above auto-register when run inside a solution directory (unless `--skip-solution-registration` is passed). For other scaffolders, register the project with the solution after scaffolding: use `uip solution projects add <project-path> [<solution-file>]` when the project already lives inside the solution directory (registers in place, no copy), or `uip solution projects import <path>` to copy a project from outside the solution dir into it and register it. If you pass an unknown type to those commands, they reject with the exhaustive accepted list — trust that error over this table. `uip solution pack` rejects the same way: a `Projects[]` entry whose `Type` no packager handles fails with `ErrorCode: invalid_argument`, naming the project, the accepted types, and how to drop the entry, rather than attempting the pack.
81
83
 
82
84
  ## End-to-End Lifecycle
83
85
 
package/dist/tool.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./packager-tool-kjjkk63a.js";
4
+ } from "./packager-tool-htp0xd7c.js";
5
5
  import"./packager-tool-vxthsps3.js";
6
- import"./packager-tool-8cw7djz6.js";
6
+ import"./packager-tool-k2tj5mv2.js";
7
7
  import"./packager-tool-xfg2cveb.js";
8
- import"./packager-tool-6d4e44g7.js";
9
- import"./packager-tool-3hbsdwjm.js";
10
- import"./packager-tool-zz9cxrqw.js";
11
- import"./packager-tool-m7vg7dwj.js";
12
- import"./packager-tool-56b5tnnr.js";
13
- import"./packager-tool-n41f88jn.js";
14
- import"./packager-tool-x3ehbhsn.js";
8
+ import"./packager-tool-p4kjbrrp.js";
9
+ import"./packager-tool-9dx65z2d.js";
10
+ import"./packager-tool-af5hm3yv.js";
11
+ import"./packager-tool-vmskhsbr.js";
12
+ import"./packager-tool-zwvkjsmc.js";
13
+ import"./packager-tool-72345dw7.js";
14
+ import"./packager-tool-nzghfa48.js";
15
15
  import"./packager-tool-fjr8yn4g.js";
16
16
  import"./packager-tool-sba5cptt.js";
17
17
  import"./packager-tool-dfrk01gn.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/solution-tool",
3
3
  "license": "MIT",
4
- "version": "1.202.0-preview.137",
4
+ "version": "1.202.0-preview.138",
5
5
  "description": "Create, pack, publish, and deploy UiPath Automation Solutions.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -47,5 +47,5 @@
47
47
  "dist"
48
48
  ],
49
49
  "private": false,
50
- "gitHead": "bbb20a6d3501afc3435a92af9ae2e9f7ab2e34f6"
50
+ "gitHead": "46372d5c4c4ae9352e9457a99e9d5efc1890cb48"
51
51
  }