[READ-ONLY] a fast, modern browser for the npm registry

chore: clean up knip config + prune unused code

+38 -213
+1 -1
.github/workflows/ci.yml
··· 139 139 run: pnpm install 140 140 141 141 - name: 🔍 Check for unused code 142 - run: pnpm knip:production 142 + run: pnpm knip
-1
app/composables/useAtproto.ts
··· 1 1 import type { UserSession } from '#shared/schemas/userSession' 2 2 3 - /** @public */ 4 3 export function useAtproto() { 5 4 const { data: user, pending, clear } = useFetch<UserSession | null>('/api/auth/session') 6 5
-1
app/composables/useCachedFetch.ts
··· 27 27 * ) 28 28 * } 29 29 * ``` 30 - * @public 31 30 */ 32 31 export function useCachedFetch(): CachedFetchFunction { 33 32 // On client, return a function that just uses $fetch (no caching, not stale)
-1
app/composables/useCharts.ts
··· 286 286 return versionDates[0] ?? null 287 287 } 288 288 289 - /** @public */ 290 289 export function useCharts() { 291 290 function resolveDateRange( 292 291 downloadEvolutionOptions: PackageDownloadEvolutionOptions,
-1
app/composables/useConnector.ts
··· 55 55 const STORAGE_KEY = 'npmx-connector' 56 56 const DEFAULT_PORT = 31415 57 57 58 - /** @public */ 59 58 export const useConnector = createSharedComposable(function useConnector() { 60 59 // Persisted connection config 61 60 const config = useState<{ token: string; port: number } | null>('connector-config', () => null)
-1
app/composables/useFacetSelection.ts
··· 5 5 /** 6 6 * Composable for managing comparison facet selection with URL sync. 7 7 * 8 - * @public 9 8 * @param queryParam - The URL query parameter name to use (default: 'facets') 10 9 */ 11 10 export function useFacetSelection(queryParam = 'facets') {
-1
app/composables/useFileTreeState.ts
··· 1 - /** @public */ 2 1 export function useFileTreeState(baseUrl: string) { 3 2 const stateKey = computed(() => `npmx-file-tree${baseUrl}`) 4 3
-1
app/composables/useI18nStatus.ts
··· 3 3 /** 4 4 * Composable for accessing translation status data from Lunaria. 5 5 * Provides information about translation progress for each locale. 6 - * @public 7 6 */ 8 7 export function useI18nStatus() { 9 8 const { locale } = useI18n()
-1
app/composables/useInstallCommand.ts
··· 3 3 /** 4 4 * Composable for generating install commands with support for 5 5 * multiple package managers, @types packages, and JSR. 6 - * @public 7 6 */ 8 7 export function useInstallCommand( 9 8 packageName: MaybeRefOrGetter<string | null>,
-1
app/composables/useIsMobile.ts
··· 3 3 * Uses the same breakpoint as Tailwind's `md:` (768px). 4 4 * 5 5 * Returns `false` during SSR to avoid hydration mismatches. 6 - * @public 7 6 */ 8 7 export function useIsMobile() { 9 8 return useMediaQuery('(max-width: 767px)')
-2
app/composables/useJsonLd.ts
··· 90 90 91 91 /** 92 92 * Inject JSON-LD script into head 93 - * @public 94 93 */ 95 94 export function setJsonLd(schema: JsonLdSchema | JsonLdSchema[]) { 96 95 const schemas = Array.isArray(schema) ? schema : [schema] ··· 106 105 107 106 /** 108 107 * Create WebSite schema with search action 109 - * @public 110 108 */ 111 109 export function createWebSiteSchema(options?: { 112 110 name?: string
-1
app/composables/useModuleReplacement.ts
··· 1 1 import type { ModuleReplacement } from 'module-replacements' 2 2 3 - /** @public */ 4 3 export function useModuleReplacement(packageName: MaybeRefOrGetter<string>) { 5 4 return useLazyFetch<ModuleReplacement | null>(() => `/api/replacements/${toValue(packageName)}`) 6 5 }
-8
app/composables/useNpmRegistry.ts
··· 176 176 } 177 177 } 178 178 179 - /** @public */ 180 179 export function usePackage( 181 180 name: MaybeRefOrGetter<string>, 182 181 requestedVersion?: MaybeRefOrGetter<string | null>, ··· 226 225 return resolved 227 226 } 228 227 229 - /** @public */ 230 228 export function usePackageDownloads( 231 229 name: MaybeRefOrGetter<string>, 232 230 period: MaybeRefOrGetter<'last-day' | 'last-week' | 'last-month' | 'last-year'> = 'last-week', ··· 264 262 /** 265 263 * Fetch download range data from npm API. 266 264 * Exported for external use (e.g., in components). 267 - * @public 268 265 */ 269 266 export async function fetchNpmDownloadsRange( 270 267 packageName: string, ··· 289 286 size?: number 290 287 } 291 288 292 - /** @public */ 293 289 export function useNpmSearch( 294 290 query: MaybeRefOrGetter<string>, 295 291 options: MaybeRefOrGetter<NpmSearchOptions> = {}, ··· 505 501 /** 506 502 * Fetch all packages for an npm organization 507 503 * Returns search-result-like objects for compatibility with PackageList 508 - * @public 509 504 */ 510 505 export function useOrgPackages(orgName: MaybeRefOrGetter<string>) { 511 506 const cachedFetch = useCachedFetch() ··· 758 753 /** 759 754 * Composable to check for outdated dependencies. 760 755 * Returns a reactive map of dependency name to outdated info. 761 - * @public 762 756 */ 763 757 export function useOutdatedDependencies( 764 758 dependencies: MaybeRefOrGetter<Record<string, string> | undefined>, ··· 808 802 809 803 /** 810 804 * Get tooltip text for an outdated dependency 811 - * @public 812 805 */ 813 806 export function getOutdatedTooltip( 814 807 info: OutdatedDependencyInfo, ··· 833 826 834 827 /** 835 828 * Get CSS class for a dependency version based on outdated status 836 - * @public 837 829 */ 838 830 export function getVersionClass(info: OutdatedDependencyInfo | undefined): string { 839 831 if (!info) return 'text-fg-subtle'
-1
app/composables/usePackageAnalysis.ts
··· 14 14 15 15 /** 16 16 * Composable for fetching package analysis data (module format, types info, etc.) 17 - * @public 18 17 */ 19 18 export function usePackageAnalysis( 20 19 packageName: MaybeRefOrGetter<string>,
-1
app/composables/usePackageComparison.ts
··· 28 28 /** 29 29 * Composable for fetching and comparing multiple packages. 30 30 * 31 - * @public 32 31 */ 33 32 export function usePackageComparison(packageNames: MaybeRefOrGetter<string[]>) { 34 33 const packages = computed(() => toValue(packageNames))
-1
app/composables/usePackageListPreferences.ts
··· 15 15 * Composable for managing package list display preferences 16 16 * Persists to localStorage and provides reactive state 17 17 * 18 - * @public 19 18 */ 20 19 export function usePackageListPreferences() { 21 20 const {
-1
app/composables/usePackageRoute.ts
··· 8 8 * /@nuxt/kit/v/1.0.0 → packageName: "@nuxt/kit", requestedVersion: "1.0.0" 9 9 * /axios@1.13.3 → packageName: "axios", requestedVersion: "1.13.3" 10 10 * /@nuxt/kit@1.0.0 → packageName: "@nuxt/kit", requestedVersion: "1.0.0" 11 - * @public 12 11 */ 13 12 export function usePackageRoute() { 14 13 const route = useRoute('package')
-1
app/composables/usePreferencesProvider.ts
··· 57 57 * Composable for managing preferences storage 58 58 * Abstracts the storage mechanism to allow future migration to API-based storage 59 59 * 60 - * @public 61 60 */ 62 61 export function usePreferencesProvider<T>(defaultValue: T) { 63 62 const provider = createLocalStorageProvider<T>(STORAGE_KEY)
-1
app/composables/useRepoMeta.ts
··· 754 754 755 755 const parseRepoFromUrl = parseRepoUrl 756 756 757 - /** @public */ 758 757 export function useRepoMeta(repositoryUrl: MaybeRefOrGetter<string | null | undefined>) { 759 758 // Get cachedFetch in setup context (outside async handler) 760 759 const cachedFetch = useCachedFetch()
-1
app/composables/useSelectedPackageManager.ts
··· 5 5 * `data-pm` attribute on `<html>`. The attribute enables CSS-based 6 6 * visibility of PM-specific content without JavaScript. 7 7 * 8 - * @public 9 8 */ 10 9 export const useSelectedPackageManager = createSharedComposable( 11 10 function useSelectedPackageManager() {
-1
app/composables/useSettings.ts
··· 55 55 /** 56 56 * Composable for accessing just the relative dates setting. 57 57 * Useful for components that only need to read this specific setting. 58 - * @public 59 58 */ 60 59 export function useRelativeDates() { 61 60 const { settings } = useSettings()
-1
app/composables/useStructuredFilters.ts
··· 111 111 /** 112 112 * Composable for structured filtering and sorting of package lists 113 113 * 114 - * @public 115 114 */ 116 115 export function useStructuredFilters(options: UseStructuredFiltersOptions) { 117 116 const { packages, initialFilters, initialSort } = options
-1
app/composables/useVirtualInfiniteScroll.ts
··· 34 34 * Composable for handling infinite scroll with virtua's WindowVirtualizer 35 35 * Detects when user scrolls near the end and triggers loading more items 36 36 * Also tracks current visible page for URL persistence 37 - * @public 38 37 */ 39 38 export function useVirtualInfiniteScroll(options: UseVirtualInfiniteScrollOptions) { 40 39 const {
-2
app/utils/charts.ts
··· 10 10 return result 11 11 } 12 12 13 - /** @public */ 14 13 export function buildWeeklyEvolutionFromDaily( 15 14 daily: Array<{ day: string; downloads: number }>, 16 15 ): Array<{ weekStart: string; weekEnd: string; downloads: number }> { ··· 23 22 }) 24 23 } 25 24 26 - /** @public */ 27 25 export function addDays(date: Date, days: number): Date { 28 26 const d = new Date(date) 29 27 d.setUTCDate(d.getUTCDate() + days)
-2
app/utils/colors.ts
··· 44 44 * Used to create light tints of accent colors for better visibility in light mode. 45 45 * @param hex - The hex color to lighten (e.g., "#ff0000") 46 46 * @param factor - Lighten factor from 0 to 1 (0.5 = 50% lighter, mixed with white) 47 - * @public 48 47 */ 49 48 export function lightenHex(hex: string, factor: number = 0.5): string { 50 49 const rgb = hexToRgb(hex) ··· 55 54 return rgbToHex(...lightened) 56 55 } 57 56 58 - /** @public */ 59 57 export function oklchToHex(color: string | undefined | null): string | undefined | null { 60 58 if (color == null) return color 61 59
-2
app/utils/formatters.ts
··· 1 - /** @public */ 2 1 export function toIsoDateString(date: Date): string { 3 2 const year = date.getUTCFullYear() 4 3 const month = String(date.getUTCMonth() + 1).padStart(2, '0') ··· 6 5 return `${year}-${month}-${day}` 7 6 } 8 7 9 - /** @public */ 10 8 export function formatCompactNumber( 11 9 value: number, 12 10 options?: { decimals?: number; space?: boolean },
-1
app/utils/input.ts
··· 1 - /** @public */ 2 1 export const noCorrect = { 3 2 autocapitalize: 'off', 4 3 autocomplete: 'off',
-2
app/utils/install-command.ts
··· 90 90 91 91 /** 92 92 * Generate the full install command for a package. 93 - * @public 94 93 */ 95 94 export function getInstallCommand(options: InstallCommandOptions): string { 96 95 return getInstallCommandParts(options).join(' ') ··· 118 117 isCreatePackage?: boolean 119 118 } 120 119 121 - /** @public */ 122 120 export function getExecuteCommand(options: ExecuteCommandOptions): string { 123 121 return getExecuteCommandParts(options).join(' ') 124 122 }
-1
app/utils/prehydrate.ts
··· 8 8 * to show the correct content before Vue hydration occurs. 9 9 * 10 10 * Call this in app.vue or any page that needs early access to user preferences. 11 - * @public 12 11 */ 13 12 export function initPreferencesOnPrehydrate() { 14 13 // Callback is stringified by Nuxt - external variables won't be available.
-1
app/utils/responsive.ts
··· 1 - /** @public */ 2 1 export function isTouchDevice() { 3 2 if (import.meta.server) { 4 3 return false
-4
app/utils/run-command.ts
··· 21 21 * - Name starts with "create-" (e.g., create-vite) 22 22 * - Scoped name contains "/create-" (e.g., @vue/create-app) 23 23 * - Has bin field but no main, module, or exports fields 24 - * @public 25 24 */ 26 25 export function isBinaryOnlyPackage(pkg: PackageMetadata): boolean { 27 26 const baseName = pkg.name.startsWith('@') ? pkg.name.split('/')[1] : pkg.name ··· 41 40 42 41 /** 43 42 * Check if a package uses the create-* naming convention. 44 - * @public 45 43 */ 46 44 export function isCreatePackage(packageName: string): boolean { 47 45 const baseName = packageName.startsWith('@') ? packageName.split('/')[1] : packageName ··· 63 61 /** 64 62 * Extract executable command information from a package's bin field. 65 63 * Handles both string format ("bin": "./cli.js") and object format ("bin": { "cmd": "./cli.js" }). 66 - * @public 67 64 */ 68 65 export function getExecutableInfo( 69 66 packageName: string, ··· 150 147 151 148 /** 152 149 * Generate the full run command for a package. 153 - * @public 154 150 */ 155 151 export function getRunCommand(options: RunCommandOptions): string { 156 152 return getRunCommandParts(options).join(' ')
-2
app/utils/versions.ts
··· 55 55 * Sort tags with 'latest' first, then alphabetically 56 56 * @param tags - Array of tag names 57 57 * @returns New sorted array 58 - * @public 59 58 */ 60 59 export function sortTags(tags: string[]): string[] { 61 60 return [...tags].sort((a, b) => { ··· 112 111 * Each unique version appears once with all its tags 113 112 * @param distTags - Object mapping tag names to version strings 114 113 * @returns Array of rows sorted by version (descending) 115 - * @public 116 114 */ 117 115 export function buildTaggedVersionRows(distTags: Record<string, string>): TaggedVersionRow[] { 118 116 const versionToTags = buildVersionToTagsMap(distTags)
-24
cli/src/logger.ts
··· 54 54 export const logDebug = createDebug('npmx-connector') 55 55 56 56 /** 57 - * Log a message (generic) 58 - * @public 59 - */ 60 - export function logMessage(message: string): void { 61 - p.log.message(message) 62 - } 63 - 64 - /** 65 57 * Show the connection token in a nice box 66 58 */ 67 59 export function showToken(token: string, port: number, frontendUrl: string): void { ··· 76 68 'Click to connect', 77 69 ) 78 70 } 79 - 80 - /** 81 - * Show outro message 82 - * @public 83 - */ 84 - export function showOutro(message: string): void { 85 - p.outro(message) 86 - } 87 - 88 - /** 89 - * Create a spinner for async operations 90 - * @public 91 - */ 92 - export function createSpinner() { 93 - return p.spinner() 94 - }
+1 -1
cli/src/npm-client.ts
··· 103 103 .trim() 104 104 } 105 105 106 - export async function execNpm( 106 + async function execNpm( 107 107 args: string[], 108 108 options: { otp?: string; silent?: boolean } = {}, 109 109 ): Promise<NpmExecResult> {
+9 -61
cli/src/schemas.ts
··· 58 58 ) 59 59 60 60 /** 61 - * Validates a team name (without scope prefix) 62 - * @public 63 - */ 64 - export const TeamNameSchema = v.pipe( 65 - v.string(), 66 - v.nonEmpty('Team name is required'), 67 - v.maxLength(50, 'Team name is too long'), 68 - v.regex(NPM_USERNAME_RE, 'Invalid team name format'), 69 - ) 70 - 71 - /** 72 61 * Validates a scope:team format (e.g., @myorg:developers) 73 62 */ 74 63 export const ScopeTeamSchema = v.pipe( ··· 120 109 ]) 121 110 122 111 /** 123 - * Validates operation status 124 - */ 125 - export const OperationStatusSchema = v.picklist([ 126 - 'pending', 127 - 'approved', 128 - 'running', 129 - 'completed', 130 - 'failed', 131 - 'cancelled', 132 - ]) 133 - 134 - /** 135 112 * Validates OTP (6-digit code) 136 113 */ 137 114 export const OtpSchema = v.optional( ··· 178 155 * Schema for operation params based on type 179 156 * Validates the params object for each operation type 180 157 */ 181 - export const OperationParamsSchema = v.record(v.string(), v.string()) 158 + const OperationParamsSchema = v.record(v.string(), v.string()) 182 159 183 160 /** 184 161 * Schema for single operation request body ··· 205 182 role: OrgRoleSchema, 206 183 }) 207 184 208 - export const OrgRemoveUserParamsSchema = v.object({ 185 + const OrgRemoveUserParamsSchema = v.object({ 209 186 org: OrgNameSchema, 210 187 user: UsernameSchema, 211 188 }) 212 189 213 - export const TeamCreateParamsSchema = v.object({ 190 + const TeamCreateParamsSchema = v.object({ 214 191 scopeTeam: ScopeTeamSchema, 215 192 }) 216 193 217 - export const TeamDestroyParamsSchema = v.object({ 194 + const TeamDestroyParamsSchema = v.object({ 218 195 scopeTeam: ScopeTeamSchema, 219 196 }) 220 197 221 - export const TeamAddUserParamsSchema = v.object({ 198 + const TeamAddUserParamsSchema = v.object({ 222 199 scopeTeam: ScopeTeamSchema, 223 200 user: UsernameSchema, 224 201 }) 225 202 226 - export const TeamRemoveUserParamsSchema = v.object({ 203 + const TeamRemoveUserParamsSchema = v.object({ 227 204 scopeTeam: ScopeTeamSchema, 228 205 user: UsernameSchema, 229 206 }) ··· 234 211 pkg: PackageNameSchema, 235 212 }) 236 213 237 - export const AccessRevokeParamsSchema = v.object({ 214 + const AccessRevokeParamsSchema = v.object({ 238 215 scopeTeam: ScopeTeamSchema, 239 216 pkg: PackageNameSchema, 240 217 }) 241 218 242 - export const OwnerAddParamsSchema = v.object({ 219 + const OwnerAddParamsSchema = v.object({ 243 220 user: UsernameSchema, 244 221 pkg: PackageNameSchema, 245 222 }) 246 223 247 - export const OwnerRemoveParamsSchema = v.object({ 224 + const OwnerRemoveParamsSchema = v.object({ 248 225 user: UsernameSchema, 249 226 pkg: PackageNameSchema, 250 227 }) ··· 326 303 error: path ? `${path}: ${message}` : message, 327 304 } 328 305 } 329 - 330 - // ============================================================================ 331 - // Type Exports 332 - // ============================================================================ 333 - 334 - /** @public */ 335 - export type PackageName = v.InferOutput<typeof PackageNameSchema> 336 - /** @public */ 337 - export type NewPackageName = v.InferOutput<typeof NewPackageNameSchema> 338 - /** @public */ 339 - export type Username = v.InferOutput<typeof UsernameSchema> 340 - /** @public */ 341 - export type OrgName = v.InferOutput<typeof OrgNameSchema> 342 - /** @public */ 343 - export type ScopeTeam = v.InferOutput<typeof ScopeTeamSchema> 344 - /** @public */ 345 - export type OrgRole = v.InferOutput<typeof OrgRoleSchema> 346 - /** @public */ 347 - export type Permission = v.InferOutput<typeof PermissionSchema> 348 - /** @public */ 349 - export type OperationType = v.InferOutput<typeof OperationTypeSchema> 350 - /** @public */ 351 - export type OperationStatus = v.InferOutput<typeof OperationStatusSchema> 352 - /** @public */ 353 - export type ConnectBody = v.InferOutput<typeof ConnectBodySchema> 354 - /** @public */ 355 - export type ExecuteBody = v.InferOutput<typeof ExecuteBodySchema> 356 - /** @public */ 357 - export type CreateOperationBody = v.InferOutput<typeof CreateOperationBodySchema>
-1
cli/src/types.ts
··· 1 - /** @public */ 2 1 export interface ConnectorConfig { 3 2 port: number 4 3 host: string
+27 -37
knip.json
··· 1 1 { 2 2 "$schema": "https://unpkg.com/knip@5/schema.json", 3 - "includeEntryExports": true, 4 - "ignoreExportsUsedInFile": true, 5 - "ignoreBinaries": ["simple-git-hooks", "lint-staged", "lex"], 6 3 "ignore": ["shared/types/lexicons/**"], 7 4 "workspaces": { 8 5 ".": { 9 6 "entry": [ 10 - "scripts/*.sh", 11 - "lunaria/**/*.ts!", 12 - "modules/**/*.ts!", 13 - "i18n/i18n.config.ts!", 14 - "app/app.vue!", 15 - "app/error.vue!", 16 - "app/pages/**/*.vue!", 17 - "app/middleware/**/*.ts!", 18 - "app/composables/**/*.ts!", 19 - "app/utils/**/*.ts!", 20 - "app/plugins/**/*.ts!", 21 - "app/components/**/*.vue!", 22 - "config/**/*.ts!", 23 - "server/utils/**/*.ts!", 24 - "shared/**/*.ts!" 25 - ], 26 - "project": [ 27 - "app/**/*.{ts,vue}!", 28 - "server/**/*.ts!", 29 - "shared/**/*.ts!", 30 - "test/**/*.ts", 31 - "tests/**/*.ts", 7 + "app/app.vue", 8 + "app/error.vue", 9 + "app/pages/**/*.vue", 10 + "app/components/**/*.vue", 11 + "app/composables/**/*.ts", 12 + "app/middleware/**/*.ts", 13 + "app/plugins/**/*.ts", 14 + "app/utils/**/*.ts", 15 + "server/**/*.ts", 16 + "modules/**/*.ts", 17 + "config/**/*.ts", 18 + "i18n/**/*.ts", 19 + "lunaria.config.ts", 20 + "pwa-assets.config.ts", 21 + ".lighthouserc.cjs", 22 + "lighthouse-setup.cjs", 23 + "uno-preset-rtl.ts", 24 + "scripts/**/*.ts", 32 25 "lunaria/**/*.ts", 33 - "modules/**/*.ts!", 34 - "i18n/**/*.ts!" 26 + "shared/**/*.ts" 35 27 ], 28 + "project": ["**/*.{ts,vue,cjs,mjs}"], 36 29 "ignoreDependencies": [ 37 - "@iconify-json/carbon", 38 - "@iconify-json/lucide", 39 - "@iconify-json/simple-icons", 40 - "@iconify-json/solar", 41 - "@iconify-json/svg-spinners", 42 - "@iconify-json/vscode-icons", 30 + "@iconify-json/*", 43 31 "@vercel/kv", 44 32 "@voidzero-dev/vite-plus-core", 45 33 "h3", 46 - "ohash", 34 + "puppeteer", 47 35 "unplugin-vue-router", 36 + "vite-plugin-pwa", 48 37 "vue-router" 49 38 ], 50 39 "ignoreUnresolved": ["#components"] 51 40 }, 52 41 "cli": { 53 - "project": ["src/**/*.ts!"] 42 + "project": ["src/**/*.ts"] 54 43 }, 55 44 "docs": { 56 - "entry": ["app/app.config.ts"], 57 - "ignoreDependencies": ["docus", "better-sqlite3", "nuxt"] 45 + "entry": ["app/**/*.{ts,vue}"], 46 + "project": ["**/*.{ts,vue}"], 47 + "ignoreDependencies": ["docus", "better-sqlite3"] 58 48 } 59 49 } 60 50 }
-1
lunaria/components.ts
··· 379 379 380 380 /** 381 381 * Build an SVG file showing a summary of each language's translation progress. 382 - * @public 383 382 */ 384 383 export const SvgSummary = (config: LunariaConfig, status: LunariaStatus): string => { 385 384 const localeHeight = 56 // Each locale’s summary is 56px high.
-3
lunaria/prepare-json-files.ts
··· 9 9 const localesFolder = path.resolve('i18n/locales') 10 10 11 11 const defaultLocale = currentLocales.find(l => l.code === 'en-US')! 12 - /** @public */ 13 12 export { lunariaJSONFiles } 14 - /** @public */ 15 13 export const sourceLocale = { 16 14 label: defaultLocale.name, 17 15 lang: defaultLocale.code, 18 16 } 19 - /** @public */ 20 17 export const locales: Locale[] = currentLocales 21 18 .filter(l => l.code !== 'en-US') 22 19 .map(l => ({
-2
package.json
··· 18 18 "i18n:check:fix": "node --experimental-transform-types scripts/compare-translations.ts --fix", 19 19 "knip": "knip", 20 20 "knip:fix": "knip --fix", 21 - "knip:production": "knip --production", 22 21 "lint": "vite lint && vite fmt --check", 23 22 "lint:fix": "vite lint --fix && vite fmt", 24 23 "generate": "nuxt generate", ··· 73 72 "module-replacements": "2.11.0", 74 73 "nuxt": "4.3.0", 75 74 "nuxt-og-image": "5.1.13", 76 - "ohash": "2.0.11", 77 75 "perfect-debounce": "2.1.0", 78 76 "sanitize-html": "2.17.0", 79 77 "semver": "7.7.3",
-3
pnpm-lock.yaml
··· 128 128 nuxt-og-image: 129 129 specifier: 5.1.13 130 130 version: 5.1.13(@unhead/vue@2.1.2(vue@3.5.27(typescript@5.9.3)))(magicast@0.5.1)(unstorage@1.17.4(@upstash/redis@1.36.1)(@vercel/kv@3.0.0)(db0@0.3.4(better-sqlite3@12.6.2))(ioredis@5.9.2))(vite@7.3.1(@types/node@24.10.9)(jiti@2.6.1)(lightningcss@1.31.1)(terser@5.46.0)(yaml@2.8.2))(vue@3.5.27(typescript@5.9.3)) 131 - ohash: 132 - specifier: 2.0.11 133 - version: 2.0.11 134 131 perfect-debounce: 135 132 specifier: 2.1.0 136 133 version: 2.1.0
-1
server/utils/atproto/oauth.ts
··· 58 58 return await client.restore(currentSession.tokenSet.sub) 59 59 } 60 60 61 - /** @public */ 62 61 export function eventHandlerWithOAuthSession<T extends EventHandlerRequest, D>( 63 62 handler: EventHandlerWithOAuthSession<T, D>, 64 63 ) {
-2
server/utils/code-highlight.ts
··· 81 81 82 82 /** 83 83 * Determine the language for syntax highlighting based on file path 84 - * @public 85 84 */ 86 85 export function getLanguageFromPath(filePath: string): string { 87 86 const filename = filePath.split('/').pop() || '' ··· 263 262 /** 264 263 * Highlight code using Shiki with line-by-line output for line highlighting. 265 264 * Each line is wrapped in a span.line for individual line highlighting. 266 - * @public 267 265 */ 268 266 export async function highlightCode( 269 267 code: string,
-1
server/utils/dependency-analysis.ts
··· 110 110 111 111 /** 112 112 * Analyze entire dependency tree for vulnerabilities and deprecated packages. 113 - * @public 114 113 */ 115 114 export const analyzeDependencyTree = defineCachedFunction( 116 115 async (name: string, version: string): Promise<VulnerabilityTreeResult> => {
-1
server/utils/error-handler.ts
··· 5 5 /** 6 6 * Generic error handler for Nitro routes 7 7 * Handles H3 errors, Valibot, and fallbacks in that order 8 - * @public 9 8 */ 10 9 export function handleApiError(error: unknown, fallback: ErrorOptions): never { 11 10 // If already a known Nuxt/H3 Error, re-throw
-1
server/utils/file-tree.ts
··· 69 69 /** 70 70 * Fetch and convert file tree for a package version. 71 71 * Returns the full response including tree and metadata. 72 - * @public 73 72 */ 74 73 export async function getPackageFileTree( 75 74 packageName: string,
-2
server/utils/import-resolver.ts
··· 8 8 9 9 /** 10 10 * Flatten a nested file tree into a set of file paths for quick lookups. 11 - * @public 12 11 */ 13 12 export function flattenFileTree(tree: PackageFileTree[]): FileSet { 14 13 const files = new Set<string>() ··· 203 202 204 203 /** 205 204 * Create a resolver function bound to a specific file tree and current file. 206 - * @public 207 205 */ 208 206 export function createImportResolver( 209 207 files: FileSet,
-1
server/utils/install-size.ts
··· 31 31 * No filesystem operations - safe for serverless environments. 32 32 * 33 33 * Dependencies are resolved for linux-x64-glibc as a representative platform. 34 - * @public 35 34 */ 36 35 export const calculateInstallSize = defineCachedFunction( 37 36 async (name: string, version: string): Promise<InstallSizeResult> => {
-1
server/utils/jsr.ts
··· 14 14 * 15 15 * @param npmPackageName - The npm package name (e.g., "@hono/hono") 16 16 * @returns JsrPackageInfo with existence status and metadata 17 - * @public 18 17 */ 19 18 export const fetchJsrPackageInfo = defineCachedFunction( 20 19 async (npmPackageName: string): Promise<JsrPackageInfo> => {
-1
server/utils/npm.ts
··· 64 64 /** 65 65 * Resolve multiple dependency constraints to their best matching versions. 66 66 * Returns a map of package name to resolved version. 67 - * @public 68 67 */ 69 68 export async function resolveDependencyVersions( 70 69 dependencies: Record<string, string>,
-1
server/utils/parse-package-params.ts
··· 1 1 /** 2 2 * Parses Nitro router segments into packageName and an optional version 3 3 * Handles patterns: [pkg], [pkg, 'v', version], [@scope, pkg], [@scope, pkg, 'v', version] 4 - * @public 5 4 */ 6 5 export function parsePackageParams(segments: string[]): { 7 6 rawPackageName: string
-1
server/utils/readme.ts
··· 247 247 return resolved 248 248 } 249 249 250 - /** @public */ 251 250 export async function renderReadmeHtml( 252 251 content: string, 253 252 packageName: string,
-3
shared/schemas/package.ts
··· 73 73 /** 74 74 * Automatically infer types for routes 75 75 * Usage - prefer this over manually defining interfaces 76 - * @public 77 76 */ 78 77 export type PackageRouteParams = v.InferOutput<typeof PackageRouteParamsSchema> 79 - /** @public */ 80 78 export type PackageVersionQuery = v.InferOutput<typeof PackageVersionQuerySchema> 81 - /** @public */ 82 79 export type PackageFileQuery = v.InferOutput<typeof PackageFileQuerySchema>
-1
shared/types/dependency-analysis.ts
··· 77 77 78 78 /** 79 79 * Package vulnerability response returned by our API 80 - * @public 81 80 */ 82 81 export interface PackageVulnerabilities { 83 82 package: string
-1
shared/types/docs.ts
··· 10 10 message?: string 11 11 } 12 12 13 - /** @public */ 14 13 export interface DocsSearchResponse { 15 14 package: string 16 15 version: string
-5
shared/types/npm-registry.ts
··· 206 206 package: string 207 207 } 208 208 209 - /** @public */ 210 209 export interface NpmDownloadRange { 211 210 downloads: Array<{ 212 211 downloads: number ··· 221 220 * Organization API types 222 221 * These require authentication 223 222 * Note: Not covered by @npm/types 224 - * @public 225 223 */ 226 224 export interface NpmOrgMember { 227 225 user: string 228 226 role: 'developer' | 'admin' | 'owner' 229 227 } 230 228 231 - /** @public */ 232 229 export interface NpmTeam { 233 230 name: string 234 231 description?: string 235 232 members?: string[] 236 233 } 237 234 238 - /** @public */ 239 235 export interface NpmPackageAccess { 240 236 permissions: 'read-only' | 'read-write' 241 237 } ··· 243 239 /** 244 240 * Trusted Publishing types 245 241 * Note: Not covered by @npm/types 246 - * @public 247 242 */ 248 243 export interface NpmTrustedPublisher { 249 244 type: 'github-actions' | 'gitlab-ci'
-2
shared/utils/constants.ts
··· 8 8 export const NPM_REGISTRY = 'https://registry.npmjs.org' 9 9 export const ERROR_PACKAGE_ANALYSIS_FAILED = 'Failed to analyze package.' 10 10 export const ERROR_PACKAGE_VERSION_AND_FILE_FAILED = 'Version and file path are required.' 11 - /** @public */ 12 11 export const ERROR_PACKAGE_REQUIREMENTS_FAILED = 13 12 'Package name, version, and file path are required.' 14 13 export const ERROR_FILE_LIST_FETCH_FAILED = 'Failed to fetch file list.' ··· 17 16 export const ERROR_JSR_FETCH_FAILED = 'Failed to fetch package from JSR registry.' 18 17 export const ERROR_NPM_FETCH_FAILED = 'Failed to fetch package from npm registry.' 19 18 export const UNSET_NUXT_SESSION_PASSWORD = 'NUXT_SESSION_PASSWORD not set' 20 - /** @public */ 21 19 export const ERROR_SUGGESTIONS_FETCH_FAILED = 'Failed to fetch suggestions.' 22 20 23 21 // microcosm services
-1
shared/utils/constellation.ts
··· 34 34 35 35 const HEADERS = { 'User-Agent': 'npmx' } 36 36 37 - /** @public */ 38 37 export class Constellation { 39 38 private readonly cachedFetch: CachedFetchFunction 40 39 constructor(fetch: CachedFetchFunction) {
-3
shared/utils/git-providers.ts
··· 320 320 /** 321 321 * Parse repository field from package.json into repository info. 322 322 * Supports both full objects and shorthand strings. 323 - * @public 324 323 */ 325 324 export function parseRepositoryInfo( 326 325 repository?: { type?: string; url?: string; directory?: string } | string, ··· 352 351 } 353 352 } 354 353 355 - /** @public */ 356 354 export function getProviderConfig(providerId: ProviderId): ProviderConfig | undefined { 357 355 return providers.find(p => p.id === providerId) 358 356 } ··· 365 363 return url 366 364 } 367 365 368 - /** @public */ 369 366 export function isKnownGitProvider(url: string): boolean { 370 367 return parseRepoUrl(url) !== null 371 368 }
-1
shared/utils/severity.ts
··· 27 27 28 28 /** 29 29 * Badge color classes for severity levels 30 - * @public 31 30 */ 32 31 export const SEVERITY_BADGE_COLORS: Record<OsvSeverityLevel, string> = { 33 32 critical: 'bg-bg-muted border border-border text-fg',
-1
shared/utils/spdx.ts
··· 21 21 * Generate an SPDX license URL for the given license identifier. 22 22 * Returns null if the license is not a valid SPDX identifier. 23 23 * @see https://spdx.org/licenses/ 24 - * @public 25 24 */ 26 25 export function getSpdxLicenseUrl(license: string | undefined): string | null { 27 26 if (!license) return null
-1
uno-preset-rtl.ts
··· 58 58 59 59 /** 60 60 * CSS RTL support to detect, replace and warn wrong left/right usages. 61 - * @public 62 61 */ 63 62 export function presetRtl(): Preset { 64 63 return {