@argos-ci/util 2.3.2 → 3.0.0
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/browser.d.ts +36 -12
- package/dist/index.js +8 -8
- package/package.json +5 -4
package/dist/browser.d.ts
CHANGED
|
@@ -1,35 +1,59 @@
|
|
|
1
1
|
type ScreenshotMetadata = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/** @description The URL of the page that was screenshotted */
|
|
3
|
+
url?: string | null;
|
|
4
|
+
/** @description An URL to an accessible preview of the screenshot */
|
|
5
|
+
previewUrl?: string | null;
|
|
4
6
|
viewport?: {
|
|
7
|
+
/** @description The width of the viewport */
|
|
5
8
|
width: number;
|
|
9
|
+
/** @description The height of the viewport */
|
|
6
10
|
height: number;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
} | null;
|
|
12
|
+
/** @description The color scheme when the screenshot was taken */
|
|
13
|
+
colorScheme?: ("light" | "dark") | null;
|
|
14
|
+
/** @description The media type when the screenshot was taken */
|
|
15
|
+
mediaType?: ("screen" | "print") | null;
|
|
16
|
+
test?: ({
|
|
17
|
+
/** @description The unique identifier of the test */
|
|
18
|
+
id?: string | null;
|
|
19
|
+
/** @description The title of the test */
|
|
12
20
|
title: string;
|
|
21
|
+
/** @description The path of titles leading to the test */
|
|
13
22
|
titlePath: string[];
|
|
14
|
-
retries
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
/** @description The number of retries for the test */
|
|
24
|
+
retries?: number | null;
|
|
25
|
+
/** @description The current retry count */
|
|
26
|
+
retry?: number | null;
|
|
27
|
+
/** @description The repeat count for the test */
|
|
28
|
+
repeat?: number | null;
|
|
29
|
+
/** @description The location of the test in the source code */
|
|
17
30
|
location?: {
|
|
31
|
+
/** @description The file where the test is located */
|
|
18
32
|
file: string;
|
|
33
|
+
/** @description The line number in the file */
|
|
19
34
|
line: number;
|
|
35
|
+
/** @description The column number in the file */
|
|
20
36
|
column: number;
|
|
21
37
|
};
|
|
22
|
-
} | null;
|
|
38
|
+
} | null) | null;
|
|
23
39
|
browser?: {
|
|
40
|
+
/** @description The name of the browser */
|
|
24
41
|
name: string;
|
|
42
|
+
/** @description The version of the browser */
|
|
25
43
|
version: string;
|
|
26
|
-
};
|
|
44
|
+
} | null;
|
|
45
|
+
/** @description The automation library that generated the screenshot */
|
|
27
46
|
automationLibrary: {
|
|
47
|
+
/** @description The name of the automation library */
|
|
28
48
|
name: string;
|
|
49
|
+
/** @description The version of the automation library */
|
|
29
50
|
version: string;
|
|
30
51
|
};
|
|
52
|
+
/** @description The Argos SDK that generated the screenshot */
|
|
31
53
|
sdk: {
|
|
54
|
+
/** @description The name of the Argos SDK */
|
|
32
55
|
name: string;
|
|
56
|
+
/** @description The version of the Argos SDK */
|
|
33
57
|
version: string;
|
|
34
58
|
};
|
|
35
59
|
transient?: {
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-VMM7XHBS.js";
|
|
6
6
|
|
|
7
7
|
// src/fs.ts
|
|
8
|
-
import { randomBytes } from "
|
|
9
|
-
import { mkdir } from "
|
|
10
|
-
import { tmpdir } from "
|
|
11
|
-
import { join } from "
|
|
8
|
+
import { randomBytes } from "crypto";
|
|
9
|
+
import { mkdir } from "fs/promises";
|
|
10
|
+
import { tmpdir } from "os";
|
|
11
|
+
import { join } from "path";
|
|
12
12
|
var createDirectoryPromises = /* @__PURE__ */ new Map();
|
|
13
13
|
async function createDirectory(pathname) {
|
|
14
14
|
let promise = createDirectoryPromises.get(pathname);
|
|
@@ -28,7 +28,7 @@ async function createTemporaryDirectory() {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// src/git.ts
|
|
31
|
-
import { exec } from "
|
|
31
|
+
import { exec } from "child_process";
|
|
32
32
|
var cached;
|
|
33
33
|
function getGitRepositoryPath() {
|
|
34
34
|
if (!cached) {
|
|
@@ -48,7 +48,7 @@ function getGitRepositoryPath() {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// src/introspection.ts
|
|
51
|
-
import { readFile } from "
|
|
51
|
+
import { readFile } from "fs/promises";
|
|
52
52
|
var versionCache = /* @__PURE__ */ new Map();
|
|
53
53
|
function readVersionFromPackage(pkgPath) {
|
|
54
54
|
const readVersion = async () => {
|
|
@@ -69,7 +69,7 @@ function readVersionFromPackage(pkgPath) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// src/metadata-io.ts
|
|
72
|
-
import { readFile as readFile2, writeFile } from "
|
|
72
|
+
import { readFile as readFile2, writeFile } from "fs/promises";
|
|
73
73
|
async function writeMetadata(screenshotPath, metadata) {
|
|
74
74
|
await writeFile(getMetadataPath(screenshotPath), JSON.stringify(metadata));
|
|
75
75
|
}
|
|
@@ -86,7 +86,7 @@ async function readMetadata(screenshotPath) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
// src/playwright-trace.ts
|
|
89
|
-
import { access } from "
|
|
89
|
+
import { access } from "fs/promises";
|
|
90
90
|
function getTracePath(screenshotPath) {
|
|
91
91
|
return screenshotPath + ".pw-trace.zip";
|
|
92
92
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/util",
|
|
3
3
|
"description": "Set of utilities used across all Argos SDKs.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
38
|
+
"node": ">=20.0.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsup",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"lint": "eslint ."
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "
|
|
47
|
+
"@types/node": "catalog:",
|
|
48
|
+
"vitest": "catalog:"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "807e4a9f3c4bfddd4197ed7394b032a39bc1c58e"
|
|
50
51
|
}
|