@uipath/packager-tool-functions 1.205.0-preview.277 → 1.206.0-preview.279
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 +57 -58
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,59 +1,3 @@
|
|
|
1
|
-
// src/types.ts
|
|
2
|
-
var Languages = {
|
|
3
|
-
JavaScript: "javascript",
|
|
4
|
-
Python: "python"
|
|
5
|
-
};
|
|
6
|
-
var LanguageLabels = {
|
|
7
|
-
[Languages.JavaScript]: "JS/TS",
|
|
8
|
-
[Languages.Python]: "Python"
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// src/language-detection.ts
|
|
12
|
-
var EXTENSION_TO_LANGUAGE = {
|
|
13
|
-
".ts": Languages.JavaScript,
|
|
14
|
-
".js": Languages.JavaScript,
|
|
15
|
-
".mjs": Languages.JavaScript,
|
|
16
|
-
".py": Languages.Python
|
|
17
|
-
};
|
|
18
|
-
function languageFromFunctionsMap(functions) {
|
|
19
|
-
const firstEntry = Object.values(functions ?? {})[0];
|
|
20
|
-
if (!firstEntry) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const filePath = firstEntry.split(":")[0] ?? "";
|
|
24
|
-
const dot = filePath.lastIndexOf(".");
|
|
25
|
-
return dot >= 0 ? EXTENSION_TO_LANGUAGE[filePath.slice(dot)] : undefined;
|
|
26
|
-
}
|
|
27
|
-
async function detectProjectLanguage(fileSystem, projectPath) {
|
|
28
|
-
const fromManifest = await languageFromUipathJson(fileSystem, projectPath);
|
|
29
|
-
if (fromManifest) {
|
|
30
|
-
return fromManifest;
|
|
31
|
-
}
|
|
32
|
-
if (await fileSystem.exists(fileSystem.path.join(projectPath, "package.json"))) {
|
|
33
|
-
return Languages.JavaScript;
|
|
34
|
-
}
|
|
35
|
-
if (await fileSystem.exists(fileSystem.path.join(projectPath, "pyproject.toml"))) {
|
|
36
|
-
return Languages.Python;
|
|
37
|
-
}
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
async function languageFromUipathJson(fileSystem, projectPath) {
|
|
41
|
-
const uipathJsonPath = fileSystem.path.join(projectPath, "uipath.json");
|
|
42
|
-
if (!await fileSystem.exists(uipathJsonPath)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const content = await fileSystem.readFile(uipathJsonPath, "utf-8");
|
|
46
|
-
if (!content) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
const uipathJson = JSON.parse(content);
|
|
51
|
-
return languageFromFunctionsMap(uipathJson.functions);
|
|
52
|
-
} catch {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
1
|
// src/functions-tool.ts
|
|
58
2
|
import {
|
|
59
3
|
ensureProjectId,
|
|
@@ -295,6 +239,62 @@ async function buildJsFunctionsPackage(fileSystem, options) {
|
|
|
295
239
|
projectStorageId: options.projectStorageId
|
|
296
240
|
});
|
|
297
241
|
}
|
|
242
|
+
// src/types.ts
|
|
243
|
+
var Languages = {
|
|
244
|
+
JavaScript: "javascript",
|
|
245
|
+
Python: "python"
|
|
246
|
+
};
|
|
247
|
+
var LanguageLabels = {
|
|
248
|
+
[Languages.JavaScript]: "JS/TS",
|
|
249
|
+
[Languages.Python]: "Python"
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
// src/language-detection.ts
|
|
253
|
+
var EXTENSION_TO_LANGUAGE = {
|
|
254
|
+
".ts": Languages.JavaScript,
|
|
255
|
+
".js": Languages.JavaScript,
|
|
256
|
+
".mjs": Languages.JavaScript,
|
|
257
|
+
".py": Languages.Python
|
|
258
|
+
};
|
|
259
|
+
function languageFromFunctionsMap(functions) {
|
|
260
|
+
const firstEntry = Object.values(functions ?? {})[0];
|
|
261
|
+
if (!firstEntry) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
const filePath = firstEntry.split(":")[0] ?? "";
|
|
265
|
+
const dot = filePath.lastIndexOf(".");
|
|
266
|
+
return dot >= 0 ? EXTENSION_TO_LANGUAGE[filePath.slice(dot)] : undefined;
|
|
267
|
+
}
|
|
268
|
+
async function detectProjectLanguage(fileSystem, projectPath) {
|
|
269
|
+
const fromManifest = await languageFromUipathJson(fileSystem, projectPath);
|
|
270
|
+
if (fromManifest) {
|
|
271
|
+
return fromManifest;
|
|
272
|
+
}
|
|
273
|
+
if (await fileSystem.exists(fileSystem.path.join(projectPath, "package.json"))) {
|
|
274
|
+
return Languages.JavaScript;
|
|
275
|
+
}
|
|
276
|
+
if (await fileSystem.exists(fileSystem.path.join(projectPath, "pyproject.toml"))) {
|
|
277
|
+
return Languages.Python;
|
|
278
|
+
}
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
async function languageFromUipathJson(fileSystem, projectPath) {
|
|
282
|
+
const uipathJsonPath = fileSystem.path.join(projectPath, "uipath.json");
|
|
283
|
+
if (!await fileSystem.exists(uipathJsonPath)) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const content = await fileSystem.readFile(uipathJsonPath, "utf-8");
|
|
287
|
+
if (!content) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
try {
|
|
291
|
+
const uipathJson = JSON.parse(content);
|
|
292
|
+
return languageFromFunctionsMap(uipathJson.functions);
|
|
293
|
+
} catch {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
298
|
// src/py/build-py-functions-package.ts
|
|
299
299
|
import { NugetConstants, Path } from "@uipath/solutionpackager-tool-core";
|
|
300
300
|
|
|
@@ -309,7 +309,6 @@ var EXCLUDED_NAMES2 = new Set([
|
|
|
309
309
|
]);
|
|
310
310
|
var EXCLUDED_DIRECTORIES = new Set([
|
|
311
311
|
"evaluations",
|
|
312
|
-
"evals",
|
|
313
312
|
".function-builder",
|
|
314
313
|
"node_modules",
|
|
315
314
|
"__pycache__",
|
|
@@ -598,4 +597,4 @@ export {
|
|
|
598
597
|
languageFromFunctionsMap
|
|
599
598
|
};
|
|
600
599
|
|
|
601
|
-
//# debugId=
|
|
600
|
+
//# debugId=E8D8AF5256EEC3C664756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/packager-tool-functions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.206.0-preview.279",
|
|
4
4
|
"description": "UiPath Functions tool implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"author": "UiPath",
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@uipath/solutionpackager-tool-core": "1.
|
|
25
|
+
"@uipath/solutionpackager-tool-core": "1.206.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "d2176feff38d4e91a9d84723af847b2dfd5c6008"
|
|
28
28
|
}
|