Compare commits

..
Author SHA1 Message Date
Karsa ec3c3906f7 feat(scripts): added icon usage script 2026-08-31 17:54:23 +02:00
25 changed files with 1226 additions and 231 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
.next
.obsidian
.now
.idea
.cache
.env
node_modules
dist
-31
View File
@@ -1,31 +0,0 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"colebemis",
"karsa-mistmere",
"ericfennis",
"jguddas",
"jennieboops"
],
"use-cases": [
"Composing or editing email messages",
"Drafting letters in mail interfaces",
"Editing email addresses on settings pages"
],
"tags": [
"email",
"message",
"letter",
"pen",
"edit",
"compose",
"draft",
"write",
"writing",
"create",
"reply"
],
"categories": [
"mail"
]
}
-15
View File
@@ -1,15 +0,0 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M15.506 17.646A2 2 0 0015 18.5l-.837 2.87a.5.5 0 00.62.62l2.87-.837a2 2 0 00.854-.506l3.013-3.009a1 1 0 00-3.004-3.004z" />
<path d="M22 10.346V6a2 2 0 00-2-2H4a2 2 0 00-2 2v12a2 2 0 002 2h6.396" />
<path d="m22 7-8.991 5.727a2 2 0 01-2.009 0L2 7" />
</svg>

Before

Width:  |  Height:  |  Size: 474 B

-6
View File
@@ -8,15 +8,9 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"connected",
"success",
"verified",
"running",
"active",
"virtual machine",
+4 -7
View File
@@ -9,12 +9,6 @@
],
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"virtual machine",
"virtual desktop",
"vm",
@@ -26,7 +20,10 @@
"software as a service",
"saas",
"workstation",
"environment"
"environment",
"tv",
"screen",
"display"
],
"categories": [
"connectivity",
+1 -3
View File
@@ -8,15 +8,13 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"virtual machine",
"vm",
"executable",
"settings",
"cog",
"edit",
"gear",
"configuration",
-6
View File
@@ -8,15 +8,9 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"status",
"notification",
"indicator",
"running",
"active",
"virtual machine",
+1 -6
View File
@@ -8,15 +8,10 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"download",
"remote",
"cast"
"download"
],
"categories": [
"connectivity",
+1 -11
View File
@@ -7,17 +7,7 @@
],
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"offline",
"disabled",
"disconnected",
"power"
"share"
],
"categories": [
"connectivity",
-4
View File
@@ -8,16 +8,12 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"video",
"movie",
"film",
"pause",
"suspend",
"hibernate",
"boot",
-4
View File
@@ -8,16 +8,12 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"video",
"movie",
"film",
"play",
"running",
"start",
"boot",
+4 -12
View File
@@ -6,25 +6,17 @@
"jguddas",
"ericfennis"
],
"use-cases": [
"Showing synchronization between desktop and mobile devices",
"Representing responsive previews across screen sizes",
"Indicating casting or screen sharing to a display"
],
"use-cases": [],
"tags": [
"smartphone",
"phone",
"cellphone",
"device",
"mobile",
"desktop",
"screen",
"display",
"external display",
"screen sharing",
"monitor",
"responsive",
"screens",
"sync",
"cast"
"screens"
],
"categories": [
"connectivity",
+2 -11
View File
@@ -6,18 +6,9 @@
],
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"devices",
"connect",
"cast",
"audio",
"sound",
"volume",
"presentation"
"cast"
],
"categories": [
"connectivity",
-3
View File
@@ -8,12 +8,9 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"video",
"movie",
"film",
+1 -5
View File
@@ -8,16 +8,12 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"upload",
"connect",
"remote",
"screen sharing",
"cast"
"screen share"
],
"categories": [
"connectivity",
-6
View File
@@ -8,18 +8,12 @@
"use-cases": [],
"tags": [
"tv",
"computer",
"screen",
"display",
"desktop",
"external display",
"screen sharing",
"virtual machine",
"vm",
"close",
"error",
"failed",
"disconnected",
"stop",
"suspend",
"remove",
+1 -9
View File
@@ -7,19 +7,11 @@
"jguddas",
"karsa-mistmere"
],
"use-cases": [
"Representing desktop displays and computer monitors",
"Showing screen-sharing or external display settings",
"Indicating virtual machines in infrastructure dashboards"
],
"use-cases": [],
"tags": [
"tv",
"computer",
"desktop",
"screen",
"display",
"external display",
"screen sharing",
"virtual machine",
"vm"
],
+2 -11
View File
@@ -5,21 +5,12 @@
"mittalyashu",
"ericfennis"
],
"use-cases": [
"Representing mobile phones in device settings",
"Showing mobile access or app availability",
"Indicating phone-based communication channels"
],
"use-cases": [],
"tags": [
"phone",
"cellphone",
"device",
"mobile",
"screen",
"display",
"touchscreen",
"portable",
"responsive"
"screen"
],
"categories": [
"connectivity",
+3 -14
View File
@@ -3,24 +3,13 @@
"contributors": [
"danielbayley"
],
"use-cases": [
"Previewing layouts across mobile device sizes",
"Testing responsive behavior on handheld screens",
"Representing mobile-first design workflows"
],
"use-cases": [],
"tags": [
"phone",
"cellphone",
"device",
"mobile",
"screen",
"display",
"touchscreen",
"portable",
"responsive",
"screens",
"browser",
"testing"
"testing",
"mobile"
],
"categories": [
"devices",
+2 -11
View File
@@ -4,18 +4,9 @@
"colebemis",
"ericfennis"
],
"use-cases": [
"Representing tablet devices in responsive layouts",
"Showing touch-based interfaces on larger mobile screens"
],
"use-cases": [],
"tags": [
"device",
"mobile",
"screen",
"display",
"touchscreen",
"portable",
"responsive"
"device"
],
"categories": [
"devices"
-41
View File
@@ -1,41 +0,0 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"briz123",
"UsamaKhan",
"ajokt123",
"timmy471",
"jguddas",
"karsa-mistmere"
],
"use-cases": [
"Representing coaches or referees in sports apps",
"Signaling alerts in training interfaces",
"Indicating traffic control or public safety roles",
"Marking lifeguard equipment in safety systems"
],
"tags": [
"alert",
"signal",
"sound",
"blow",
"noise",
"coach",
"trainer",
"referee",
"gym",
"game",
"training",
"sports",
"traffic cops",
"police",
"lifeguard",
"safety",
"rescue",
"emergency"
],
"categories": [
"sports",
"notifications"
]
}
-14
View File
@@ -1,14 +0,0 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10 6v4" />
<path d="M21 6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-5.675A7 7 0 1 1 9 6z" />
</svg>

Before

Width:  |  Height:  |  Size: 304 B

+1
View File
@@ -26,6 +26,7 @@
"generate:sponsors": "node scripts/updateSponsors.mts",
"generate:contributors": "node ./scripts/updateContributors.mts icons/*.svg",
"generate:nextJSAliases": "node ./scripts/generateNextJSAliases.mts",
"icon-usage": "node ./scripts/iconUsage.mts",
"suggest:metadata": "node ./scripts/suggestMetaData.mts",
"suggest:metadata:watch": "node --env-file .env --watch ./scripts/suggestMetaData.mts",
"postinstall": "husky install",
+41
View File
@@ -0,0 +1,41 @@
# Lucide Icon Usage Estimator
Run with:
```sh
pnpm icon-usage trash trash-2
```
The default is a bounded first pass over `lucide-react`, with two GitHub search pages and up to 200 candidate files validated per query slice. Use `--all-packages` to include every supported package, or `--thorough` for the previous broader limits of 10 pages and 1,000 candidate files per query slice.
GitHub code search requires authentication, so set `GITHUB_TOKEN` or pass `--token-env <NAME>`.
Use `--verbose` or `-v` to print detailed progress logs to stderr, including queries, pages, cache hits, retries, content validation, and matches.
## Method
The script uses GitHub REST `GET /search/code` with package-scoped, code-extension-scoped queries, then fetches each returned file and validates common Lucide import styles before counting a repository. Counts are deduplicated by `owner/repository`.
Output includes overall repository counts and per-package statistics. Per-package statistics are computed from validated matches for that package, so a repository using `trash` via `lucide-react` and `trash-2` via another package is represented correctly in both the overall totals and each package section.
Supported packages are `lucide-react`, `@lucide/vue`, `@lucide/svelte`, `@lucide/angular`, `@lucide/astro`, `lucide-preact`, `lucide-solid`, `lucide`, and `@lucide/lab`. The default package is `lucide-react` because all packages plus file-scope slicing is slow for broad icons; use `--all-packages` when that broader sample is needed.
Searches are split across relevant implementation file scopes using REST code search qualifiers such as `language:typescript`, `language:javascript`, `extension:vue`, and `extension:svelte`. Returned paths are still filtered by expected extensions before content is fetched, so Markdown and prompt/spec files are intentionally excluded by default because they frequently contain examples or generated implementation notes rather than live package usage.
By default, queries exclude forks, archived repositories, generated files, and vendored files using GitHub code search qualifiers. Use `--include-forks`, `--include-archived`, `--include-generated`, or `--include-vendored` to include them.
## GitHub API Limits
GitHub REST code search is authenticated and rate-limited to 10 requests per minute. Each query can return at most 1,000 results, with up to 100 results per page. Search only covers default branches and files smaller than 384 KB.
`total_count` and `incomplete_results` come from GitHub search and are recorded in JSON metadata. If a query exceeds the 1,000-result cap or returns `incomplete_results: true`, the script reports a warning and the result should be treated as incomplete rather than exhaustive.
GitHub's newer code search syntax is usable for public code search queries and supports qualifiers such as `NOT is:fork`, `NOT is:archived`, `NOT is:generated`, and `NOT is:vendored`, but the documented REST code search endpoint remains capped for result retrieval.
## Practical Strategy For Broad Icons
For common icons that hit search caps, use the script output as lower-bound or sampled evidence. The most defensible follow-up is to narrow query slices and cite them separately, for example by package, language/path, or repository cohorts, while preserving the JSON metadata for every query performed.
## Known Biases
Only public GitHub repositories visible to the token are observable. Private repositories and consumers outside GitHub are absent. GitHub is not representative of every Lucide consumer. Framework/package usage can differ materially. GitHub indexing may be incomplete or delayed. Generated or vendored code can still create false positives when GitHub does not identify it. Very common icons may exceed GitHub search-result caps.
File diff suppressed because it is too large Load Diff