diff --git a/app/components/Package/Dependencies.vue b/app/components/Package/Dependencies.vue
index 35657daadb..939ab57ca8 100644
--- a/app/components/Package/Dependencies.vue
+++ b/app/components/Package/Dependencies.vue
@@ -215,7 +215,7 @@ const numberFormatter = useNumberFormatter()
count: getVulnerableDepInfo(resolveDepName(dep, version))!.counts.total,
})
"
- classicon="i-lucide:shield-check"
+ classicon="i-lucide:shield-alert"
/>
diff --git a/app/components/PackageProvenanceSection.vue b/app/components/PackageProvenanceSection.vue
index 14c9b310c3..e78a73c82f 100644
--- a/app/components/PackageProvenanceSection.vue
+++ b/app/components/PackageProvenanceSection.vue
@@ -16,7 +16,7 @@ defineProps<{
diff --git a/app/components/ProvenanceBadge.stories.ts b/app/components/ProvenanceBadge.stories.ts
index 973e55db12..4363f6e754 100644
--- a/app/components/ProvenanceBadge.stories.ts
+++ b/app/components/ProvenanceBadge.stories.ts
@@ -4,14 +4,7 @@ import ProvenanceBadge from './ProvenanceBadge.vue'
const meta = {
component: ProvenanceBadge,
tags: ['autodocs'],
- argTypes: {
- provider: {
- control: 'select',
- options: ['github', 'gitlab', undefined],
- },
- },
args: {
- provider: 'github',
packageName: 'example-package',
version: '1.0.0',
},
@@ -30,23 +23,9 @@ export const Compact: Story = {
},
}
-/** Built on GitLab CI rather than GitHub Actions. */
-export const GitLab: Story = {
- args: {
- provider: 'gitlab',
- },
-}
-
/** Rendered as static text (no link) when `linked` is false. */
export const NotLinked: Story = {
args: {
linked: false,
},
}
-
-/** Without a provider, it shows a generic "verified" title. */
-export const NoProvider: Story = {
- args: {
- provider: undefined,
- },
-}
diff --git a/app/components/ProvenanceBadge.vue b/app/components/ProvenanceBadge.vue
index 08e91bc4e2..0a26af8b24 100644
--- a/app/components/ProvenanceBadge.vue
+++ b/app/components/ProvenanceBadge.vue
@@ -1,7 +1,5 @@
@@ -33,9 +18,13 @@ const title = computed(() =>
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center justify-center gap-1 text-xs font-mono text-fg-muted hover:text-fg transition-colors duration-200 min-w-6 min-h-6"
- :title="title"
+ :title="$t('badges.provenance.verified_title')"
>
-
+
{{
$t('badges.provenance.verified')
}}
@@ -43,9 +32,13 @@ const title = computed(() =>
-
+
{{
$t('badges.provenance.verified')
}}
diff --git a/app/components/TrustedPublishingBadge.stories.ts b/app/components/TrustedPublishingBadge.stories.ts
new file mode 100644
index 0000000000..ca91ad68f4
--- /dev/null
+++ b/app/components/TrustedPublishingBadge.stories.ts
@@ -0,0 +1,50 @@
+import type { Meta, StoryObj } from '@storybook-vue/nuxt'
+import TrustedPublishingBadge from './TrustedPublishingBadge.vue'
+
+const meta = {
+ component: TrustedPublishingBadge,
+ tags: ['autodocs'],
+ argTypes: {
+ provider: {
+ control: 'select',
+ options: ['github', 'gitlab', undefined],
+ },
+ },
+ args: {
+ provider: 'github',
+ },
+} satisfies Meta
+
+export default meta
+type Story = StoryObj
+
+/** Links to the npm trusted publishing docs. */
+export const Default: Story = {}
+
+/** Icon-only variant for tight spaces, as used on search result cards. */
+export const Compact: Story = {
+ args: {
+ compact: true,
+ },
+}
+
+/** Published from GitLab CI rather than GitHub Actions. */
+export const GitLab: Story = {
+ args: {
+ provider: 'gitlab',
+ },
+}
+
+/** Rendered as static text (no link) when `linked` is false. */
+export const NotLinked: Story = {
+ args: {
+ linked: false,
+ },
+}
+
+/** Without a provider, it shows a generic title. */
+export const NoProvider: Story = {
+ args: {
+ provider: undefined,
+ },
+}
diff --git a/app/components/TrustedPublishingBadge.vue b/app/components/TrustedPublishingBadge.vue
new file mode 100644
index 0000000000..de446923c9
--- /dev/null
+++ b/app/components/TrustedPublishingBadge.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+ {{ $t('badges.trusted_publishing.label') }}
+
+
+
+
+
+ {{ $t('badges.trusted_publishing.label') }}
+
+
+
diff --git a/i18n/locales/ar.json b/i18n/locales/ar.json
index 1b07218934..5c0d7b0c4d 100644
--- a/i18n/locales/ar.json
+++ b/i18n/locales/ar.json
@@ -662,8 +662,7 @@
"badges": {
"provenance": {
"verified": "موثّق",
- "verified_title": "مصدر موثّق",
- "verified_via": "موثّق: تم النشر عبر {provider}"
+ "verified_title": "مصدر موثّق"
},
"jsr": {
"title": "متوفر أيضًا على JSR"
diff --git a/i18n/locales/az-AZ.json b/i18n/locales/az-AZ.json
index d1e6e82902..c799007e26 100644
--- a/i18n/locales/az-AZ.json
+++ b/i18n/locales/az-AZ.json
@@ -776,8 +776,7 @@
"badges": {
"provenance": {
"verified": "təsdiqlənmiş",
- "verified_title": "Təsdiqlənmiş mənşə",
- "verified_via": "Təsdiqlənmiş: {provider} vasitəsilə dərc edilib"
+ "verified_title": "Təsdiqlənmiş mənşə"
},
"jsr": {
"title": "JSR-də də mövcuddur"
diff --git a/i18n/locales/bg-BG.json b/i18n/locales/bg-BG.json
index 00ca2b506d..2d5fcb73b6 100644
--- a/i18n/locales/bg-BG.json
+++ b/i18n/locales/bg-BG.json
@@ -732,8 +732,7 @@
"badges": {
"provenance": {
"verified": "потвърден",
- "verified_title": "Потвърден произход",
- "verified_via": "Потвърдено: публикувано чрез {provider}"
+ "verified_title": "Потвърден произход"
},
"jsr": {
"title": "налично също в JSR"
diff --git a/i18n/locales/bn-IN.json b/i18n/locales/bn-IN.json
index e40b428b58..a5a909bfb4 100644
--- a/i18n/locales/bn-IN.json
+++ b/i18n/locales/bn-IN.json
@@ -1081,8 +1081,7 @@
"badges": {
"provenance": {
"verified": "যাচাইকৃত",
- "verified_title": "যাচাইকৃত প্রোভেন্স",
- "verified_via": "যাচাইকৃত: {provider} এর মাধ্যমে প্রকাশিত"
+ "verified_title": "যাচাইকৃত প্রোভেন্স"
},
"jsr": {
"title": "JSR-এও উপলব্ধ"
diff --git a/i18n/locales/cs-CZ.json b/i18n/locales/cs-CZ.json
index 7f0e9ed737..e6b209f843 100644
--- a/i18n/locales/cs-CZ.json
+++ b/i18n/locales/cs-CZ.json
@@ -1071,8 +1071,7 @@
"badges": {
"provenance": {
"verified": "ověřeno",
- "verified_title": "Ověřený původ",
- "verified_via": "Ověřeno: publikováno přes {provider}"
+ "verified_title": "Ověřený původ"
},
"jsr": {
"title": "také dostupné na JSR"
diff --git a/i18n/locales/de.json b/i18n/locales/de.json
index 565378fa7b..f78e00532f 100644
--- a/i18n/locales/de.json
+++ b/i18n/locales/de.json
@@ -1028,8 +1028,7 @@
"badges": {
"provenance": {
"verified": "verifiziert",
- "verified_title": "Verifizierter Herkunftsnachweis",
- "verified_via": "Verifiziert: veröffentlicht via {provider}"
+ "verified_title": "Verifizierter Herkunftsnachweis"
},
"jsr": {
"title": "auch auf JSR verfügbar"
diff --git a/i18n/locales/en.json b/i18n/locales/en.json
index 1164125f72..74c0f2a925 100644
--- a/i18n/locales/en.json
+++ b/i18n/locales/en.json
@@ -1190,13 +1190,17 @@
"badges": {
"provenance": {
"verified": "verified",
- "verified_title": "Verified provenance",
- "verified_via": "Verified: published via {provider}"
+ "verified_title": "Verified provenance"
},
"staged_publish": {
"label": "staged publish",
"title": "Published through staged publishing with 2FA approval"
},
+ "trusted_publishing": {
+ "label": "trusted publishing",
+ "title": "Published with trusted publishing",
+ "title_via": "Published with trusted publishing via {provider}"
+ },
"jsr": {
"title": "also available on JSR"
}
diff --git a/i18n/locales/es.json b/i18n/locales/es.json
index 8833e6b1c9..09fdd5c99b 100644
--- a/i18n/locales/es.json
+++ b/i18n/locales/es.json
@@ -1082,8 +1082,7 @@
"badges": {
"provenance": {
"verified": "verificado",
- "verified_title": "Procedencia verificada",
- "verified_via": "Verificado: publicado vía {provider}"
+ "verified_title": "Procedencia verificada"
},
"jsr": {
"title": "también disponible en JSR"
diff --git a/i18n/locales/fr-FR.json b/i18n/locales/fr-FR.json
index 9a2b218fb1..4a1c6efd80 100644
--- a/i18n/locales/fr-FR.json
+++ b/i18n/locales/fr-FR.json
@@ -1061,8 +1061,7 @@
"badges": {
"provenance": {
"verified": "vérifié",
- "verified_title": "Provenance vérifiée",
- "verified_via": "Vérifié : publié via {provider}"
+ "verified_title": "Provenance vérifiée"
},
"jsr": {
"title": "aussi disponible sur JSR"
diff --git a/i18n/locales/hi-IN.json b/i18n/locales/hi-IN.json
index 3dc7e6dc26..76a9dace66 100644
--- a/i18n/locales/hi-IN.json
+++ b/i18n/locales/hi-IN.json
@@ -826,8 +826,7 @@
"badges": {
"provenance": {
"verified": "सत्यापित",
- "verified_title": "सत्यापित प्रोवेनेंस",
- "verified_via": "सत्यापित: {provider} के माध्यम से प्रकाशित"
+ "verified_title": "सत्यापित प्रोवेनेंस"
},
"jsr": {
"title": "JSR पर भी उपलब्ध"
diff --git a/i18n/locales/hu-HU.json b/i18n/locales/hu-HU.json
index eef8ea861e..ac0ab2a6b3 100644
--- a/i18n/locales/hu-HU.json
+++ b/i18n/locales/hu-HU.json
@@ -732,8 +732,7 @@
"badges": {
"provenance": {
"verified": "ellenőrzött",
- "verified_title": "Ellenőrzött eredet",
- "verified_via": "Ellenőrizve: {provider} által közzétéve"
+ "verified_title": "Ellenőrzött eredet"
},
"jsr": {
"title": "a JSR-en is elérhető"
diff --git a/i18n/locales/id-ID.json b/i18n/locales/id-ID.json
index 87abf8d82d..9d5cbe99c4 100644
--- a/i18n/locales/id-ID.json
+++ b/i18n/locales/id-ID.json
@@ -846,8 +846,7 @@
"badges": {
"provenance": {
"verified": "terverifikasi",
- "verified_title": "Provenans terverifikasi",
- "verified_via": "Terverifikasi: diterbitkan via {provider}"
+ "verified_title": "Provenans terverifikasi"
},
"jsr": {
"title": "juga tersedia di JSR"
diff --git a/i18n/locales/it-IT.json b/i18n/locales/it-IT.json
index 2038308c43..9a98652cff 100644
--- a/i18n/locales/it-IT.json
+++ b/i18n/locales/it-IT.json
@@ -1066,8 +1066,7 @@
"badges": {
"provenance": {
"verified": "verificato",
- "verified_title": "Provenienza verificata",
- "verified_via": "Verificato: pubblicato tramite {provider}"
+ "verified_title": "Provenienza verificata"
},
"jsr": {
"title": "disponibile anche su JSR"
diff --git a/i18n/locales/ja-JP.json b/i18n/locales/ja-JP.json
index d929b25f83..1e69b421f6 100644
--- a/i18n/locales/ja-JP.json
+++ b/i18n/locales/ja-JP.json
@@ -1074,8 +1074,7 @@
"badges": {
"provenance": {
"verified": "検証済み",
- "verified_title": "検証済みprovenance",
- "verified_via": "検証済み: {provider} 経由で公開"
+ "verified_title": "検証済みprovenance"
},
"jsr": {
"title": "JSRでも利用可能"
diff --git a/i18n/locales/kn-IN.json b/i18n/locales/kn-IN.json
index 1d3cfc1696..a515afb1d6 100644
--- a/i18n/locales/kn-IN.json
+++ b/i18n/locales/kn-IN.json
@@ -546,8 +546,7 @@
"badges": {
"provenance": {
"verified": "ಪರಿಶೀಲಿಸಲಾಗಿದೆ",
- "verified_title": "ಪರಿಶೀಲಿತ ಮೂಲ",
- "verified_via": "ಪರಿಶೀಲಿಸಲಾಗಿದೆ: {provider} ಮೂಲಕ ಪ್ರಕಟಿಸಲಾಗಿದೆ"
+ "verified_title": "ಪರಿಶೀಲಿತ ಮೂಲ"
},
"jsr": {
"title": "JSR ನಲ್ಲಿ ಕೂಡ ಲಭ್ಯವಿದೆ"
diff --git a/i18n/locales/ko-KR.json b/i18n/locales/ko-KR.json
index d4aa212fcb..3c722e893f 100644
--- a/i18n/locales/ko-KR.json
+++ b/i18n/locales/ko-KR.json
@@ -1107,8 +1107,7 @@
"badges": {
"provenance": {
"verified": "검증됨",
- "verified_title": "검증된 출처",
- "verified_via": "검증됨: {provider}를 통해 게시됨"
+ "verified_title": "검증된 출처"
},
"jsr": {
"title": "JSR에서도 사용 가능"
diff --git a/i18n/locales/mr-IN.json b/i18n/locales/mr-IN.json
index 768fc95987..644e78ae1e 100644
--- a/i18n/locales/mr-IN.json
+++ b/i18n/locales/mr-IN.json
@@ -799,8 +799,7 @@
"badges": {
"provenance": {
"verified": "सत्यापित",
- "verified_title": "सत्यापित प्रोव्हनन्स",
- "verified_via": "सत्यापित: {provider} मार्फत प्रकाशित"
+ "verified_title": "सत्यापित प्रोव्हनन्स"
},
"jsr": {
"title": "JSR वरही उपलब्ध"
diff --git a/i18n/locales/nb-NO.json b/i18n/locales/nb-NO.json
index 25699219e0..a6092e4926 100644
--- a/i18n/locales/nb-NO.json
+++ b/i18n/locales/nb-NO.json
@@ -1071,8 +1071,7 @@
"badges": {
"provenance": {
"verified": "verifisert",
- "verified_title": "Verifisert opprinnelse",
- "verified_via": "Verifisert: publisert via {provider}"
+ "verified_title": "Verifisert opprinnelse"
},
"jsr": {
"title": "også tilgjengelig på JSR"
diff --git a/i18n/locales/ne-NP.json b/i18n/locales/ne-NP.json
index fc315bf9b2..73914e2843 100644
--- a/i18n/locales/ne-NP.json
+++ b/i18n/locales/ne-NP.json
@@ -1158,8 +1158,7 @@
"badges": {
"provenance": {
"verified": "प्रमाणित",
- "verified_title": "प्रमाणित प्रोभेनेन्स",
- "verified_via": "प्रमाणित: {provider} मार्फत प्रकाशित"
+ "verified_title": "प्रमाणित प्रोभेनेन्स"
},
"jsr": {
"title": "JSR मा पनि उपलब्ध"
diff --git a/i18n/locales/nl.json b/i18n/locales/nl.json
index 47ce114514..11a1d14cab 100644
--- a/i18n/locales/nl.json
+++ b/i18n/locales/nl.json
@@ -1184,8 +1184,7 @@
"badges": {
"provenance": {
"verified": "geverifieerd",
- "verified_title": "geverifieerde herkomstgegevens",
- "verified_via": "Geverifieerd: gepubliceerd via {provider}"
+ "verified_title": "geverifieerde herkomstgegevens"
},
"staged_publish": {
"label": "Gefaseerde publicatie",
diff --git a/i18n/locales/pl-PL.json b/i18n/locales/pl-PL.json
index ffb3c8ee9e..61c2f21957 100644
--- a/i18n/locales/pl-PL.json
+++ b/i18n/locales/pl-PL.json
@@ -790,8 +790,7 @@
"badges": {
"provenance": {
"verified": "zweryfikowane",
- "verified_title": "Zweryfikowane pochodzenie",
- "verified_via": "Zweryfikowane: opublikowane przez {provider}"
+ "verified_title": "Zweryfikowane pochodzenie"
},
"jsr": {
"title": "dostępne także na JSR"
diff --git a/i18n/locales/pt-BR.json b/i18n/locales/pt-BR.json
index 311445cfaa..50f35f2820 100644
--- a/i18n/locales/pt-BR.json
+++ b/i18n/locales/pt-BR.json
@@ -992,8 +992,7 @@
"badges": {
"provenance": {
"verified": "verificado",
- "verified_title": "Proveniência verificada",
- "verified_via": "Verificado: publicado via {provider}"
+ "verified_title": "Proveniência verificada"
},
"jsr": {
"title": "também disponível no JSR"
diff --git a/i18n/locales/pt-PT.json b/i18n/locales/pt-PT.json
index 09dbfa9fd9..b32593ec04 100644
--- a/i18n/locales/pt-PT.json
+++ b/i18n/locales/pt-PT.json
@@ -1006,8 +1006,7 @@
"badges": {
"provenance": {
"verified": "verificado",
- "verified_title": "Proveniência verificada",
- "verified_via": "Verificado: publicado via {provider}"
+ "verified_title": "Proveniência verificada"
},
"jsr": {
"title": "também disponível no JSR"
diff --git a/i18n/locales/ro-RO.json b/i18n/locales/ro-RO.json
index 2fc6324e06..1d94ba46da 100644
--- a/i18n/locales/ro-RO.json
+++ b/i18n/locales/ro-RO.json
@@ -1017,8 +1017,7 @@
"badges": {
"provenance": {
"verified": "verificat",
- "verified_title": "Provenanță verificată",
- "verified_via": "Verificat: publicat via {provider}"
+ "verified_title": "Provenanță verificată"
},
"jsr": {
"title": "disponibil și pe JSR"
diff --git a/i18n/locales/ru-RU.json b/i18n/locales/ru-RU.json
index 9e3e1313fd..f3155e9730 100644
--- a/i18n/locales/ru-RU.json
+++ b/i18n/locales/ru-RU.json
@@ -1163,8 +1163,7 @@
"badges": {
"provenance": {
"verified": "подтверждено",
- "verified_title": "Подтвержденное происхождение",
- "verified_via": "Подтверждено: опубликовано через {provider}"
+ "verified_title": "Подтвержденное происхождение"
},
"jsr": {
"title": "также доступно на JSR"
diff --git a/i18n/locales/sr-Latn-RS.json b/i18n/locales/sr-Latn-RS.json
index 0fdc94d48c..67a838fee8 100644
--- a/i18n/locales/sr-Latn-RS.json
+++ b/i18n/locales/sr-Latn-RS.json
@@ -843,8 +843,7 @@
"badges": {
"provenance": {
"verified": "verifikovano",
- "verified_title": "Verifikovano poreklo",
- "verified_via": "Verifikovano: objavljeno preko {provider}"
+ "verified_title": "Verifikovano poreklo"
},
"jsr": {
"title": "takođe dostupno na JSR-u"
diff --git a/i18n/locales/ta-IN.json b/i18n/locales/ta-IN.json
index 5d55752405..a8aa11d21f 100644
--- a/i18n/locales/ta-IN.json
+++ b/i18n/locales/ta-IN.json
@@ -637,8 +637,7 @@
"badges": {
"provenance": {
"verified": "சரிபார்க்கப்பட்டது",
- "verified_title": "சரிபார்க்கப்பட்ட மூலநிலை",
- "verified_via": "சரிபார்க்கப்பட்டது: {provider} வழியாக வெளியிடப்பட்டது"
+ "verified_title": "சரிபார்க்கப்பட்ட மூலநிலை"
},
"jsr": {
"title": "JSR-லும் கிடைக்கிறது"
diff --git a/i18n/locales/te-IN.json b/i18n/locales/te-IN.json
index f7e6cc10b4..2311289bc9 100644
--- a/i18n/locales/te-IN.json
+++ b/i18n/locales/te-IN.json
@@ -546,8 +546,7 @@
"badges": {
"provenance": {
"verified": "ధృవీకరించబడింది",
- "verified_title": "ధృవీకరించబడిన ప్రోవెనెన్స్",
- "verified_via": "ధృవీకరించబడింది: {provider} ద్వారా ప్రచురించబడింది"
+ "verified_title": "ధృవీకరించబడిన ప్రోవెనెన్స్"
},
"jsr": {
"title": "JSR లో కూడా అందుబాటులో ఉంది"
diff --git a/i18n/locales/tr-TR.json b/i18n/locales/tr-TR.json
index cd90b5ca8e..99e74aca52 100644
--- a/i18n/locales/tr-TR.json
+++ b/i18n/locales/tr-TR.json
@@ -1025,8 +1025,7 @@
"badges": {
"provenance": {
"verified": "doğrulanmış",
- "verified_title": "Doğrulanmış köken",
- "verified_via": "Doğrulandı: {provider} aracılığıyla yayınlandı"
+ "verified_title": "Doğrulanmış köken"
},
"jsr": {
"title": "JSR'de de mevcut"
diff --git a/i18n/locales/uk-UA.json b/i18n/locales/uk-UA.json
index bf01007ea4..7746c0bb90 100644
--- a/i18n/locales/uk-UA.json
+++ b/i18n/locales/uk-UA.json
@@ -1167,8 +1167,7 @@
"badges": {
"provenance": {
"verified": "перевірено",
- "verified_title": "Перевірене походження",
- "verified_via": "Перевірено: опубліковано через {provider}"
+ "verified_title": "Перевірене походження"
},
"jsr": {
"title": "також доступно на JSR"
diff --git a/i18n/locales/vi-VN.json b/i18n/locales/vi-VN.json
index f04decd6b2..5293cc851c 100644
--- a/i18n/locales/vi-VN.json
+++ b/i18n/locales/vi-VN.json
@@ -843,8 +843,7 @@
"badges": {
"provenance": {
"verified": "đã xác minh",
- "verified_title": "Provenance đã xác minh",
- "verified_via": "Đã xác minh: xuất bản qua {provider}"
+ "verified_title": "Provenance đã xác minh"
},
"jsr": {
"title": "cũng có trên JSR"
diff --git a/i18n/locales/zh-CN.json b/i18n/locales/zh-CN.json
index 117cc2e5f1..4e913672b8 100644
--- a/i18n/locales/zh-CN.json
+++ b/i18n/locales/zh-CN.json
@@ -1022,8 +1022,7 @@
"badges": {
"provenance": {
"verified": "已验证",
- "verified_title": "已验证来源",
- "verified_via": "已验证:通过 {provider} 发布"
+ "verified_title": "已验证来源"
},
"jsr": {
"title": "也适用于 JSR"
diff --git a/i18n/locales/zh-TW.json b/i18n/locales/zh-TW.json
index 1302226439..5b02ba0487 100644
--- a/i18n/locales/zh-TW.json
+++ b/i18n/locales/zh-TW.json
@@ -962,8 +962,7 @@
"badges": {
"provenance": {
"verified": "已驗證",
- "verified_title": "已驗證來源",
- "verified_via": "已驗證:透過 {provider} 發布"
+ "verified_title": "已驗證來源"
},
"jsr": {
"title": "也適用於 JSR"
diff --git a/i18n/schema.json b/i18n/schema.json
index 09157dcf7b..2e877fdef1 100644
--- a/i18n/schema.json
+++ b/i18n/schema.json
@@ -3576,14 +3576,23 @@
},
"verified_title": {
"type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "staged_publish": {
+ "type": "object",
+ "properties": {
+ "label": {
+ "type": "string"
},
- "verified_via": {
+ "title": {
"type": "string"
}
},
"additionalProperties": false
},
- "staged_publish": {
+ "trusted_publishing": {
"type": "object",
"properties": {
"label": {
@@ -3591,6 +3600,9 @@
},
"title": {
"type": "string"
+ },
+ "title_via": {
+ "type": "string"
}
},
"additionalProperties": false
diff --git a/test/nuxt/a11y.spec.ts b/test/nuxt/a11y.spec.ts
index 987085ed49..742cdbc569 100644
--- a/test/nuxt/a11y.spec.ts
+++ b/test/nuxt/a11y.spec.ts
@@ -302,6 +302,7 @@ import {
ProgressBar,
ProvenanceBadge,
StagedPublishBadge,
+ TrustedPublishingBadge,
Readme,
ReadmeTocDropdown,
SearchProviderToggle,
@@ -1066,7 +1067,6 @@ describe('component accessibility audits', () => {
it('should have no accessibility violations with link', async () => {
const component = await mountSuspended(ProvenanceBadge, {
props: {
- provider: 'github',
packageName: 'vue',
version: '3.0.0',
},
@@ -1078,7 +1078,6 @@ describe('component accessibility audits', () => {
it('should have no accessibility violations in compact mode', async () => {
const component = await mountSuspended(ProvenanceBadge, {
props: {
- provider: 'github',
packageName: 'vue',
version: '3.0.0',
compact: true,
@@ -1105,6 +1104,35 @@ describe('component accessibility audits', () => {
})
})
+ describe('TrustedPublishingBadge', () => {
+ it('should have no accessibility violations with link', async () => {
+ const component = await mountSuspended(TrustedPublishingBadge, {
+ props: { provider: 'github' },
+ })
+ const results = await runAxe(component)
+ expect(results.violations).toEqual([])
+ expect(component.find('a').attributes('title')).toBe(
+ 'Published with trusted publishing via GitHub Actions',
+ )
+ })
+
+ it('should have no accessibility violations without link', async () => {
+ const component = await mountSuspended(TrustedPublishingBadge, {
+ props: { provider: 'github', linked: false },
+ })
+ const results = await runAxe(component)
+ expect(results.violations).toEqual([])
+ })
+
+ it('should have no accessibility violations in compact mode', async () => {
+ const component = await mountSuspended(TrustedPublishingBadge, {
+ props: { compact: true },
+ })
+ const results = await runAxe(component)
+ expect(results.violations).toEqual([])
+ })
+ })
+
describe('PackageSkeleton', () => {
it('should have no accessibility violations', async () => {
const component = await mountSuspended(PackageSkeleton)
@@ -1217,6 +1245,23 @@ describe('component accessibility audits', () => {
const results = await runAxe(component)
expect(results.violations).toEqual([])
})
+
+ it('should have no accessibility violations with a trusted publisher', async () => {
+ const component = await mountSuspended(PackageCard, {
+ props: {
+ result: {
+ ...mockResult,
+ package: {
+ ...mockResult.package,
+ publisher: { ...mockResult.package.publisher, trustedPublisher: { id: 'github' } },
+ },
+ },
+ },
+ })
+ const results = await runAxe(component)
+ expect(results.violations).toEqual([])
+ expect(component.findComponent(TrustedPublishingBadge).exists()).toBe(true)
+ })
})
describe('PackageLikeCard', () => {
@@ -5256,9 +5301,13 @@ describe('background theme accessibility', () => {
name: 'ProvenanceBadge',
mount: () =>
mountSuspended(ProvenanceBadge, {
- props: { provider: 'github', packageName: 'vue', version: '3.0.0' },
+ props: { packageName: 'vue', version: '3.0.0' },
}),
},
+ {
+ name: 'TrustedPublishingBadge',
+ mount: () => mountSuspended(TrustedPublishingBadge, { props: { provider: 'github' } }),
+ },
{
name: 'LicenseDisplay',
mount: () => mountSuspended(LicenseDisplay, { props: { license: 'MIT' } }),