Skip to content

Commit b1ab6c5

Browse files
authored
Merge branch 'main' into fix-search
2 parents 17dfb26 + da4a963 commit b1ab6c5

Some content is hidden

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

57 files changed

+4038
-563
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: mirror
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
mirror:
15+
name: 🕸️ Mirror to Tangled
16+
runs-on: ubuntu-24.04-arm
17+
18+
steps:
19+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
with:
21+
fetch-depth: 0
22+
23+
- name: 🔑 Configure SSH
24+
env:
25+
TANGLED_SSH_KEY: ${{ secrets.TANGLED_SSH_KEY }}
26+
run: |
27+
mkdir -p ~/.ssh
28+
echo "$TANGLED_SSH_KEY" > ~/.ssh/id_ed25519
29+
chmod 600 ~/.ssh/id_ed25519
30+
ssh-keyscan -t ed25519 tangled.org >> ~/.ssh/known_hosts 2>/dev/null
31+
32+
- name: ⬆︎ Push to Tangled
33+
run: |
34+
git remote add tangled git@tangled.org:npmx.dev/npmx.dev
35+
git push tangled main --force
36+
git push tangled --tags --force

app/components/AppFooter.vue

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,9 @@ const showModal = () => modalRef.value?.showModal?.()
2323
<LinkBase :to="{ name: 'privacy' }">
2424
{{ $t('privacy_policy.title') }}
2525
</LinkBase>
26-
<LinkBase to="https://docs.npmx.dev">
27-
{{ $t('footer.docs') }}
28-
</LinkBase>
29-
<LinkBase to="https://repo.npmx.dev">
30-
{{ $t('footer.source') }}
31-
</LinkBase>
32-
<LinkBase to="https://social.npmx.dev">
33-
{{ $t('footer.social') }}
34-
</LinkBase>
35-
<LinkBase to="https://chat.npmx.dev">
36-
{{ $t('footer.chat') }}
37-
</LinkBase>
38-
3926
<button
4027
type="button"
41-
class="group inline-flex gap-x-1 items-center justify-center underline-offset-[0.2rem] underline decoration-1 decoration-fg/30 font-mono text-fg hover:(decoration-accent text-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200"
28+
class="cursor-pointer group inline-flex gap-x-1 items-center justify-center underline-offset-[0.2rem] underline decoration-1 decoration-fg/30 font-mono text-fg hover:(decoration-accent text-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200"
4229
@click.prevent="showModal"
4330
aria-haspopup="dialog"
4431
>
@@ -102,6 +89,18 @@ const showModal = () => modalRef.value?.showModal?.()
10289
</li>
10390
</ul>
10491
</Modal>
92+
<LinkBase to="https://docs.npmx.dev">
93+
{{ $t('footer.docs') }}
94+
</LinkBase>
95+
<LinkBase to="https://repo.npmx.dev">
96+
{{ $t('footer.source') }}
97+
</LinkBase>
98+
<LinkBase to="https://social.npmx.dev">
99+
{{ $t('footer.social') }}
100+
</LinkBase>
101+
<LinkBase to="https://chat.npmx.dev">
102+
{{ $t('footer.chat') }}
103+
</LinkBase>
105104
</div>
106105
</div>
107106
<BuildEnvironment v-if="!isHome" footer />

app/components/Compare/PackageSelector.vue

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,17 @@ function handleKeydown(e: KeyboardEvent) {
9292
}
9393
}
9494
95+
const { start, stop } = useTimeoutFn(() => {
96+
isInputFocused.value = false
97+
}, 200)
98+
9599
function handleBlur() {
96-
useTimeoutFn(() => {
97-
isInputFocused.value = false
98-
}, 200)
100+
start()
101+
}
102+
103+
function handleFocus() {
104+
stop()
105+
isInputFocused.value = true
99106
}
100107
</script>
101108

@@ -151,7 +158,7 @@ function handleBlur() {
151158
size="medium"
152159
class="w-full min-w-25 ps-7"
153160
aria-autocomplete="list"
154-
@focus="isInputFocused = true"
161+
@focus="handleFocus"
155162
@blur="handleBlur"
156163
@keydown="handleKeydown"
157164
/>
@@ -178,13 +185,13 @@ function handleBlur() {
178185
:aria-label="$t('compare.no_dependency.add_column')"
179186
@click="addPackage(NO_DEPENDENCY_ID)"
180187
>
181-
<div class="text-sm text-accent italic flex items-center gap-2">
188+
<span class="text-sm text-accent italic flex items-center gap-2 block">
182189
<span class="i-carbon:clean w-4 h-4" aria-hidden="true" />
183190
{{ $t('compare.no_dependency.typeahead_title') }}
184-
</div>
185-
<div class="text-xs text-fg-muted truncate mt-0.5">
191+
</span>
192+
<span class="text-xs text-fg-muted truncate mt-0.5">
186193
{{ $t('compare.no_dependency.typeahead_description') }}
187-
</div>
194+
</span>
188195
</ButtonBase>
189196

190197
<div v-if="isSearching" class="px-4 py-3 text-sm text-fg-muted">
@@ -196,10 +203,10 @@ function handleBlur() {
196203
class="block w-full text-start"
197204
@click="addPackage(result.name)"
198205
>
199-
<div class="font-mono text-sm text-fg">{{ result.name }}</div>
200-
<div v-if="result.description" class="text-xs text-fg-muted truncate mt-0.5">
206+
<span class="font-mono text-sm text-fg block">{{ result.name }}</span>
207+
<span v-if="result.description" class="text-xs text-fg-muted truncate mt-0.5">
201208
{{ result.description }}
202-
</div>
209+
</span>
203210
</ButtonBase>
204211
</div>
205212
</Transition>

app/components/Header/AccountMenu.client.vue

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function openAuthModal() {
6565
class="border-none"
6666
>
6767
<!-- Stacked avatars when connected -->
68-
<div
68+
<span
6969
v-if="hasAnyConnection"
7070
class="flex items-center"
7171
:class="hasBothConnections ? '-space-x-2' : ''"
@@ -103,7 +103,7 @@ function openAuthModal() {
103103
>
104104
<span class="i-carbon-cloud w-3 h-3 text-fg-muted" aria-hidden="true" />
105105
</span>
106-
</div>
106+
</span>
107107

108108
<!-- "connect" text when not connected -->
109109
<span v-if="!hasAnyConnection" class="font-mono text-sm">
@@ -163,10 +163,10 @@ function openAuthModal() {
163163
>
164164
<span class="i-carbon-terminal w-4 h-4 text-fg-muted" aria-hidden="true" />
165165
</span>
166-
<div class="flex-1 min-w-0">
167-
<div class="font-mono text-sm text-fg truncate">~{{ npmUser }}</div>
168-
<div class="text-xs text-fg-subtle">{{ $t('account_menu.npm_cli') }}</div>
169-
</div>
166+
<span class="flex-1 min-w-0">
167+
<span class="font-mono text-sm text-fg truncate block">~{{ npmUser }}</span>
168+
<span class="text-xs text-fg-subtle">{{ $t('account_menu.npm_cli') }}</span>
169+
</span>
170170
<span
171171
v-if="operationCount > 0"
172172
class="px-1.5 py-0.5 font-mono text-xs rounded"
@@ -206,10 +206,12 @@ function openAuthModal() {
206206
>
207207
<span class="i-carbon-cloud w-4 h-4 text-fg-muted" aria-hidden="true" />
208208
</span>
209-
<div class="flex-1 min-w-0">
210-
<div class="font-mono text-sm text-fg truncate">@{{ atprotoUser.handle }}</div>
211-
<div class="text-xs text-fg-subtle">{{ $t('account_menu.atmosphere') }}</div>
212-
</div>
209+
<span class="flex-1 min-w-0">
210+
<span class="font-mono text-sm text-fg truncate block"
211+
>@{{ atprotoUser.handle }}</span
212+
>
213+
<span class="text-xs text-fg-subtle">{{ $t('account_menu.atmosphere') }}</span>
214+
</span>
213215
</button>
214216
</div>
215217

@@ -236,16 +238,16 @@ function openAuthModal() {
236238
/>
237239
<span v-else class="i-carbon-terminal w-4 h-4 text-fg-muted" aria-hidden="true" />
238240
</span>
239-
<div class="flex-1 min-w-0">
240-
<div class="font-mono text-sm text-fg">
241+
<span class="flex-1 min-w-0">
242+
<span class="font-mono text-sm text-fg block">
241243
{{
242244
isNpmConnecting
243245
? $t('account_menu.connecting')
244246
: $t('account_menu.connect_npm_cli')
245247
}}
246-
</div>
247-
<div class="text-xs text-fg-subtle">{{ $t('account_menu.npm_cli_desc') }}</div>
248-
</div>
248+
</span>
249+
<span class="text-xs text-fg-subtle">{{ $t('account_menu.npm_cli_desc') }}</span>
250+
</span>
249251
</button>
250252

251253
<button
@@ -258,12 +260,12 @@ function openAuthModal() {
258260
<span class="w-8 h-8 rounded-full bg-bg-muted flex items-center justify-center">
259261
<span class="i-carbon-cloud w-4 h-4 text-fg-muted" aria-hidden="true" />
260262
</span>
261-
<div class="flex-1 min-w-0">
262-
<div class="font-mono text-sm text-fg">
263+
<span class="flex-1 min-w-0">
264+
<span class="font-mono text-sm text-fg block">
263265
{{ $t('account_menu.connect_atmosphere') }}
264-
</div>
265-
<div class="text-xs text-fg-subtle">{{ $t('account_menu.atmosphere_desc') }}</div>
266-
</div>
266+
</span>
267+
<span class="text-xs text-fg-subtle">{{ $t('account_menu.atmosphere_desc') }}</span>
268+
</span>
267269
</button>
268270
</div>
269271
</div>

app/components/Header/SearchBox.vue

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const emit = defineEmits(['blur', 'focus'])
1515
1616
const router = useRouter()
1717
const route = useRoute()
18+
const { isAlgolia } = useSearchProvider()
1819
1920
const isSearchFocused = shallowRef(false)
2021
@@ -28,11 +29,32 @@ const searchQuery = shallowRef(normalizeSearchParam(route.query.q))
2829
// Pages that have their own local filter using ?q
2930
const pagesWithLocalFilter = new Set(['~username', 'org'])
3031
31-
const updateUrlQuery = debounce((value: string) => {
32+
function updateUrlQueryImpl(value: string) {
33+
// Don't navigate away from pages that use ?q for local filtering
34+
if (pagesWithLocalFilter.has(route.name)) {
35+
return
36+
}
3237
if (route.name === 'search') {
3338
router.replace({ query: { q: value || undefined } })
3439
}
35-
}, 250)
40+
41+
router.push({
42+
name: 'search',
43+
query: {
44+
q: value,
45+
},
46+
})
47+
}
48+
49+
const updateUrlQueryNpm = debounce(updateUrlQueryImpl, 250)
50+
const updateUrlQueryAlgolia = debounce(updateUrlQueryImpl, 80)
51+
52+
const updateUrlQuery = Object.assign(
53+
(value: string) => (isAlgolia.value ? updateUrlQueryAlgolia : updateUrlQueryNpm)(value),
54+
{
55+
flush: () => (isAlgolia.value ? updateUrlQueryAlgolia : updateUrlQueryNpm).flush(),
56+
},
57+
)
3658
3759
watch(searchQuery, value => {
3860
if (route.name === 'search') {

app/components/Package/Dependencies.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ const numberFormatter = useNumberFormatter()
9595
{{ dep }}
9696
</LinkBase>
9797
<span class="flex items-center gap-1 max-w-[40%]" dir="ltr">
98-
<span
98+
<TooltipApp
9999
v-if="outdatedDeps[dep]"
100-
class="shrink-0"
100+
class="shrink-0 p-2 -m-2"
101101
:class="getVersionClass(outdatedDeps[dep])"
102-
:title="getOutdatedTooltip(outdatedDeps[dep], $t)"
103102
aria-hidden="true"
103+
:text="getOutdatedTooltip(outdatedDeps[dep], $t)"
104104
>
105105
<span class="i-carbon:warning-alt w-3 h-3" />
106-
</span>
106+
</TooltipApp>
107107
<LinkBase
108108
v-if="getVulnerableDepInfo(dep)"
109109
:to="packageRoute(dep, getVulnerableDepInfo(dep)!.version)"

app/components/Package/DeprecatedTree.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ function getDepthStyle(depth: DependencyDepth) {
5353
aria-controls="deprecated-tree-details"
5454
@click="isExpanded = !isExpanded"
5555
>
56-
<div class="flex items-center gap-2 min-w-0">
56+
<span class="flex items-center gap-2 min-w-0 block">
5757
<span class="i-carbon-warning-hex w-4 h-4 shrink-0" aria-hidden="true" />
5858
<span class="font-mono text-sm font-medium truncate">
5959
{{ $t('package.deprecated.tree_found', analysisData!.deprecatedPackages.length) }}
6060
</span>
61-
</div>
61+
</span>
6262
<span
6363
class="i-carbon-chevron-down w-4 h-4 transition-transform duration-200 shrink-0"
6464
:class="{ 'rotate-180': isExpanded }"

0 commit comments

Comments
 (0)