@kayjs/icons 2.0.0-alpha.5 → 2.0.0-alpha.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kayjs/icons",
3
- "version": "2.0.0-alpha.5",
3
+ "version": "2.0.0-alpha.7",
4
4
  "description": "Compile-time Iconify SVG icon plugin (~icons/<set>/<name>) for Kay v2",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,6 +21,6 @@
21
21
  "directory": "packages/plugin-icons"
22
22
  },
23
23
  "peerDependencies": {
24
- "kay": "^2.0.0-alpha.5"
24
+ "kay": "^2.0.0-alpha.7"
25
25
  }
26
26
  }
package/src/Icon.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource kay */
1
2
  import type { IconData } from './types'
2
3
 
3
4
  export interface IconComponentProps {
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference path="./ambient.d.ts" />
1
2
  // @kayjs/icons — Zero-runtime inline SVG icons from @iconify-json/* via `import arrow from '~icons/tabler/arrow-right'`.
2
3
  // Built strictly on the public KayPlugin API (bunPlugins).
3
4
 
@@ -96,7 +97,12 @@ export function icons(options: IconsPluginOptions = {}): KayPlugin {
96
97
  resolved = Bun.resolveSync(pkgPath, root)
97
98
  }
98
99
  catch {
99
- throw new Error(`@kayjs/icons: could not resolve "${pkgPath}". Install @iconify-json/${prefix}.`)
100
+ try {
101
+ resolved = Bun.resolveSync(pkgPath, process.cwd())
102
+ }
103
+ catch {
104
+ throw new Error(`@kayjs/icons: could not resolve "${pkgPath}". Install @iconify-json/${prefix}.`)
105
+ }
100
106
  }
101
107
  set = await Bun.file(resolved).json() as IconSet
102
108
  cache.set(prefix, set)