@coolicons/cli 5.1.0 → 5.2.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
@@ -2,12 +2,12 @@
2
2
 
3
3
  <a href="https://coolicons.cool"><img src="https://raw.githubusercontent.com/krystonschwarze/coolicons/main/.github/assets/banner.png" alt="coolicons: Every icon for your next project. Free, wherever you build." width="100%"></a>
4
4
 
5
- Search [coolicons](https://coolicons.cool) and copy them into your project from the terminal: 1,258 icons in five styles and three corner radii. No install, no dependencies, no network. The whole set ships inside the package.
5
+ Search [coolicons](https://coolicons.cool) and copy them into your project from the terminal: 1,324 icons in five styles and three corner radii. No install, no dependencies, no network. The whole set ships inside the package.
6
6
 
7
7
  ```sh
8
- npx @coolicons/cli search delete
9
- npx @coolicons/cli show trash --style fill > trash.svg
10
- npx @coolicons/cli add trash bell --style bulk --radius round --out src/icons
8
+ npx @coolicons/cli search date
9
+ npx @coolicons/cli show calendar --style fill > calendar.svg
10
+ npx @coolicons/cli add calendar bell --style bulk --radius round --out src/icons
11
11
  ```
12
12
 
13
13
  ## Commands
package/dist/cli.js CHANGED
@@ -28,9 +28,9 @@ Options
28
28
  -v, --version Show the version
29
29
 
30
30
  Examples
31
- npx @coolicons/cli search delete
32
- npx @coolicons/cli show trash --style fill > trash.svg
33
- npx @coolicons/cli add trash bell --style bulk --radius round --out src/icons
31
+ npx @coolicons/cli search date
32
+ npx @coolicons/cli show calendar --style fill > calendar.svg
33
+ npx @coolicons/cli add calendar bell --style bulk --radius round --out src/icons
34
34
  `;
35
35
 
36
36
  const SHORT = { s: "style", r: "radius", o: "out", l: "limit", c: "category", h: "help", v: "version" };
@@ -69,7 +69,7 @@ function run({ command, words, options }) {
69
69
 
70
70
  if (command === "search") {
71
71
  const query = words.join(" ");
72
- if (!query) throw new LookupError("search needs a query, like: coolicons search delete");
72
+ if (!query) throw new LookupError("search needs a query, like: coolicons search date");
73
73
  const results = search(query, Number(options.limit ?? 20));
74
74
  if (options.json) return out(JSON.stringify(results.map((icon) => ({ ...icon, component: component(icon) })), null, 2));
75
75
  if (!results.length) {
@@ -84,12 +84,12 @@ function run({ command, words, options }) {
84
84
  }
85
85
 
86
86
  if (command === "show") {
87
- if (words.length !== 1) throw new LookupError("show needs exactly one name, like: coolicons show trash");
87
+ if (words.length !== 1) throw new LookupError("show needs exactly one name, like: coolicons show calendar");
88
88
  return out(svg(words[0], variant(options)));
89
89
  }
90
90
 
91
91
  if (command === "add") {
92
- if (!words.length) throw new LookupError("add needs at least one name, like: coolicons add trash bell");
92
+ if (!words.length) throw new LookupError("add needs at least one name, like: coolicons add calendar bell");
93
93
  const icons = words.map(findIcon);
94
94
  const folder = path.resolve(options.out ?? "icons");
95
95
  mkdirSync(folder, { recursive: true });
package/dist/core.js CHANGED
@@ -126,7 +126,7 @@ export function usage(inputs, { framework = "react", style = "line", radius = "r
126
126
  };
127
127
  }
128
128
  if (framework === "shadcn") {
129
- const items = icons.map((icon) => `${SITE}/r/${registryItem(icon, style, radius)}.json`);
129
+ const items = icons.map((icon) => `@coolicons/${registryItem(icon, style, radius)}`);
130
130
  const files = icons.map((icon) => `components/icons/${registryItem(icon, style, radius)}.tsx`);
131
131
  return { install: `npx shadcn@latest add ${items.join(" ")}`, code: `Adds ${files.join(", ")} exporting ${names.join(", ")}.` };
132
132
  }