@uipath/packager-tool-webapp 1.207.0-preview.338 → 1.207.0-preview.339
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/action-schema/index.js +48 -12
- package/dist/coded-app-declarations.d.ts +7 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +78 -1
- package/dist/index.js +24 -10
- package/dist/webapp-tool-factory.d.ts +1 -0
- package/package.json +2 -2
|
@@ -403,11 +403,26 @@ function describeDuplicateActionPropertyNames(duplicates) {
|
|
|
403
403
|
function joinWithAnd(items) {
|
|
404
404
|
return `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
405
405
|
}
|
|
406
|
+
// src/action-schema/webapp-contributing-tool-factory.ts
|
|
407
|
+
import { describeDeclaredBindingsAsync } from "@uipath/solutionpackager-tool-core/resource-declarations";
|
|
408
|
+
|
|
406
409
|
// src/webapp-tool-factory.ts
|
|
407
410
|
import {
|
|
408
411
|
ProjectTypes as ProjectTypes4
|
|
409
412
|
} from "@uipath/solutionpackager-tool-core";
|
|
410
413
|
|
|
414
|
+
// src/coded-app-declarations.ts
|
|
415
|
+
var CODED_APP_RESOURCE_DECLARATIONS = {
|
|
416
|
+
language: "typescript",
|
|
417
|
+
roots: ["source", "."],
|
|
418
|
+
bindingsFiles: [
|
|
419
|
+
"source/bindings_v2.json",
|
|
420
|
+
"source/bindings.json",
|
|
421
|
+
"bindings.json",
|
|
422
|
+
"bindings_v2.json"
|
|
423
|
+
]
|
|
424
|
+
};
|
|
425
|
+
|
|
411
426
|
// src/project-identity.ts
|
|
412
427
|
import {
|
|
413
428
|
MAX_IDENTITY_FILE_BYTES,
|
|
@@ -475,7 +490,6 @@ import {
|
|
|
475
490
|
ToolErrorCodes as ToolErrorCodes2,
|
|
476
491
|
ToolResult
|
|
477
492
|
} from "@uipath/solutionpackager-tool-core";
|
|
478
|
-
|
|
479
493
|
// src/utils/bundle-path.ts
|
|
480
494
|
import { Path as Path2 } from "@uipath/solutionpackager-tool-core";
|
|
481
495
|
function normalizeBundlePath(path) {
|
|
@@ -703,7 +717,8 @@ import {
|
|
|
703
717
|
NugetPackager,
|
|
704
718
|
Path as Path6,
|
|
705
719
|
ProjectTypes as ProjectTypes2,
|
|
706
|
-
TargetFramework
|
|
720
|
+
TargetFramework,
|
|
721
|
+
writeDeclaredBindingsAsync
|
|
707
722
|
} from "@uipath/solutionpackager-tool-core";
|
|
708
723
|
|
|
709
724
|
// src/utils/fs-helpers.ts
|
|
@@ -860,7 +875,7 @@ class CodedAppStrategy {
|
|
|
860
875
|
logger?.progress("Copying bundle to content folder...");
|
|
861
876
|
await copyDirectoryAsync(this.fileSystem, fullBundlePath, contentFolder);
|
|
862
877
|
logger?.progress("Preparing metadata files...");
|
|
863
|
-
await this.prepareMetadataFiles(localBuildFolder, contentFolder, packageInfo, manifest, projectPath, fullBundlePath);
|
|
878
|
+
await this.prepareMetadataFiles(localBuildFolder, contentFolder, packageInfo, manifest, projectPath, fullBundlePath, logger);
|
|
864
879
|
logger?.progress("Creating NuGet package...");
|
|
865
880
|
const nupkgFileName = `${packageInfo.id}.${packageInfo.version}.nupkg`;
|
|
866
881
|
const nupkgPath = Path6.join(outputPath, nupkgFileName);
|
|
@@ -912,7 +927,7 @@ class CodedAppStrategy {
|
|
|
912
927
|
throw new CodedAppNotPackableError(problem, bundleProblemInstructions(fullBundlePath, bundleSource));
|
|
913
928
|
}
|
|
914
929
|
}
|
|
915
|
-
async prepareMetadataFiles(_localBuildFolder, contentFolder, _packageInfo, manifest, projectPath, sourceBundlePath) {
|
|
930
|
+
async prepareMetadataFiles(_localBuildFolder, contentFolder, _packageInfo, manifest, projectPath, sourceBundlePath, logger) {
|
|
916
931
|
const declaredMainFile = manifest.config?.mainFile;
|
|
917
932
|
const mainFile = await this.resolveMainFileAsync(contentFolder, declaredMainFile);
|
|
918
933
|
if (!mainFile) {
|
|
@@ -965,12 +980,7 @@ class CodedAppStrategy {
|
|
|
965
980
|
await this.fileSystem.writeFile(bindingsPath, bindingsJson);
|
|
966
981
|
}
|
|
967
982
|
const bindingsV2Path = Path6.join(contentFolder, "bindings_v2.json");
|
|
968
|
-
const bindingsCandidatePaths = [
|
|
969
|
-
Path6.join(projectPath, "source", "bindings_v2.json"),
|
|
970
|
-
Path6.join(projectPath, "source", "bindings.json"),
|
|
971
|
-
Path6.join(projectPath, "bindings.json"),
|
|
972
|
-
Path6.join(projectPath, "bindings_v2.json")
|
|
973
|
-
];
|
|
983
|
+
const bindingsCandidatePaths = (CODED_APP_RESOURCE_DECLARATIONS.bindingsFiles ?? []).map((relativePath) => Path6.join(projectPath, ...relativePath.split("/")));
|
|
974
984
|
let bindingsV2Json = null;
|
|
975
985
|
for (const candidate of bindingsCandidatePaths) {
|
|
976
986
|
if (await this.fileSystem.exists(candidate)) {
|
|
@@ -989,6 +999,12 @@ class CodedAppStrategy {
|
|
|
989
999
|
}, null, 2);
|
|
990
1000
|
}
|
|
991
1001
|
await this.fileSystem.writeFile(bindingsV2Path, bindingsV2Json);
|
|
1002
|
+
await writeDeclaredBindingsAsync(this.fileSystem, {
|
|
1003
|
+
projectDir: projectPath,
|
|
1004
|
+
contentFolder,
|
|
1005
|
+
support: CODED_APP_RESOURCE_DECLARATIONS,
|
|
1006
|
+
logger
|
|
1007
|
+
});
|
|
992
1008
|
const entryPointsPath = Path6.join(contentFolder, "entry-points.json");
|
|
993
1009
|
const projectEntryPointsPath = Path6.join(projectPath, "entry-points.json");
|
|
994
1010
|
let entryPointsContent;
|
|
@@ -1476,6 +1492,7 @@ class WebAppToolFactory {
|
|
|
1476
1492
|
commandRunner;
|
|
1477
1493
|
readProjectIdentityAsync = readProjectIdentity;
|
|
1478
1494
|
supportedTypes = [ProjectTypes4.AppV2];
|
|
1495
|
+
resourceDeclarations = CODED_APP_RESOURCE_DECLARATIONS;
|
|
1479
1496
|
constructor(commandRunner) {
|
|
1480
1497
|
this.commandRunner = commandRunner;
|
|
1481
1498
|
}
|
|
@@ -1487,7 +1504,26 @@ class WebAppToolFactory {
|
|
|
1487
1504
|
// src/action-schema/webapp-contributing-tool-factory.ts
|
|
1488
1505
|
class WebAppContributingToolFactory extends WebAppToolFactory {
|
|
1489
1506
|
async describeResourcesAsync(projectDir, fs) {
|
|
1490
|
-
|
|
1507
|
+
const [app, declared] = await Promise.all([
|
|
1508
|
+
describeActionApp(projectDir, fs),
|
|
1509
|
+
describeDeclaredBindingsAsync(projectDir, fs, this.resourceDeclarations)
|
|
1510
|
+
]);
|
|
1511
|
+
if (!declared)
|
|
1512
|
+
return app;
|
|
1513
|
+
const errors = [...app.errors ?? [], ...declared.errors ?? []];
|
|
1514
|
+
const warnings = [
|
|
1515
|
+
...app.warnings ?? [],
|
|
1516
|
+
...declared.warnings ?? []
|
|
1517
|
+
];
|
|
1518
|
+
return {
|
|
1519
|
+
...app,
|
|
1520
|
+
...declared.bindings && { bindings: declared.bindings },
|
|
1521
|
+
...declared.selfProvisioned && {
|
|
1522
|
+
selfProvisioned: declared.selfProvisioned
|
|
1523
|
+
},
|
|
1524
|
+
...errors.length > 0 && { errors },
|
|
1525
|
+
...warnings.length > 0 && { warnings }
|
|
1526
|
+
};
|
|
1491
1527
|
}
|
|
1492
1528
|
}
|
|
1493
1529
|
export {
|
|
@@ -1511,4 +1547,4 @@ export {
|
|
|
1511
1547
|
validateActionSchema
|
|
1512
1548
|
};
|
|
1513
1549
|
|
|
1514
|
-
//# debugId=
|
|
1550
|
+
//# debugId=3DD069D5EC99C57A64756E2164756E21
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ResourceDeclarationsSupport } from "@uipath/solutionpackager-tool-core";
|
|
2
|
+
/**
|
|
3
|
+
* Where a coded app keeps `uipath_resources.ts` and any hand-written bindings
|
|
4
|
+
* file, in lookup order: `source/` for a project `codedapp init` created
|
|
5
|
+
* inside a solution, the project root for a standalone app.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CODED_APP_RESOURCE_DECLARATIONS: ResourceDeclarationsSupport;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CODED_APP_RESOURCE_DECLARATIONS } from "./coded-app-declarations.js";
|
|
1
2
|
export { isBundleRelativePath, isCanonicalBundleChild, isHtmlEntryPointPath, normalizeBundlePath, resolveHtmlEntryPoint, } from "./utils/bundle-path.js";
|
|
2
3
|
/**
|
|
3
4
|
* Constants used throughout the WebApp tool implementation
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
// src/models/webapp-manifest.ts
|
|
2
2
|
var WEBAPP_MANIFEST_FILE_NAME = "webAppManifest.json";
|
|
3
3
|
|
|
4
|
+
// src/coded-app-declarations.ts
|
|
5
|
+
var CODED_APP_RESOURCE_DECLARATIONS = {
|
|
6
|
+
language: "typescript",
|
|
7
|
+
roots: ["source", "."],
|
|
8
|
+
bindingsFiles: [
|
|
9
|
+
"source/bindings_v2.json",
|
|
10
|
+
"source/bindings.json",
|
|
11
|
+
"bindings.json",
|
|
12
|
+
"bindings_v2.json"
|
|
13
|
+
]
|
|
14
|
+
};
|
|
4
15
|
// ../packager-core/src/filesystem/path.ts
|
|
5
16
|
class Path {
|
|
6
17
|
static normalize(path) {
|
|
@@ -879,6 +890,71 @@ I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
|
879
890
|
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
880
891
|
I18nManager.registerTranslations("zu", zu);
|
|
881
892
|
I18nManager.setLocale("en");
|
|
893
|
+
// ../packager-core/src/resource-declarations/languages.ts
|
|
894
|
+
var RESOURCE_DECLARATIONS_FILE_NAMES = {
|
|
895
|
+
typescript: "uipath_resources.ts",
|
|
896
|
+
python: "uipath_resources.py"
|
|
897
|
+
};
|
|
898
|
+
function resourceDeclarationsPaths(language) {
|
|
899
|
+
const name = RESOURCE_DECLARATIONS_FILE_NAMES[language];
|
|
900
|
+
return [name, `src/${name}`];
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
// ../packager-core/src/resource-declarations/scanner.ts
|
|
904
|
+
var closingIndexOf = new Map;
|
|
905
|
+
|
|
906
|
+
// ../packager-core/src/resource-declarations/declarations.ts
|
|
907
|
+
var RESOURCE_DECLARATIONS_FILE_NAME = RESOURCE_DECLARATIONS_FILE_NAMES.typescript;
|
|
908
|
+
var RESOURCE_DECLARATIONS_PATHS = resourceDeclarationsPaths("typescript");
|
|
909
|
+
var MAX_RESOURCE_DECLARATIONS_LENGTH = 1024 * 1024;
|
|
910
|
+
// ../packager-core/src/resource-declarations/editor.ts
|
|
911
|
+
var RESERVED_IDENTIFIERS = new Set([
|
|
912
|
+
"constructor",
|
|
913
|
+
"prototype",
|
|
914
|
+
"name",
|
|
915
|
+
"length",
|
|
916
|
+
"caller",
|
|
917
|
+
"arguments"
|
|
918
|
+
]);
|
|
919
|
+
var SUB_TYPES_BY_KIND = {
|
|
920
|
+
asset: new Set(["text", "integer", "bool", "credential", "secret", "json"]),
|
|
921
|
+
bucket: new Set(["orchestrator", "amazon", "azure"])
|
|
922
|
+
};
|
|
923
|
+
// ../packager-core/src/resource-declarations/python.ts
|
|
924
|
+
var PYTHON_KEYWORDS = new Set([
|
|
925
|
+
"and",
|
|
926
|
+
"as",
|
|
927
|
+
"assert",
|
|
928
|
+
"async",
|
|
929
|
+
"await",
|
|
930
|
+
"break",
|
|
931
|
+
"class",
|
|
932
|
+
"continue",
|
|
933
|
+
"def",
|
|
934
|
+
"del",
|
|
935
|
+
"elif",
|
|
936
|
+
"else",
|
|
937
|
+
"except",
|
|
938
|
+
"finally",
|
|
939
|
+
"for",
|
|
940
|
+
"from",
|
|
941
|
+
"global",
|
|
942
|
+
"if",
|
|
943
|
+
"import",
|
|
944
|
+
"in",
|
|
945
|
+
"is",
|
|
946
|
+
"lambda",
|
|
947
|
+
"nonlocal",
|
|
948
|
+
"not",
|
|
949
|
+
"or",
|
|
950
|
+
"pass",
|
|
951
|
+
"raise",
|
|
952
|
+
"return",
|
|
953
|
+
"try",
|
|
954
|
+
"while",
|
|
955
|
+
"with",
|
|
956
|
+
"yield"
|
|
957
|
+
]);
|
|
882
958
|
// ../packager-core/src/services/project-identity.ts
|
|
883
959
|
var MAX_IDENTITY_FILE_BYTES = 1024 * 1024;
|
|
884
960
|
// ../packager-core/src/services/tools-factory-repository.ts
|
|
@@ -1007,6 +1083,7 @@ var ERROR_MESSAGES = {
|
|
|
1007
1083
|
};
|
|
1008
1084
|
export {
|
|
1009
1085
|
APP_FOLDER_NAME,
|
|
1086
|
+
CODED_APP_RESOURCE_DECLARATIONS,
|
|
1010
1087
|
CONTENT_APP_FOLDER_NAME,
|
|
1011
1088
|
DEFAULT_BUNDLE_PATH,
|
|
1012
1089
|
DEFAULT_ENTRY_POINT_TYPE,
|
|
@@ -1022,4 +1099,4 @@ export {
|
|
|
1022
1099
|
resolveHtmlEntryPoint
|
|
1023
1100
|
};
|
|
1024
1101
|
|
|
1025
|
-
//# debugId=
|
|
1102
|
+
//# debugId=9AC15C01BE092FDD64756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -72,6 +72,17 @@ import {
|
|
|
72
72
|
ToolResult
|
|
73
73
|
} from "@uipath/solutionpackager-tool-core";
|
|
74
74
|
|
|
75
|
+
// src/coded-app-declarations.ts
|
|
76
|
+
var CODED_APP_RESOURCE_DECLARATIONS = {
|
|
77
|
+
language: "typescript",
|
|
78
|
+
roots: ["source", "."],
|
|
79
|
+
bindingsFiles: [
|
|
80
|
+
"source/bindings_v2.json",
|
|
81
|
+
"source/bindings.json",
|
|
82
|
+
"bindings.json",
|
|
83
|
+
"bindings_v2.json"
|
|
84
|
+
]
|
|
85
|
+
};
|
|
75
86
|
// src/utils/bundle-path.ts
|
|
76
87
|
import { Path as Path2 } from "@uipath/solutionpackager-tool-core";
|
|
77
88
|
function normalizeBundlePath(path) {
|
|
@@ -299,7 +310,8 @@ import {
|
|
|
299
310
|
NugetPackager,
|
|
300
311
|
Path as Path6,
|
|
301
312
|
ProjectTypes as ProjectTypes2,
|
|
302
|
-
TargetFramework
|
|
313
|
+
TargetFramework,
|
|
314
|
+
writeDeclaredBindingsAsync
|
|
303
315
|
} from "@uipath/solutionpackager-tool-core";
|
|
304
316
|
|
|
305
317
|
// src/utils/fs-helpers.ts
|
|
@@ -456,7 +468,7 @@ class CodedAppStrategy {
|
|
|
456
468
|
logger?.progress("Copying bundle to content folder...");
|
|
457
469
|
await copyDirectoryAsync(this.fileSystem, fullBundlePath, contentFolder);
|
|
458
470
|
logger?.progress("Preparing metadata files...");
|
|
459
|
-
await this.prepareMetadataFiles(localBuildFolder, contentFolder, packageInfo, manifest, projectPath, fullBundlePath);
|
|
471
|
+
await this.prepareMetadataFiles(localBuildFolder, contentFolder, packageInfo, manifest, projectPath, fullBundlePath, logger);
|
|
460
472
|
logger?.progress("Creating NuGet package...");
|
|
461
473
|
const nupkgFileName = `${packageInfo.id}.${packageInfo.version}.nupkg`;
|
|
462
474
|
const nupkgPath = Path6.join(outputPath, nupkgFileName);
|
|
@@ -508,7 +520,7 @@ class CodedAppStrategy {
|
|
|
508
520
|
throw new CodedAppNotPackableError(problem, bundleProblemInstructions(fullBundlePath, bundleSource));
|
|
509
521
|
}
|
|
510
522
|
}
|
|
511
|
-
async prepareMetadataFiles(_localBuildFolder, contentFolder, _packageInfo, manifest, projectPath, sourceBundlePath) {
|
|
523
|
+
async prepareMetadataFiles(_localBuildFolder, contentFolder, _packageInfo, manifest, projectPath, sourceBundlePath, logger) {
|
|
512
524
|
const declaredMainFile = manifest.config?.mainFile;
|
|
513
525
|
const mainFile = await this.resolveMainFileAsync(contentFolder, declaredMainFile);
|
|
514
526
|
if (!mainFile) {
|
|
@@ -561,12 +573,7 @@ class CodedAppStrategy {
|
|
|
561
573
|
await this.fileSystem.writeFile(bindingsPath, bindingsJson);
|
|
562
574
|
}
|
|
563
575
|
const bindingsV2Path = Path6.join(contentFolder, "bindings_v2.json");
|
|
564
|
-
const bindingsCandidatePaths = [
|
|
565
|
-
Path6.join(projectPath, "source", "bindings_v2.json"),
|
|
566
|
-
Path6.join(projectPath, "source", "bindings.json"),
|
|
567
|
-
Path6.join(projectPath, "bindings.json"),
|
|
568
|
-
Path6.join(projectPath, "bindings_v2.json")
|
|
569
|
-
];
|
|
576
|
+
const bindingsCandidatePaths = (CODED_APP_RESOURCE_DECLARATIONS.bindingsFiles ?? []).map((relativePath) => Path6.join(projectPath, ...relativePath.split("/")));
|
|
570
577
|
let bindingsV2Json = null;
|
|
571
578
|
for (const candidate of bindingsCandidatePaths) {
|
|
572
579
|
if (await this.fileSystem.exists(candidate)) {
|
|
@@ -585,6 +592,12 @@ class CodedAppStrategy {
|
|
|
585
592
|
}, null, 2);
|
|
586
593
|
}
|
|
587
594
|
await this.fileSystem.writeFile(bindingsV2Path, bindingsV2Json);
|
|
595
|
+
await writeDeclaredBindingsAsync(this.fileSystem, {
|
|
596
|
+
projectDir: projectPath,
|
|
597
|
+
contentFolder,
|
|
598
|
+
support: CODED_APP_RESOURCE_DECLARATIONS,
|
|
599
|
+
logger
|
|
600
|
+
});
|
|
588
601
|
const entryPointsPath = Path6.join(contentFolder, "entry-points.json");
|
|
589
602
|
const projectEntryPointsPath = Path6.join(projectPath, "entry-points.json");
|
|
590
603
|
let entryPointsContent;
|
|
@@ -1074,6 +1087,7 @@ class WebAppToolFactory {
|
|
|
1074
1087
|
commandRunner;
|
|
1075
1088
|
readProjectIdentityAsync = readProjectIdentity;
|
|
1076
1089
|
supportedTypes = [ProjectTypes4.AppV2];
|
|
1090
|
+
resourceDeclarations = CODED_APP_RESOURCE_DECLARATIONS;
|
|
1077
1091
|
constructor(commandRunner) {
|
|
1078
1092
|
this.commandRunner = commandRunner;
|
|
1079
1093
|
}
|
|
@@ -1090,4 +1104,4 @@ export {
|
|
|
1090
1104
|
readProjectIdentity
|
|
1091
1105
|
};
|
|
1092
1106
|
|
|
1093
|
-
//# debugId=
|
|
1107
|
+
//# debugId=2B54057DA535E8B164756E2164756E21
|
|
@@ -11,6 +11,7 @@ export declare class WebAppToolFactory implements IProjectToolFactory {
|
|
|
11
11
|
private readonly commandRunner?;
|
|
12
12
|
readProjectIdentityAsync: import("@uipath/solutionpackager-tool-core").ProjectIdentityReader;
|
|
13
13
|
readonly supportedTypes: readonly ProjectType[];
|
|
14
|
+
readonly resourceDeclarations: import("@uipath/solutionpackager-tool-core").ResourceDeclarationsSupport;
|
|
14
15
|
constructor(commandRunner?: CommandRunner | undefined);
|
|
15
16
|
createAsync(logger: IToolLogger, fileSystem: IFileSystem): Promise<WebAppTool>;
|
|
16
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/packager-tool-webapp",
|
|
3
|
-
"version": "1.207.0-preview.
|
|
3
|
+
"version": "1.207.0-preview.339",
|
|
4
4
|
"description": "UiPath WebApp tool implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"@uipath/solutionpackager-tool-core": "1.207.0",
|
|
28
28
|
"zod": "^4.3.6"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "facf304fc254e99cf469fb94ab5d625e358897bc"
|
|
31
31
|
}
|