@uipath/packager-tool-functions 1.199.0 → 1.201.0-preview.115
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/README.md +2 -2
- package/dist/index.js +28 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ Studio Web publish (Python)
|
|
|
14
14
|
→ FunctionsTool.buildAsync() ← this package
|
|
15
15
|
→ buildPyFunctionsPackage() ← src/py (local implementation)
|
|
16
16
|
|
|
17
|
-
CLI: uip
|
|
17
|
+
CLI: uip function pack (JS/TS)
|
|
18
18
|
→ uipath-functions pack ← @uipath/uipath-functions CLI
|
|
19
19
|
→ buildFunctionsPackage() ← same shared library
|
|
20
20
|
|
|
21
|
-
CLI: uip
|
|
21
|
+
CLI: uip function pack (Python)
|
|
22
22
|
→ uipath pack ← Python CLI subprocess
|
|
23
23
|
```
|
|
24
24
|
|
package/dist/index.js
CHANGED
|
@@ -22,10 +22,27 @@ var EXCLUDED_NAMES = new Set([
|
|
|
22
22
|
".env",
|
|
23
23
|
".deno",
|
|
24
24
|
"dist",
|
|
25
|
-
".uip-dbg",
|
|
26
25
|
".uipath"
|
|
27
26
|
]);
|
|
28
27
|
var EXCLUDED_EXTENSIONS = [".nupkg"];
|
|
28
|
+
var NPMRC = ".npmrc";
|
|
29
|
+
var UIPATH_SCOPE = "@uipath:";
|
|
30
|
+
var CREDENTIAL_KEYS = ["_authtoken", "_auth", "_password"];
|
|
31
|
+
function isComment(line) {
|
|
32
|
+
return line === "" || line.startsWith("#") || line.startsWith(";");
|
|
33
|
+
}
|
|
34
|
+
function isOurs(line) {
|
|
35
|
+
const trimmed = line.trim();
|
|
36
|
+
if (isComment(trimmed))
|
|
37
|
+
return false;
|
|
38
|
+
const key = (trimmed.split("=")[0] ?? "").trim().toLowerCase();
|
|
39
|
+
return key.startsWith(UIPATH_SCOPE) || CREDENTIAL_KEYS.some((c) => key.endsWith(c));
|
|
40
|
+
}
|
|
41
|
+
function sanitizeNpmrc(content) {
|
|
42
|
+
const kept = content.split(/\r?\n/).filter((line) => !isOurs(line));
|
|
43
|
+
return kept.some((line) => !isComment(line.trim())) ? kept.join(`
|
|
44
|
+
`) : null;
|
|
45
|
+
}
|
|
29
46
|
var LOCK_FILES = new Set(["bun.lock", "package-lock.json", "deno.lock", "yarn.lock"]);
|
|
30
47
|
async function buildFunctionsPackage(fs, options) {
|
|
31
48
|
const { projectPath, outputPath, projectStorageId } = options;
|
|
@@ -42,7 +59,7 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
42
59
|
throw new Error("entry-points.json not found. Run 'uipath-functions pack' to generate it.");
|
|
43
60
|
}
|
|
44
61
|
const entryPoints = JSON.parse(entryPointsRaw);
|
|
45
|
-
const bindingsRaw = await fs.readFile(fs.path.join(projectPath, "
|
|
62
|
+
const bindingsRaw = await fs.readFile(fs.path.join(projectPath, "bindings_v2.json"), "utf-8");
|
|
46
63
|
const bindings = bindingsRaw ? JSON.parse(bindingsRaw) : {
|
|
47
64
|
$schema: "https://cloud.uipath.com/draft/2024-12/bindings",
|
|
48
65
|
version: "2.0",
|
|
@@ -53,11 +70,9 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
53
70
|
const targetRuntime = detectRuntime(uipathJson.functions);
|
|
54
71
|
const includeLockFile = options.excludeLockFile ? false : uipathJson.packOptions?.includeLockFile ?? true;
|
|
55
72
|
await copyProjectFiles(fs, projectPath, contentPath, includeLockFile, uipathJson.packOptions);
|
|
56
|
-
const mainPath = entryPoints.entryPoints[0]?.filePath ?? "";
|
|
57
73
|
const operateJson = {
|
|
58
74
|
$schema: "https://cloud.uipath.com/draft/2024-12/operate",
|
|
59
75
|
projectId: projectStorageId,
|
|
60
|
-
main: mainPath,
|
|
61
76
|
contentType: "function",
|
|
62
77
|
targetFramework: "Portable",
|
|
63
78
|
targetRuntime,
|
|
@@ -65,6 +80,9 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
65
80
|
requiresUserInteraction: false,
|
|
66
81
|
isAttended: false
|
|
67
82
|
},
|
|
83
|
+
deploymentOptions: {
|
|
84
|
+
generateSlug: true
|
|
85
|
+
},
|
|
68
86
|
dependencies: packageDependencies
|
|
69
87
|
};
|
|
70
88
|
await fs.writeFile(fs.path.join(contentPath, "operate.json"), JSON.stringify(operateJson, null, 2));
|
|
@@ -81,7 +99,7 @@ async function buildFunctionsPackage(fs, options) {
|
|
|
81
99
|
for (const ep of entryPoints.entryPoints) {
|
|
82
100
|
const fnEntry = uipathJson.functions?.[ep.filePath];
|
|
83
101
|
const filePath = fnEntry ? fnEntry.split(":")[0] ?? ep.filePath : ep.filePath;
|
|
84
|
-
packageDescriptor.files[ep.filePath] =
|
|
102
|
+
packageDescriptor.files[ep.filePath] = `${filePath}`;
|
|
85
103
|
}
|
|
86
104
|
await fs.writeFile(fs.path.join(contentPath, "package-descriptor.json"), JSON.stringify(packageDescriptor, null, 2));
|
|
87
105
|
}
|
|
@@ -119,6 +137,10 @@ async function copyProjectFiles(fs, sourcePath, destPath, includeLockFile, packO
|
|
|
119
137
|
const stat = await fs.stat(srcEntry);
|
|
120
138
|
if (stat?.isDirectory()) {
|
|
121
139
|
await walk(srcEntry, destEntry);
|
|
140
|
+
} else if (name === NPMRC) {
|
|
141
|
+
const sanitized = sanitizeNpmrc(await fs.readFile(srcEntry, "utf-8") ?? "");
|
|
142
|
+
if (sanitized !== null)
|
|
143
|
+
await fs.writeFile(destEntry, sanitized);
|
|
122
144
|
} else if (stat?.isFile()) {
|
|
123
145
|
const content = await fs.readFile(srcEntry);
|
|
124
146
|
if (content)
|
|
@@ -429,4 +451,4 @@ export {
|
|
|
429
451
|
FunctionsToolFactory
|
|
430
452
|
};
|
|
431
453
|
|
|
432
|
-
//# debugId=
|
|
454
|
+
//# debugId=24233E119AFECB3C64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/packager-tool-functions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.201.0-preview.115",
|
|
4
4
|
"description": "UiPath Functions tool implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "",
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@uipath/solutionpackager-tool-core": "1.
|
|
28
|
+
"@uipath/solutionpackager-tool-core": "1.201.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
|
|
31
31
|
}
|