@stacksjs/iconify-generator 0.2.413 → 0.2.414
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 +95 -95
- package/dist/cli.js.map +5 -5
- package/dist/index.js +90 -90
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
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 ${
|
|
5
|
+
export const ${n}: IconData = ${JSON.stringify(e,null,2)}
|
|
6
6
|
|
|
7
|
-
export default ${
|
|
8
|
-
`}function
|
|
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) || ${
|
|
11
|
-
const iconHeight = (typeof height !== 'undefined' ? height : null) || (typeof size !== 'undefined' ? size : null) || ${
|
|
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 = "${
|
|
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(
|
|
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(
|
|
48
|
-
${
|
|
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
|
|
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 ${
|
|
57
|
-
`}function
|
|
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-${
|
|
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-${
|
|
104
|
+
console.log('\u2713 Built @stacksjs/iconify-${t}')
|
|
105
105
|
}
|
|
106
|
-
`}function
|
|
106
|
+
`}function M(t,e,n){return`# @stacksjs/iconify-${t}
|
|
107
107
|
|
|
108
|
-
${
|
|
108
|
+
${e.name} icons for stx from Iconify.
|
|
109
109
|
|
|
110
110
|
## Installation
|
|
111
111
|
|
|
112
112
|
\`\`\`bash
|
|
113
|
-
bun add @stacksjs/iconify-${
|
|
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-${
|
|
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-${
|
|
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 ${
|
|
147
|
+
This package contains ${n} icons from ${e.name}.
|
|
148
148
|
|
|
149
149
|
## License
|
|
150
150
|
|
|
151
|
-
${
|
|
151
|
+
${e.license?.title||"MIT"}
|
|
152
152
|
|
|
153
|
-
${
|
|
153
|
+
${e.license?.url?`License: ${e.license.url}`:""}
|
|
154
154
|
|
|
155
155
|
## Credits
|
|
156
156
|
|
|
157
|
-
- Icons: ${
|
|
157
|
+
- Icons: ${e.author?.name||"Iconify"}${e.author?.url?` (${e.author.url})`:""}
|
|
158
158
|
- Iconify: https://iconify.design/
|
|
159
|
-
`}function
|
|
160
|
-
`);return`# ${
|
|
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
|
-
> ${
|
|
162
|
+
> ${e.name} icons for stx from Iconify
|
|
163
163
|
|
|
164
164
|
## Overview
|
|
165
165
|
|
|
166
|
-
This package provides access to ${
|
|
166
|
+
This package provides access to ${s} icons from the ${e.name} collection through the stx iconify integration.
|
|
167
167
|
|
|
168
|
-
**Collection ID:** \`${
|
|
169
|
-
**Total Icons:** ${
|
|
170
|
-
${
|
|
171
|
-
${
|
|
172
|
-
${
|
|
173
|
-
${
|
|
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-${
|
|
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
|
-
<${
|
|
189
|
-
<${
|
|
190
|
-
<${
|
|
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
|
-
<${
|
|
198
|
-
<${
|
|
197
|
+
<${o[0]||"Icon"} size="24" />
|
|
198
|
+
<${o[0]||"Icon"} size="1em" />
|
|
199
199
|
|
|
200
200
|
<!-- Using width and height -->
|
|
201
|
-
<${
|
|
201
|
+
<${o[0]||"Icon"} width="24" height="32" />
|
|
202
202
|
|
|
203
203
|
<!-- With color -->
|
|
204
|
-
<${
|
|
205
|
-
<${
|
|
204
|
+
<${o[0]||"Icon"} size="24" color="red" />
|
|
205
|
+
<${o[0]||"Icon"} size="24" color="#4a90e2" />
|
|
206
206
|
|
|
207
207
|
<!-- With CSS class -->
|
|
208
|
-
<${
|
|
208
|
+
<${o[0]||"Icon"} size="24" class="icon-primary" />
|
|
209
209
|
|
|
210
210
|
<!-- With all properties -->
|
|
211
|
-
<${
|
|
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
|
-
<${
|
|
237
|
-
<${
|
|
238
|
-
<${
|
|
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 { ${
|
|
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(${
|
|
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
|
-
${
|
|
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
|
-
<${
|
|
280
|
-
<${
|
|
279
|
+
<${o[0]||"Icon"} size="24" color="red" />
|
|
280
|
+
<${o[0]||"Icon"} size="24" color="#4a90e2" />
|
|
281
281
|
|
|
282
282
|
<!-- Via inline style -->
|
|
283
|
-
<${
|
|
283
|
+
<${o[0]||"Icon"} size="24" style="color: green;" />
|
|
284
284
|
|
|
285
285
|
<!-- Via CSS class -->
|
|
286
|
-
<${
|
|
286
|
+
<${o[0]||"Icon"} size="24" class="text-primary" />
|
|
287
287
|
\`\`\`
|
|
288
288
|
|
|
289
|
-
${!
|
|
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
|
-
<${
|
|
326
|
-
<${
|
|
327
|
-
<${
|
|
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
|
-
<${
|
|
334
|
-
<${
|
|
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
|
-
.${
|
|
342
|
+
.${h(t)}-icon {
|
|
343
343
|
width: 1em;
|
|
344
344
|
height: 1em;
|
|
345
345
|
}
|
|
346
346
|
\`\`\`
|
|
347
347
|
|
|
348
348
|
\`\`\`html
|
|
349
|
-
<${
|
|
349
|
+
<${o[0]||"DraftsIcon"} class="${h(t)}-icon" />
|
|
350
350
|
\`\`\`
|
|
351
351
|
|
|
352
352
|
## Available Icons
|
|
353
353
|
|
|
354
|
-
This package contains **${
|
|
354
|
+
This package contains **${s}** icons:
|
|
355
355
|
|
|
356
|
-
${
|
|
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="/"><${
|
|
365
|
-
<a href="/about"><${
|
|
366
|
-
<a href="/contact"><${
|
|
367
|
-
<a href="/settings"><${
|
|
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
|
-
<${
|
|
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
|
-
<${
|
|
410
|
+
<${o[0]||"Icon"} size="16" color="#22c55e" />
|
|
411
411
|
<span>Success</span>
|
|
412
412
|
</div>
|
|
413
413
|
<div class="status-item">
|
|
414
|
-
<${
|
|
414
|
+
<${o[1]||"Icon"} size="16" color="#f59e0b" />
|
|
415
415
|
<span>Warning</span>
|
|
416
416
|
</div>
|
|
417
417
|
<div class="status-item">
|
|
418
|
-
<${
|
|
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
|
-
<${
|
|
430
|
-
<${
|
|
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
|
-
<${
|
|
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 <${
|
|
453
|
+
<p>Click the <${o[0]||"Icon"} height="1em" /> icon to continue</p>
|
|
454
454
|
|
|
455
455
|
<!-- Standalone -->
|
|
456
|
-
<${
|
|
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 { ${
|
|
462
|
+
import { ${i[0]||"icon"} } from '@stacksjs/iconify-${t}'
|
|
463
463
|
import { renderIcon } from '@stacksjs/iconify-core'
|
|
464
|
-
global.customIcon = renderIcon(${
|
|
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 { ${
|
|
476
|
+
import { ${i[0]||"icon"} } from '@stacksjs/iconify-${t}'
|
|
477
477
|
|
|
478
478
|
// Icons are typed as IconData
|
|
479
|
-
const myIcon: IconData = ${
|
|
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
|
-
${
|
|
490
|
+
${e.license?.title||"MIT"}
|
|
491
491
|
|
|
492
|
-
${
|
|
492
|
+
${e.license?.url?`See [license details](${e.license.url}) for more information.`:""}
|
|
493
493
|
|
|
494
494
|
## Credits
|
|
495
495
|
|
|
496
|
-
- **Icons**: ${
|
|
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/${
|
|
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/${
|
|
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
|
|
506
|
-
\uD83D\uDCE6 Generating package for ${
|
|
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
|
-
`),
|
|
529
|
+
`),g.exit(0);let t=c[0];if(t==="list"){console.log(`
|
|
530
530
|
\uD83D\uDCDA Fetching available icon collections...
|
|
531
|
-
`);let
|
|
532
|
-
`);for(let[
|
|
533
|
-
Total: ${
|
|
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-${
|
|
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=
|
|
537
|
+
//# debugId=35E82EE2BEDE2E3E64756E2164756E21
|