@stacksjs/iconify-generator 0.2.413 → 0.2.415

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/dist/cli.js CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var O=import.meta.require;import{mkdir as S,writeFile as K}from"fs/promises";import{join as T}from"path";var Z="https://api.iconify.design";async function q(){let y=await fetch(`${Z}/collections`);if(!y.ok)throw Error(`Failed to fetch collections: ${y.statusText}`);return await y.json()}async function _(y,g){try{let G=O.resolve("/home/runner/work/stx/stx/node_modules/@iconify/json/dist/index.cjs"),k=`${`${G.substring(0,G.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${y}.json`,U=Bun.file(k);if(await U.exists()){let E=await U.json();if(g&&g.length>0){let v={};for(let Q of g)if(E.icons[Q])v[Q]=E.icons[Q];return{...E,icons:v}}return E}}catch{}let u=g&&g.length>0?`${Z}/${y}.json?icons=${g.join(",")}`:`${Z}/${y}.json`,$=await fetch(u);if(!$.ok)throw Error(`Failed to fetch icons for ${y}: ${$.statusText}`);return await $.json()}function j(y,g=24,u=24){return{body:y.body,width:y.width||g,height:y.height||u,viewBox:`0 0 ${y.width||g} ${y.height||u}`}}function F(y,g){let u=L(y);return`import type { IconData } from '@stacksjs/iconify-core'
3
+ var v=import.meta.require;import{join as J}from"path";import g from"process";import{mkdir as x,writeFile as m}from"fs/promises";import{join as d}from"path";var I="https://api.iconify.design";async function b(){let t=await fetch(`${I}/collections`);if(!t.ok)throw Error(`Failed to fetch collections: ${t.statusText}`);return await t.json()}async function A(t,e){try{let i=v.resolve("/home/runner/work/stx/stx/node_modules/@iconify/json/dist/index.cjs"),a=`${`${i.substring(0,i.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${t}.json`,r=Bun.file(a);if(await r.exists()){let l=await r.json();if(e&&e.length>0){let p={};for(let f of e)if(l.icons[f])p[f]=l.icons[f];return{...l,icons:p}}return l}}catch{}let n=e&&e.length>0?`${I}/${t}.json?icons=${e.join(",")}`:`${I}/${t}.json`,s=await fetch(n);if(!s.ok)throw Error(`Failed to fetch icons for ${t}: ${s.statusText}`);return await s.json()}function E(t,e=24,n=24){return{body:t.body,width:t.width||e,height:t.height||n,viewBox:`0 0 ${t.width||e} ${t.height||n}`}}function U(t,e){let n=h(t);return`import type { IconData } from '@stacksjs/iconify-core'
4
4
 
5
- export const ${u}: IconData = ${JSON.stringify(g,null,2)}
5
+ export const ${n}: IconData = ${JSON.stringify(e,null,2)}
6
6
 
7
- export default ${u}
8
- `}function s(y,g){return`<script>
7
+ export default ${n}
8
+ `}function _(t,e){return`<script>
9
9
  // Get props with defaults (handle undefined)
10
- const iconWidth = (typeof width !== 'undefined' ? width : null) || (typeof size !== 'undefined' ? size : null) || ${g.width||24}
11
- const iconHeight = (typeof height !== 'undefined' ? height : null) || (typeof size !== 'undefined' ? size : null) || ${g.height||24}
10
+ const iconWidth = (typeof width !== 'undefined' ? width : null) || (typeof size !== 'undefined' ? size : null) || ${e.width||24}
11
+ const iconHeight = (typeof height !== 'undefined' ? height : null) || (typeof size !== 'undefined' ? size : null) || ${e.height||24}
12
12
  const iconColor = typeof color !== 'undefined' ? color : 'currentColor'
13
- const viewBox = "${g.viewBox||`0 0 ${g.width||24} ${g.height||24}`}"
13
+ const viewBox = "${e.viewBox||`0 0 ${e.width||24} ${e.height||24}`}"
14
14
 
15
15
  // Build transform
16
16
  const transforms = []
@@ -34,7 +34,7 @@ const styleAttr = styles.length > 0 ? \` style="\${styles.join(' ')}"\` : ''
34
34
  const classAttr = typeof className !== 'undefined' && className ? \` class="\${className}"\` : ''
35
35
 
36
36
  // Icon body
37
- let body = ${JSON.stringify(g.body)}
37
+ let body = ${JSON.stringify(e.body)}
38
38
  if (iconColor && iconColor !== 'currentColor') {
39
39
  body = body.replace(/currentColor/g, iconColor)
40
40
  }
@@ -44,17 +44,17 @@ const svg = \`<svg xmlns="http://www.w3.org/2000/svg" width="\${iconWidth}" heig
44
44
  </script>
45
45
 
46
46
  {!! svg !!}
47
- `}function N(y){let g=new Set;return`// Icon data exports
48
- ${y.map(($)=>{let b=L($);if(g.has(b)){let k=$.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(k))k=`_${k}`;b=k;let U=2;while(g.has(b))b=`${k}_${U}`,U++}return g.add(b),`export { default as ${b} } from './${$}.js'`}).join(`
47
+ `}function N(t){let e=new Set;return`// Icon data exports
48
+ ${t.map((s)=>{let o=h(s);if(e.has(o)){let a=s.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(a))a=`_${a}`;o=a;let r=2;while(e.has(o))o=`${a}_${r}`,r++}return e.add(o),`export { default as ${o} } from './${s}.js'`}).join(`
49
49
  `)}
50
50
 
51
51
  export * from './types.js'
52
- `}function d(y){return`import type { IconData, IconProps } from '@stacksjs/iconify-core'
52
+ `}function R(t){return`import type { IconData, IconProps } from '@stacksjs/iconify-core'
53
53
 
54
54
  export type { IconData, IconProps }
55
55
 
56
- export type ${f(y)}Icon = IconData
57
- `}function D(y,g,u){let $={name:`@stacksjs/iconify-${y}`,type:"module",version:"0.0.1",description:`${g.name} icons for stx from Iconify`,author:g.author?.name||"Iconify",license:g.license?.spdx||"MIT",repository:{type:"git",url:"https://github.com/stacksjs/stx.git",directory:`packages/iconify-${y}`},keywords:["iconify","icons","svg",y,g.name,"stx"],sideEffects:!1,exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./*":"./dist/*"},main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist"],scripts:{build:"bun build.ts",prepublishOnly:"bun build.ts"},dependencies:{"@stacksjs/iconify-core":"workspace:*"}};return JSON.stringify($,null,2)}function r(y){return`import { existsSync, readdirSync, statSync } from 'node:fs'
56
+ export type ${Y(t)}Icon = IconData
57
+ `}function O(t,e,n){let s={name:`@stacksjs/iconify-${t}`,type:"module",version:"0.0.1",description:`${e.name} icons for stx from Iconify`,author:e.author?.name||"Iconify",license:e.license?.spdx||"MIT",repository:{type:"git",url:"https://github.com/stacksjs/stx.git",directory:`packages/iconify-${t}`},keywords:["iconify","icons","svg",t,e.name,"stx"],sideEffects:!1,exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./*":"./dist/*"},main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist"],scripts:{build:"bun build.ts",prepublishOnly:"bun build.ts"},dependencies:{"@stacksjs/iconify-core":"workspace:*"}};return JSON.stringify(s,null,2)}function W(t){return`import { existsSync, readdirSync, statSync } from 'node:fs'
58
58
  import { dirname, join } from 'node:path'
59
59
  import { fileURLToPath } from 'node:url'
60
60
  import dts from 'bun-plugin-dtsx'
@@ -89,7 +89,7 @@ function isDistFresh() {
89
89
  }
90
90
 
91
91
  if (isDistFresh()) {
92
- console.log('\u2713 @stacksjs/iconify-${y} dist is fresh, skipping rebuild')
92
+ console.log('\u2713 @stacksjs/iconify-${t} dist is fresh, skipping rebuild')
93
93
  } else {
94
94
  await Bun.build({
95
95
  entrypoints: [join(srcDir, 'index.ts')],
@@ -101,16 +101,16 @@ if (isDistFresh()) {
101
101
  sourcemap: 'external',
102
102
  splitting: true,
103
103
  })
104
- console.log('\u2713 Built @stacksjs/iconify-${y}')
104
+ console.log('\u2713 Built @stacksjs/iconify-${t}')
105
105
  }
106
- `}function C(y,g,u){return`# @stacksjs/iconify-${y}
106
+ `}function M(t,e,n){return`# @stacksjs/iconify-${t}
107
107
 
108
- ${g.name} icons for stx from Iconify.
108
+ ${e.name} icons for stx from Iconify.
109
109
 
110
110
  ## Installation
111
111
 
112
112
  \`\`\`bash
113
- bun add @stacksjs/iconify-${y}
113
+ bun add @stacksjs/iconify-${t}
114
114
  \`\`\`
115
115
 
116
116
  ## Usage
@@ -119,7 +119,7 @@ bun add @stacksjs/iconify-${y}
119
119
 
120
120
  \`\`\`html
121
121
  <script>
122
- import { home } from '@stacksjs/iconify-${y}'
122
+ import { home } from '@stacksjs/iconify-${t}'
123
123
  import { renderIcon } from '@stacksjs/iconify-core'
124
124
 
125
125
  export const homeIcon = renderIcon(home, { size: 24, color: 'currentColor' })
@@ -133,7 +133,7 @@ bun add @stacksjs/iconify-${y}
133
133
  ### In TypeScript/JavaScript
134
134
 
135
135
  \`\`\`typescript
136
- import { home, account, settings } from '@stacksjs/iconify-${y}'
136
+ import { home, account, settings } from '@stacksjs/iconify-${t}'
137
137
  import { renderIcon } from '@stacksjs/iconify-core'
138
138
 
139
139
  const svg = renderIcon(home, {
@@ -144,38 +144,38 @@ const svg = renderIcon(home, {
144
144
 
145
145
  ## Available Icons
146
146
 
147
- This package contains ${u} icons from ${g.name}.
147
+ This package contains ${n} icons from ${e.name}.
148
148
 
149
149
  ## License
150
150
 
151
- ${g.license?.title||"MIT"}
151
+ ${e.license?.title||"MIT"}
152
152
 
153
- ${g.license?.url?`License: ${g.license.url}`:""}
153
+ ${e.license?.url?`License: ${e.license.url}`:""}
154
154
 
155
155
  ## Credits
156
156
 
157
- - Icons: ${g.author?.name||"Iconify"}${g.author?.url?` (${g.author.url})`:""}
157
+ - Icons: ${e.author?.name||"Iconify"}${e.author?.url?` (${e.author.url})`:""}
158
158
  - Iconify: https://iconify.design/
159
- `}function x(y,g,u){let $=u.length,G=u.slice(0,5).map(L),b=G.map((U)=>`${U.charAt(0).toUpperCase()}${U.slice(1)}Icon`),k=u.map((U)=>{return`- \`${L(U)}\``}).join(`
160
- `);return`# ${g.name}
159
+ `}function B(t,e,n){let s=n.length,i=n.slice(0,5).map(h),o=i.map((r)=>`${r.charAt(0).toUpperCase()}${r.slice(1)}Icon`),a=n.map((r)=>`- \`${h(r)}\``).join(`
160
+ `);return`# ${e.name}
161
161
 
162
- > ${g.name} icons for stx from Iconify
162
+ > ${e.name} icons for stx from Iconify
163
163
 
164
164
  ## Overview
165
165
 
166
- This package provides access to ${$} icons from the ${g.name} collection through the stx iconify integration.
166
+ This package provides access to ${s} icons from the ${e.name} collection through the stx iconify integration.
167
167
 
168
- **Collection ID:** \`${y}\`
169
- **Total Icons:** ${$}
170
- ${g.author?.name?`**Author:** ${g.author.name}${g.author.url?` ([Website](${g.author.url}))`:""}`:""}
171
- ${g.license?.title?`**License:** ${g.license.title}${g.license.url?` ([Details](${g.license.url}))`:""}`:""}
172
- ${g.category?`**Category:** ${g.category}`:""}
173
- ${g.palette!==void 0?`**Palette:** ${g.palette?"Yes (color icons)":"No (monotone icons)"}`:""}
168
+ **Collection ID:** \`${t}\`
169
+ **Total Icons:** ${s}
170
+ ${e.author?.name?`**Author:** ${e.author.name}${e.author.url?` ([Website](${e.author.url}))`:""}`:""}
171
+ ${e.license?.title?`**License:** ${e.license.title}${e.license.url?` ([Details](${e.license.url}))`:""}`:""}
172
+ ${e.category?`**Category:** ${e.category}`:""}
173
+ ${e.palette!==void 0?`**Palette:** ${e.palette?"Yes (color icons)":"No (monotone icons)"}`:""}
174
174
 
175
175
  ## Installation
176
176
 
177
177
  \`\`\`bash
178
- bun add @stacksjs/iconify-${y}
178
+ bun add @stacksjs/iconify-${t}
179
179
  \`\`\`
180
180
 
181
181
  ## Quick Start
@@ -185,30 +185,30 @@ bun add @stacksjs/iconify-${y}
185
185
  Icons are available as .stx components that can be used directly in templates:
186
186
 
187
187
  \`\`\`html
188
- <${b[0]||"Icon"} height="1em" />
189
- <${b[0]||"Icon"} width="1em" height="1em" />
190
- <${b[0]||"Icon"} height="24" />
188
+ <${o[0]||"Icon"} height="1em" />
189
+ <${o[0]||"Icon"} width="1em" height="1em" />
190
+ <${o[0]||"Icon"} height="24" />
191
191
  \`\`\`
192
192
 
193
193
  ### With Properties
194
194
 
195
195
  \`\`\`html
196
196
  <!-- Using size property -->
197
- <${b[0]||"Icon"} size="24" />
198
- <${b[0]||"Icon"} size="1em" />
197
+ <${o[0]||"Icon"} size="24" />
198
+ <${o[0]||"Icon"} size="1em" />
199
199
 
200
200
  <!-- Using width and height -->
201
- <${b[0]||"Icon"} width="24" height="32" />
201
+ <${o[0]||"Icon"} width="24" height="32" />
202
202
 
203
203
  <!-- With color -->
204
- <${b[0]||"Icon"} size="24" color="red" />
205
- <${b[0]||"Icon"} size="24" color="#4a90e2" />
204
+ <${o[0]||"Icon"} size="24" color="red" />
205
+ <${o[0]||"Icon"} size="24" color="#4a90e2" />
206
206
 
207
207
  <!-- With CSS class -->
208
- <${b[0]||"Icon"} size="24" class="icon-primary" />
208
+ <${o[0]||"Icon"} size="24" class="icon-primary" />
209
209
 
210
210
  <!-- With all properties -->
211
- <${b[0]||"Icon"}
211
+ <${o[0]||"Icon"}
212
212
  size="32"
213
213
  color="#4a90e2"
214
214
  class="my-icon"
@@ -233,9 +233,9 @@ Icons are available as .stx components that can be used directly in templates:
233
233
  </head>
234
234
  <body>
235
235
  <div class="icon-grid">
236
- <${b[0]||"Icon"} size="24" />
237
- <${b[1]||"Icon"} size="24" color="#4a90e2" />
238
- <${b[2]||"Icon"} size="32" class="my-icon" />
236
+ <${o[0]||"Icon"} size="24" />
237
+ <${o[1]||"Icon"} size="24" color="#4a90e2" />
238
+ <${o[2]||"Icon"} size="32" class="my-icon" />
239
239
  </div>
240
240
  </body>
241
241
  </html>
@@ -246,10 +246,10 @@ Icons are available as .stx components that can be used directly in templates:
246
246
  You can also import icon data and use the \`renderIcon\` function directly:
247
247
 
248
248
  \`\`\`typescript
249
- import { ${G.slice(0,3).join(", ")} } from '@stacksjs/iconify-${y}'
249
+ import { ${i.slice(0,3).join(", ")} } from '@stacksjs/iconify-${t}'
250
250
  import { renderIcon } from '@stacksjs/iconify-core'
251
251
 
252
- const svg = renderIcon(${G[0]||"icon"}, { size: 24 })
252
+ const svg = renderIcon(${i[0]||"icon"}, { size: 24 })
253
253
  \`\`\`
254
254
 
255
255
  ## Icon Properties
@@ -270,23 +270,23 @@ All icon component functions and \`renderIcon\` accept the following properties:
270
270
 
271
271
  ## Color
272
272
 
273
- ${g.palette?`### Color Icons
273
+ ${e.palette?`### Color Icons
274
274
 
275
275
  This collection contains color icons. While you can still set a color property, it may override the original colors.`:"### Monotone Icons\n\nMonotone icons use `currentColor` by default, allowing you to change icon color via the `color` property or CSS:"}
276
276
 
277
277
  \`\`\`html
278
278
  <!-- Via color property -->
279
- <${b[0]||"Icon"} size="24" color="red" />
280
- <${b[0]||"Icon"} size="24" color="#4a90e2" />
279
+ <${o[0]||"Icon"} size="24" color="red" />
280
+ <${o[0]||"Icon"} size="24" color="#4a90e2" />
281
281
 
282
282
  <!-- Via inline style -->
283
- <${b[0]||"Icon"} size="24" style="color: green;" />
283
+ <${o[0]||"Icon"} size="24" style="color: green;" />
284
284
 
285
285
  <!-- Via CSS class -->
286
- <${b[0]||"Icon"} size="24" class="text-primary" />
286
+ <${o[0]||"Icon"} size="24" class="text-primary" />
287
287
  \`\`\`
288
288
 
289
- ${!g.palette?`\`\`\`css
289
+ ${!e.palette?`\`\`\`css
290
290
  /* In your CSS */
291
291
  .text-primary {
292
292
  color: #4a90e2;
@@ -322,16 +322,16 @@ You do not need to set both properties. If you set one property, the other prope
322
322
  **Examples:**
323
323
 
324
324
  \`\`\`html
325
- <${b[0]||"DraftsIcon"} height="1em" />
326
- <${b[0]||"DraftsIcon"} width="1em" height="1em" />
327
- <${b[0]||"DraftsIcon"} height="24" />
325
+ <${o[0]||"DraftsIcon"} height="1em" />
326
+ <${o[0]||"DraftsIcon"} width="1em" height="1em" />
327
+ <${o[0]||"DraftsIcon"} height="24" />
328
328
  \`\`\`
329
329
 
330
330
  You can also use the \`size\` property as a shorthand for setting both width and height:
331
331
 
332
332
  \`\`\`html
333
- <${b[0]||"DraftsIcon"} size="24" />
334
- <${b[0]||"DraftsIcon"} size="1em" />
333
+ <${o[0]||"DraftsIcon"} size="24" />
334
+ <${o[0]||"DraftsIcon"} size="1em" />
335
335
  \`\`\`
336
336
 
337
337
  ### CSS Sizing
@@ -339,21 +339,21 @@ You can also use the \`size\` property as a shorthand for setting both width and
339
339
  You can also control icon size via CSS:
340
340
 
341
341
  \`\`\`css
342
- .${L(y)}-icon {
342
+ .${h(t)}-icon {
343
343
  width: 1em;
344
344
  height: 1em;
345
345
  }
346
346
  \`\`\`
347
347
 
348
348
  \`\`\`html
349
- <${b[0]||"DraftsIcon"} class="${L(y)}-icon" />
349
+ <${o[0]||"DraftsIcon"} class="${h(t)}-icon" />
350
350
  \`\`\`
351
351
 
352
352
  ## Available Icons
353
353
 
354
- This package contains **${$}** icons:
354
+ This package contains **${s}** icons:
355
355
 
356
- ${k}
356
+ ${a}
357
357
 
358
358
  ## Usage Examples
359
359
 
@@ -361,10 +361,10 @@ ${k}
361
361
 
362
362
  \`\`\`html
363
363
  <nav>
364
- <a href="/"><${b[0]||"Icon"} size="20" class="nav-icon" /> Home</a>
365
- <a href="/about"><${b[1]||"Icon"} size="20" class="nav-icon" /> About</a>
366
- <a href="/contact"><${b[2]||"Icon"} size="20" class="nav-icon" /> Contact</a>
367
- <a href="/settings"><${b[3]||"Icon"} size="20" class="nav-icon" /> Settings</a>
364
+ <a href="/"><${o[0]||"Icon"} size="20" class="nav-icon" /> Home</a>
365
+ <a href="/about"><${o[1]||"Icon"} size="20" class="nav-icon" /> About</a>
366
+ <a href="/contact"><${o[2]||"Icon"} size="20" class="nav-icon" /> Contact</a>
367
+ <a href="/settings"><${o[3]||"Icon"} size="20" class="nav-icon" /> Settings</a>
368
368
  </nav>
369
369
 
370
370
  <style>
@@ -386,7 +386,7 @@ ${k}
386
386
  ### Custom Styling
387
387
 
388
388
  \`\`\`html
389
- <${b[0]||"Icon"}
389
+ <${o[0]||"Icon"}
390
390
  size="24"
391
391
  class="icon icon-primary"
392
392
  style="opacity: 0.8; transition: opacity 0.2s;"
@@ -407,15 +407,15 @@ ${k}
407
407
  \`\`\`html
408
408
  <div class="status-grid">
409
409
  <div class="status-item">
410
- <${b[0]||"Icon"} size="16" color="#22c55e" />
410
+ <${o[0]||"Icon"} size="16" color="#22c55e" />
411
411
  <span>Success</span>
412
412
  </div>
413
413
  <div class="status-item">
414
- <${b[1]||"Icon"} size="16" color="#f59e0b" />
414
+ <${o[1]||"Icon"} size="16" color="#f59e0b" />
415
415
  <span>Warning</span>
416
416
  </div>
417
417
  <div class="status-item">
418
- <${b[2]||"Icon"} size="16" color="#ef4444" />
418
+ <${o[2]||"Icon"} size="16" color="#ef4444" />
419
419
  <span>Error</span>
420
420
  </div>
421
421
  </div>
@@ -426,8 +426,8 @@ ${k}
426
426
  1. **Use Components Directly**: Import and use icon components in your templates
427
427
  \`\`\`html
428
428
  <!-- Recommended -->
429
- <${b[0]||"Icon"} size="24" />
430
- <${b[1]||"Icon"} size="24" color="#4a90e2" />
429
+ <${o[0]||"Icon"} size="24" />
430
+ <${o[1]||"Icon"} size="24" color="#4a90e2" />
431
431
  \`\`\`
432
432
 
433
433
  2. **Use CSS for Theming**: Apply consistent styling through CSS classes
@@ -444,24 +444,24 @@ ${k}
444
444
  \`\`\`
445
445
 
446
446
  \`\`\`html
447
- <${b[0]||"Icon"} size="24" class="icon" />
447
+ <${o[0]||"Icon"} size="24" class="icon" />
448
448
  \`\`\`
449
449
 
450
450
  3. **Set Appropriate Sizes**: Use \`1em\` for inline icons, fixed pixel sizes for standalone icons
451
451
  \`\`\`html
452
452
  <!-- Inline with text -->
453
- <p>Click the <${b[0]||"Icon"} height="1em" /> icon to continue</p>
453
+ <p>Click the <${o[0]||"Icon"} height="1em" /> icon to continue</p>
454
454
 
455
455
  <!-- Standalone -->
456
- <${b[0]||"Icon"} size="24" />
456
+ <${o[0]||"Icon"} size="24" />
457
457
  \`\`\`
458
458
 
459
459
  4. **Use Data Import for Advanced Use Cases**: When you need more control
460
460
  \`\`\`html
461
461
  @js
462
- import { ${G[0]||"icon"} } from '@stacksjs/iconify-${y}'
462
+ import { ${i[0]||"icon"} } from '@stacksjs/iconify-${t}'
463
463
  import { renderIcon } from '@stacksjs/iconify-core'
464
- global.customIcon = renderIcon(${G[0]||"icon"}, { size: 24 })
464
+ global.customIcon = renderIcon(${i[0]||"icon"}, { size: 24 })
465
465
  @endjs
466
466
 
467
467
  {!! customIcon !!}
@@ -473,10 +473,10 @@ This package includes full TypeScript support with type definitions for all icon
473
473
 
474
474
  \`\`\`typescript
475
475
  import type { IconData } from '@stacksjs/iconify-core'
476
- import { ${G[0]||"icon"} } from '@stacksjs/iconify-${y}'
476
+ import { ${i[0]||"icon"} } from '@stacksjs/iconify-${t}'
477
477
 
478
478
  // Icons are typed as IconData
479
- const myIcon: IconData = ${G[0]||"icon"}
479
+ const myIcon: IconData = ${i[0]||"icon"}
480
480
  \`\`\`
481
481
 
482
482
  ## Related Packages
@@ -487,23 +487,23 @@ const myIcon: IconData = ${G[0]||"icon"}
487
487
 
488
488
  ## License
489
489
 
490
- ${g.license?.title||"MIT"}
490
+ ${e.license?.title||"MIT"}
491
491
 
492
- ${g.license?.url?`See [license details](${g.license.url}) for more information.`:""}
492
+ ${e.license?.url?`See [license details](${e.license.url}) for more information.`:""}
493
493
 
494
494
  ## Credits
495
495
 
496
- - **Icons**: ${g.author?.name||"Iconify"}${g.author?.url?` ([Website](${g.author.url}))`:""}
496
+ - **Icons**: ${e.author?.name||"Iconify"}${e.author?.url?` ([Website](${e.author.url}))`:""}
497
497
  - **Iconify**: [https://iconify.design/](https://iconify.design/)
498
- - **Icon Set**: [View on Iconify](https://icon-sets.iconify.design/${y}/)
498
+ - **Icon Set**: [View on Iconify](https://icon-sets.iconify.design/${t}/)
499
499
 
500
500
  ## Resources
501
501
 
502
- - [Browse all icons in this collection](https://icon-sets.iconify.design/${y}/)
502
+ - [Browse all icons in this collection](https://icon-sets.iconify.design/${t}/)
503
503
  - [Iconify documentation](https://iconify.design/docs/)
504
504
  - [stx iconify integration guide](../../docs/iconify.md)
505
- `}async function V(y,g,u,$){console.log(`
506
- \uD83D\uDCE6 Generating package for ${y}...`);let b=(await q())[y];if(!b)throw Error(`Collection ${y} not found`);console.log(` Collection: ${b.name}`),console.log(` Total icons: ${b.total}`);let k=await _(y,u),U=Object.keys(k.icons);console.log(` Generating ${U.length} icons...`);let E=T(g,`iconify-${y}`),v=T(E,"src");await S(v,{recursive:!0});let Q=k.width||24,A=k.height||24;for(let z of U){let X=k.icons[z],B=j(X,Q,A),J=F(z,B);await K(T(v,`${z}.ts`),J);let P=s(z,B);await K(T(v,`${z}-icon.stx`),P)}let R=N(U);await K(T(v,"index.ts"),R);let Y=d(y);await K(T(v,"types.ts"),Y);let w=D(y,b,U.length);await K(T(E,"package.json"),w);let W=r(y);await K(T(E,"build.ts"),W);let H=C(y,b,U.length);if(await K(T(E,"README.md"),H),$){let z=T($,`iconify-${y}.md`),X=x(y,b,U);await S($,{recursive:!0}),await K(z,X),console.log(` \u2713 Generated documentation in ${z}`)}console.log(` \u2713 Generated ${U.length} icons in ${E}`)}var I=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","let","static","yield","implements","interface","package","private","protected","public","await","eval","arguments"]);function L(y){let g=y.replace(/-([a-z0-9])/g,(u)=>u[1].toUpperCase());if(g=g.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(g))g=`_${g}`;if(I.has(g))g=`${g}_`;return g}function f(y){let g=L(y);return g.charAt(0).toUpperCase()+g.slice(1)}import{join as m}from"path";import M from"process";var h=M.argv.slice(2);async function p(){if(h.length===0||h.includes("--help")||h.includes("-h"))console.log(`
505
+ `}async function C(t,e,n,s){console.log(`
506
+ \uD83D\uDCE6 Generating package for ${t}...`);let o=(await b())[t];if(!o)throw Error(`Collection ${t} not found`);console.log(` Collection: ${o.name}`),console.log(` Total icons: ${o.total}`);let a=await A(t,n),r=Object.keys(a.icons);console.log(` Generating ${r.length} icons...`);let l=d(e,`iconify-${t}`),p=d(l,"src");await x(p,{recursive:!0});let f=a.width||24,k=a.height||24;for(let u of r){let y=a.icons[u],w=E(y,f,k),T=U(u,w);await m(d(p,`${u}.ts`),T);let F=_(u,w);await m(d(p,`${u}-icon.stx`),F)}let S=N(r);await m(d(p,"index.ts"),S);let j=R(t);await m(d(p,"types.ts"),j);let z=O(t,o,r.length);await m(d(l,"package.json"),z);let D=W(t);await m(d(l,"build.ts"),D);let P=M(t,o,r.length);if(await m(d(l,"README.md"),P),s){let u=d(s,`iconify-${t}.md`),y=B(t,o,r);await x(s,{recursive:!0}),await m(u,y),console.log(` \u2713 Generated documentation in ${u}`)}console.log(` \u2713 Generated ${r.length} icons in ${l}`)}var G=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","let","static","yield","implements","interface","package","private","protected","public","await","eval","arguments"]);function h(t){let e=t.replace(/-([a-z0-9])/g,(n)=>n[1].toUpperCase());if(e=e.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(e))e=`_${e}`;if(G.has(e))e=`${e}_`;return e}function Y(t){let e=h(t);return e.charAt(0).toUpperCase()+e.slice(1)}var c=g.argv.slice(2);async function L(){if(c.length===0||c.includes("--help")||c.includes("-h"))console.log(`
507
507
  stx-iconify - Generate Iconify icon packages for stx
508
508
 
509
509
  Usage:
@@ -526,12 +526,12 @@ Examples:
526
526
  stx-iconify generate tabler --output ./packages
527
527
  stx-iconify generate lucide --docs ./docs/collections
528
528
  stx-iconify generate mdi --output ./packages --docs ./docs/collections
529
- `),M.exit(0);let y=h[0];if(y==="list"){console.log(`
529
+ `),g.exit(0);let t=c[0];if(t==="list"){console.log(`
530
530
  \uD83D\uDCDA Fetching available icon collections...
531
- `);let g=await q(),u=Object.entries(g).sort(($,G)=>G[1].total-$[1].total);console.log(`Available collections:
532
- `);for(let[$,G]of u)console.log(` ${$.padEnd(30)} ${G.name} (${G.total} icons)`);console.log(`
533
- Total: ${u.length} collections`)}else if(y==="generate"){let g=h[1];if(!g)console.error("Error: Please specify a collection prefix"),console.error("Usage: stx-iconify generate <prefix> [icons...]"),M.exit(1);let u=m(M.cwd(),"packages"),$,G=[];for(let b=2;b<h.length;b++)if(h[b]==="--output"||h[b]==="-o")u=h[b+1],b++;else if(h[b]==="--docs"||h[b]==="-d")$=h[b+1],b++;else if(!h[b].startsWith("--")&&!h[b].startsWith("-"))G.push(h[b]);await V(g,u,G.length>0?G:void 0,$),console.log(`
531
+ `);let e=await b(),n=Object.entries(e).sort((s,i)=>i[1].total-s[1].total);console.log(`Available collections:
532
+ `);for(let[s,i]of n)console.log(` ${s.padEnd(30)} ${i.name} (${i.total} icons)`);console.log(`
533
+ Total: ${n.length} collections`)}else if(t==="generate"){let e=c[1];if(!e)console.error("Error: Please specify a collection prefix"),console.error("Usage: stx-iconify generate <prefix> [icons...]"),g.exit(1);let n=J(g.cwd(),"packages"),s,i=[];for(let o=2;o<c.length;o++)if(c[o]==="--output"||c[o]==="-o")n=c[o+1],o++;else if(c[o]==="--docs"||c[o]==="-d")s=c[o+1],o++;else if(!c[o].startsWith("--")&&!c[o].startsWith("-"))i.push(c[o]);await C(e,n,i.length>0?i:void 0,s),console.log(`
534
534
  \u2713 Package generated successfully!`),console.log(`
535
- To use the package:`),console.log(` 1. cd packages/iconify-${g}`),console.log(" 2. bun install"),console.log(" 3. bun run build")}else console.error(`Unknown command: ${y}`),console.error('Run "stx-iconify --help" for usage information'),M.exit(1)}p().catch((y)=>{console.error("Error:",y.message),M.exit(1)});
535
+ To use the package:`),console.log(` 1. cd packages/iconify-${e}`),console.log(" 2. bun install"),console.log(" 3. bun run build")}else console.error(`Unknown command: ${t}`),console.error('Run "stx-iconify --help" for usage information'),g.exit(1)}L().catch((t)=>{console.error("Error:",t.message),g.exit(1)});
536
536
 
537
- //# debugId=9F4361B94767790964756E2164756E21
537
+ //# debugId=35E82EE2BEDE2E3E64756E2164756E21