pakstr 0.18.0 → 0.18.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.
@@ -38,18 +38,18 @@ async function resolveAppIcon(input) {
38
38
  }
39
39
  if (input.configuredIcon !== undefined) {
40
40
  const configured = (0, assetPath_1.resolveAssetPath)(input.configuredIcon, configDir);
41
- if (!fs_1.default.existsSync(configured) || !fs_1.default.lstatSync(configured).isFile()) {
42
- throw new Error(`❌ Icon not found or not a regular file: ${configured}`);
43
- }
44
41
  try {
42
+ if (!fs_1.default.existsSync(configured) || !fs_1.default.lstatSync(configured).isFile()) {
43
+ throw new Error("not found or not a regular file");
44
+ }
45
45
  const metadata = await (0, sharp_1.default)(configured).metadata();
46
46
  if (!metadata.width || !metadata.height)
47
47
  throw new Error("image has no dimensions");
48
+ return { path: configured, source: "configured" };
48
49
  }
49
50
  catch (error) {
50
- throw new Error(`❌ Invalid configured icon ${configured}: ${error instanceof Error ? error.message : String(error)}`);
51
+ console.warn(`⚠️ Ignoring unsuitable configured icon ${configured}: ${error instanceof Error ? error.message : String(error)}`);
51
52
  }
52
- return { path: configured, source: "configured" };
53
53
  }
54
54
  return { path: input.defaultIcon, source: "default" };
55
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pakstr",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "CLI for packaging Nostr web apps into Android APKs",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",