Skip to content

Commit e07af6c

Browse files
committed
added indication that release is pre-release/draft
now showing the date as of when the release was made fixed icon for changelog button at package page
1 parent 08717bc commit e07af6c

File tree

7 files changed

+45
-10
lines changed

7 files changed

+45
-10
lines changed

app/components/Changelog/Card.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function navigateToTitle() {
1717
</script>
1818
<template>
1919
<section class="border border-border rounded-lg p-4 sm:p-6">
20-
<div class="flex justify-between" :id="cardId">
20+
<div class="flex gap-2 items-center" :id="cardId">
2121
<h2 class="text-1xl sm:text-2xl font-medium min-w-0 break-words py-2" :id="navId">
2222
<a
2323
class="hover:decoration-accent hover:text-accent focus-visible:decoration-accent focus-visible:text-accent transition-colors duration-200"
@@ -28,13 +28,21 @@ function navigateToTitle() {
2828
{{ release.title }}
2929
</a>
3030
</h2>
31+
<TagStatic v-if="release.prerelease" variant="default" :tabindex="0" class="h-unset">
32+
{{ $t('changelog.pre_release') }}
33+
</TagStatic>
34+
<TagStatic v-if="release.draft" variant="default" :tabindex="0" class="h-unset">
35+
{{ $t('changelog.draft') }}
36+
</TagStatic>
37+
<div class="flex-1" aria-hidden="true"></div>
3138
<ReadmeTocDropdown
3239
v-if="release?.toc && release.toc.length > 1"
3340
:toc="release.toc"
34-
class="justify-self-end"
41+
class="ms-auto"
3542
/>
3643
<!-- :active-id="activeTocId" -->
3744
</div>
45+
<DateTime v-if="release.publishedAt" :datetime="release.publishedAt" date-style="medium" />
3846
<Readme v-if="release.html" :html="release.html"></Readme>
3947
</section>
4048
</template>

app/pages/package-changes/[...path].vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ const latestVersion = computed(() => pkg.value?.['dist-tags']?.latest ?? null)
5353
5454
watch(
5555
[version, latestVersion, packageName],
56-
([version, latest, name]) => {
57-
if (!version && latest && name) {
56+
([v, latest, name]) => {
57+
if (!v && latest && name) {
5858
const pathSegments = [...name.split('/'), 'v', latest]
5959
router.replace({ name: 'changes', params: { path: pathSegments as [string, ...string[]] } })
6060
}
@@ -93,11 +93,8 @@ const { data: changelog, pending } = usePackageChangelog(packageName, version)
9393

9494
<section class="container w-full" v-if="changelog">
9595
<LazyChangelogReleases v-if="changelog.type == 'release'" :info="changelog" />
96-
<LazyChangelogMarkdown
97-
v-else-if="changelog.type == 'md'"
98-
:info="changelog"
99-
></LazyChangelogMarkdown>
100-
<p v-else-if="!pending">Sorry, this package doesn't track any changelogs</p>
96+
<LazyChangelogMarkdown v-else-if="changelog.type == 'md'" :info="changelog" />
97+
<p v-else-if="!pending" class="mt-5">{{ $t('changelog.no_logs') }}</p>
10198
</section>
10299
</main>
103100
</template>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ const showSkeleton = shallowRef(false)
910910
</li>
911911
<li v-if="!!changelog && resolvedVersion">
912912
<LinkBase
913-
classicon="i-carbon:warning"
913+
classicon="i-lucide:notebook-text"
914914
:to="{ name: 'changes', params: { path: [pkg.name, 'v', resolvedVersion] } }"
915915
>
916916
{{ $t('package.links.changelog') }}

i18n/locales/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,5 +1171,10 @@
11711171
"all": "all"
11721172
}
11731173
}
1174+
},
1175+
"changelog": {
1176+
"pre_release": "Pre-release",
1177+
"draft": "Draft",
1178+
"no_logs": "Sorry, this package doesn't track any changelogs or their method of trackings changes isn't supported"
11741179
}
11751180
}

i18n/schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3520,6 +3520,21 @@
35203520
},
35213521
"additionalProperties": false
35223522
},
3523+
"changelog": {
3524+
"type": "object",
3525+
"properties": {
3526+
"pre_release": {
3527+
"type": "string"
3528+
},
3529+
"draft": {
3530+
"type": "string"
3531+
},
3532+
"no_logs": {
3533+
"type": "string"
3534+
}
3535+
},
3536+
"additionalProperties": false
3537+
},
35233538
"$schema": {
35243539
"type": "string"
35253540
}

lunaria/files/en-GB.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,5 +1136,10 @@
11361136
"p1": "If you encounter an accessibility barrier on {app}, please let us know by opening an issue on our {link}. We take these reports seriously and will do our best to address them.",
11371137
"link": "GitHub repository"
11381138
}
1139+
},
1140+
"changelog": {
1141+
"pre_release": "Pre-release",
1142+
"draft": "Draft",
1143+
"no_logs": "Sorry, this package doesn't track any changelogs or their method of trackings changes isn't supported"
11391144
}
11401145
}

lunaria/files/en-US.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,5 +1136,10 @@
11361136
"p1": "If you encounter an accessibility barrier on {app}, please let us know by opening an issue on our {link}. We take these reports seriously and will do our best to address them.",
11371137
"link": "GitHub repository"
11381138
}
1139+
},
1140+
"changelog": {
1141+
"pre_release": "Pre-release",
1142+
"draft": "Draft",
1143+
"no_logs": "Sorry, this package doesn't track any changelogs or their method of trackings changes isn't supported"
11391144
}
11401145
}

0 commit comments

Comments
 (0)