@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 +4 -4
- package/dist/cli.js +6 -6
- package/dist/core.js +1 -1
- package/dist/data/bulk-regular.json +1 -1
- package/dist/data/bulk-round.json +1 -1
- package/dist/data/bulk-sharp.json +1 -1
- package/dist/data/duocolor-regular.json +1 -1
- package/dist/data/duocolor-round.json +1 -1
- package/dist/data/duocolor-sharp.json +1 -1
- package/dist/data/duotone-regular.json +1 -1
- package/dist/data/duotone-round.json +1 -1
- package/dist/data/duotone-sharp.json +1 -1
- package/dist/data/fill-regular.json +1 -1
- package/dist/data/fill-round.json +1 -1
- package/dist/data/fill-sharp.json +1 -1
- package/dist/data/index.json +1 -1
- package/dist/data/line-regular.json +1 -1
- package/dist/data/line-round.json +1 -1
- package/dist/data/line-sharp.json +1 -1
- package/package.json +1 -1
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,
|
|
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
|
|
9
|
-
npx @coolicons/cli show
|
|
10
|
-
npx @coolicons/cli add
|
|
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
|
|
32
|
-
npx @coolicons/cli show
|
|
33
|
-
npx @coolicons/cli add
|
|
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
|
|
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
|
|
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
|
|
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) =>
|
|
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
|
}
|