@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.
Files changed (2) hide show
  1. package/dist/index.mjs +15 -8
  2. 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
- const resultFilePath = await tmpFile();
459
- await sharp(filepath).resize(2048, 20480, {
460
- fit: "inside",
461
- withoutEnlargement: true
462
- }).png({
463
- force: true
464
- }).toFile(resultFilePath);
465
- return resultFilePath;
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.3.0",
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.1.0",
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": "8022e7391f8bd156e23a83b5da0ce452e28e324e"
62
+ "gitHead": "b601673bab3248f9a615ded0cca76af78830eeec"
63
63
  }