@argos-ci/core 6.7.1 → 6.7.2
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.d.mts +11 -9
- package/dist/index.mjs +9 -6
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ArgosAPISchema } from "@argos-ci/api-client";
|
|
2
2
|
import { ScreenshotMetadata } from "@argos-ci/util";
|
|
3
|
-
|
|
4
3
|
//#region src/config.d.ts
|
|
5
4
|
interface Config {
|
|
6
5
|
/**
|
|
@@ -135,13 +134,13 @@ interface Config {
|
|
|
135
134
|
subset?: boolean;
|
|
136
135
|
}
|
|
137
136
|
declare function readConfig(options?: Partial<Config>): Promise<Config>;
|
|
138
|
-
declare function getConfigFromOptions({
|
|
139
|
-
parallel,
|
|
140
|
-
...options
|
|
141
|
-
}: Omit<Partial<Config>, "parallel"> & {
|
|
137
|
+
declare function getConfigFromOptions({ parallel, ...options }: Omit<Partial<Config>, "parallel"> & {
|
|
142
138
|
parallel?: {
|
|
143
|
-
/** Unique build ID for this parallel build */
|
|
144
|
-
|
|
139
|
+
/** Unique build ID for this parallel build */
|
|
140
|
+
nonce: string;
|
|
141
|
+
/** The number of parallel nodes being ran */
|
|
142
|
+
total: number;
|
|
143
|
+
/** The index of the parallel node */
|
|
145
144
|
index?: number;
|
|
146
145
|
} | false | undefined;
|
|
147
146
|
}): Promise<Config>;
|
|
@@ -302,8 +301,11 @@ interface UploadParameters {
|
|
|
302
301
|
* @default false
|
|
303
302
|
*/
|
|
304
303
|
parallel?: {
|
|
305
|
-
/** Unique build identifier shared across parallel jobs. */
|
|
306
|
-
|
|
304
|
+
/** Unique build identifier shared across parallel jobs. */
|
|
305
|
+
nonce: string;
|
|
306
|
+
/** Total number of parallel jobs, set to -1 to finalize manually. */
|
|
307
|
+
total: number;
|
|
308
|
+
/** Index of the current job (must start from 1). */
|
|
307
309
|
index?: number;
|
|
308
310
|
} | false;
|
|
309
311
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1408,7 +1408,7 @@ async function deploy(params) {
|
|
|
1408
1408
|
if (createResponse.error) throwAPIError(createResponse.error, createResponse.response);
|
|
1409
1409
|
const { deploymentId, uploadFiles: filesToUpload } = createResponse.data;
|
|
1410
1410
|
debug(`Deployment created: ${deploymentId}, files to upload: ${filesToUpload.length}`);
|
|
1411
|
-
const
|
|
1411
|
+
const uploads = filesToUpload.map(({ path, uploadUrl }) => {
|
|
1412
1412
|
const file = filesByPath.get(path);
|
|
1413
1413
|
if (!file) throw new Error(`Invariant: file not found for path: ${path}`);
|
|
1414
1414
|
return {
|
|
@@ -1416,7 +1416,8 @@ async function deploy(params) {
|
|
|
1416
1416
|
path: file.absolutePath,
|
|
1417
1417
|
contentType: file.contentType
|
|
1418
1418
|
};
|
|
1419
|
-
})
|
|
1419
|
+
});
|
|
1420
|
+
const uploadChunks = chunk(uploads, CHUNK_SIZE$1);
|
|
1420
1421
|
for (let i = 0; i < uploadChunks.length; i++) {
|
|
1421
1422
|
const uploadChunk = uploadChunks[i];
|
|
1422
1423
|
if (!uploadChunk) continue;
|
|
@@ -1439,7 +1440,8 @@ const require = createRequire(import.meta.url);
|
|
|
1439
1440
|
* Get the version of the @argos-ci/core package.
|
|
1440
1441
|
*/
|
|
1441
1442
|
async function getArgosCoreSDKIdentifier() {
|
|
1442
|
-
|
|
1443
|
+
const pkgPath = require.resolve("@argos-ci/core/package.json");
|
|
1444
|
+
return `@argos-ci/core@${await readVersionFromPackage(pkgPath)}`;
|
|
1443
1445
|
}
|
|
1444
1446
|
//#endregion
|
|
1445
1447
|
//#region src/skip.ts
|
|
@@ -1699,7 +1701,7 @@ const CHUNK_SIZE = 10;
|
|
|
1699
1701
|
* `updateBuild` request. Kept below the API request body size limit (3MB) to
|
|
1700
1702
|
* leave room for the rest of the body (build metadata, etc.).
|
|
1701
1703
|
*/
|
|
1702
|
-
const MAX_UPDATE_BUILD_SCREENSHOTS_BYTES =
|
|
1704
|
+
const MAX_UPDATE_BUILD_SCREENSHOTS_BYTES = 2097152;
|
|
1703
1705
|
const PLAYWRIGHT_TRACE_CONTENT_TYPE = "application/zip";
|
|
1704
1706
|
/**
|
|
1705
1707
|
* Upload screenshots to Argos.
|
|
@@ -1849,7 +1851,7 @@ async function upload(params) {
|
|
|
1849
1851
|
});
|
|
1850
1852
|
}) ?? []]);
|
|
1851
1853
|
debug("Updating build");
|
|
1852
|
-
const
|
|
1854
|
+
const screenshotInputs = snapshots.map((snapshot) => ({
|
|
1853
1855
|
key: snapshot.hash,
|
|
1854
1856
|
name: snapshot.name,
|
|
1855
1857
|
metadata: snapshot.metadata,
|
|
@@ -1858,7 +1860,8 @@ async function upload(params) {
|
|
|
1858
1860
|
baseName: snapshot.baseName,
|
|
1859
1861
|
parentName: snapshot.parentName,
|
|
1860
1862
|
contentType: snapshot.contentType
|
|
1861
|
-
}))
|
|
1863
|
+
}));
|
|
1864
|
+
const screenshotChunks = chunkBySize(screenshotInputs, MAX_UPDATE_BUILD_SCREENSHOTS_BYTES);
|
|
1862
1865
|
if (screenshotChunks.length === 0) screenshotChunks.push([]);
|
|
1863
1866
|
const groupsRequests = !config.parallel || config.parallelIndex != null;
|
|
1864
1867
|
let build = null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/core",
|
|
3
3
|
"description": "Node.js SDK for visual testing with Argos.",
|
|
4
|
-
"version": "6.7.
|
|
4
|
+
"version": "6.7.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"fast-glob": "^3.3.3",
|
|
47
47
|
"mime-types": "^3.0.2",
|
|
48
48
|
"p-retry": "^8.0.0",
|
|
49
|
-
"sharp": "^0.35.
|
|
49
|
+
"sharp": "^0.35.3",
|
|
50
50
|
"tmp": "^0.2.7"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/node": "catalog:",
|
|
58
58
|
"@types/tmp": "^0.2.6",
|
|
59
59
|
"@vercel/repository-dispatch": "^0.1.0",
|
|
60
|
-
"msw": "^2.
|
|
60
|
+
"msw": "^2.15.0",
|
|
61
61
|
"vitest": "catalog:"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"lint": "eslint .",
|
|
69
69
|
"test": "vitest"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "3268a9ff953f019494367e3bf87ea520268b6ed2"
|
|
72
72
|
}
|