diff --git a/scripts/build-icons.py b/scripts/build-icons.py index 1da01fc..b191b2a 100644 --- a/scripts/build-icons.py +++ b/scripts/build-icons.py @@ -218,7 +218,7 @@ def normalize_tabler(raw: str) -> str: body = re.sub(r'', "", body) body = re.sub(r"\s+", " ", body).strip() return ( - '' ) @@ -232,7 +232,7 @@ def normalize_simple(raw: str) -> str: body = inner.group(1).strip() body = re.sub(r"\s+", " ", body).strip() return ( - '' ) @@ -284,7 +284,7 @@ def normalize_url(raw: str) -> str: body = re.sub(r'\bfill="none"', '', body) body = re.sub(r"\s+", " ", body).strip() return ( - f'' ) @@ -303,7 +303,7 @@ def normalize_devicon(raw: str) -> str: body = re.sub(r'\bclass="[^"]*"', 'fill="currentColor"', body) body = re.sub(r"\s+", " ", body).strip() return ( - '' ) @@ -320,7 +320,7 @@ def normalize_logz(raw: str) -> str: body = re.sub(r'\bfill="#[0-9a-fA-F]{3,8}"', 'fill="currentColor"', body) body = re.sub(r"\s+", " ", body).strip() return ( - '' ) diff --git a/scripts/test-lint-a11y.py b/scripts/test-lint-a11y.py index 19ea76c..37ae5ec 100644 --- a/scripts/test-lint-a11y.py +++ b/scripts/test-lint-a11y.py @@ -3,6 +3,7 @@ from __future__ import annotations +import importlib.util import shutil import subprocess import sys @@ -12,6 +13,7 @@ from pathlib import Path ROOT = Path(__file__).resolve().parent.parent LINTER = ROOT / "scripts/lint-skin.py" +BUILD_ICONS = ROOT / "scripts/build-icons.py" VALID_SVG = """\ int: directory, ) + spec = importlib.util.spec_from_file_location("build_icons", BUILD_ICONS) + if spec is None or spec.loader is None: + raise AssertionError("generated-icons: could not load build-icons.py") + build_icons = importlib.util.module_from_spec(spec) + previous_bytecode_setting = sys.dont_write_bytecode + sys.dont_write_bytecode = True + try: + spec.loader.exec_module(build_icons) + finally: + sys.dont_write_bytecode = previous_bytecode_setting + generated_icons = { + "tabler": build_icons.normalize_tabler(""), + "simple": build_icons.normalize_simple(""), + "url": build_icons.normalize_url( + '' + ), + "devicon": build_icons.normalize_devicon(""), + "logz": build_icons.normalize_logz(""), + } + for source, icon in generated_icons.items(): + require_pass( + f"generated-{source}-icon", + VALID_SVG.replace("", f" {icon}\n"), + directory, + ) + project = directory / "baseline-project" (project / "scripts").mkdir(parents=True) (project / "skills/diagram-design/assets").mkdir(parents=True) diff --git a/skills/diagram-design/references/primitive-icons.md b/skills/diagram-design/references/primitive-icons.md index 036f5f6..0721e45 100644 --- a/skills/diagram-design/references/primitive-icons.md +++ b/skills/diagram-design/references/primitive-icons.md @@ -14,7 +14,7 @@ Generic icons are stroked (1.5px, hairline, like the rest of the skill); brand s User laptop or workstation. ```svg - + ``` Source: Tabler Icons / `device-laptop` (MIT) @@ -23,7 +23,7 @@ Source: Tabler Icons / `device-laptop` (MIT) Mobile phone or tablet client. ```svg - + ``` Source: Tabler Icons / `device-mobile` (MIT) @@ -32,7 +32,7 @@ Source: Tabler Icons / `device-mobile` (MIT) Desktop computer. ```svg - + ``` Source: Tabler Icons / `device-desktop` (MIT) @@ -41,7 +41,7 @@ Source: Tabler Icons / `device-desktop` (MIT) Physical server or VM host. ```svg - + ``` Source: Tabler Icons / `server` (MIT) @@ -50,7 +50,7 @@ Source: Tabler Icons / `server` (MIT) Container image or running instance. ```svg - + ``` Source: Tabler Icons / `package` (MIT) @@ -59,7 +59,7 @@ Source: Tabler Icons / `package` (MIT) Virtual machine. ```svg - + ``` Source: Tabler Icons / `cube` (MIT) @@ -70,7 +70,7 @@ Source: Tabler Icons / `cube` (MIT) End user or single actor. ```svg - + ``` Source: Tabler Icons / `user` (MIT) @@ -79,7 +79,7 @@ Source: Tabler Icons / `user` (MIT) Group / cohort / team. ```svg - + ``` Source: Tabler Icons / `users` (MIT) @@ -88,7 +88,7 @@ Source: Tabler Icons / `users` (MIT) Privileged user / admin. ```svg - + ``` Source: Tabler Icons / `user-shield` (MIT) @@ -97,7 +97,7 @@ Source: Tabler Icons / `user-shield` (MIT) Bot, agent, or automated process. ```svg - + ``` Source: Tabler Icons / `robot` (MIT) @@ -108,7 +108,7 @@ Source: Tabler Icons / `robot` (MIT) Cloud provider or boundary. ```svg - + ``` Source: Tabler Icons / `cloud` (MIT) @@ -117,7 +117,7 @@ Source: Tabler Icons / `cloud` (MIT) Public internet. ```svg - + ``` Source: Tabler Icons / `world` (MIT) @@ -126,7 +126,7 @@ Source: Tabler Icons / `world` (MIT) CDN or edge cache. ```svg - + ``` Source: Tabler Icons / `world-www` (MIT) @@ -135,7 +135,7 @@ Source: Tabler Icons / `world-www` (MIT) Firewall or perimeter control. ```svg - + ``` Source: Tabler Icons / `wall` (MIT) @@ -144,7 +144,7 @@ Source: Tabler Icons / `wall` (MIT) VPN or encrypted tunnel. ```svg - + ``` Source: Tabler Icons / `shield-lock` (MIT) @@ -153,7 +153,7 @@ Source: Tabler Icons / `shield-lock` (MIT) Load balancer / traffic split. ```svg - + ``` Source: Tabler Icons / `arrows-split` (MIT) @@ -162,7 +162,7 @@ Source: Tabler Icons / `arrows-split` (MIT) API gateway or ingress door. ```svg - + ``` Source: Tabler Icons / `door-enter` (MIT) @@ -171,7 +171,7 @@ Source: Tabler Icons / `door-enter` (MIT) DNS / name resolution. ```svg - + ``` Source: Tabler Icons / `tag` (MIT) @@ -182,7 +182,7 @@ Source: Tabler Icons / `tag` (MIT) Relational or document database. ```svg - + ``` Source: Tabler Icons / `database` (MIT) @@ -191,7 +191,7 @@ Source: Tabler Icons / `database` (MIT) Generic file. ```svg - + ``` Source: Tabler Icons / `file` (MIT) @@ -200,7 +200,7 @@ Source: Tabler Icons / `file` (MIT) Log file / event stream. ```svg - + ``` Source: Tabler Icons / `file-text` (MIT) @@ -209,7 +209,7 @@ Source: Tabler Icons / `file-text` (MIT) Message queue / FIFO. ```svg - + ``` Source: Tabler Icons / `stack-2` (MIT) @@ -218,7 +218,7 @@ Source: Tabler Icons / `stack-2` (MIT) Cache layer. ```svg - + ``` Source: Tabler Icons / `bolt` (MIT) @@ -227,7 +227,7 @@ Source: Tabler Icons / `bolt` (MIT) Object storage / S3 bucket. ```svg - + ``` Source: Tabler Icons / `bucket` (MIT) @@ -236,7 +236,7 @@ Source: Tabler Icons / `bucket` (MIT) Backup or snapshot. ```svg - + ``` Source: Tabler Icons / `device-floppy` (MIT) @@ -245,7 +245,7 @@ Source: Tabler Icons / `device-floppy` (MIT) Search index / query. ```svg - + ``` Source: Tabler Icons / `search` (MIT) @@ -256,7 +256,7 @@ Source: Tabler Icons / `search` (MIT) Pod (smallest deployable unit). ```svg - + ``` Source: Tabler Icons / `hexagon` (MIT) @@ -265,7 +265,7 @@ Source: Tabler Icons / `hexagon` (MIT) Cluster node. ```svg - + ``` Source: Tabler Icons / `topology-star` (MIT) @@ -274,7 +274,7 @@ Source: Tabler Icons / `topology-star` (MIT) K8s service / virtual endpoint. ```svg - + ``` Source: Tabler Icons / `world-cog` (MIT) @@ -283,7 +283,7 @@ Source: Tabler Icons / `world-cog` (MIT) Deployment rollout. ```svg - + ``` Source: Tabler Icons / `rocket` (MIT) @@ -292,7 +292,7 @@ Source: Tabler Icons / `rocket` (MIT) Ingress controller / route in. ```svg - + ``` Source: Tabler Icons / `arrow-right-rhombus` (MIT) @@ -301,7 +301,7 @@ Source: Tabler Icons / `arrow-right-rhombus` (MIT) Persistent volume. ```svg - + ``` Source: Tabler Icons / `device-sd-card` (MIT) @@ -312,7 +312,7 @@ Source: Tabler Icons / `device-sd-card` (MIT) API surface / endpoint. ```svg - + ``` Source: Tabler Icons / `braces` (MIT) @@ -321,7 +321,7 @@ Source: Tabler Icons / `braces` (MIT) Outbound request. ```svg - + ``` Source: Tabler Icons / `arrow-right` (MIT) @@ -330,7 +330,7 @@ Source: Tabler Icons / `arrow-right` (MIT) Inbound response. ```svg - + ``` Source: Tabler Icons / `arrow-left` (MIT) @@ -339,7 +339,7 @@ Source: Tabler Icons / `arrow-left` (MIT) Sync / reconcile loop. ```svg - + ``` Source: Tabler Icons / `refresh` (MIT) @@ -348,7 +348,7 @@ Source: Tabler Icons / `refresh` (MIT) Locked / authenticated. ```svg - + ``` Source: Tabler Icons / `lock` (MIT) @@ -357,7 +357,7 @@ Source: Tabler Icons / `lock` (MIT) Key / secret. ```svg - + ``` Source: Tabler Icons / `key` (MIT) @@ -366,7 +366,7 @@ Source: Tabler Icons / `key` (MIT) Warning / paged alert. ```svg - + ``` Source: Tabler Icons / `alert-triangle` (MIT) @@ -377,7 +377,7 @@ Source: Tabler Icons / `alert-triangle` (MIT) Branch / fork point. ```svg - + ``` Source: Tabler Icons / `git-branch` (MIT) @@ -386,7 +386,7 @@ Source: Tabler Icons / `git-branch` (MIT) Shell / CLI. ```svg - + ``` Source: Tabler Icons / `terminal` (MIT) @@ -395,7 +395,7 @@ Source: Tabler Icons / `terminal` (MIT) CI/CD pipeline. ```svg - + ``` Source: Tabler Icons / `git-merge` (MIT) @@ -404,7 +404,7 @@ Source: Tabler Icons / `git-merge` (MIT) Bug / defect. ```svg - + ``` Source: Tabler Icons / `bug` (MIT) @@ -413,7 +413,7 @@ Source: Tabler Icons / `bug` (MIT) Metrics / observability. ```svg - + ``` Source: Tabler Icons / `chart-line` (MIT) @@ -422,7 +422,7 @@ Source: Tabler Icons / `chart-line` (MIT) Test / experiment. ```svg - + ``` Source: Tabler Icons / `test-pipe` (MIT) @@ -433,7 +433,7 @@ Source: Tabler Icons / `test-pipe` (MIT) Docker engine / image. ```svg - + ``` Source: Tabler Icons / `brand-docker` (MIT) @@ -442,7 +442,7 @@ Source: Tabler Icons / `brand-docker` (MIT) Terraform IaC. ```svg - + ``` Source: Tabler Icons / `brand-terraform` (MIT) @@ -451,7 +451,7 @@ Source: Tabler Icons / `brand-terraform` (MIT) Amazon Web Services. ```svg - + ``` Source: Tabler Icons / `brand-aws` (MIT) @@ -460,7 +460,7 @@ Source: Tabler Icons / `brand-aws` (MIT) Microsoft Azure. ```svg - + ``` Source: Tabler Icons / `brand-azure` (MIT) @@ -469,7 +469,7 @@ Source: Tabler Icons / `brand-azure` (MIT) GitHub. ```svg - + ``` Source: Tabler Icons / `brand-github` (MIT) @@ -478,7 +478,7 @@ Source: Tabler Icons / `brand-github` (MIT) Kubernetes. ```svg -Kubernetes + ``` Source: Simple Icons / `kubernetes` (CC0) @@ -487,7 +487,7 @@ Source: Simple Icons / `kubernetes` (CC0) Google Cloud. ```svg -Google Cloud + ``` Source: Simple Icons / `googlecloud` (CC0) @@ -496,7 +496,7 @@ Source: Simple Icons / `googlecloud` (CC0) PostgreSQL. ```svg -PostgreSQL + ``` Source: Simple Icons / `postgresql` (CC0) @@ -505,7 +505,7 @@ Source: Simple Icons / `postgresql` (CC0) Redis. ```svg - + ``` Source: log-z/logos / `redis` (MIT) @@ -514,7 +514,7 @@ Source: log-z/logos / `redis` (MIT) Nginx. ```svg -NGINX + ``` Source: Simple Icons / `nginx` (CC0) @@ -523,7 +523,7 @@ Source: Simple Icons / `nginx` (CC0) Gitea self-hosted git. ```svg -Gitea + ``` Source: Simple Icons / `gitea` (CC0) @@ -532,7 +532,7 @@ Source: Simple Icons / `gitea` (CC0) Keycloak identity / SSO. ```svg -Keycloak + ``` Source: Simple Icons / `keycloak` (CC0) @@ -541,7 +541,7 @@ Source: Simple Icons / `keycloak` (CC0) Active Directory / LDAP identity directory. ```svg - + ``` Source: Tabler Icons / `address-book` (MIT) @@ -550,7 +550,7 @@ Source: Tabler Icons / `address-book` (MIT) MinIO S3-compatible object storage. ```svg -MinIO + ``` Source: Simple Icons / `minio` (CC0) @@ -559,7 +559,7 @@ Source: Simple Icons / `minio` (CC0) MySQL. ```svg - + ``` Source: log-z/logos / `mysql` (MIT) @@ -568,7 +568,7 @@ Source: log-z/logos / `mysql` (MIT) Oracle Database. ```svg -Oracle + ``` Source: Simple Icons / `oracle` (CC0) @@ -577,7 +577,7 @@ Source: Simple Icons / `oracle` (CC0) Microsoft SQL Server. ```svg -Microsoft SQL Server + ``` Source: Simple Icons / `microsoftsqlserver` (CC0) @@ -586,7 +586,7 @@ Source: Simple Icons / `microsoftsqlserver` (CC0) SQLite embedded database. ```svg -SQLite + ``` Source: Simple Icons / `sqlite` (CC0) @@ -595,7 +595,7 @@ Source: Simple Icons / `sqlite` (CC0) Apache Hive data warehouse. ```svg -Apache Hive + ``` Source: Simple Icons / `apachehive` (CC0) @@ -604,7 +604,7 @@ Source: Simple Icons / `apachehive` (CC0) StarRocks MPP analytical DB. ```svg - + ``` Source: log-z/logos / `starrocks` (MIT) @@ -615,7 +615,7 @@ Source: log-z/logos / `starrocks` (MIT) Apache NiFi data flow. ```svg -Apache NiFi + ``` Source: Simple Icons / `apachenifi` (CC0) @@ -624,7 +624,7 @@ Source: Simple Icons / `apachenifi` (CC0) Apache Airflow scheduler / DAG runner. ```svg -Apache Airflow + ``` Source: Simple Icons / `apacheairflow` (CC0) @@ -633,7 +633,7 @@ Source: Simple Icons / `apacheairflow` (CC0) Apache Hop data orchestration / ETL. ```svg -image/svg+xml + ``` Source: Direct fetch / `hop.apache.org` — verify license before use @@ -642,7 +642,7 @@ Source: Direct fetch / `hop.apache.org` — verify license before use Pentaho PDI (Kettle) ETL & data integration. ```svg - + ``` Source: Direct fetch / `cdn.worldvectorlogo.com` — verify license before use @@ -651,7 +651,7 @@ Source: Direct fetch / `cdn.worldvectorlogo.com` — verify license before use Dagster data orchestration platform. ```svg - + ``` Source: Direct fetch / `cdn.prod.website-files.com` — verify license before use @@ -660,7 +660,7 @@ Source: Direct fetch / `cdn.prod.website-files.com` — verify license before us Trino distributed SQL query engine. ```svg -Trino + ``` Source: Simple Icons / `trino` (CC0) @@ -669,7 +669,7 @@ Source: Simple Icons / `trino` (CC0) Apache Superset BI / dashboards. ```svg -Apache Superset + ``` Source: Simple Icons / `apachesuperset` (CC0) @@ -678,7 +678,7 @@ Source: Simple Icons / `apachesuperset` (CC0) Redash open-source BI & dashboards. ```svg -Redash + ``` Source: Simple Icons / `redash` (CC0) @@ -687,7 +687,7 @@ Source: Simple Icons / `redash` (CC0) Tableau data visualization. ```svg -Tableau + ``` Source: Simple Icons / `tableau` (CC0) @@ -696,7 +696,7 @@ Source: Simple Icons / `tableau` (CC0) Microsoft Power BI. ```svg -Power BI + ``` Source: Simple Icons / `powerbi` (CC0) @@ -705,7 +705,7 @@ Source: Simple Icons / `powerbi` (CC0) Jupyter / JupyterLab notebooks. ```svg -Jupyter + ``` Source: Simple Icons / `jupyter` (CC0) @@ -716,7 +716,7 @@ Source: Simple Icons / `jupyter` (CC0) Python. ```svg -Python + ``` Source: Simple Icons / `python` (CC0) @@ -725,7 +725,7 @@ Source: Simple Icons / `python` (CC0) R statistical language. ```svg -R + ``` Source: Simple Icons / `r` (CC0) @@ -734,7 +734,7 @@ Source: Simple Icons / `r` (CC0) SQL / generic relational query. ```svg - + ``` Source: Tabler Icons / `sql` (MIT) @@ -745,7 +745,7 @@ Source: Tabler Icons / `sql` (MIT) IBM SPSS Statistics. ```svg - + ``` Source: Devicon / `spss-plain` (MIT) @@ -754,7 +754,7 @@ Source: Devicon / `spss-plain` (MIT) SAS analytics platform. ```svg - + ``` Source: Direct fetch / `upload.wikimedia.org` — verify license before use @@ -763,7 +763,7 @@ Source: Direct fetch / `upload.wikimedia.org` — verify license before use Stata statistical software. ```svg - + ``` Source: Direct fetch / `icon.icepanel.io` — verify license before use @@ -772,7 +772,7 @@ Source: Direct fetch / `icon.icepanel.io` — verify license before use RStudio / Posit IDE for R and Python. ```svg - + ``` Source: Devicon / `rstudio-plain` (MIT) @@ -781,7 +781,7 @@ Source: Devicon / `rstudio-plain` (MIT) QGIS open-source GIS platform. ```svg -QGIS + ``` Source: Simple Icons / `qgis` (CC0) @@ -792,7 +792,7 @@ Source: Simple Icons / `qgis` (CC0) Microsoft Excel spreadsheet. ```svg - + ``` Source: Tabler Icons / `file-type-xls` (MIT) @@ -801,7 +801,7 @@ Source: Tabler Icons / `file-type-xls` (MIT) Comma-separated values file. ```svg - + ``` Source: Tabler Icons / `file-type-csv` (MIT) @@ -810,7 +810,7 @@ Source: Tabler Icons / `file-type-csv` (MIT) Plain text file. ```svg - + ``` Source: Tabler Icons / `file-type-txt` (MIT)