Skip to content
Open
Show file tree
Hide file tree
Changes from 134 commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
c0a23b4
now able to detect whether gh releases are biing used by a package.
WilcoSp Feb 4, 2026
4873b1c
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 4, 2026
92193b5
moved has changelog to it's own api endpoint
WilcoSp Feb 7, 2026
2a397bf
added detection of a changelog file on the root of the github repo
WilcoSp Feb 7, 2026
4cfbbfe
Merge branch main into feat/changelog-1
WilcoSp Feb 7, 2026
42802dc
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 7, 2026
9c130bd
github releases are now being show at /package-changes (rendering of …
WilcoSp Feb 8, 2026
a424459
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Feb 8, 2026
e487292
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 8, 2026
6c7d817
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 11, 2026
ba81215
fixed issue where markdown from github releases could be null
WilcoSp Feb 11, 2026
8d22cf2
some refactoring
WilcoSp Feb 11, 2026
f8b32d4
adding a11y test for changelog card.
WilcoSp Feb 11, 2026
b345df1
markdown is now being rendered (settings need to be added still)
WilcoSp Feb 12, 2026
f4c84ec
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 12, 2026
bc0fa2f
added headings handling and toc (only scroll behavior needs to be cha…
WilcoSp Feb 12, 2026
5e32d04
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Feb 12, 2026
faf6b3b
fallback to tag for title if name is null
WilcoSp Feb 13, 2026
14c50da
removing   from toc slug and text
WilcoSp Feb 13, 2026
5cd51af
adding id for navigation for when it gets implemented
WilcoSp Feb 16, 2026
53cd46f
code blocks, blockquote & links are now handled by the markdown renderer
WilcoSp Feb 16, 2026
30d2663
new lines rendering is now closing to how it's on github. at least fo…
WilcoSp Feb 16, 2026
8d5ee71
enableling gfm for changelogs
WilcoSp Feb 20, 2026
34faad0
the changelog info api endpoint will now give the info when a changel…
WilcoSp Feb 20, 2026
55d45f3
now also able to render changelog markdown files
WilcoSp Feb 20, 2026
9c36c60
Merge branch 'main' into feat/changelog-1
WilcoSp Feb 20, 2026
95e3699
added heading links for changelog markdown
WilcoSp Feb 21, 2026
9f9195d
release card header links can now also be clicked to navigate to
WilcoSp Feb 21, 2026
f2d5f2b
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 22, 2026
cab3cc6
when the latest gh release contains a link to a changelog.md the chan…
WilcoSp Feb 22, 2026
342adca
Merge branch 'main' into feat/changelog-1
WilcoSp Feb 22, 2026
1a8c342
re exporting slugify
WilcoSp Feb 22, 2026
fbbff33
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 23, 2026
08717bc
adding back removing non bracking spaces, :emoji: support now also ad…
WilcoSp Feb 23, 2026
e07af6c
added indication that release is pre-release/draft
WilcoSp Feb 23, 2026
8225654
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 24, 2026
013654c
preventing package@version from being turned into mailto
WilcoSp Feb 24, 2026
6cbe6e8
changed how content-none is applied for changelog.md
WilcoSp Feb 24, 2026
1d93405
for changelog.md now resolving url
WilcoSp Feb 24, 2026
f6ec86e
relative/absolute resolved urls will stay within the base url
WilcoSp Feb 24, 2026
6198a71
id with release id will now be applied to all elements
WilcoSp Feb 24, 2026
2c057b9
Added button to view changelog/releases on the provider website.
WilcoSp Feb 25, 2026
ce34993
added a div which reservers the space for toc
WilcoSp Feb 25, 2026
fd15403
Merge branch 'main' into feat/changelog-1
WilcoSp Feb 25, 2026
04b2a99
adding back .tolowercase in slugify to have test pass again
WilcoSp Feb 25, 2026
746464f
Merge branch 'main' into feat/changelog-1
WilcoSp Feb 26, 2026
750072c
fixing some (minor) things caught by coderabbitai
WilcoSp Feb 26, 2026
6e6ee3a
..
WilcoSp Feb 26, 2026
0cab1e8
improving intermediateTitleAttr
WilcoSp Feb 26, 2026
4de0348
removing unneeded comment
WilcoSp Feb 26, 2026
5f4520f
removing resolving explicitly ./ & ../ comment
WilcoSp Feb 26, 2026
81f68b6
Merge branch 'main' into feat/changelog-1
WilcoSp Feb 26, 2026
6d0edfd
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 26, 2026
f9c0736
adding view_on translation to kn_IN (autofix removed it)
WilcoSp Feb 26, 2026
d48654a
Merge branch 'main' into feat/changelog-1
WilcoSp Feb 27, 2026
a67f039
Merge branch 'main' into feat/changelog-1
WilcoSp Feb 27, 2026
08828b8
adding ogImage to package changes page
WilcoSp Feb 27, 2026
5f1be8a
fixed version selector by adding latestVersion
WilcoSp Feb 27, 2026
d71dfd9
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Feb 28, 2026
503b4df
for releases the date is now being used to send you as close as possi…
WilcoSp Feb 28, 2026
cfc8612
removing unused pending variable
WilcoSp Feb 28, 2026
e2fc2d2
removing console log
WilcoSp Feb 28, 2026
47431f5
switching from encodeURIComponent to encodeURI for changelog card navid
WilcoSp Feb 28, 2026
c43514b
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 1, 2026
ef72002
disableling ogImage for package changes page as it has been changed a…
WilcoSp Mar 1, 2026
886dd9f
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 1, 2026
40e8f2b
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 1, 2026
299b45c
adding view_on to fr_TR
WilcoSp Mar 1, 2026
2de6f9f
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 2, 2026
6915b33
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Mar 3, 2026
89cae7e
for releases now also matching on version in release title for scrolling
WilcoSp Mar 3, 2026
bdcf1a7
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Mar 3, 2026
133aa39
now also matching to version with changelog.md
WilcoSp Mar 3, 2026
ce053be
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 3, 2026
8b5311c
added better checks/detecting for monorepos using changelog.md
WilcoSp Mar 4, 2026
eb96164
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 4, 2026
7c99b43
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Mar 4, 2026
ddd4121
ensuring toc will always be at the end for changelog
WilcoSp Mar 5, 2026
bb8b09f
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 5, 2026
fabc65d
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 9, 2026
443341b
moved slugify to `shared/utils/html.ts` to allow usage in the front &…
WilcoSp Mar 9, 2026
c54c406
changelog page now using useViewOnGitProvider
WilcoSp Mar 9, 2026
267880f
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 10, 2026
9427f0f
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 11, 2026
94f2571
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 12, 2026
43306af
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 13, 2026
41e395f
added changelog to packageHeader & switched changelog to use the pack…
WilcoSp Mar 13, 2026
aaea9ee
showing skeleton loaders for changelog.
WilcoSp Mar 13, 2026
327dd42
fixed height for sticky header changelog
WilcoSp Mar 13, 2026
6d140ab
n in 5 -> _n of 5 due to type check
WilcoSp Mar 13, 2026
a9d09b3
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 13, 2026
96bf944
removing docsLink, earlier merge hadn't removed it
WilcoSp Mar 13, 2026
04b2c21
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Mar 13, 2026
7da82ae
skeleton loaders are now being displayed when loading the releases/ma…
WilcoSp Mar 13, 2026
850e5c8
..
WilcoSp Mar 13, 2026
c1e91e9
fixed going to latest & changed going to has to only client side
WilcoSp Mar 13, 2026
609395e
moved from [...path] -> [[org]]/[name] ....
WilcoSp Mar 14, 2026
314d49f
the version will now be resolved like on the package page so no more …
WilcoSp Mar 14, 2026
a9d9802
fixed issue to where the prev version was jumped to while resolving v…
WilcoSp Mar 14, 2026
dcbbdac
the sticky header is now always one with toc instead of github
WilcoSp Mar 14, 2026
f7377d5
fixed missing tocHeaderClass in a11y tests
WilcoSp Mar 14, 2026
732268d
added the shortcut for 'm' & '-'
WilcoSp Mar 14, 2026
0c441b2
..
WilcoSp Mar 14, 2026
435b569
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 14, 2026
f3c1759
changelog will tab will always be visible when on changelog page
WilcoSp Mar 15, 2026
c0f3c44
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Mar 15, 2026
6757ae0
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 15, 2026
c77f335
fix: use idPrefix for release in resolveUrl
WilcoSp Mar 16, 2026
fcacad8
removing target when url doesn't have protocol (for example when poin…
WilcoSp Mar 16, 2026
21a7d5f
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Mar 16, 2026
5180309
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 16, 2026
9d7aff1
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 17, 2026
2d9609c
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Mar 17, 2026
5630b1c
applying most changes recommended from review (thanks alexdln)
WilcoSp Mar 18, 2026
a2e0c16
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 18, 2026
22ccc27
fixing ci issues
WilcoSp Mar 18, 2026
85e2cb0
changed the watch to watcheffect for navigating to the specific version
WilcoSp Mar 19, 2026
172f758
moved changelog routing from 'changes' -> 'changelog'
WilcoSp Mar 19, 2026
acea1fd
detecting now when ungh.cc has exhausted it's api keys
WilcoSp Mar 19, 2026
246fc86
added error message when ungh's api keys are exhausted
WilcoSp Mar 19, 2026
07c28a9
preparing merging with main
WilcoSp Mar 19, 2026
ee38fbd
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 19, 2026
f9475fd
updated i18n schema
WilcoSp Mar 19, 2026
b93bf44
switch to nuxtError due to ci issues
WilcoSp Mar 19, 2026
78ba6f7
..
WilcoSp Mar 19, 2026
e70f094
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 20, 2026
ddddc63
Merge branch 'main' into feat/changelog-1
ghostdevv Mar 20, 2026
9036e81
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 20, 2026
479a1c4
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 22, 2026
52151ba
fixing things the merge broke
WilcoSp Mar 22, 2026
2ff9374
added 429 to detect key exhaustion
WilcoSp Mar 22, 2026
b512aea
fixed schema for ci
WilcoSp Mar 22, 2026
2a439b4
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 24, 2026
9caf56b
..
WilcoSp Mar 24, 2026
ee5e892
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 25, 2026
5e6ee46
changed how the ::after icon is unset for changelog
WilcoSp Mar 25, 2026
3a86ab8
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 25, 2026
44fffff
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp Mar 27, 2026
4433716
added padding to changelog markdown component
WilcoSp Mar 27, 2026
22901bc
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 27, 2026
ef51c3d
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 27, 2026
200d861
adding flush post, this should hopefully make the auto scrolling more…
WilcoSp Mar 28, 2026
d8f7ed0
reverted lazyChangelogCard & hydrate-on-interaction because auto scro…
WilcoSp Mar 28, 2026
66f2de2
..
WilcoSp Mar 28, 2026
9714514
added index.vue for changelog which did fix some issues
WilcoSp Mar 30, 2026
3ff1c44
adding french translation for changelog (thanks @WarningImHack3r / An…
WilcoSp Mar 30, 2026
3cec9bd
Merge branch 'main' into feat/changelog-1
WilcoSp Mar 30, 2026
edd7541
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp Mar 30, 2026
07eadba
made it that the anchor link for heading in readme is visible over th…
WilcoSp Mar 30, 2026
d15e2e9
resolving version now happens in the background when switching versio…
WilcoSp Mar 31, 2026
d35024f
..
WilcoSp Mar 31, 2026
41e68b5
added translation for "version_unavailable", thanks @WarningImHack3r…
WilcoSp Mar 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions app/components/Changelog/Card.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<script setup lang="ts">
import type { ReleaseData } from '~~/shared/types/changelog'
import { slugify } from '~~/shared/utils/html'
const { release } = defineProps<{
release: ReleaseData
}>()
const formattedDate = computed(() => {
if (!release.publishedAt) {
return
}
return new Date(release.publishedAt).toISOString().split('T')[0]
})
const cardId = computed(() => (formattedDate.value ? `date-${formattedDate.value}` : undefined))
const navId = computed(() => `release-${slugify(release.title)}`)
function navigateToTitle() {
navigateTo(`#${navId.value}`)
}
</script>
<template>
<section
class="border border-border rounded-lg p-4 pt-2 sm:p-6 sm:pt-4 scroll-mt-18"
:id="cardId"
>
<div
class="flex gap-2 items-center sticky z-3 text-2xl p-2 border-border bg-bg top-[--combined-header-height]"
>
<h2
class="text-1xl sm:text-2xl font-medium min-w-0 break-words py-2 scroll-mt-20"
:id="navId"
>
<a
class="hover:decoration-accent hover:text-accent focus-visible:decoration-accent focus-visible:text-accent transition-colors duration-200"
:class="$style.linkTitle"
:href="`#${navId}`"
@click.prevent="navigateToTitle()"
>
{{ release.title }}
</a>
</h2>
<TagStatic v-if="release.prerelease" variant="default" class="h-unset">
{{ $t('changelog.pre_release') }}
</TagStatic>
<TagStatic v-if="release.draft" variant="default" class="h-unset">
{{ $t('changelog.draft') }}
</TagStatic>
<div class="flex-1" aria-hidden="true"></div>
<ReadmeTocDropdown
v-if="release?.toc && release.toc.length > 1"
:toc="release.toc"
class="ms-auto"
/>
<!-- :active-id="activeTocId" -->
</div>
<DateTime v-if="release.publishedAt" :datetime="release.publishedAt" date-style="medium" />
<Readme v-if="release.html" :html="release.html"></Readme>
</section>
</template>

<style module>
.linkTitle::after {
content: '__';
@apply inline i-lucide:link rtl-flip ms-1 opacity-0;
font-size: 0.75em;
}
.linkTitle:hover::after {
@apply opacity-100;
}
</style>
15 changes: 15 additions & 0 deletions app/components/Changelog/ErrorMsg.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup lang="ts">
const { pkgName, changelogLink, viewOnGit } = defineProps<{
pkgName?: string
changelogLink: string
viewOnGit: string
}>()
</script>
<template>
<div class="w-full flex items-center flex-col gap-2 mt-4">
<p>{{ $t('changelog.error.p1', { package: pkgName }) }}</p>
<i18n-t keypath="changelog.error.p2" tag="p" #viewon>
<LinkBase :to="changelogLink" class="lowercase">{{ viewOnGit }}</LinkBase>
</i18n-t>
</div>
</template>
43 changes: 43 additions & 0 deletions app/components/Changelog/Markdown.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script setup lang="ts">
const { info, requestedVersion, tpTarget } = defineProps<{
info: ChangelogMarkdownInfo
requestedVersion: string | null | undefined
tpTarget?: HTMLElement | null
}>()

const route = useRoute()

const { data, error } = await useFetch(
() => `/api/changelog/md/${info.provider}/${info.repo}/${info.path}`,
)

if (import.meta.client) {
// doing this server side can make it that we go to the homepage
watchEffect(() => {
const toc = data.value?.toc

if (toc && route.hash) {
navigateTo(route.hash)
return
}
if (!toc || !requestedVersion || route.hash) {
return
}
// lc = lower case
const lcRequestedVersion = requestedVersion.toLowerCase()
for (const item of toc) {
if (item.text.toLowerCase().includes(lcRequestedVersion)) {
navigateTo(`#${item.id}`)
return
}
}
})
}
</script>
<template>
<Teleport v-if="data?.toc && data.toc.length > 1 && !!tpTarget" :to="tpTarget">
<ReadmeTocDropdown :toc="data.toc" class="justify-self-end" />
</Teleport>
<Readme v-if="data?.html" :html="data.html"></Readme>
<slot v-else-if="error" name="error"></slot>
</template>
64 changes: 64 additions & 0 deletions app/components/Changelog/Releases.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<script setup lang="ts">
import { slugify } from '~~/shared/utils/html'

const { info, requestedDate, requestedVersion } = defineProps<{
info: ChangelogReleaseInfo
requestedDate?: string
requestedVersion?: string | null | undefined
}>()

const { data: releases, error } = await useFetch<ReleaseData[]>(
() => `/api/changelog/releases/${info.provider}/${info.repo}`,
)

const route = useRoute()

const matchingDateReleases = computed(() => {
if (!requestedDate || !releases.value) {
return []
}

return releases.value.filter(release => {
if (!release.publishedAt) {
return
}
return requestedDate === toIsoDate(new Date(release.publishedAt))
})
})

if (import.meta.client) {
// doing this server side can make it that we go to the homepage
watchEffect(() => {
const uReleases = releases.value
if (route.hash && uReleases) {
navigateTo(route.hash, { replace: true })
return
}
const date = requestedDate?.toLowerCase()
if (route.hash || !date || !uReleases) {
return
}
const uMatchingDateReleases = matchingDateReleases.value
if (uMatchingDateReleases?.length < 1) {
// if no releases have matched the requested version publish date then most likely no release note has been made
return
}

if (requestedVersion) {
for (const match of uMatchingDateReleases) {
if (match.title.toLowerCase().includes(requestedVersion)) {
navigateTo(`#release-${slugify(match.title)}`, { replace: true })
return
}
}
}
navigateTo(`#date-${date}`, { replace: true })
})
}
</script>
<template>
<div class="flex flex-col gap-2 py-3" v-if="releases">
<ChangelogCard v-for="release of releases" :release :key="release.id" />
</div>
<slot v-else-if="error" name="error"></slot>
</template>
46 changes: 45 additions & 1 deletion app/components/Package/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { RouteLocationRaw } from 'vue-router'
import { SCROLL_TO_TOP_THRESHOLD } from '~/composables/useScrollToTop'
import { isEditableElement } from '~/utils/input'
import { usePackageChangelog } from '~/composables/usePackageChangelog'

const props = defineProps<{
pkg?: Pick<SlimPackument, 'name' | 'versions' | 'dist-tags'> | null
Expand All @@ -10,7 +11,7 @@ const props = defineProps<{
latestVersion?: SlimVersion | null
provenanceData?: ProvenanceDetails | null
provenanceStatus?: string | null
page: 'main' | 'docs' | 'code' | 'diff'
page: 'main' | 'docs' | 'code' | 'diff' | 'changelog'
versionUrlPattern: string
}>()

Expand Down Expand Up @@ -120,6 +121,20 @@ const diffLink = computed((): RouteLocationRaw | null => {
return diffRoute(props.pkg.name, props.resolvedVersion, props.latestVersion.version)
})

const { data: changelog } = usePackageChangelog(packageName, requestedVersion)

const changelogLink = computed((): RouteLocationRaw | null => {
if (
// either changelog.value is available or current page is the changelog
!(changelog.value || props.page == 'changelog') ||
props.pkg == null ||
props.resolvedVersion == null
) {
return null
}
return changelogRoute(props.pkg.name, props.resolvedVersion)
})

const keyboardShortcuts = useKeyboardShortcuts()

onKeyStroke(
Expand Down Expand Up @@ -174,6 +189,26 @@ onKeyStroke(
{ dedupe: true },
)

onKeyStroke(
e => keyboardShortcuts.value && isKeyWithoutModifiers(e, '-') && !isEditableElement(e.target),
e => {
if (changelogLink.value === null) return
e.preventDefault()
navigateTo(changelogLink.value)
},
{ dedupe: true },
)

onKeyStroke(
e => keyboardShortcuts.value && isKeyWithoutModifiers(e, '-') && !isEditableElement(e.target),
e => {
if (changelogLink.value === null) return
e.preventDefault()
navigateTo(changelogLink.value)
},
{ dedupe: true },
)

const fundingUrl = computed(() => {
let funding = props.displayVersion?.funding
if (Array.isArray(funding)) funding = funding[0]
Expand Down Expand Up @@ -343,6 +378,15 @@ const fundingUrl = computed(() => {
>
{{ $t('compare.compare_versions') }}
</LinkBase>
<LinkBase
v-if="changelogLink"
:to="changelogLink"
aria-keyshortcuts="-"
class="decoration-none border-b-2 p-1 hover:border-accent/50"
:class="page === 'changelog' ? 'border-accent text-accent!' : 'border-transparent'"
>
{{ $t('package.links.changelog') }}
</LinkBase>
</nav>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Readme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function handleClick(event: MouseEvent) {
@apply inline i-lucide:external-link rtl-flip ms-1 opacity-50;
}

.readme :deep(:is(h1, h2, h3, h4, h5, h6) a[href^='#']::after) {
.readme :deep(:is(h1, h2, h3, h4, h5, h6) a[href^='#']:not([content-none])::after) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a huge selector... Do we really need this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is because in changelog the link to the heading is an icon instead of the whole header, by having "content-none" is prevents that ::after also shows an icon and the tailwind class "content-none" doesn't work due to low specificity compared to the selector above

/* I don't know what kind of sorcery this is, but it ensures this icon can't wrap to a new line on its own. */
content: '__';
@apply inline i-lucide:link rtl-flip ms-1 opacity-0;
Expand Down
13 changes: 13 additions & 0 deletions app/composables/usePackageChangelog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { ChangelogInfo } from '~~/shared/types/changelog'

export function usePackageChangelog(
packageName: MaybeRefOrGetter<string>,
version?: MaybeRefOrGetter<string | null | undefined>,
) {
return useLazyFetch<ChangelogInfo>(() => {
const name = toValue(packageName)
const ver = toValue(version)
const base = `/api/changelog/info/${name}`
return ver ? `${base}/v/${ver}` : base
})
}
24 changes: 24 additions & 0 deletions app/composables/useProviderIcon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { ProviderId } from '#imports'
import type { IconClass } from '~/types/icon'
import { computed, toValue } from 'vue'

const PROVIDER_ICONS: Record<ProviderId, IconClass> = {
github: 'i-simple-icons:github',
gitlab: 'i-simple-icons:gitlab',
bitbucket: 'i-simple-icons:bitbucket',
codeberg: 'i-simple-icons:codeberg',
gitea: 'i-simple-icons:gitea',
forgejo: 'i-simple-icons:forgejo',
gitee: 'i-simple-icons:gitee',
sourcehut: 'i-simple-icons:sourcehut',
tangled: 'i-custom:tangled',
radicle: 'i-lucide:network', // Radicle is a P2P network, using network icon
}

export function useProviderIcon(provider: MaybeRefOrGetter<ProviderId | null | undefined>) {
return computed((): IconClass => {
const uProvider = toValue(provider)
if (!uProvider) return 'i-simple-icons:github'
return PROVIDER_ICONS[uProvider] ?? 'i-lucide:code'
})
}
Loading
Loading