@wkovacs64/add-icon 1.2.0 → 1.2.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/README.md CHANGED
@@ -3,6 +3,10 @@
3
3
  A command-line tool to download icons from the [Iconify Framework](https://iconify.design/) and
4
4
  apply custom transformations.
5
5
 
6
+ <!-- prettier-ignore -->
7
+ > [!WARNING]
8
+ > This is "vibe coded" AI slop. I did not write any of this code by hand. Use at your own risk.
9
+
6
10
  ## Installation
7
11
 
8
12
  Add it to your project:
package/bin/add-icon.js CHANGED
@@ -1,19 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import url from 'node:url';
4
- import path from 'node:path';
5
- import os from 'node:os';
6
3
  import { runCli } from '../dist/index.js';
7
4
 
8
- const __filename = url.fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- // This logic ensures we only run the CLI when this file is called directly
12
- // and not when it's imported as a module
13
- if (
14
- os.platform() === 'win32'
15
- ? process.argv[1] === __filename
16
- : process.argv[1] === __filename || process.argv[1] === __dirname
17
- ) {
18
- runCli();
19
- }
5
+ runCli();
package/dist/iconify.js CHANGED
@@ -34,7 +34,7 @@ async function fetchIconSvg(iconSet, iconName) {
34
34
  }
35
35
  catch (error) {
36
36
  const errorMessage = error instanceof Error ? error.message : String(error);
37
- throw new Error(`Failed to fetch icon SVG: ${errorMessage}`);
37
+ throw new Error(`Failed to fetch icon SVG: ${errorMessage}`, { cause: error });
38
38
  }
39
39
  }
40
40
  /**
@@ -76,6 +76,6 @@ export async function downloadIcon(iconReference, config) {
76
76
  }
77
77
  catch (error) {
78
78
  const errorMessage = error instanceof Error ? error.message : String(error);
79
- throw new Error(`Failed to download icon: ${errorMessage}`);
79
+ throw new Error(`Failed to download icon: ${errorMessage}`, { cause: error });
80
80
  }
81
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkovacs64/add-icon",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "CLI tool to download and transform icons from Iconify",
5
5
  "keywords": [
6
6
  "iconify",
@@ -34,39 +34,37 @@
34
34
  "dist",
35
35
  "bin"
36
36
  ],
37
+ "prettier": "@wkovacs64/prettier-config",
38
+ "engines": {
39
+ "node": ">=20.19.0"
40
+ },
41
+ "dependencies": {
42
+ "commander": "^14.0.0",
43
+ "esbuild": "~0.27.0",
44
+ "typescript": "^5.8.3"
45
+ },
46
+ "devDependencies": {
47
+ "@arethetypeswrong/cli": "0.18.2",
48
+ "@changesets/changelog-github": "0.5.2",
49
+ "@changesets/cli": "2.29.8",
50
+ "@types/node": "24.10.13",
51
+ "@wkovacs64/eslint-config": "7.12.0",
52
+ "@wkovacs64/prettier-config": "4.2.4",
53
+ "del-cli": "7.0.0",
54
+ "eslint": "9.39.3",
55
+ "npm-run-all2": "8.0.4",
56
+ "prettier": "3.8.1"
57
+ },
37
58
  "scripts": {
38
59
  "build": "tsc",
39
60
  "clean": "del-cli dist",
40
- "prebuild": "npm run --silent clean",
41
- "prepublishOnly": "run-p --silent lint typecheck build",
61
+ "prebuild": "pnpm run --silent clean",
42
62
  "typecheck": "attw --pack --profile esm-only",
43
63
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
44
64
  "format": "prettier --cache --write .",
45
65
  "format:check": "prettier --cache --check .",
46
66
  "changeset": "changeset",
47
- "changeset:version": "changeset version && npm install --package-lock-only",
67
+ "changeset:version": "changeset version && pnpm install",
48
68
  "changeset:publish": "changeset publish"
49
- },
50
- "prettier": "@wkovacs64/prettier-config",
51
- "engines": {
52
- "node": ">=20.19.0"
53
- },
54
- "dependencies": {
55
- "commander": "^13.1.0",
56
- "esbuild": "~0.25.2",
57
- "typescript": "^5.8.3"
58
- },
59
- "devDependencies": {
60
- "@arethetypeswrong/cli": "0.17.4",
61
- "@changesets/changelog-github": "0.5.1",
62
- "@changesets/cli": "2.29.1",
63
- "@types/node": "22.14.1",
64
- "@wkovacs64/eslint-config": "7.5.2",
65
- "@wkovacs64/prettier-config": "4.1.1",
66
- "del-cli": "6.0.0",
67
- "eslint": "9.24.0",
68
- "npm-run-all2": "7.0.2",
69
- "prettier": "3.5.3",
70
- "tsx": "4.19.3"
71
69
  }
72
- }
70
+ }