@argos-ci/core 1.3.0 → 1.4.1
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.mjs +15 -8
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -455,14 +455,21 @@ const discoverScreenshots = async (patterns, { root = process.cwd(), ignore } =
|
|
|
455
455
|
|
|
456
456
|
const tmpFile = promisify(tmp.file);
|
|
457
457
|
const optimizeScreenshot = async (filepath)=>{
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
458
|
+
try {
|
|
459
|
+
const resultFilePath = await tmpFile();
|
|
460
|
+
await sharp(filepath).resize(2048, 20480, {
|
|
461
|
+
fit: "inside",
|
|
462
|
+
withoutEnlargement: true
|
|
463
|
+
}).png({
|
|
464
|
+
force: true
|
|
465
|
+
}).toFile(resultFilePath);
|
|
466
|
+
return resultFilePath;
|
|
467
|
+
} catch (error) {
|
|
468
|
+
const message = error instanceof Error ? error.message : "Unknown Error";
|
|
469
|
+
throw new Error(`Error while processing image (${filepath}): ${message}`, {
|
|
470
|
+
cause: error
|
|
471
|
+
});
|
|
472
|
+
}
|
|
466
473
|
};
|
|
467
474
|
|
|
468
475
|
const hashFile = async (filepath)=>{
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/core",
|
|
3
3
|
"description": "Visual testing solution to avoid visual regression. The core component of Argos SDK that handles build creation.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
10
11
|
"require": "./dist/index.cjs",
|
|
11
12
|
"import": "./dist/index.mjs",
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
13
|
"default": "./dist/index.mjs"
|
|
14
14
|
},
|
|
15
15
|
"./package.json": "./package.json"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@argos-ci/util": "1.
|
|
43
|
+
"@argos-ci/util": "1.2.0",
|
|
44
44
|
"axios": "^1.5.0",
|
|
45
45
|
"convict": "^6.2.4",
|
|
46
46
|
"debug": "^4.3.4",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"build": "rollup -c",
|
|
60
60
|
"e2e": "node ./e2e/upload.cjs && node ./e2e/upload.mjs"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b601673bab3248f9a615ded0cca76af78830eeec"
|
|
63
63
|
}
|