@dogsbay/icons 0.2.0-beta.115 → 0.2.0-beta.117

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/registry.js +14 -1
  2. package/package.json +5 -3
package/dist/registry.js CHANGED
@@ -40,6 +40,15 @@ const EMOJI_MAP = {
40
40
  tada: "🎉", trophy: "🏆", medal: "🏅", crown: "👑",
41
41
  image: "🖼️",
42
42
  };
43
+ /** Iconify set prefixes → the library (and variant) names this registry uses. */
44
+ const ICONIFY_PREFIX_ALIASES = {
45
+ mdi: { library: "material" },
46
+ "simple-icons": { library: "simple" },
47
+ octicon: { library: "octicons" },
48
+ "fa6-solid": { library: "fontawesome", variant: "solid" },
49
+ "fa6-regular": { library: "fontawesome", variant: "regular" },
50
+ "fa6-brands": { library: "fontawesome", variant: "brands" },
51
+ };
43
52
  export class IconRegistry {
44
53
  resolvers = new Map();
45
54
  emojiMap = new Map(Object.entries(EMOJI_MAP));
@@ -72,7 +81,11 @@ export class IconRegistry {
72
81
  if (customResolver) {
73
82
  return customResolver.resolve(name, variant, size);
74
83
  }
75
- // Fall back to @iconify/json
84
+ // Fall back to @iconify/json. Iconify's own set prefixes (`mdi:home`, `simple-icons:github`,
85
+ // `fa6-solid:house`, `octicon:repo`) name the same packs as the library names.
86
+ const alias = ICONIFY_PREFIX_ALIASES[library];
87
+ if (alias)
88
+ return this.resolveIconify(alias.library, name, alias.variant ?? variant, size);
76
89
  return this.resolveIconify(library, name, variant, size);
77
90
  }
78
91
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dogsbay/icons",
3
- "version": "0.2.0-beta.115",
3
+ "version": "0.2.0-beta.117",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,7 +23,8 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.20.1",
26
- "typescript": "^5.9.3"
26
+ "typescript": "^5.9.3",
27
+ "vitest": "^4.1.10"
27
28
  },
28
29
  "license": "MIT",
29
30
  "repository": {
@@ -36,6 +37,7 @@
36
37
  "url": "https://github.com/dogsbay/dogsbay/issues"
37
38
  },
38
39
  "scripts": {
39
- "build": "tsc"
40
+ "build": "tsc",
41
+ "test": "vitest run"
40
42
  }
41
43
  }