@uipath/packager-tool-apiworkflow 1.204.0-preview.255 → 1.205.0-preview.256

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.
@@ -21,9 +21,22 @@ export declare class ApiWorkflowsTool extends ProjectTool {
21
21
  */
22
22
  private copyFiles;
23
23
  /**
24
- * Create operate.json file if it doesn't already exist
24
+ * Create operate.json file if it doesn't already exist.
25
+ *
26
+ * Its `main` is the entry point for `project.uiproj`'s `MainFile`, not the
27
+ * first one listed: Studio Web appends a new workflow's entry point to the
28
+ * end of entry-points.json and "Set as main" does not reorder it, so in a
29
+ * project with several workflows the first entry is just the oldest one.
25
30
  */
26
31
  private createOperateFile;
32
+ /**
33
+ * `project.uiproj`'s `MainFile`, when it names one.
34
+ *
35
+ * Best-effort: a missing or unreadable `project.uiproj` leaves `main` to the
36
+ * first entry point instead of failing a build that does not otherwise
37
+ * need the file.
38
+ */
39
+ private readMainFile;
27
40
  /**
28
41
  * Create package-descriptor.json file
29
42
  */
@@ -19,6 +19,9 @@ export declare const en: {
19
19
  readonly success: {
20
20
  readonly done: "done";
21
21
  };
22
+ readonly warnings: {
23
+ readonly mainFileUnreadable: "Could not read the main file from {path}, using the first entry point as main: {error}";
24
+ };
22
25
  readonly errors: {
23
26
  readonly buildFailed: "An error occurred while building API project files";
24
27
  readonly packFailed: "An error occurred while packing API project";
package/dist/index.js CHANGED
@@ -43,6 +43,9 @@ var en = {
43
43
  success: {
44
44
  done: "done"
45
45
  },
46
+ warnings: {
47
+ mainFileUnreadable: "Could not read the main file from {path}, using the first entry point as main: {error}"
48
+ },
46
49
  errors: {
47
50
  buildFailed: "An error occurred while building API project files",
48
51
  packFailed: "An error occurred while packing API project"
@@ -477,12 +480,27 @@ class ApiWorkflowsTool extends ProjectTool {
477
480
  }
478
481
  }
479
482
  async createOperateFile(options, contentFolder) {
483
+ const mainFile = await this.readMainFile(options.projectPath);
480
484
  await ensureContentOperateFile(this.fileSystem, {
481
485
  contentFolder,
482
486
  projectPath: options.projectPath,
483
487
  projectStorageId: options.projectStorageId,
484
- contentType: ProjectTypes.Api
488
+ contentType: ProjectTypes.Api,
489
+ mainFile
490
+ });
491
+ }
492
+ async readMainFile(projectPath) {
493
+ const uiProject = await this.getUiProjectAsync(projectPath).catch((error) => {
494
+ const projectFile = Path.join(projectPath, ProjectTool.ProjectFileName);
495
+ const reason = error instanceof Error ? error.message : String(error);
496
+ this.logger.warn(translate.t("toolApiworkflow.warnings.mainFileUnreadable", {
497
+ path: projectFile,
498
+ error: reason
499
+ }));
500
+ return;
485
501
  });
502
+ const mainFile = uiProject?.MainFile;
503
+ return typeof mainFile === "string" && mainFile.length > 0 ? mainFile : undefined;
486
504
  }
487
505
  async createPackageDescriptor(localBuildFolder) {
488
506
  const packageDescriptor = {
@@ -515,4 +533,4 @@ export {
515
533
  ApiWorkflowToolFactory
516
534
  };
517
535
 
518
- //# debugId=4DB123C55ED8A71564756E2164756E21
536
+ //# debugId=BB7329ACD50A595764756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/packager-tool-apiworkflow",
3
- "version": "1.204.0-preview.255",
3
+ "version": "1.205.0-preview.256",
4
4
  "description": "UiPath API Workflow tool implementation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,7 +21,7 @@
21
21
  "author": "UiPath",
22
22
  "license": "SEE LICENSE IN LICENSE.txt",
23
23
  "peerDependencies": {
24
- "@uipath/solutionpackager-tool-core": "1.204.0"
24
+ "@uipath/solutionpackager-tool-core": "1.205.0"
25
25
  },
26
- "gitHead": "699c58dabb59414557755a8933bcbe40aa420df3"
26
+ "gitHead": "63740c6cbb7ff282fa9118cc16a148eb030b245f"
27
27
  }