Skip to content

Commit 87a2f2a

Browse files
committed
feat: add changelog button
1 parent 8d99bb0 commit 87a2f2a

File tree

27 files changed

+321
-2
lines changed

27 files changed

+321
-2
lines changed

app/composables/usePackageAnalysis.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { ModuleFormat, TypesStatus, CreatePackageInfo } from '#shared/utils/package-analysis'
2+
import type { ChangelogInfo } from '#shared/types'
23

34
export interface PackageAnalysisResponse {
45
package: string
@@ -10,6 +11,7 @@ export interface PackageAnalysisResponse {
1011
npm?: string
1112
}
1213
createPackage?: CreatePackageInfo
14+
changelog?: ChangelogInfo
1315
}
1416

1517
/**

app/pages/package/[...package].vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,26 @@ defineOgImageComponent('Package', {
609609
{{ $t('package.links.issues') }}
610610
</a>
611611
</li>
612+
<li v-if="packageAnalysis?.changelog">
613+
<NuxtLink
614+
v-if="packageAnalysis.changelog.source === 'file'"
615+
:to="packageAnalysis.changelog.url"
616+
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5"
617+
>
618+
<span class="i-carbon:catalog w-4 h-4" aria-hidden="true" />
619+
{{ $t('package.links.changelog') }}
620+
</NuxtLink>
621+
<a
622+
v-else
623+
:href="packageAnalysis.changelog.url"
624+
target="_blank"
625+
rel="noopener noreferrer"
626+
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5"
627+
>
628+
<span class="i-carbon:catalog w-4 h-4" aria-hidden="true" />
629+
{{ $t('package.links.changelog') }}
630+
</a>
631+
</li>
612632
<li>
613633
<a
614634
:href="`https://www.npmjs.com/package/${pkg.name}`"

i18n/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"repo": "repo",
176176
"homepage": "homepage",
177177
"issues": "issues",
178+
"changelog": "changelog",
178179
"jsr": "jsr",
179180
"code": "code",
180181
"docs": "docs",

lunaria/files/ar-EG.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"repo": "المستودع",
176176
"homepage": "الصفحة الرئيسية",
177177
"issues": "المشكلات",
178+
"changelog": "سجل التغييرات",
178179
"jsr": "jsr",
179180
"code": "الكود",
180181
"docs": "التوثيق",

lunaria/files/az.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
"repo": "repo",
144144
"homepage": "ana səhifə",
145145
"issues": "xətalar",
146+
"changelog": "changelog",
146147
"jsr": "jsr",
147148
"code": "kod",
148149
"docs": "sənədlər",

lunaria/files/cs-CZ.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
"repo": "repozitář",
172172
"homepage": "domovská stránka",
173173
"issues": "úkoly",
174+
"changelog": "changelog",
174175
"jsr": "jsr",
175176
"code": "kód",
176177
"docs": "dokumentace",

lunaria/files/de-DE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
"repo": "Repo",
173173
"homepage": "Homepage",
174174
"issues": "Issues",
175+
"changelog": "Changelog",
175176
"jsr": "JSR",
176177
"code": "Code",
177178
"docs": "Doku",

lunaria/files/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"repo": "repo",
176176
"homepage": "homepage",
177177
"issues": "issues",
178+
"changelog": "changelog",
178179
"jsr": "jsr",
179180
"code": "code",
180181
"docs": "docs",

lunaria/files/es-419.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
"repo": "repo",
145145
"homepage": "página de inicio",
146146
"issues": "problemas",
147+
"changelog": "historial de cambios",
147148
"jsr": "jsr",
148149
"code": "código",
149150
"docs": "documentación",

lunaria/files/es-ES.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
"repo": "repo",
145145
"homepage": "página de inicio",
146146
"issues": "problemas",
147+
"changelog": "historial de cambios",
147148
"jsr": "jsr",
148149
"code": "código",
149150
"docs": "documentación",

0 commit comments

Comments
 (0)