@solar-icons/cli 2.4.2 → 2.6.0

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
@@ -21,4 +21,4 @@ solar-icons styles [--json]
21
21
 
22
22
  All `--json` outputs are machine-readable (for agents / MCP).
23
23
 
24
- Framework snippet examples: `react` → `import { HomeBoldIcon } from "@solar-icons/react/bold/home"`, `vue`, `svelte`, `solid`, `angular` (`SolarHomeBold`), `react-native`, `nuxt`, `static`, `js`.
24
+ Framework snippet examples: `react` → `import { HomeBoldIcon } from "@solar-icons/react/bold/home"`, `vue`, `svelte`, `solid`, `angular` (`SolarHomeBold`), `react-native`, `nuxt`, `static`, `js`, `blade` (`<x-solar-bold-home />`), `flutter` (`HomeBoldIcon()`).
@@ -1,27 +1,48 @@
1
1
  //#region src/catalog.d.ts
2
- type IconDescription = {
2
+ export type DeprecatedAlias = {
3
+ name: string;
4
+ replacement: string;
5
+ reason: string;
6
+ deprecatedSince?: string;
7
+ };
8
+ export type IconDescription = {
3
9
  name: string;
4
10
  category: string;
5
11
  categoryTags: string[];
6
12
  tags: string[];
13
+ deprecatedAliases?: DeprecatedAlias[];
14
+ };
15
+ export declare const STYLES: readonly ['bold', 'bold-duotone', 'broken', 'linear', 'line-duotone', 'outline'];
16
+ export type Style = (typeof STYLES)[number];
17
+ export declare const FRAMEWORKS: readonly ['react', 'vue', 'svelte', 'solid', 'angular', 'react-native', 'nuxt', 'static', 'js', 'blade', 'flutter'];
18
+ export type Framework = (typeof FRAMEWORKS)[number];
19
+ export declare function styleToPascal(style: Style): string;
20
+ /**
21
+ * Flutter style directory and file stem (e.g. line-duotone/arrow-up →
22
+ * line_duotone/arrow_up). Mirrors lib/<style>/<icon>.dart.
23
+ */
24
+ export declare function toDartPath(style: Style, kebabName: string): string;
25
+ export declare function toPascalKebab(kebab: string): string;
26
+ /**
27
+ * Resolve a requested name to its catalog entry. Exact canonical names win;
28
+ * deprecated aliases redirect to their canonical entry so renames keep
29
+ * working with a deprecation notice instead of a "not found" error.
30
+ */
31
+ export declare function resolveIconName(descriptions: IconDescription[], name: string): {
32
+ entry: IconDescription;
33
+ alias?: DeprecatedAlias;
7
34
  };
8
- declare const STYLES: readonly ['bold', 'bold-duotone', 'broken', 'linear', 'line-duotone', 'outline'];
9
- type Style = (typeof STYLES)[number];
10
- declare const FRAMEWORKS: readonly ['react', 'vue', 'svelte', 'solid', 'angular', 'react-native', 'nuxt', 'static', 'js'];
11
- type Framework = (typeof FRAMEWORKS)[number];
12
- declare function styleToPascal(style: Style): string;
13
- declare function toPascalKebab(kebab: string): string;
14
35
  /**
15
36
  * Generic per-file component name (style in path, no suffix).
16
37
  * e.g. home + linear → HomeIcon
17
38
  */
18
- declare function perFileComponentName(kebabName: string): string;
39
+ export declare function perFileComponentName(kebabName: string): string;
19
40
  /**
20
41
  * Root/top-level component name (style in name, path is package root).
21
42
  * e.g. home + bold → HomeBoldIcon
22
43
  */
23
- declare function rootComponentName(kebabName: string, style: Style, framework: Framework): string;
24
- declare function componentName(kebabName: string, style: Style, framework: Framework): string;
44
+ export declare function rootComponentName(kebabName: string, style: Style, framework: Framework): string;
45
+ export declare function componentName(kebabName: string, style: Style, framework: Framework): string;
25
46
  /**
26
47
  * Per-file import snippet (recommended, tree-shakable).
27
48
  * Style is in the path, component name is generic (no style suffix).
@@ -31,32 +52,34 @@ declare function componentName(kebabName: string, style: Style, framework: Frame
31
52
  * svelte: import HeartIcon from '@solar-icons/svelte/bold/heart' (default)
32
53
  * solid: import { HeartIcon } from '@solar-icons/solid/bold/heart'
33
54
  * angular:import { SolarHeartBold } from '@solar-icons/angular' (style in name, root)
55
+ * blade: <x-solar-bold-heart /> (Blade component, style in name)
56
+ * flutter: HeartBoldIcon() (static widget, style in name; dynamic: HomeIcon(style: ...))
34
57
  */
35
- declare function importSnippet(name: string, style: Style, framework: Framework): string;
36
- declare function rootImportSnippet(name: string, style: Style, framework: Framework): string;
37
- declare function loadDescriptions(): IconDescription[];
38
- declare function listCategories(): string[];
58
+ export declare function importSnippet(name: string, style: Style, framework: Framework): string;
59
+ export declare function rootImportSnippet(name: string, style: Style, framework: Framework): string;
60
+ export declare function loadDescriptions(): IconDescription[];
61
+ export declare function listCategories(): string[];
39
62
  /**
40
63
  * Totale counts for generation / --json usage.
41
64
  */
42
- declare function catalogStats(): {
65
+ export declare function catalogStats(): {
43
66
  icons: number;
44
67
  categories: number;
45
68
  styles: number;
46
69
  variations: number;
47
70
  };
48
- declare function resolveSvgPath(name: string, style: Style): string | null;
49
- declare function cdnSvgUrl(name: string, style: Style, version?: string): string;
50
- declare const FIGMA_URL = "https://www.figma.com/community/plugin/1664759238792120976/solar-icons";
51
- declare const DOCS_URL = "https://solar-icons.vercel.app/";
52
- declare const ICONS_URL = "https://solar-icons.vercel.app/icons";
53
- type PackageInfo = {
71
+ export declare function resolveSvgPath(name: string, style: Style): string | null;
72
+ export declare function cdnSvgUrl(name: string, style: Style, version?: string): string;
73
+ export declare const FIGMA_URL = "https://www.figma.com/community/plugin/1664759238792120976/solar-icons";
74
+ export declare const DOCS_URL = "https://solar-icons.vercel.app/";
75
+ export declare const ICONS_URL = "https://solar-icons.vercel.app/icons";
76
+ export type PackageInfo = {
54
77
  name: string;
55
78
  version: string;
56
79
  description: string;
57
80
  directory: string;
58
81
  };
59
- type Overview = {
82
+ export type Overview = {
60
83
  catalog: {
61
84
  icons: number;
62
85
  categories: number;
@@ -69,6 +92,5 @@ type Overview = {
69
92
  docs: string;
70
93
  iconsExplorer: string;
71
94
  };
72
- declare function getOverview(): Overview;
73
- //#endregion
74
- export { DOCS_URL, FIGMA_URL, FRAMEWORKS, Framework, ICONS_URL, IconDescription, Overview, PackageInfo, STYLES, Style, catalogStats, cdnSvgUrl, componentName, getOverview, importSnippet, listCategories, loadDescriptions, perFileComponentName, resolveSvgPath, rootComponentName, rootImportSnippet, styleToPascal, toPascalKebab };
95
+ export declare function getOverview(): Overview;
96
+ //#endregion
package/dist/catalog.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import{createRequire as e}from"node:module";import{existsSync as t,readFileSync as n,readdirSync as r}from"node:fs";import{dirname as i,join as a,resolve as o}from"node:path";import{fileURLToPath as s}from"node:url";const c=[`bold`,`bold-duotone`,`broken`,`linear`,`line-duotone`,`outline`],l=[`react`,`vue`,`svelte`,`solid`,`angular`,`react-native`,`nuxt`,`static`,`js`],u={bold:`Bold`,"bold-duotone":`BoldDuotone`,broken:`Broken`,linear:`Linear`,"line-duotone":`LineDuotone`,outline:`Outline`};function d(e){return u[e]}function f(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function p(e){return`${f(e)}Icon`}function m(e,t,n){let r=f(e),i=d(t);return n===`angular`?`Solar${r}${i}`:`${r}${i}Icon`}function h(e,t,n){return m(e,t,n)}function g(e,t,n){let r=e,i=p(e),a=m(e,t,n);switch(n){case`react`:return`import { ${i} } from "@solar-icons/react/${t}/${r}";`;case`vue`:return`import { ${i} } from "@solar-icons/vue/${t}/${r}";`;case`svelte`:return`import ${i} from "@solar-icons/svelte/${t}/${r}";`;case`solid`:return`import { ${i} } from "@solar-icons/solid/${t}/${r}";`;case`angular`:return`import { ${a} } from "@solar-icons/angular"; // usage: <svg ${a.charAt(0).toLowerCase()+a.slice(1)}></svg> (directive)`;case`react-native`:return`import { ${i} } from "@solar-icons/react-native/${t}/${r}";`;case`nuxt`:return`// nuxt.config: modules: ["@solar-icons/nuxt"] → auto-import <${a} />`;case`static`:return`import url from "@solar-icons/static/${t}/${r}.svg"; // <img src={url} alt="${r}" />`;case`js`:return`import { createIcons, icons } from "@solar-icons/js"; // icons["${r}-${t}"]`;default:return`import { ${i} } from "@solar-icons/${n}/${t}/${r}";`}}function _(e,t,n){let r=m(e,t,n);switch(n){case`svelte`:return`import { ${r} } from "@solar-icons/svelte";`;case`angular`:return`import { ${r} } from "@solar-icons/angular";`;case`static`:case`js`:case`nuxt`:return g(e,t,n);default:return`import { ${r} } from "@solar-icons/${n}";`}}function v(e){if(!t(e))return null;try{return JSON.parse(n(e,`utf8`))}catch{return null}}let y=null,b=null;function x(){if(y)return y;let t=[];try{let n=e(import.meta.url).resolve(`@solar-icons/static/package.json`),r=i(n);t.push(a(r,`dist`,`metadata-descriptions.json`)),t.push(a(r,`metadata-descriptions.json`))}catch{}try{let e=i(s(import.meta.url));t.push(o(e,`../../static/dist/metadata-descriptions.json`)),t.push(o(e,`../../../packages/static/dist/metadata-descriptions.json`)),t.push(o(e,`../../core/src/metadata-descriptions.json`)),t.push(o(e,`../../../packages/core/src/metadata-descriptions.json`))}catch{}for(let e of t){let t=v(e);if(Array.isArray(t)&&t.length>0)return y=t,y}throw Error(`Could not locate Solar Icons metadata. Ensure @solar-icons/static is installed or run inside the solar-icons monorepo. Tried:
1
+ import{createRequire as e}from"node:module";import{existsSync as t,readFileSync as n,readdirSync as r}from"node:fs";import{dirname as i,join as a,resolve as o}from"node:path";import{fileURLToPath as s}from"node:url";const c=[`bold`,`bold-duotone`,`broken`,`linear`,`line-duotone`,`outline`],l=[`react`,`vue`,`svelte`,`solid`,`angular`,`react-native`,`nuxt`,`static`,`js`,`blade`,`flutter`],u={bold:`Bold`,"bold-duotone":`BoldDuotone`,broken:`Broken`,linear:`Linear`,"line-duotone":`LineDuotone`,outline:`Outline`};function d(e){return u[e]}function f(e,t){return`${e.replaceAll(`-`,`_`)}/${t.replaceAll(`-`,`_`)}`}function p(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function m(e,t){let n=e.find(e=>e.name===t);if(n)return{entry:n};for(let n of e){let e=n.deprecatedAliases?.find(e=>e.name===t);if(e)return{entry:n,alias:e}}throw Error(`icon '${t}' not found.`)}function h(e){return`${p(e)}Icon`}function g(e,t,n){let r=p(e),i=d(t);return n===`angular`?`Solar${r}${i}`:`${r}${i}Icon`}function _(e,t,n){return g(e,t,n)}function v(e,t,n){let r=e,i=h(e),a=g(e,t,n);switch(n){case`react`:return`import { ${i} } from "@solar-icons/react/${t}/${r}";`;case`vue`:return`import { ${i} } from "@solar-icons/vue/${t}/${r}";`;case`svelte`:return`import ${i} from "@solar-icons/svelte/${t}/${r}";`;case`solid`:return`import { ${i} } from "@solar-icons/solid/${t}/${r}";`;case`angular`:return`import { ${a} } from "@solar-icons/angular"; // usage: <svg ${a.charAt(0).toLowerCase()+a.slice(1)}></svg> (directive)`;case`react-native`:return`import { ${i} } from "@solar-icons/react-native/${t}/${r}";`;case`nuxt`:return`// nuxt.config: modules: ["@solar-icons/nuxt"] → auto-import <${a} />`;case`static`:return`import url from "@solar-icons/static/${t}/${r}.svg"; // <img src={url} alt="${r}" />`;case`js`:return`import { createIcons, icons } from "@solar-icons/js"; // icons["${r}-${t}"]`;case`blade`:return`<x-solar-${t}-${r} />`;case`flutter`:return`import 'package:flutter_solar_icons/${f(t,r)}.dart';\n${a}()`;default:return`import { ${i} } from "@solar-icons/${n}/${t}/${r}";`}}function y(e,t,n){let r=g(e,t,n);switch(n){case`svelte`:return`import { ${r} } from "@solar-icons/svelte";`;case`angular`:return`import { ${r} } from "@solar-icons/angular";`;case`static`:case`js`:case`nuxt`:case`blade`:return v(e,t,n);case`flutter`:return`import 'package:flutter_solar_icons/flutter_solar_icons.dart';\n${r}()`;default:return`import { ${r} } from "@solar-icons/${n}";`}}function b(e){if(!t(e))return null;try{return JSON.parse(n(e,`utf8`))}catch{return null}}let x=null,S=null;function C(){if(x)return x;let t=[];try{let n=e(import.meta.url).resolve(`@solar-icons/static/package.json`),r=i(n);t.push(a(r,`dist`,`metadata-descriptions.json`)),t.push(a(r,`metadata-descriptions.json`))}catch{}try{let e=i(s(import.meta.url));t.push(o(e,`../../static/dist/metadata-descriptions.json`)),t.push(o(e,`../../../packages/static/dist/metadata-descriptions.json`)),t.push(o(e,`../../core/src/metadata-descriptions.json`)),t.push(o(e,`../../../packages/core/src/metadata-descriptions.json`))}catch{}for(let e of t){let t=b(e);if(Array.isArray(t)&&t.length>0)return x=t,x}throw Error(`Could not locate Solar Icons metadata. Ensure @solar-icons/static is installed or run inside the solar-icons monorepo. Tried:
2
2
  `+t.join(`
3
- `))}function S(){if(b)return b;let e=x(),t=new Set;for(let n of e)t.add(n.category);return b=[...t].sort(),b}function C(){let e=x(),t=new Set(e.map(e=>e.category));return{icons:e.length,categories:t.size,styles:c.length,variations:e.length*c.length}}function w(n,r){let c=[];try{let t=e(import.meta.url).resolve(`@solar-icons/static/package.json`),o=i(t);c.push(a(o,`dist`,`icons`,r,`${n}.svg`))}catch{}try{let e=i(s(import.meta.url));c.push(o(e,`../../static/dist/icons`,r,`${n}.svg`)),c.push(o(e,`../../../packages/static/dist/icons`,r,`${n}.svg`))}catch{}for(let e of c)if(t(e))return e;return null}function T(e,t,n=`latest`){return`https://cdn.jsdelivr.net/npm/@solar-icons/static@${n}/dist/icons/${t}/${e}.svg`}const E=`https://www.figma.com/community/plugin/1664759238792120976/solar-icons`,D=`https://solar-icons.vercel.app/`,O=`https://solar-icons.vercel.app/icons`;function k(){let t=[];try{let n=e(import.meta.url).resolve(`@solar-icons/cli/package.json`),r=v(n);if(r?.version)return r.version;t.push(n)}catch{}try{let e=i(s(import.meta.url));t.push(o(e,`../../package.json`)),t.push(o(e,`../../../packages/cli/package.json`)),t.push(o(e,`../package.json`))}catch{}for(let e of t){let t=v(e);if(t?.version)return t.version}return`unknown`}function A(){let e=[];try{let t=i(s(import.meta.url));e.push(o(t,`../../..`,`packages`)),e.push(o(t,`../../../packages`)),e.push(o(t,`../../packages`)),e.push(o(t,`..`,`..`,`packages`)),e.push(o(t,`../packages`))}catch{}try{e.push(o(process.cwd(),`packages`))}catch{}for(let n of e)if(t(n))try{let e=r(n,{withFileTypes:!0}),i=[];for(let r of e){if(!r.isDirectory())continue;let e=a(n,r.name,`package.json`);if(!t(e))continue;let o=v(e);o?.name?.startsWith(`@solar-icons/`)&&(o.private||i.push({name:o.name,version:o.version??`unknown`,description:o.description??``,directory:`packages/${r.name}`}))}if(i.length>0)return i.sort((e,t)=>e.name.localeCompare(t.name)),i}catch{}return[]}function j(){return{catalog:C(),packages:A(),cliVersion:k(),figma:E,docs:D,iconsExplorer:O}}export{D as DOCS_URL,E as FIGMA_URL,l as FRAMEWORKS,O as ICONS_URL,c as STYLES,C as catalogStats,T as cdnSvgUrl,h as componentName,j as getOverview,g as importSnippet,S as listCategories,x as loadDescriptions,p as perFileComponentName,w as resolveSvgPath,m as rootComponentName,_ as rootImportSnippet,d as styleToPascal,f as toPascalKebab};
3
+ `))}function w(){if(S)return S;let e=C(),t=/* @__PURE__ */ new Set;for(let n of e)t.add(n.category);return S=[...t].sort(),S}function T(){let e=C(),t=new Set(e.map(e=>e.category));return{icons:e.length,categories:t.size,styles:c.length,variations:e.length*c.length}}function E(n,r){let c=[];try{let t=e(import.meta.url).resolve(`@solar-icons/static/package.json`),o=i(t);c.push(a(o,`dist`,`icons`,r,`${n}.svg`))}catch{}try{let e=i(s(import.meta.url));c.push(o(e,`../../static/dist/icons`,r,`${n}.svg`)),c.push(o(e,`../../../packages/static/dist/icons`,r,`${n}.svg`))}catch{}for(let e of c)if(t(e))return e;return null}function D(e,t,n=`latest`){return`https://cdn.jsdelivr.net/npm/@solar-icons/static@${n}/dist/icons/${t}/${e}.svg`}const O=`https://www.figma.com/community/plugin/1664759238792120976/solar-icons`,k=`https://solar-icons.vercel.app/`,A=`https://solar-icons.vercel.app/icons`;function j(){let t=[];try{let n=e(import.meta.url).resolve(`@solar-icons/cli/package.json`),r=b(n);if(r?.version)return r.version;t.push(n)}catch{}try{let e=i(s(import.meta.url));t.push(o(e,`../../package.json`)),t.push(o(e,`../../../packages/cli/package.json`)),t.push(o(e,`../package.json`))}catch{}for(let e of t){let t=b(e);if(t?.version)return t.version}return`unknown`}function M(){let e=[];try{let t=i(s(import.meta.url));e.push(o(t,`../../..`,`packages`)),e.push(o(t,`../../../packages`)),e.push(o(t,`../../packages`)),e.push(o(t,`..`,`..`,`packages`)),e.push(o(t,`../packages`))}catch{}try{e.push(o(process.cwd(),`packages`))}catch{}for(let n of e)if(t(n))try{let e=r(n,{withFileTypes:!0}),i=[];for(let r of e){if(!r.isDirectory())continue;let e=a(n,r.name,`package.json`);if(!t(e))continue;let o=b(e);o?.name?.startsWith(`@solar-icons/`)&&(o.private||i.push({name:o.name,version:o.version??`unknown`,description:o.description??``,directory:`packages/${r.name}`}))}if(i.length>0)return i.sort((e,t)=>e.name.localeCompare(t.name)),i}catch{}return[]}function N(){return{catalog:T(),packages:M(),cliVersion:j(),figma:O,docs:k,iconsExplorer:A}}export{k as DOCS_URL,O as FIGMA_URL,l as FRAMEWORKS,A as ICONS_URL,c as STYLES,T as catalogStats,D as cdnSvgUrl,_ as componentName,N as getOverview,v as importSnippet,w as listCategories,C as loadDescriptions,h as perFileComponentName,m as resolveIconName,E as resolveSvgPath,g as rootComponentName,y as rootImportSnippet,d as styleToPascal,f as toDartPath,p as toPascalKebab};
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{STYLES as e,getOverview as t,listCategories as n}from"./catalog.mjs";import{runSearch as r}from"./commands/search.mjs";import{runGet as i}from"./commands/get.mjs";import{runList as a}from"./commands/list.mjs";import{runInfo as o}from"./commands/info.mjs";import{createRequire as s}from"node:module";import{readFileSync as c,realpathSync as l}from"node:fs";import{fileURLToPath as u,pathToFileURL as d}from"node:url";import f from"picocolors";import{Command as p}from"commander";let m=`0.0.0`;try{m=s(import.meta.url)(`@solar-icons/cli/package.json`).version??`0.0.0`}catch{}if(m===`0.0.0`)try{let e=new URL(`../package.json`,import.meta.url);m=JSON.parse(c(u(e),`utf8`)).version??`0.0.0`}catch{}const h=new p().name(`solar-icons`).description(`Solar Icons CLI — search, get and list 1,451 icons × 6 styles.`).version(m,`-v, --version`).showHelpAfterError().showSuggestionAfterError().configureHelp({sortSubcommands:!0,styleTitle:e=>f.bold(f.cyan(e)),styleCommandText:e=>f.cyan(e),styleCommandDescription:e=>f.dim(e),styleOptionText:e=>f.green(e),styleArgumentText:e=>f.yellow(e),styleDescriptionText:e=>f.dim(e),styleOptionTerm:e=>f.green(e)});h.addHelpText(`after`,`\n${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons`)} ${f.green(`search`)} ${f.yellow(`"home"`)} ${f.dim(`--limit 10 --framework react`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons`)} ${f.green(`get`)} ${f.yellow(`arrow-up`)} ${f.dim(`--style linear --framework vue`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons`)} ${f.green(`overview`)} ${f.dim(`--json`)} ${f.dim(`# for agents / CI`)}\n`),h.command(`search`).argument(`<query>`,`search query, e.g. "home" or "shopping cart"`).option(`-l, --limit <n>`,`max results (1..200, default 20)`,`20`).option(`--style <style>`,`restrict import hint to one style: ${e.join(`|`)}`).option(`--category <category>`,`restrict to category (see: solar-icons categories)`).option(`--framework <framework>`,`emit import snippet for framework (react|vue|svelte|solid|angular|react-native|nuxt|static|js)`).option(`--json`,`machine-readable JSON output (for agents/MCP)`).description(`Search icons by name/tags/category`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons search`)} ${f.yellow(`"shopping cart"`)} ${f.dim(`--framework react`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons search`)} ${f.yellow(`arrow`)} ${f.dim(`--category arrows --json`)}\n `).action((e,t)=>{try{r(e,t)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`get`).argument(`<name>`,`kebab icon name, e.g. home`).option(`--style <style>`,`style`,`linear`).option(`--framework <framework>`,`framework for snippet`,`react`).option(`--out <file>`,`copy SVG to file`).option(`--json`,`JSON output`).description(`Get import snippet and SVG for an icon`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons get`)} ${f.yellow(`home`)} ${f.dim(`--style bold --framework svelte`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons get`)} ${f.yellow(`arrow-up`)} ${f.dim(`--out ./arrow.svg`)}\n `).action((e,t)=>{try{i(e,t)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`list`).option(`--category <category>`,`filter by category`).option(`--style <style>`,`hint style: ${e.join(`|`)}`).option(`-l, --limit <n>`,`max results (1..2000, default 50)`,`50`).option(`--json`,`JSON output`).description(`List icons`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons list`)} ${f.dim(`--category home --limit 20`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons list`)} ${f.dim(`--json | jq .[].name`)}\n `).action(e=>{try{a(e)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`info`).argument(`<name>`,`icon name`).option(`--json`,`JSON output`).description(`Show metadata and all import paths for an icon`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons info`)} ${f.yellow(`arrow-up`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons info`)} ${f.yellow(`heart`)} ${f.dim(`--json`)}\n `).action((e,t)=>{try{o(e,t)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`categories`).option(`--json`,`JSON output`).description(`List all categories`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons categories`)} ${f.dim(`--json`)}\n `).action(e=>{let t=n();if(e.json)console.log(JSON.stringify(t,null,2));else for(let e of t)console.log(e)}),h.command(`styles`).option(`--json`,`JSON output`).description(`List all styles and provider tokens`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons styles`)}\n `).action(t=>{if(t.json)console.log(JSON.stringify(e,null,2));else{for(let t of e)console.log(t);console.log(f.dim(`
2
+ import{STYLES as e,getOverview as t,listCategories as n}from"./catalog.mjs";import{runSearch as r}from"./commands/search.mjs";import{runGet as i}from"./commands/get.mjs";import{runList as a}from"./commands/list.mjs";import{runInfo as o}from"./commands/info.mjs";import{createRequire as s}from"node:module";import{readFileSync as c,realpathSync as l}from"node:fs";import{fileURLToPath as u,pathToFileURL as d}from"node:url";import f from"picocolors";import{Command as p}from"commander";let m=`0.0.0`;try{m=s(import.meta.url)(`@solar-icons/cli/package.json`).version??`0.0.0`}catch{}if(m===`0.0.0`)try{let e=new URL(`../package.json`,import.meta.url);m=JSON.parse(c(u(e),`utf8`)).version??`0.0.0`}catch{}const h=new p().name(`solar-icons`).description(`Solar Icons CLI — search, get and list 1,451 icons × 6 styles.`).version(m,`-v, --version`).showHelpAfterError().showSuggestionAfterError().configureHelp({sortSubcommands:!0,styleTitle:e=>f.bold(f.cyan(e)),styleCommandText:e=>f.cyan(e),styleCommandDescription:e=>f.dim(e),styleOptionText:e=>f.green(e),styleArgumentText:e=>f.yellow(e),styleDescriptionText:e=>f.dim(e),styleOptionTerm:e=>f.green(e)});h.addHelpText(`after`,`\n${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons`)} ${f.green(`search`)} ${f.yellow(`"home"`)} ${f.dim(`--limit 10 --framework react`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons`)} ${f.green(`get`)} ${f.yellow(`arrow-up`)} ${f.dim(`--style linear --framework vue`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons`)} ${f.green(`overview`)} ${f.dim(`--json`)} ${f.dim(`# for agents / CI`)}\n`),h.command(`search`).argument(`<query>`,`search query, e.g. "home" or "shopping cart"`).option(`-l, --limit <n>`,`max results (1..200, default 20)`,`20`).option(`--style <style>`,`restrict import hint to one style: ${e.join(`|`)}`).option(`--category <category>`,`restrict to category (see: solar-icons categories)`).option(`--framework <framework>`,`emit import snippet for framework (react|vue|svelte|solid|angular|react-native|nuxt|static|js|blade|flutter)`).option(`--json`,`machine-readable JSON output (for agents/MCP)`).description(`Search icons by name/tags/category`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons search`)} ${f.yellow(`"shopping cart"`)} ${f.dim(`--framework react`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons search`)} ${f.yellow(`arrow`)} ${f.dim(`--category arrows --json`)}\n `).action((e,t)=>{try{r(e,t)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`get`).argument(`<name>`,`kebab icon name, e.g. home`).option(`--style <style>`,`style`,`linear`).option(`--framework <framework>`,`framework for snippet`,`react`).option(`--out <file>`,`copy SVG to file`).option(`--json`,`JSON output`).description(`Get import snippet and SVG for an icon`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons get`)} ${f.yellow(`home`)} ${f.dim(`--style bold --framework svelte`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons get`)} ${f.yellow(`arrow-up`)} ${f.dim(`--out ./arrow.svg`)}\n `).action((e,t)=>{try{i(e,t)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`list`).option(`--category <category>`,`filter by category`).option(`--style <style>`,`hint style: ${e.join(`|`)}`).option(`-l, --limit <n>`,`max results (1..2000, default 50)`,`50`).option(`--json`,`JSON output`).description(`List icons`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons list`)} ${f.dim(`--category home --limit 20`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons list`)} ${f.dim(`--json | jq .[].name`)}\n `).action(e=>{try{a(e)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`info`).argument(`<name>`,`icon name`).option(`--json`,`JSON output`).description(`Show metadata and all import paths for an icon`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons info`)} ${f.yellow(`arrow-up`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons info`)} ${f.yellow(`heart`)} ${f.dim(`--json`)}\n `).action((e,t)=>{try{o(e,t)}catch(e){console.error(f.red(`error: ${e.message}`)),process.exit(2)}}),h.command(`categories`).option(`--json`,`JSON output`).description(`List all categories`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons categories`)} ${f.dim(`--json`)}\n `).action(e=>{let t=n();if(e.json)console.log(JSON.stringify(t,null,2));else for(let e of t)console.log(e)}),h.command(`styles`).option(`--json`,`JSON output`).description(`List all styles and provider tokens`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons styles`)}\n `).action(t=>{if(t.json)console.log(JSON.stringify(e,null,2));else{for(let t of e)console.log(t);console.log(f.dim(`
3
3
  Provider tokens: --solar-color, --solar-size, --solar-stroke-width, --solar-secondary-color, --solar-secondary-opacity`))}}),h.command(`overview`).option(`--json`,`JSON output`).description(`Show global overview — catalog, packages, Figma plugin and docs`).addHelpText(`after`,` ${f.bold(`Examples:`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons overview`)}\n ${f.dim(`$`)} ${f.cyan(`solar-icons overview`)} ${f.dim(`--json`)}\n `).action(e=>{let n=t();if(e.json){console.log(JSON.stringify(n,null,2));return}if(console.log(`${f.bgCyan(f.black(` Solar Icons `))} ${f.dim(`v${n.cliVersion}`)}`),console.log(``),console.log(`${f.bold(f.cyan(String(n.catalog.icons)))} ${f.dim(`icons`)} ${f.dim(`×`)} ${f.bold(String(n.catalog.styles))} ${f.dim(`styles`)} ${f.dim(`=`)} ${f.bold(f.cyan(String(n.catalog.variations)))} ${f.dim(`variations`)} ${f.dim(`—`)} ${f.bold(String(n.catalog.categories))} ${f.dim(`categories`)}`),console.log(f.dim(`─`.repeat(56))),n.packages.length>0){console.log(f.bold(`\nPackages (${n.packages.length})`));let e=Math.max(...n.packages.map(e=>e.name.length));for(let t of n.packages){let n=f.cyan(t.name.padEnd(e)),r=f.dim(`v${t.version}`.padEnd(8)),i=f.dim(t.description.length>58?`${t.description.slice(0,55)}…`:t.description);console.log(` ${f.dim(`›`)} ${n} ${r} ${i}`)}}else console.log(f.dim(`
4
4
  Packages: (run inside monorepo to list versions)`));console.log(``),console.log(`${f.bold(`Figma`)} ${f.underline(f.cyan(n.figma))}`),console.log(`${f.bold(`Docs `)} ${f.underline(f.cyan(n.docs))}`),console.log(`${f.bold(`Icons`)} ${f.underline(f.cyan(n.iconsExplorer))}`)});async function g(){await h.parseAsync(process.argv)}const _=process.argv[1]?l(process.argv[1]):void 0;_&&import.meta.url===d(_).href&&g();export{};
@@ -1,10 +1,9 @@
1
1
  //#region src/commands/get.d.ts
2
- type GetCliOptions = {
2
+ export type GetCliOptions = {
3
3
  style?: string;
4
4
  framework?: string;
5
5
  out?: string;
6
6
  json?: boolean;
7
7
  };
8
- declare function runGet(name: string | undefined, opts: GetCliOptions): void;
9
- //#endregion
10
- export { GetCliOptions, runGet };
8
+ export declare function runGet(name: string | undefined, opts: GetCliOptions): void;
9
+ //#endregion
@@ -1 +1 @@
1
- import{FRAMEWORKS as e,STYLES as t,cdnSvgUrl as n,importSnippet as r,loadDescriptions as i,resolveSvgPath as a}from"../catalog.mjs";import{copyFileSync as o,existsSync as s,mkdirSync as c,readFileSync as l}from"node:fs";import{dirname as u}from"node:path";import d from"picocolors";function f(e){let n=e??`linear`;if(t.includes(n))return n;throw Error(`--style must be one of: ${t.join(`, `)}. Received: '${e}'`)}function p(t){let n=t??`react`;if(e.includes(n))return n;throw Error(`--framework must be one of: ${e.join(`, `)}. Received: '${t}'`)}function m(e,t){e||(console.error(d.red(`error: get requires <name>. Example: solar-icons get home --style bold`)),process.exit(2));let m=f(t.style),h=p(t.framework),g=i().find(t=>t.name===e);g||(console.error(d.red(`error: icon '${e}' not found.`)),console.error(d.dim(`Try: solar-icons search "${e}" --limit 10`)),process.exit(2));let _=a(e,m),v=n(e,m),y=r(e,m,h);if(t.json){let t={name:e,style:m,framework:h,category:g.category,tags:g.tags,import:y,cdn:v,svgPath:_??null};if(_&&s(_))try{t.svg=l(_,`utf8`)}catch{}console.log(JSON.stringify(t,null,2));return}if(t.out){let e=t.out;_&&s(_)?(c(u(e),{recursive:!0}),o(_,e),console.log(d.green(e))):(console.error(d.yellow(`Local SVG not found (expected ${_??`unknown`}). CDN fallback: ${v}. Use --json to get CDN URL.`)),process.exit(2)),console.log(d.dim(y));return}if(console.log(d.green(y)),console.log(`${d.bold(`Category`)} ${d.cyan(g.category)}`),console.log(`${d.bold(`CDN`)} ${d.underline(d.cyan(v))}`),_&&s(_)){let e=l(_,`utf8`);console.log(`\n${d.dim(`Preview`)} ${d.dim(`(${e.length} bytes)`)}`),console.log(d.dim(e.slice(0,400)+(e.length>400?d.dim(` …`):``)))}}export{m as runGet};
1
+ import{FRAMEWORKS as e,STYLES as t,cdnSvgUrl as n,importSnippet as r,loadDescriptions as i,resolveIconName as a,resolveSvgPath as o}from"../catalog.mjs";import{copyFileSync as s,existsSync as c,mkdirSync as l,readFileSync as u}from"node:fs";import{dirname as d}from"node:path";import f from"picocolors";function p(e){let n=e??`linear`;if(t.includes(n))return n;throw Error(`--style must be one of: ${t.join(`, `)}. Received: '${e}'`)}function m(t){let n=t??`react`;if(e.includes(n))return n;throw Error(`--framework must be one of: ${e.join(`, `)}. Received: '${t}'`)}function h(e,t){e||(console.error(f.red(`error: get requires <name>. Example: solar-icons get home --style bold`)),process.exit(2));let h=p(t.style),g=m(t.framework),_=i(),{entry:v,alias:y}=(()=>{try{return a(_,e)}catch{console.error(f.red(`error: icon '${e}' not found.`)),console.error(f.dim(`Try: solar-icons search "${e}" --limit 10`)),process.exit(2)}})(),b=v.name,x=r(b,h,g),S=o(b,h),C=n(b,h);if(t.json){let t={name:b,style:h,framework:g,category:v.category,tags:v.tags,import:x,cdn:C,svgPath:S??null};if(y&&(t.requestedName=e,t.deprecated={alias:y.name,reason:y.reason}),S&&c(S))try{t.svg=u(S,`utf8`)}catch{}console.log(JSON.stringify(t,null,2));return}if(t.out){let e=t.out;S&&c(S)?(l(d(e),{recursive:!0}),s(S,e),console.log(f.green(e))):(console.error(f.yellow(`Local SVG not found (expected ${S??`unknown`}). CDN fallback: ${C}. Use --json to get CDN URL.`)),process.exit(2)),console.log(f.dim(x));return}if(console.log(f.green(x)),y&&console.log(f.yellow(`Deprecated name '${y.name}': ${y.reason} Using '${b}'.`)),console.log(`${f.bold(`Category`)} ${f.cyan(v.category)}`),console.log(`${f.bold(`CDN`)} ${f.underline(f.cyan(C))}`),S&&c(S)){let e=u(S,`utf8`);console.log(`\n${f.dim(`Preview`)} ${f.dim(`(${e.length} bytes)`)}`),console.log(f.dim(e.slice(0,400)+(e.length>400?f.dim(` …`):``)))}}export{h as runGet};
@@ -1,7 +1,6 @@
1
1
  //#region src/commands/info.d.ts
2
- type InfoCliOptions = {
2
+ export type InfoCliOptions = {
3
3
  json?: boolean;
4
4
  };
5
- declare function runInfo(name: string | undefined, opts: InfoCliOptions): void;
6
- //#endregion
7
- export { InfoCliOptions, runInfo };
5
+ export declare function runInfo(name: string | undefined, opts: InfoCliOptions): void;
6
+ //#endregion
@@ -1,10 +1,9 @@
1
1
  //#region src/commands/list.d.ts
2
- type ListCliOptions = {
2
+ export type ListCliOptions = {
3
3
  category?: string;
4
4
  style?: string;
5
5
  json?: boolean;
6
6
  limit?: string;
7
7
  };
8
- declare function runList(opts: ListCliOptions): void;
9
- //#endregion
10
- export { ListCliOptions, runList };
8
+ export declare function runList(opts: ListCliOptions): void;
9
+ //#endregion
@@ -1,11 +1,10 @@
1
1
  //#region src/commands/search.d.ts
2
- type SearchCliOptions = {
2
+ export type SearchCliOptions = {
3
3
  limit?: string;
4
4
  style?: string;
5
5
  category?: string;
6
6
  framework?: string;
7
7
  json?: boolean;
8
8
  };
9
- declare function runSearch(query: string | undefined, opts: SearchCliOptions): void;
10
- //#endregion
11
- export { SearchCliOptions, runSearch };
9
+ export declare function runSearch(query: string | undefined, opts: SearchCliOptions): void;
10
+ //#endregion
@@ -1 +1 @@
1
- import{FRAMEWORKS as e,STYLES as t,importSnippet as n,loadDescriptions as r}from"../catalog.mjs";import{searchCatalog as i}from"../search.mjs";import a from"picocolors";function o(e){if(!e)return 20;let t=Number(e);if(!Number.isInteger(t)||t<=0||t>200)throw Error(`--limit must be 1..200. Received: '${e}'`);return t}function s(e){if(e){if(t.includes(e))return e;throw Error(`--style must be one of: ${t.join(`, `)}. Received: '${e}'`)}}function c(t){if(t){if(e.includes(t))return t;throw Error(`--framework must be one of: ${e.join(`, `)}. Received: '${t}'`)}}function l(e,t){e||(console.error(a.red(`error: search query is required. Example: solar-icons search "home"`)),process.exit(2));let l=o(t.limit),u=s(t.style),d=c(t.framework),f=r(),p=i(f,{query:e,limit:l,style:u,category:t.category});if(t.json){let e=p.map(e=>({name:e.name,category:e.category,tags:e.tags,categoryTags:e.categoryTags,score:e.score,...d?{import:n(e.name,u??`linear`,d)}:{},...u?{styleHint:u}:{}}));console.log(JSON.stringify(e,null,2));return}p.length===0&&(console.error(a.yellow(`No match for "${e}". Try broader terms or: solar-icons categories`)),process.exit(2));let m=Math.max(...p.map(e=>e.name.length),12);for(let e of p){let t=` ${a.cyan(a.bold(e.name.padEnd(m)))} ${a.dim(e.category.padEnd(16))} ${a.dim(e.tags.slice(0,4).join(`, `))}`;if(d){let r=n(e.name,u??`linear`,d);console.log(`${t}\n ${a.dim(`→`)} ${a.green(r)}`)}else console.log(t)}console.log(a.dim(`\n ${p.length} result${p.length>1?`s`:``} — try --framework react or --json`))}export{l as runSearch};
1
+ import{FRAMEWORKS as e,STYLES as t,importSnippet as n,loadDescriptions as r}from"../catalog.mjs";import{searchCatalog as i}from"../search.mjs";import a from"picocolors";function o(e){if(!e)return 20;let t=Number(e);if(!Number.isInteger(t)||t<=0||t>200)throw Error(`--limit must be 1..200. Received: '${e}'`);return t}function s(e){if(e){if(t.includes(e))return e;throw Error(`--style must be one of: ${t.join(`, `)}. Received: '${e}'`)}}function c(t){if(t){if(e.includes(t))return t;throw Error(`--framework must be one of: ${e.join(`, `)}. Received: '${t}'`)}}function l(e,t){e||(console.error(a.red(`error: search query is required. Example: solar-icons search "home"`)),process.exit(2));let l=o(t.limit),u=s(t.style),d=c(t.framework),f=r(),p=i(f,{query:e,limit:l,style:u,category:t.category});if(t.json){let e=p.map(e=>({name:e.name,category:e.category,tags:e.tags,categoryTags:e.categoryTags,score:e.score,...e.matchedAlias?{matchedAlias:e.matchedAlias}:{},...d?{import:n(e.name,u??`linear`,d)}:{},...u?{styleHint:u}:{}}));console.log(JSON.stringify(e,null,2));return}p.length===0&&(console.error(a.yellow(`No match for "${e}". Try broader terms or: solar-icons categories`)),process.exit(2));let m=Math.max(...p.map(e=>e.name.length),12);for(let e of p){let t=` ${a.cyan(a.bold(e.name.padEnd(m)))} ${a.dim(e.category.padEnd(16))} ${a.dim(e.tags.slice(0,4).join(`, `))}${e.matchedAlias?a.yellow(` (via deprecated '${e.matchedAlias}')`):``}`;if(d){let r=n(e.name,u??`linear`,d);console.log(`${t}\n ${a.dim(`→`)} ${a.green(r)}`)}else console.log(t)}console.log(a.dim(`\n ${p.length} result${p.length>1?`s`:``} — try --framework react or --json`))}export{l as runSearch};
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { DOCS_URL, FIGMA_URL, FRAMEWORKS, Framework, ICONS_URL, IconDescription, Overview, PackageInfo, STYLES, Style, catalogStats, cdnSvgUrl, componentName, getOverview, importSnippet, listCategories, loadDescriptions, perFileComponentName, resolveSvgPath, rootComponentName, rootImportSnippet, styleToPascal, toPascalKebab } from "./catalog.mjs";
1
+ import { DOCS_URL, DeprecatedAlias, FIGMA_URL, FRAMEWORKS, Framework, ICONS_URL, IconDescription, Overview, PackageInfo, STYLES, Style, catalogStats, cdnSvgUrl, componentName, getOverview, importSnippet, listCategories, loadDescriptions, perFileComponentName, resolveIconName, resolveSvgPath, rootComponentName, rootImportSnippet, styleToPascal, toDartPath, toPascalKebab } from "./catalog.mjs";
2
2
  import { SearchOptions, SearchResult, searchCatalog } from "./search.mjs";
3
3
  import { runSearch } from "./commands/search.mjs";
4
4
  import { runGet } from "./commands/get.mjs";
5
5
  import { runList } from "./commands/list.mjs";
6
6
  import { runInfo } from "./commands/info.mjs";
7
- export { DOCS_URL, FIGMA_URL, FRAMEWORKS, Framework, ICONS_URL, IconDescription, Overview, PackageInfo, STYLES, SearchOptions, SearchResult, Style, catalogStats, cdnSvgUrl, componentName, getOverview, importSnippet, listCategories, loadDescriptions, perFileComponentName, resolveSvgPath, rootComponentName, rootImportSnippet, runGet, runInfo, runList, runSearch, searchCatalog, styleToPascal, toPascalKebab };
7
+ export { DOCS_URL, DeprecatedAlias, FIGMA_URL, FRAMEWORKS, Framework, ICONS_URL, IconDescription, Overview, PackageInfo, STYLES, SearchOptions, SearchResult, Style, catalogStats, cdnSvgUrl, componentName, getOverview, importSnippet, listCategories, loadDescriptions, perFileComponentName, resolveIconName, resolveSvgPath, rootComponentName, rootImportSnippet, runGet, runInfo, runList, runSearch, searchCatalog, styleToPascal, toDartPath, toPascalKebab };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{DOCS_URL as e,FIGMA_URL as t,FRAMEWORKS as n,ICONS_URL as r,STYLES as i,catalogStats as a,cdnSvgUrl as o,componentName as s,getOverview as c,importSnippet as l,listCategories as u,loadDescriptions as d,perFileComponentName as f,resolveSvgPath as p,rootComponentName as m,rootImportSnippet as h,styleToPascal as g,toPascalKebab as _}from"./catalog.mjs";import{searchCatalog as v}from"./search.mjs";import{runSearch as y}from"./commands/search.mjs";import{runGet as b}from"./commands/get.mjs";import{runList as x}from"./commands/list.mjs";import{runInfo as S}from"./commands/info.mjs";export{e as DOCS_URL,t as FIGMA_URL,n as FRAMEWORKS,r as ICONS_URL,i as STYLES,a as catalogStats,o as cdnSvgUrl,s as componentName,c as getOverview,l as importSnippet,u as listCategories,d as loadDescriptions,f as perFileComponentName,p as resolveSvgPath,m as rootComponentName,h as rootImportSnippet,b as runGet,S as runInfo,x as runList,y as runSearch,v as searchCatalog,g as styleToPascal,_ as toPascalKebab};
1
+ import{DOCS_URL as e,FIGMA_URL as t,FRAMEWORKS as n,ICONS_URL as r,STYLES as i,catalogStats as a,cdnSvgUrl as o,componentName as s,getOverview as c,importSnippet as l,listCategories as u,loadDescriptions as d,perFileComponentName as f,resolveIconName as p,resolveSvgPath as m,rootComponentName as h,rootImportSnippet as g,styleToPascal as _,toDartPath as v,toPascalKebab as y}from"./catalog.mjs";import{searchCatalog as b}from"./search.mjs";import{runSearch as x}from"./commands/search.mjs";import{runGet as S}from"./commands/get.mjs";import{runList as C}from"./commands/list.mjs";import{runInfo as w}from"./commands/info.mjs";export{e as DOCS_URL,t as FIGMA_URL,n as FRAMEWORKS,r as ICONS_URL,i as STYLES,a as catalogStats,o as cdnSvgUrl,s as componentName,c as getOverview,l as importSnippet,u as listCategories,d as loadDescriptions,f as perFileComponentName,p as resolveIconName,m as resolveSvgPath,h as rootComponentName,g as rootImportSnippet,S as runGet,w as runInfo,C as runList,x as runSearch,b as searchCatalog,_ as styleToPascal,v as toDartPath,y as toPascalKebab};
package/dist/search.d.mts CHANGED
@@ -1,15 +1,15 @@
1
1
  import { IconDescription, Style } from "./catalog.mjs";
2
2
  //#region src/search.d.ts
3
- type SearchOptions = {
3
+ export type SearchOptions = {
4
4
  query: string;
5
5
  limit?: number;
6
6
  style?: Style;
7
7
  category?: string;
8
8
  };
9
- type SearchResult = IconDescription & {
9
+ export type SearchResult = IconDescription & {
10
10
  score: number;
11
11
  styleHint: Style;
12
+ matchedAlias?: string;
12
13
  };
13
- declare function searchCatalog(descriptions: IconDescription[], opts: SearchOptions): SearchResult[];
14
- //#endregion
15
- export { SearchOptions, SearchResult, searchCatalog };
14
+ export declare function searchCatalog(descriptions: IconDescription[], opts: SearchOptions): SearchResult[];
15
+ //#endregion
package/dist/search.mjs CHANGED
@@ -1 +1 @@
1
- function e(e){return e.toLowerCase()}function t(t,n){let r=n.query.trim().toLowerCase();if(!r)return[];let i=n.limit??20,a=n.style??`linear`,o=r.split(/\s+/).filter(Boolean),s=n.category?t.filter(t=>e(t.category)===e(n.category)):t,c=[];for(let t of s){let i=e(t.name),s=(t.tags??[]).map(e).join(` `),l=(t.categoryTags??[]).map(e).join(` `),u=0;if(i===r)u=100;else if(i.includes(r))u=50;else if(o.every(e=>i.includes(e)))u=40;else if(s.includes(r))u=30;else if(l.includes(r))u=18;else if(o.every(e=>(s+` `+l).includes(e)))u=15;else if(o.some(e=>i.includes(e)||s.includes(e)||l.includes(e)))u=8;else continue;n.category&&(u+=2),c.push({...t,score:u,styleHint:a})}return c.sort((e,t)=>t.score-e.score||e.name.localeCompare(t.name)),c.slice(0,i)}export{t as searchCatalog};
1
+ function e(e){return e.toLowerCase()}function t(t,n){let r=n.query.trim().toLowerCase();if(!r)return[];let i=n.limit??20,a=n.style??`linear`,o=r.split(/\s+/).filter(Boolean),s=n.category?t.filter(t=>e(t.category)===e(n.category)):t,c=[];for(let t of s){let i=e(t.name),s=(t.tags??[]).map(e).join(` `),l=(t.categoryTags??[]).map(e).join(` `),u=0,d,f=(t.deprecatedAliases??[]).map(e=>e.name);if(i===r)u=100;else if(f.some(t=>e(t)===r))u=90,d=f.find(t=>e(t)===r);else if(i.includes(r))u=50;else if(o.every(e=>i.includes(e)))u=40;else if(f.some(t=>e(t).includes(r)))u=35,d=f.find(t=>e(t).includes(r));else if(s.includes(r))u=30;else if(l.includes(r))u=18;else if(o.every(e=>(s+` `+l).includes(e)))u=15;else if(o.some(e=>i.includes(e)||s.includes(e)||l.includes(e)))u=8;else continue;n.category&&(u+=2),c.push({...t,score:u,styleHint:a,...d?{matchedAlias:d}:{}})}return c.sort((e,t)=>t.score-e.score||e.name.localeCompare(t.name)),c.slice(0,i)}export{t as searchCatalog};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-icons/cli",
3
- "version": "2.4.2",
3
+ "version": "2.6.0",
4
4
  "private": false,
5
5
  "description": "CLI for Solar Icons — search, get and list 1,380 icons × 6 styles. Base for skills and MCP.",
6
6
  "keywords": [
@@ -47,13 +47,13 @@
47
47
  "picocolors": "^1.1.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@tala-tools/tsconfig": "0.0.2",
51
- "@types/node": "^26.5.1",
50
+ "@tala-tools/tsconfig": "0.1.0",
51
+ "@types/node": "^26.6.2",
52
52
  "rimraf": "^6.1.3",
53
- "tsdown": "^0.22.14",
54
- "tsx": "^4.23.13",
53
+ "tsdown": "^0.23.0",
54
+ "tsx": "^4.23.15",
55
55
  "typescript": "7.0.2",
56
- "vitest": "^4.1.11"
56
+ "vitest": "^5.0.2"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=18"