@argos-ci/core 6.4.0 → 6.5.3
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 +32 -4
- package/dist/index.d.mts +9 -3
- package/dist/index.mjs +12 -12
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -7,17 +7,45 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
<p align="center"><strong>The open source visual testing
|
|
10
|
+
<p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
|
|
11
11
|
|
|
12
|
-
# Argos
|
|
12
|
+
# Argos Node.js SDK
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Node.js SDK for visual testing with Argos. It powers the Argos CLI and the higher-level integrations (Playwright, Cypress, …), and can be used directly to upload screenshots from Node.js.
|
|
15
15
|
|
|
16
16
|
[](https://www.npmjs.com/package/@argos-ci/core)
|
|
17
17
|
[](https://www.npmjs.com/package/@argos-ci/core)
|
|
18
18
|
[](https://www.npmjs.com/package/@argos-ci/core)
|
|
19
19
|
|
|
20
|
+
Visit the [Node.js SDK documentation](https://argos-ci.com/docs/sdks-reference/node.js-sdk) for guides, the API reference, and more.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install @argos-ci/core
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Upload a directory of screenshots to Argos and create a build:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { upload } from "@argos-ci/core";
|
|
34
|
+
|
|
35
|
+
const { build } = await upload({
|
|
36
|
+
// Directory containing the screenshots.
|
|
37
|
+
root: "./screenshots",
|
|
38
|
+
// Globs matching the screenshots to upload.
|
|
39
|
+
files: ["**/*.png"],
|
|
40
|
+
// Defaults to the ARGOS_TOKEN environment variable.
|
|
41
|
+
token: process.env.ARGOS_TOKEN,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
console.log(`Build created: ${build.url}`);
|
|
45
|
+
```
|
|
46
|
+
|
|
20
47
|
## Links
|
|
21
48
|
|
|
22
|
-
- [Official SDK Docs](https://argos-ci.com/docs)
|
|
49
|
+
- [Official SDK Docs](https://argos-ci.com/docs/sdks-reference/node.js-sdk)
|
|
23
50
|
- [API Reference](https://js-sdk-reference.argos-ci.com)
|
|
51
|
+
- [Discord](https://argos-ci.com/discord)
|
package/dist/index.d.mts
CHANGED
|
@@ -101,7 +101,7 @@ interface Config {
|
|
|
101
101
|
* Build mode to use.
|
|
102
102
|
* - "ci": Review visual changes introduced by a feature branch and prevent regressions.
|
|
103
103
|
* - "monitoring": Track visual changes outside the standard CI flow, either on a schedule or before a release.
|
|
104
|
-
* @see https://argos-ci.com/docs/build-modes
|
|
104
|
+
* @see https://argos-ci.com/docs/learn/platform-fundamentals/build-modes
|
|
105
105
|
*/
|
|
106
106
|
mode: "ci" | "monitoring" | null;
|
|
107
107
|
/**
|
|
@@ -248,6 +248,12 @@ declare function finalize(params: FinalizeParameters): Promise<{
|
|
|
248
248
|
}[];
|
|
249
249
|
}>;
|
|
250
250
|
//#endregion
|
|
251
|
+
//#region src/mime-type.d.ts
|
|
252
|
+
/**
|
|
253
|
+
* Get the mime type of a snapshot file based on its extension.
|
|
254
|
+
*/
|
|
255
|
+
declare function getSnapshotMimeType(filepath: string): string;
|
|
256
|
+
//#endregion
|
|
251
257
|
//#region src/upload.d.ts
|
|
252
258
|
type BuildMetadata = ArgosAPISchema.components["schemas"]["BuildMetadata"];
|
|
253
259
|
interface UploadParameters {
|
|
@@ -301,7 +307,7 @@ interface UploadParameters {
|
|
|
301
307
|
* Build mode to use.
|
|
302
308
|
* - "ci": Review the visual changes introduced by a feature branch and prevent regressions.
|
|
303
309
|
* - "monitoring": Track visual changes outside the standard CI flow, either on a schedule or before a release.
|
|
304
|
-
* @see https://argos-ci.com/docs/build-modes
|
|
310
|
+
* @see https://argos-ci.com/docs/learn/platform-fundamentals/build-modes
|
|
305
311
|
* @default "ci"
|
|
306
312
|
*/
|
|
307
313
|
mode?: "ci" | "monitoring";
|
|
@@ -381,4 +387,4 @@ declare function skip(params: SkipParameters): Promise<{
|
|
|
381
387
|
build: ArgosAPISchema.components["schemas"]["Build"];
|
|
382
388
|
}>;
|
|
383
389
|
//#endregion
|
|
384
|
-
export { Config, DeployParameters, FinalizeParameters, UploadParameters, deploy, finalize, getConfigFromOptions, readConfig, skip, upload };
|
|
390
|
+
export { Config, DeployParameters, FinalizeParameters, UploadParameters, deploy, finalize, getConfigFromOptions, getSnapshotMimeType, readConfig, skip, upload };
|
package/dist/index.mjs
CHANGED
|
@@ -336,7 +336,7 @@ To resolve this, Argos requires a GITHUB_TOKEN to fetch the pull request associa
|
|
|
336
336
|
|
|
337
337
|
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
338
338
|
|
|
339
|
-
For more details, check out the documentation: Read more at https://argos-ci.com/docs/run-on-preview-
|
|
339
|
+
For more details, check out the documentation: Read more at https://argos-ci.com/docs/learn/how-to-guides/ci-pipelines/run-on-preview-deployments
|
|
340
340
|
|
|
341
341
|
If you want to disable this warning, you can set the following environment variable:
|
|
342
342
|
|
|
@@ -1385,6 +1385,16 @@ async function finalize(params) {
|
|
|
1385
1385
|
return finalizeBuildsResult.data;
|
|
1386
1386
|
}
|
|
1387
1387
|
//#endregion
|
|
1388
|
+
//#region src/mime-type.ts
|
|
1389
|
+
/**
|
|
1390
|
+
* Get the mime type of a snapshot file based on its extension.
|
|
1391
|
+
*/
|
|
1392
|
+
function getSnapshotMimeType(filepath) {
|
|
1393
|
+
const type = mime.lookup(filepath);
|
|
1394
|
+
if (!type) throw new Error(`Unable to determine snapshot file type for: ${filepath}`);
|
|
1395
|
+
return type;
|
|
1396
|
+
}
|
|
1397
|
+
//#endregion
|
|
1388
1398
|
//#region src/discovery.ts
|
|
1389
1399
|
/**
|
|
1390
1400
|
* Discover snapshots in the given root directory matching the provided patterns.
|
|
@@ -1562,16 +1572,6 @@ async function resolveBaseline(params) {
|
|
|
1562
1572
|
};
|
|
1563
1573
|
}
|
|
1564
1574
|
//#endregion
|
|
1565
|
-
//#region src/mime-type.ts
|
|
1566
|
-
/**
|
|
1567
|
-
* Get the mime type of a snapshot file based on its extension.
|
|
1568
|
-
*/
|
|
1569
|
-
function getSnapshotMimeType(filepath) {
|
|
1570
|
-
const type = mime.lookup(filepath);
|
|
1571
|
-
if (!type) throw new Error(`Unable to determine snapshot file type for: ${filepath}`);
|
|
1572
|
-
return type;
|
|
1573
|
-
}
|
|
1574
|
-
//#endregion
|
|
1575
1575
|
//#region src/skip.ts
|
|
1576
1576
|
/**
|
|
1577
1577
|
* Mark a build as skipped.
|
|
@@ -1832,4 +1832,4 @@ function formatPreviewUrl(url, formatter) {
|
|
|
1832
1832
|
return new URL(urlObj.pathname + urlObj.search + urlObj.hash, formatter.baseUrl).href;
|
|
1833
1833
|
}
|
|
1834
1834
|
//#endregion
|
|
1835
|
-
export { deploy, finalize, getConfigFromOptions, readConfig, skip, upload };
|
|
1835
|
+
export { deploy, finalize, getConfigFromOptions, getSnapshotMimeType, readConfig, skip, upload };
|
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.
|
|
4
|
+
"version": "6.5.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"url": "https://github.com/argos-ci/argos-javascript.git",
|
|
19
19
|
"directory": "packages/core"
|
|
20
20
|
},
|
|
21
|
-
"homepage": "https://argos-ci.com/docs/node-sdk",
|
|
21
|
+
"homepage": "https://argos-ci.com/docs/sdks-reference/node.js-sdk",
|
|
22
22
|
"bugs": {
|
|
23
23
|
"url": "https://github.com/argos-ci/argos-javascript/issues"
|
|
24
24
|
},
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@argos-ci/api-client": "0.24.
|
|
43
|
-
"@argos-ci/util": "4.0.
|
|
42
|
+
"@argos-ci/api-client": "0.24.4",
|
|
43
|
+
"@argos-ci/util": "4.0.4",
|
|
44
44
|
"convict": "^6.2.5",
|
|
45
45
|
"debug": "^4.4.3",
|
|
46
46
|
"fast-glob": "^3.3.3",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"lint": "eslint .",
|
|
69
69
|
"test": "vitest"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "1b25b7c1109a3d032d627c5f9d2f2c3937731aea"
|
|
72
72
|
}
|