Skip to content

Commit 8c3151c

Browse files
authored
Merge branch 'main' into chore/test-route-overriting
2 parents 575fa89 + c9e9821 commit 8c3151c

22 files changed

Lines changed: 537 additions & 176 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,18 +289,6 @@ import { hasProtocol } from 'ufo'
289289
| Constants | SCREAMING_SNAKE_CASE | `NPM_REGISTRY`, `ALLOWED_TAGS` |
290290
| Types/Interfaces | PascalCase | `NpmSearchResponse` |
291291

292-
> [!TIP]
293-
> Exports in `app/composables/`, `app/utils/`, and `server/utils/` are auto-imported by Nuxt. To prevent [knip](https://knip.dev/) from flagging them as unused, add a `@public` JSDoc annotation:
294-
>
295-
> ```typescript
296-
> /**
297-
> * @public
298-
> */
299-
> export function myAutoImportedFunction() {
300-
> // ...
301-
> }
302-
> ```
303-
304292
### Vue components
305293

306294
- Use Composition API with `<script setup lang="ts">`

app/components/Package/TableRow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const allMaintainersText = computed(() => {
4444

4545
<template>
4646
<tr
47-
class="group relative border-b border-border hover:bg-bg-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-inset focus-visible:outline-none focus:bg-bg-muted"
47+
class="group relative scale-100 [clip-path:inset(0)] border-b border-border hover:bg-bg-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-inset focus-visible:outline-none focus:bg-bg-muted"
4848
tabindex="0"
4949
:data-result-index="index"
5050
>

app/composables/useActiveTocItem.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { Ref } from 'vue'
77
*
88
* @param toc - Reactive array of TOC items
99
* @returns Object containing activeId
10-
* @public
1110
*/
1211
export function useActiveTocItem(toc: Ref<TocItem[]>) {
1312
const activeId = shallowRef<string | null>(null)

app/composables/useMarkdown.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ interface UseMarkdownOptions {
88
packageName?: string
99
}
1010

11-
/** @public */
1211
export function useMarkdown(options: MaybeRefOrGetter<UseMarkdownOptions>) {
1312
return computed(() => parseMarkdown(toValue(options)))
1413
}

app/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ defineOgImageComponent('Default', {
109109

110110
<nav
111111
:aria-label="$t('nav.popular_packages')"
112-
class="pt-4 pb-36 sm:pb-40 text-center motion-safe:animate-fade-in motion-safe:animate-fill-both"
112+
class="pt-4 pb-36 sm:pb-40 text-center motion-safe:animate-fade-in motion-safe:animate-fill-both max-w-xl mx-auto"
113113
style="animation-delay: 0.3s"
114114
>
115115
<ul class="flex flex-wrap items-center justify-center gap-x-6 gap-y-3 list-none m-0 p-0">

app/utils/frameworks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const SHOWCASED_FRAMEWORKS = [
6363
},
6464
{
6565
name: 'tanstack start',
66-
package: '@tanstack/start',
66+
package: '@tanstack/start-server-core',
6767
color: 'oklch(60.9% .126 221.723)',
6868
},
6969
]

i18n/locales/de-DE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@
624624
"invalid_name": "Ungültiger Paketname:",
625625
"available": "Dieser Name ist verfügbar!",
626626
"taken": "Dieser Name ist bereits vergeben.",
627+
"missing_permission": "Du hast keine Berechtigung, ein Paket zum Scope {'@'}{scope} hinzuzufügen.",
627628
"similar_warning": "Ähnliche Pakete existieren - npm könnte diesen Namen ablehnen:",
628629
"related": "Verwandte Pakete:",
629630
"scope_warning_title": "Erwäge stattdessen ein Scoped-Paket",

lunaria/files/de-DE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@
623623
"invalid_name": "Ungültiger Paketname:",
624624
"available": "Dieser Name ist verfügbar!",
625625
"taken": "Dieser Name ist bereits vergeben.",
626+
"missing_permission": "Du hast keine Berechtigung, ein Paket zum Scope {'@'}{scope} hinzuzufügen.",
626627
"similar_warning": "Ähnliche Pakete existieren - npm könnte diesen Namen ablehnen:",
627628
"related": "Verwandte Pakete:",
628629
"scope_warning_title": "Erwäge stattdessen ein Scoped-Paket",

modules/runtime/server/cache.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,44 @@ function getMockForUrl(url: string): MockResult | null {
195195
return { data: null }
196196
}
197197

198+
// npm attestations API - return empty attestations (provenance not needed in tests)
199+
if (host === 'registry.npmjs.org' && pathname.startsWith('/-/npm/v1/attestations/')) {
200+
return { data: { attestations: [] } }
201+
}
202+
203+
// Constellation API - return empty results for link queries
204+
if (host === 'constellation.microcosm.blue') {
205+
if (pathname === '/links/distinct-dids') {
206+
return { data: { total: 0, linking_dids: [], cursor: undefined } }
207+
}
208+
if (pathname === '/links/all') {
209+
return { data: { links: {} } }
210+
}
211+
if (pathname === '/xrpc/blue.microcosm.links.getBacklinks') {
212+
return { data: { total: 0, records: [], cursor: undefined } }
213+
}
214+
return { data: null }
215+
}
216+
217+
// UNGH (GitHub proxy) - return mock repo metadata
218+
if (host === 'ungh.cc') {
219+
const repoMatch = pathname.match(/^\/repos\/([^/]+)\/([^/]+)$/)
220+
if (repoMatch?.[1] && repoMatch?.[2]) {
221+
return {
222+
data: {
223+
repo: {
224+
description: `${repoMatch[1]}/${repoMatch[2]} - mock repo description`,
225+
stars: 1000,
226+
forks: 100,
227+
watchers: 50,
228+
defaultBranch: 'main',
229+
},
230+
},
231+
}
232+
}
233+
return { data: null }
234+
}
235+
198236
// GitHub API - handled via fixtures, return null to use fixture system
199237
// Note: The actual fixture loading is handled in fetchFromFixtures via special case
200238
if (host === 'api.github.com') {
@@ -426,6 +464,19 @@ async function handleGitHubApi(
426464
return { data: [] }
427465
}
428466

467+
// Commits endpoint: /repos/{owner}/{repo}/commits
468+
const commitsMatch = pathname.match(/^\/repos\/([^/]+)\/([^/]+)\/commits$/)
469+
if (commitsMatch) {
470+
// Return a single-item array; fetchPageCount will use body.length when no Link header
471+
return { data: [{ sha: 'mock-commit' }] }
472+
}
473+
474+
// Search endpoint: /search/issues, /search/commits, etc.
475+
const searchMatch = pathname.match(/^\/search\/(.+)$/)
476+
if (searchMatch) {
477+
return { data: { total_count: 0, incomplete_results: false, items: [] } }
478+
}
479+
429480
// Other GitHub API endpoints can be added here as needed
430481
return null
431482
}

nuxt.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import process from 'node:process'
22
import { currentLocales } from './config/i18n'
3-
import { isCI, provider } from 'std-env'
3+
import { isCI, isTest, provider } from 'std-env'
44

55
export default defineNuxtConfig({
66
modules: [
@@ -213,6 +213,9 @@ export default defineNuxtConfig({
213213
include: ['../test/unit/server/**/*.ts'],
214214
},
215215
},
216+
replace: {
217+
'import.meta.test': isTest,
218+
},
216219
},
217220

218221
fonts: {

0 commit comments

Comments
 (0)