Skip to content

Commit f80e212

Browse files
committed
Merge remote-tracking branch 'origin/main' into gd/regex-escape
2 parents 51be2ae + cb1b4a4 commit f80e212

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2293
-266
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ We welcome contributions – please do feel free to explore the project and
155155
- [npm-userscript](https://github.com/bluwy/npm-userscript) – Browser userscript with various improvements and fixes for npmjs.com
156156
- [npm-alt](https://npm.willow.sh/) – An alternative npm package browser
157157
- [npkg.lorypelli.dev](https://npkg.lorypelli.dev/) – An alternative frontend to npm made with as little client-side JavaScript as possible
158-
- [vscode-npmx](https://github.com/npmx-dev/vscode-npmx) – VSCode extension for npmx
158+
- [vscode-npmx](https://github.com/npmx-dev/vscode-npmx) – Official VSCode extension for npmx
159+
- [vscode-open-in-npmx](https://github.com/sybers/vscode-open-in-npmx) – VSCode shortcut to open packages on npmx
159160
- [nxjt](https://nxjt.netlify.app) – npmx Jump To: Quickly navigate to npmx common webpages.
160161
- [npmx-weekly](https://npmx-weekly.trueberryless.org/) – A weekly newsletter for the npmx ecosystem. Add your own content via suggestions in the weekly PR on [GitHub](https://github.com/trueberryless-org/npmx-weekly/pulls?q=is%3Aopen+is%3Apr+label%3A%22%F0%9F%95%94+weekly+post%22).
161162
- [npmx-digest](https://npmx-digest.trueberryless.org/) – An automated news aggregation website that summarizes npmx activity from GitHub and Bluesky every 8 hours.

app/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ if (import.meta.client) {
121121
<template>
122122
<div class="min-h-screen flex flex-col bg-bg text-fg">
123123
<NuxtPwaAssets />
124-
<LinkBase to="#main-content" variant="button-primary" class="skip-link">{{
124+
<LinkBase to="#main-content" external variant="button-primary" class="skip-link">{{
125125
$t('common.skip_link')
126126
}}</LinkBase>
127127

app/components/AppFooter.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import { NPMX_DOCS_SITE } from '#shared/utils/constants'
3+
24
const route = useRoute()
35
const isHome = computed(() => route.name === 'index')
46
@@ -13,7 +15,9 @@ const showModal = () => modalRef.value?.showModal?.()
1315
class="flex flex-col sm:flex-row sm:flex-wrap items-center sm:items-baseline justify-between gap-2 sm:gap-4"
1416
>
1517
<div>
16-
<p class="font-mono text-balance m-0 hidden sm:block">{{ $t('tagline') }}</p>
18+
<p class="font-mono text-balance m-0 hidden sm:block">
19+
{{ $t('tagline') }}
20+
</p>
1721
</div>
1822
<!-- Desktop: Show all links. Mobile: Links are in MobileMenu -->
1923
<div class="hidden sm:flex items-center gap-6 min-h-11 text-xs">
@@ -92,7 +96,7 @@ const showModal = () => modalRef.value?.showModal?.()
9296
</li>
9397
</ul>
9498
</Modal>
95-
<LinkBase to="https://docs.npmx.dev">
99+
<LinkBase :to="NPMX_DOCS_SITE">
96100
{{ $t('footer.docs') }}
97101
</LinkBase>
98102
<LinkBase to="https://repo.npmx.dev">

app/components/AppHeader.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { LinkBase } from '#components'
33
import type { NavigationConfig, NavigationConfigWithGroups } from '~/types'
44
import { isEditableElement } from '~/utils/input'
5+
import { NPMX_DOCS_SITE } from '#shared/utils/constants'
56
67
withDefaults(
78
defineProps<{
@@ -85,7 +86,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
8586
{
8687
name: 'Docs',
8788
label: $t('footer.docs'),
88-
href: 'https://docs.npmx.dev',
89+
href: NPMX_DOCS_SITE,
8990
target: '_blank',
9091
type: 'link',
9192
external: true,
@@ -107,7 +108,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
107108
target: '_blank',
108109
type: 'link',
109110
external: true,
110-
iconClass: 'i-simple-icons:bluesky',
111+
iconClass: 'i-carbon:logo-bluesky',
111112
},
112113
{
113114
name: 'Chat',
@@ -124,6 +125,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
124125
125126
const showFullSearch = shallowRef(false)
126127
const showMobileMenu = shallowRef(false)
128+
const { env } = useAppConfig().buildInfo
127129
128130
// On mobile, clicking logo+search button expands search
129131
const route = useRoute()
@@ -212,10 +214,16 @@ onKeyStroke(
212214
:to="{ name: 'index' }"
213215
:aria-label="$t('header.home')"
214216
dir="ltr"
215-
class="inline-flex items-center gap-1 header-logo font-mono text-lg font-medium text-fg hover:text-fg/90 transition-colors duration-200 rounded"
217+
class="relative inline-flex items-center gap-1 header-logo font-mono text-lg font-medium text-fg hover:text-fg/90 transition-colors duration-200 rounded"
216218
>
217-
<AppLogo class="w-8 h-8 rounded-lg" />
218-
<span>npmx</span>
219+
<AppLogo class="w-7 h-7 rounded-lg" />
220+
<span class="pb-0.5">npmx</span>
221+
<span
222+
aria-hidden="true"
223+
class="scale-35 transform-origin-br font-mono tracking-wide text-accent absolute bottom-0.5 -inset-ie-1"
224+
>
225+
{{ env === 'release' ? 'alpha' : env }}
226+
</span>
219227
</NuxtLink>
220228
</div>
221229
<!-- Spacer when logo is hidden on desktop -->
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<script setup lang="ts">
2+
import { BLUESKY_API, BSKY_POST_AT_URI_REGEX } from '#shared/utils/constants'
3+
4+
const props = defineProps<{
5+
/** AT URI of the post, e.g. at://did:plc:.../app.bsky.feed.post/... */
6+
uri: string
7+
}>()
8+
9+
interface PostAuthor {
10+
did: string
11+
handle: string
12+
displayName?: string
13+
avatar?: string
14+
}
15+
16+
interface EmbedImage {
17+
thumb: string
18+
fullsize: string
19+
alt: string
20+
aspectRatio?: { width: number; height: number }
21+
}
22+
23+
interface BlueskyPost {
24+
uri: string
25+
author: PostAuthor
26+
record: { text: string; createdAt: string }
27+
embed?: { $type: string; images?: EmbedImage[] }
28+
likeCount?: number
29+
replyCount?: number
30+
repostCount?: number
31+
}
32+
33+
const postUrl = computed(() => {
34+
const match = props.uri.match(BSKY_POST_AT_URI_REGEX)
35+
if (!match) return null
36+
const [, did, rkey] = match
37+
return `https://bsky.app/profile/${did}/post/${rkey}`
38+
})
39+
40+
const { data: post, status } = useAsyncData(
41+
`bsky-post-${props.uri}`,
42+
async (): Promise<BlueskyPost | null> => {
43+
const response = await $fetch<{ posts: BlueskyPost[] }>(
44+
`${BLUESKY_API}/xrpc/app.bsky.feed.getPosts`,
45+
{ query: { uris: props.uri } },
46+
)
47+
return response.posts[0] ?? null
48+
},
49+
{ lazy: true, server: false },
50+
)
51+
</script>
52+
53+
<template>
54+
<div
55+
v-if="status === 'pending'"
56+
class="rounded-lg border border-border bg-bg-subtle p-6 text-center text-fg-subtle text-sm"
57+
>
58+
<span class="i-svg-spinners:90-ring-with-bg h-5 w-5 inline-block" />
59+
</div>
60+
61+
<a
62+
v-else-if="post"
63+
:href="postUrl ?? '#'"
64+
target="_blank"
65+
rel="noopener noreferrer"
66+
class="block rounded-lg border border-border bg-bg-subtle p-4 sm:p-5 no-underline hover:border-border-hover transition-colors duration-200"
67+
>
68+
<!-- Author row -->
69+
<div class="flex items-center gap-3 mb-3">
70+
<img
71+
v-if="post.author.avatar"
72+
:src="`${post.author.avatar}?size=48`"
73+
:alt="post.author.displayName || post.author.handle"
74+
width="40"
75+
height="40"
76+
class="w-10 h-10 rounded-full"
77+
loading="lazy"
78+
/>
79+
<div class="min-w-0">
80+
<div class="font-medium text-fg truncate">
81+
{{ post.author.displayName || post.author.handle }}
82+
</div>
83+
<div class="text-sm text-fg-subtle truncate">@{{ post.author.handle }}</div>
84+
</div>
85+
<span
86+
class="i-carbon:logo-bluesky w-5 h-5 text-fg-subtle ms-auto shrink-0"
87+
aria-hidden="true"
88+
/>
89+
</div>
90+
91+
<!-- Post text -->
92+
<p class="text-fg-muted whitespace-pre-wrap leading-relaxed mb-3">{{ post.record.text }}</p>
93+
94+
<!-- Embedded images -->
95+
<template v-if="post.embed?.images?.length">
96+
<img
97+
v-for="(img, i) in post.embed.images"
98+
:key="i"
99+
:src="img.fullsize"
100+
:alt="img.alt"
101+
class="w-full mb-3 rounded-lg object-cover"
102+
:style="
103+
img.aspectRatio
104+
? { aspectRatio: `${img.aspectRatio.width}/${img.aspectRatio.height}` }
105+
: undefined
106+
"
107+
loading="lazy"
108+
/>
109+
</template>
110+
111+
<!-- Timestamp + engagement -->
112+
<div class="flex items-center gap-4 text-sm text-fg-subtle">
113+
<DateTime :datetime="post.record.createdAt" date-style="medium" />
114+
<span v-if="post.likeCount" class="flex items-center gap-1">
115+
<span class="i-carbon:favorite w-3.5 h-3.5" aria-hidden="true" />
116+
{{ post.likeCount }}
117+
</span>
118+
<span v-if="post.repostCount" class="flex items-center gap-1">
119+
<span class="i-carbon:repeat w-3.5 h-3.5" aria-hidden="true" />
120+
{{ post.repostCount }}
121+
</span>
122+
<span v-if="post.replyCount" class="flex items-center gap-1">
123+
<span class="i-carbon:chat w-3.5 h-3.5" aria-hidden="true" />
124+
{{ post.replyCount }}
125+
</span>
126+
</div>
127+
</a>
128+
</template>

app/components/CallToAction.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const socialLinks = computed(() => [
1919
{
2020
id: 'bluesky',
2121
href: 'https://social.npmx.dev',
22-
icon: 'i-simple-icons:bluesky',
22+
icon: 'i-carbon:logo-bluesky',
2323
titleKey: $t('about.get_involved.follow.title'),
2424
descriptionKey: $t('about.get_involved.follow.description'),
2525
ctaKey: $t('about.get_involved.follow.cta'),

app/components/Header/AccountMenu.client.vue

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ function openAuthModal() {
142142
<!-- Connected accounts section -->
143143
<div v-if="hasAnyConnection" class="py-1">
144144
<!-- npm CLI connection -->
145-
<button
145+
<ButtonBase
146146
v-if="isNpmConnected && npmUser"
147-
type="button"
148147
role="menuitem"
149-
class="w-full px-3 py-2.5 flex items-center gap-3 hover:bg-bg-muted transition-colors text-start rounded-md"
148+
class="w-full text-start gap-x-3 border-none"
150149
@click="openConnectorModal"
150+
out
151151
>
152152
<img
153153
v-if="npmAvatar"
@@ -182,14 +182,13 @@ function openAuthModal() {
182182
})
183183
}}
184184
</span>
185-
</button>
185+
</ButtonBase>
186186

187187
<!-- Atmosphere connection -->
188-
<button
188+
<ButtonBase
189189
v-if="atprotoUser"
190-
type="button"
191190
role="menuitem"
192-
class="w-full px-3 py-2.5 flex items-center gap-3 hover:bg-bg-muted transition-colors text-start rounded-md"
191+
class="w-full text-start gap-x-3 border-none"
193192
@click="openAuthModal"
194193
>
195194
<img
@@ -212,7 +211,7 @@ function openAuthModal() {
212211
>
213212
<span class="text-xs text-fg-subtle">{{ $t('account_menu.atmosphere') }}</span>
214213
</span>
215-
</button>
214+
</ButtonBase>
216215
</div>
217216

218217
<!-- Divider (only if we have connections AND options to connect) -->
@@ -223,11 +222,10 @@ function openAuthModal() {
223222

224223
<!-- Connect options -->
225224
<div v-if="!isNpmConnected || !atprotoUser" class="py-1">
226-
<button
225+
<ButtonBase
227226
v-if="!isNpmConnected"
228-
type="button"
229227
role="menuitem"
230-
class="w-full px-3 py-2.5 flex items-center gap-3 hover:bg-bg-muted transition-colors text-start rounded-md"
228+
class="w-full text-start gap-x-3 border-none"
231229
@click="openConnectorModal"
232230
>
233231
<span class="w-8 h-8 rounded-full bg-bg-muted flex items-center justify-center">
@@ -248,13 +246,12 @@ function openAuthModal() {
248246
</span>
249247
<span class="text-xs text-fg-subtle">{{ $t('account_menu.npm_cli_desc') }}</span>
250248
</span>
251-
</button>
249+
</ButtonBase>
252250

253-
<button
251+
<ButtonBase
254252
v-if="!atprotoUser"
255-
type="button"
256253
role="menuitem"
257-
class="w-full px-3 py-2.5 flex items-center gap-3 hover:bg-bg-muted transition-colors text-start rounded-md"
254+
class="w-full text-start gap-x-3 border-none"
258255
@click="openAuthModal"
259256
>
260257
<span class="w-8 h-8 rounded-full bg-bg-muted flex items-center justify-center">
@@ -266,7 +263,7 @@ function openAuthModal() {
266263
</span>
267264
<span class="text-xs text-fg-subtle">{{ $t('account_menu.atmosphere_desc') }}</span>
268265
</span>
269-
</button>
266+
</ButtonBase>
270267
</div>
271268
</div>
272269
</div>

app/components/Header/AuthModal.client.vue

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,9 @@ watch(handleInput, newHandleInput => {
6464
</p>
6565
</div>
6666
</div>
67-
<button
68-
class="w-full px-4 py-2 font-mono text-sm text-fg-muted bg-bg-subtle border border-border rounded-md transition-colors duration-200 hover:text-fg hover:border-border-hover focus-visible:outline-accent/70"
69-
@click="logout"
70-
>
67+
<ButtonBase class="w-full" @click="logout">
7168
{{ $t('auth.modal.disconnect') }}
72-
</button>
69+
</ButtonBase>
7370
</div>
7471

7572
<!-- Disconnected state -->
@@ -111,19 +108,13 @@ watch(handleInput, newHandleInput => {
111108
<span class="font-bold">npmx.dev</span>
112109
</template>
113110
<template #atproto>
114-
<a :href="atprotoLink" target="_blank" class="text-blue-400 hover:underline">
115-
AT Protocol
116-
</a>
111+
<LinkBase :to="atprotoLink"> AT Protocol </LinkBase>
117112
</template>
118113
<template #bluesky>
119-
<a href="https://bsky.app" target="_blank" class="text-blue-400 hover:underline">
120-
Bluesky
121-
</a>
114+
<LinkBase to="https://bsky.app"> Bluesky </LinkBase>
122115
</template>
123116
<template #tangled>
124-
<a href="https://tangled.org" target="_blank" class="text-blue-400 hover:underline">
125-
Tangled
126-
</a>
117+
<LinkBase to="https://tangled.org"> Tangled </LinkBase>
127118
</template>
128119
</i18n-t>
129120
</div>
@@ -133,18 +124,17 @@ watch(handleInput, newHandleInput => {
133124
<ButtonBase type="submit" variant="primary" :disabled="!handleInput.trim()" class="w-full">
134125
{{ $t('auth.modal.connect') }}
135126
</ButtonBase>
136-
<ButtonBase type="button" variant="primary" class="w-full" @click="handleCreateAccount">
127+
<ButtonBase type="button" class="w-full" @click="handleCreateAccount">
137128
{{ $t('auth.modal.create_account') }}
138129
</ButtonBase>
139130
<hr class="color-border" />
140-
<ButtonBase type="button" variant="primary" class="w-full" @click="handleBlueskySignIn" block>
131+
<ButtonBase
132+
type="button"
133+
class="w-full"
134+
@click="handleBlueskySignIn"
135+
classicon="i-carbon:logo-bluesky"
136+
>
141137
{{ $t('auth.modal.connect_bluesky') }}
142-
<svg fill="none" viewBox="0 0 64 57" width="20" style="width: 20px">
143-
<path
144-
fill="#0F73FF"
145-
d="M13.873 3.805C21.21 9.332 29.103 20.537 32 26.55v15.882c0-.338-.13.044-.41.867-1.512 4.456-7.418 21.847-20.923 7.944-7.111-7.32-3.819-14.64 9.125-16.85-7.405 1.264-15.73-.825-18.014-9.015C1.12 23.022 0 8.51 0 6.55 0-3.268 8.579-.182 13.873 3.805ZM50.127 3.805C42.79 9.332 34.897 20.537 32 26.55v15.882c0-.338.13.044.41.867 1.512 4.456 7.418 21.847 20.923 7.944 7.111-7.32 3.819-14.64-9.125-16.85 7.405 1.264 15.73-.825 18.014-9.015C62.88 23.022 64 8.51 64 6.55c0-9.818-8.578-6.732-13.873-2.745Z"
146-
></path>
147-
</svg>
148138
</ButtonBase>
149139
</form>
150140
</Modal>

0 commit comments

Comments
 (0)