From 8441700612fea8138c74641943e01db6ba48926d Mon Sep 17 00:00:00 2001 From: konojunya Date: Fri, 4 Sep 2026 20:42:24 +0900 Subject: [PATCH 1/3] Center the provider icon trigger on mobile --- src/components/provider-icons.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/provider-icons.tsx b/src/components/provider-icons.tsx index 04373f1..f6294d4 100644 --- a/src/components/provider-icons.tsx +++ b/src/components/provider-icons.tsx @@ -54,8 +54,14 @@ export function ProviderIcons({ disabled, packs, onImport, onRemove }: ProviderI return ( - - - -
    - {pack.icons.map((icon) => ( -
  • - -
  • - ))} -
- - ))} + {icons.length > 0 ? ( +
    + {icons + .slice(0, visibleByProvider[pack.providerId] ?? ICON_BATCH_SIZE) + .map((icon) => ( +
  • + +
  • + ))} +
+ ) : null} + {icons.length > (visibleByProvider[pack.providerId] ?? ICON_BATCH_SIZE) ? ( + + ) : null} + + ))} )} From a4d8c93d23a88fd43575fc6e0da74b39b266926d Mon Sep 17 00:00:00 2001 From: konojunya Date: Sat, 5 Sep 2026 01:23:14 +0900 Subject: [PATCH 3/3] Use Engine 0.6 for provider provenance --- docs/ja/language/themes-and-icons.md | 2 +- docs/ko/language/themes-and-icons.md | 2 +- docs/language/themes-and-icons.md | 2 +- docs/zh/language/themes-and-icons.md | 2 +- package-lock.json | 8 ++-- package.json | 2 +- scripts/validate-docs.mjs | 4 +- src/App.test.tsx | 13 ++++++- src/components/provider-icons.test.tsx | 24 ++++++++++-- src/components/provider-icons.tsx | 48 +++++++++++++---------- src/lib/provider-notice.test.ts | 23 ++++++++++- src/lib/provider-notice.ts | 16 ++++++-- src/lib/provider-pack.test.ts | 25 ++++++++++++ src/lib/provider-pack.ts | 54 ++++++++++++++++---------- 14 files changed, 161 insertions(+), 64 deletions(-) diff --git a/docs/ja/language/themes-and-icons.md b/docs/ja/language/themes-and-icons.md index ad3bc02..daffb9f 100644 --- a/docs/ja/language/themes-and-icons.md +++ b/docs/ja/language/themes-and-icons.md @@ -107,7 +107,7 @@ Free core catalogは、次のprovider-neutralな明示iconを`default`、`light` | `email` | Email delivery | Email delivery / inbox | | `ai` | Artificial intelligence system | AI model / inference service | -下のpreviewをlight / darkへ切り替えると、実際のoutputを比較できます。各imageは公開`@stack-sh/engine@0.5.0`がlocalでrenderし、DocumentationにTheme SVG assetを複製していません。Syntaxの行を選ぶとコピーできます。 +下のpreviewをlight / darkへ切り替えると、実際のoutputを比較できます。各imageは公開`@stack-sh/engine@0.6.0`がlocalでrenderし、DocumentationにTheme SVG assetを複製していません。Syntaxの行を選ぶとコピーできます。 diff --git a/docs/ko/language/themes-and-icons.md b/docs/ko/language/themes-and-icons.md index 1bed721..30958c5 100644 --- a/docs/ko/language/themes-and-icons.md +++ b/docs/ko/language/themes-and-icons.md @@ -107,7 +107,7 @@ diagram "Explicit icon" { | `email` | Email delivery | 이메일 전송 또는 받은편지함 | | `ai` | Artificial intelligence system | AI 모델 또는 추론 서비스 | -아래 미리보기를 라이트와 다크로 전환하여 실제 출력을 비교할 수 있습니다. 각 이미지는 공개된 `@stack-sh/engine@0.5.0`이 로컬에서 렌더링하며 문서에 Theme SVG 에셋을 복제하지 않습니다. 문법 행을 선택하면 복사됩니다. +아래 미리보기를 라이트와 다크로 전환하여 실제 출력을 비교할 수 있습니다. 각 이미지는 공개된 `@stack-sh/engine@0.6.0`이 로컬에서 렌더링하며 문서에 Theme SVG 에셋을 복제하지 않습니다. 문법 행을 선택하면 복사됩니다. diff --git a/docs/language/themes-and-icons.md b/docs/language/themes-and-icons.md index 4a52ea1..89ad46f 100644 --- a/docs/language/themes-and-icons.md +++ b/docs/language/themes-and-icons.md @@ -107,7 +107,7 @@ The free core catalog includes these provider-neutral explicit icons in `default | `email` | Email delivery | Email delivery or inboxes | | `ai` | Artificial intelligence system | AI models or inference services | -Switch the preview below between light and dark to inspect the actual output. The published `@stack-sh/engine@0.5.0` renders every image locally; the Documentation does not copy Theme SVG assets. Select a syntax row to copy it. +Switch the preview below between light and dark to inspect the actual output. The published `@stack-sh/engine@0.6.0` renders every image locally; the Documentation does not copy Theme SVG assets. Select a syntax row to copy it. diff --git a/docs/zh/language/themes-and-icons.md b/docs/zh/language/themes-and-icons.md index 8f97a11..1902d1e 100644 --- a/docs/zh/language/themes-and-icons.md +++ b/docs/zh/language/themes-and-icons.md @@ -107,7 +107,7 @@ diagram "Explicit icon" { | `email` | Email delivery | 邮件投递或收件箱 | | `ai` | Artificial intelligence system | AI 模型或推理服务 | -切换下方预览的浅色与深色模式即可比较真实输出。每张图片都由已发布的 `@stack-sh/engine@0.5.0` 在本地渲染;文档没有复制 Theme SVG 资源。选择语法行即可复制。 +切换下方预览的浅色与深色模式即可比较真实输出。每张图片都由已发布的 `@stack-sh/engine@0.6.0` 在本地渲染;文档没有复制 Theme SVG 资源。选择语法行即可复制。 diff --git a/package-lock.json b/package-lock.json index 1b9f271..e35067d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@fontsource/ibm-plex-mono": "^5.3.0", "@shikijs/core": "4.4.3", "@shikijs/engine-javascript": "4.4.3", - "@stack-sh/engine": "0.5.0", + "@stack-sh/engine": "0.6.0", "@stack-sh/language": "0.1.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", @@ -4869,9 +4869,9 @@ "license": "CC0-1.0" }, "node_modules/@stack-sh/engine": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@stack-sh/engine/-/engine-0.5.0.tgz", - "integrity": "sha512-xwt+QNQe71FIrSsrHk9jJtdvTbd6lUmpptUlk0E9N7hTeq4Vn58ebNJT7KHExFwp41Y8j2kOV+TYfycVDK/oqQ==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@stack-sh/engine/-/engine-0.6.0.tgz", + "integrity": "sha512-u5N70XLHfA6giOOcCiDqy3m/Fagl5J2q/Ak2DIS49yi4m2aHvvqLDG8aHQNisCIaXOYZmD4Bj3dAylwUFrj/8Q==", "license": "Apache-2.0" }, "node_modules/@stack-sh/language": { diff --git a/package.json b/package.json index e792904..501dcdd 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@fontsource/ibm-plex-mono": "^5.3.0", "@shikijs/core": "4.4.3", "@shikijs/engine-javascript": "4.4.3", - "@stack-sh/engine": "0.5.0", + "@stack-sh/engine": "0.6.0", "@stack-sh/language": "0.1.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/scripts/validate-docs.mjs b/scripts/validate-docs.mjs index 8ba6643..3cd8f6a 100644 --- a/scripts/validate-docs.mjs +++ b/scripts/validate-docs.mjs @@ -23,8 +23,8 @@ const providerCatalog = JSON.parse( await readFile(path.join(docsRoot, ".vitepress/theme/data/provider-catalogs.json"), "utf8"), ) -if (packageMetadata.dependencies["@stack-sh/engine"] !== "0.5.0") { - throw new Error("Documentation must use the exact @stack-sh/engine 0.5.0 release") +if (packageMetadata.dependencies["@stack-sh/engine"] !== "0.6.0") { + throw new Error("Documentation must use the exact @stack-sh/engine 0.6.0 release") } const expectedProviderCounts = { aws: 305, gcp: 45, azure: 639, "simple-icons": 62 } diff --git a/src/App.test.tsx b/src/App.test.tsx index 0104166..f443845 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -23,7 +23,7 @@ vi.mock("@stack-sh/engine", () => ({ import App from "./App" const metadata = { - engineVersion: "0.5.0", + engineVersion: "0.6.0", languageVersion: { major: 1, minor: 0 }, themeCatalogRevision: "sha256:test", themeCatalogVersion: "0.4.0", @@ -64,13 +64,22 @@ describe("Stack Playground", () => { { archiveSha256: "sha256:test", attribution: "AWS icons are owned by Amazon Web Services.", - icons: [{ id: "aws:s3", productName: "Amazon S3" }], + icons: [{ id: "aws:s3", productName: "Amazon S3", sourceId: "primary" }], nonEndorsement: "AWS does not endorse Stack.", packRevision: "sha256:pack", packVersion: "0.1.0", providerId: "aws", providerName: "Amazon Web Services", sourceRelease: "fixture-1", + sources: [ + { + archiveSha256: "sha256:test", + id: "primary", + pageUrl: "https://example.com/icons", + release: "fixture-1", + termsUrl: "https://example.com/terms", + }, + ], termsSummary: "Use in architecture diagrams.", termsUrl: "https://example.com/terms", }, diff --git a/src/components/provider-icons.test.tsx b/src/components/provider-icons.test.tsx index 92f6d4a..7e66b8a 100644 --- a/src/components/provider-icons.test.tsx +++ b/src/components/provider-icons.test.tsx @@ -11,10 +11,22 @@ function providerPack(): LoadedProviderPack { providerId: "azure", providerName: "Microsoft Azure", packVersion: "0.2.0", - sourcePageUrl: "https://example.com/icons", - sourceRelease: "fixture", - termsUrl: "https://example.com/terms", - reviewAfter: "2026-12-03", + sources: [ + { + id: "primary", + pageUrl: "https://example.com/icons", + release: "fixture", + termsUrl: "https://example.com/terms", + reviewAfter: "2026-12-03", + }, + { + id: "categories", + pageUrl: "https://example.com/categories", + release: "fixture-categories", + termsUrl: "https://example.com/category-terms", + reviewAfter: "2026-12-04", + }, + ], icons: Array.from({ length: 50 }, (_, index) => ({ id: `azure:service-${index + 1}`, productName: index === 49 ? "Needle Database" : `Azure Service ${index + 1}`, @@ -36,6 +48,10 @@ describe("ProviderIcons", () => { ) await user.click(screen.getByRole("button", { name: "Provider icons" })) + expect(screen.getByText("primary")).toBeInTheDocument() + expect(screen.getByText("categories")).toBeInTheDocument() + expect(screen.getAllByRole("link", { name: "Source" })).toHaveLength(2) + expect(screen.getAllByRole("link", { name: "Terms" })).toHaveLength(2) expect(screen.getByText("azure:service-48")).toBeInTheDocument() expect(screen.queryByText("azure:service-49")).not.toBeInTheDocument() diff --git a/src/components/provider-icons.tsx b/src/components/provider-icons.tsx index 0aaa5d1..776cc3b 100644 --- a/src/components/provider-icons.tsx +++ b/src/components/provider-icons.tsx @@ -184,28 +184,34 @@ export function ProviderIcons({ disabled, packs, onImport, onRemove }: ProviderI {pack.providerName}

- {pack.sourceRelease} · pack {pack.packVersion} · {pack.icons.length} icons -

-

- Review terms again after {pack.reviewAfter}.{" "} - - Source - {" "} - ·{" "} - - Terms - + {pack.sources[0].release} · pack {pack.packVersion} · {pack.icons.length}{" "} + icons

+
    + {pack.sources.map((source) => ( +
  • + {source.id}{" "} + + Source + {" "} + /{" "} + + Terms + + {` (review after ${source.reviewAfter})`} +
  • + ))} +