Skip to content

Commit 97a4282

Browse files
authored
Merge branch 'main' into button-butter
2 parents ed46b9a + a5b2e9c commit 97a4282

36 files changed

Lines changed: 1434 additions & 123 deletions

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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,12 @@ 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">{{
125-
$t('common.skip_link')
126-
}}</LinkBase>
124+
<LinkBase
125+
:to="{ hash: '#main-content', query: route.query, params: route.params }"
126+
variant="button-primary"
127+
class="skip-link"
128+
>{{ $t('common.skip_link') }}</LinkBase
129+
>
127130

128131
<AppHeader :show-logo="!isHomepage" />
129132

app/components/AppHeader.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
107107
target: '_blank',
108108
type: 'link',
109109
external: true,
110-
iconClass: 'i-simple-icons:bluesky',
110+
iconClass: 'i-carbon:logo-bluesky',
111111
},
112112
{
113113
name: 'Chat',
@@ -124,6 +124,7 @@ const mobileLinks = computed<NavigationConfigWithGroups>(() => [
124124
125125
const showFullSearch = shallowRef(false)
126126
const showMobileMenu = shallowRef(false)
127+
const { env } = useAppConfig().buildInfo
127128
128129
// On mobile, clicking logo+search button expands search
129130
const route = useRoute()
@@ -214,8 +215,14 @@ onKeyStroke(
214215
dir="ltr"
215216
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 focus-visible:(outline-2 outline-accent)"
216217
>
217-
<AppLogo class="w-8 h-8 rounded-lg" />
218-
<span>npmx</span>
218+
<AppLogo class="w-7 h-7 rounded-lg" />
219+
<span class="pb-0.5">npmx</span>
220+
<span
221+
aria-hidden="true"
222+
class="scale-35 transform-origin-br font-mono tracking-wide text-accent absolute bottom-0.5 -inset-ie-1"
223+
>
224+
{{ env === 'release' ? 'alpha' : env }}
225+
</span>
219226
</NuxtLink>
220227
</div>
221228
<!-- 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 group 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
@@ -250,13 +248,12 @@ function openAuthModal() {
250248
</span>
251249
<span class="text-xs text-fg-subtle">{{ $t('account_menu.npm_cli_desc') }}</span>
252250
</span>
253-
</button>
251+
</ButtonBase>
254252

255-
<button
253+
<ButtonBase
256254
v-if="!atprotoUser"
257-
type="button"
258255
role="menuitem"
259-
class="w-full px-3 py-2.5 group flex items-center gap-3 hover:bg-bg-muted transition-colors text-start rounded-md"
256+
class="w-full text-start gap-x-3 border-none"
260257
@click="openAuthModal"
261258
>
262259
<span
@@ -270,7 +267,7 @@ function openAuthModal() {
270267
</span>
271268
<span class="text-xs text-fg-subtle">{{ $t('account_menu.atmosphere_desc') }}</span>
272269
</span>
273-
</button>
270+
</ButtonBase>
274271
</div>
275272
</div>
276273
</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>

app/components/Header/ConnectorModal.vue

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,9 @@ function handleDisconnect() {
8080
{{ $t('connector.modal.connected_hint') }}
8181
</div>
8282

83-
<button
84-
type="button"
85-
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"
86-
@click="handleDisconnect"
87-
>
83+
<ButtonBase type="button" class="w-full" @click="handleDisconnect">
8884
{{ $t('connector.modal.disconnect') }}
89-
</button>
85+
</ButtonBase>
9086
</div>
9187

9288
<!-- Disconnected state -->
@@ -100,14 +96,11 @@ function handleDisconnect() {
10096
<p class="text-sm text-fg-muted">
10197
<i18n-t keypath="connector.modal.contributor_notice" scope="global">
10298
<template #link>
103-
<a
104-
href="https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md#local-connector-cli"
105-
target="_blank"
106-
rel="noopener noreferrer"
107-
class="text-blue-400 hover:underline"
99+
<LinkBase
100+
to="https://github.com/npmx-dev/npmx.dev/blob/main/CONTRIBUTING.md#local-connector-cli"
108101
>
109102
{{ $t('connector.modal.contributor_link') }}
110-
</a>
103+
</LinkBase>
111104
</template>
112105
</i18n-t>
113106
</p>
@@ -124,15 +117,12 @@ function handleDisconnect() {
124117
>
125118
<span class="text-fg-subtle">$</span>
126119
<span class="text-fg-subtle ms-2">pnpm npmx-connector</span>
127-
<button
128-
type="button"
120+
<ButtonBase
129121
:aria-label="copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
130-
class="ms-auto text-fg-subtle p-1.5 -m-1.5 hover:text-fg transition-colors duration-200 focus-visible:outline-accent/70 rounded"
131122
@click="copy('pnpm npmx-connector')"
132-
>
133-
<span v-if="!copied" class="i-carbon:copy block w-5 h-5" aria-hidden="true" />
134-
<span v-else class="i-carbon:checkmark block w-5 h-5 text-green-500" aria-hidden="true" />
135-
</button>
123+
class="ms-auto"
124+
:classicon="copied ? 'i-carbon:checkmark text-green-500' : 'i-carbon:copy'"
125+
/>
136126
</div>
137127

138128
<!-- TODO: Uncomment when npmx-connector is published to npm

0 commit comments

Comments
 (0)