Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/ClaimPackageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function handleClaim() {

// Auto-approve and execute
await approveOperation(operation.id)
const result = await executeOperations()
await executeOperations()

// Refresh state and check if operation completed successfully
await refreshState()
Expand Down
28 changes: 14 additions & 14 deletions app/components/ConnectorModal.vue
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up to #540

Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ function handleDisconnect() {
disconnect()
}

function copyCommand() {
let command = executeNpmxConnectorCommand.value
if (portInput.value !== '31415') {
command += ` --port ${portInput.value}`
}
copy(command)
}
// function copyCommand() {
// let command = executeNpmxConnectorCommand.value
// if (portInput.value !== '31415') {
// command += ` --port ${portInput.value}`
// }
// copy(command)
// }

const selectedPM = useSelectedPackageManager()
// const selectedPM = useSelectedPackageManager()

const executeNpmxConnectorCommand = computed(() => {
return getExecuteCommand({
packageName: 'npmx-connector',
packageManager: selectedPM.value,
})
})
// const executeNpmxConnectorCommand = computed(() => {
// return getExecuteCommand({
// packageName: 'npmx-connector',
// packageManager: selectedPM.value,
// })
// })

// Reset form when modal opens
watch(open, isOpen => {
Expand Down
1 change: 0 additions & 1 deletion app/components/PackageDownloadAnalytics.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { ref, computed, shallowRef, watch } from 'vue'
import type { VueUiXyDatasetItem } from 'vue-data-ui'
import { VueUiXy } from 'vue-data-ui/vue-ui-xy'
import { useDebounceFn, useElementSize } from '@vueuse/core'
Expand Down
1 change: 0 additions & 1 deletion app/components/PackageWeeklyDownloadStats.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { ref, computed, onMounted, watch } from 'vue'
import { VueUiSparkline } from 'vue-data-ui/vue-ui-sparkline'
import { useCssVariables } from '../composables/useColors'
import { OKLCH_NEUTRAL_FALLBACK, lightenOklch } from '../utils/colors'
Expand Down
1 change: 0 additions & 1 deletion app/components/PaginationControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const effectiveMode = computed<PaginationMode>(() =>

// When 'all' is selected, there's only 1 page with everything
const isShowingAll = computed(() => pageSize.value === 'all')
const effectivePageSize = computed(() => (isShowingAll.value ? props.totalItems : pageSize.value))
const totalPages = computed(() =>
isShowingAll.value ? 1 : Math.ceil(props.totalItems / (pageSize.value as number)),
)
Expand Down
5 changes: 2 additions & 3 deletions app/components/VersionSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { onClickOutside } from '@vueuse/core'
import { compare } from 'semver'
import {
buildVersionToTagsMap,
parseVersion,
getPrereleaseChannel,
getVersionGroupKey,
getVersionGroupLabel,
Expand Down Expand Up @@ -511,7 +510,7 @@ watch(
@keydown="handleListboxKeydown"
>
<!-- Version groups -->
<div v-for="(group, groupIndex) in versionGroups" :key="group.id">
<div v-for="group in versionGroups" :key="group.id">
<!-- Group header (primary version) -->
<div
:id="`version-${group.primaryVersion.version}`"
Expand Down Expand Up @@ -580,7 +579,7 @@ watch(
v-if="group.isExpanded && group.versions.length > 1"
class="ms-6 border-is border-border"
>
<template v-for="(v, vIndex) in group.versions.slice(1)" :key="v.version">
<template v-for="v in group.versions.slice(1)" :key="v.version">
<NuxtLink
:id="`version-${v.version}`"
:to="getVersionUrl(v.version)"
Expand Down
11 changes: 1 addition & 10 deletions app/components/compare/FacetSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
import type { ComparisonFacet } from '#shared/types'
import { FACET_INFO, FACETS_BY_CATEGORY, CATEGORY_ORDER } from '#shared/types/comparison'

const {
isFacetSelected,
toggleFacet,
selectCategory,
deselectCategory,
selectAll,
deselectAll,
isAllSelected,
isNoneSelected,
} = useFacetSelection()
const { isFacetSelected, toggleFacet, selectCategory, deselectCategory } = useFacetSelection()

// Enrich facets with their info for rendering
const facetsByCategory = computed(() => {
Expand Down
5 changes: 0 additions & 5 deletions app/pages/@[org].vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ function handleClearFilter(chip: FilterChip) {
clearFilter(chip)
}

// Handle sort change from table
function handleSortChange(option: SortOption) {
setSort(option)
}

const activeTab = shallowRef<'members' | 'teams'>('members')

// Canonical URL for this org page
Expand Down
2 changes: 1 addition & 1 deletion app/pages/compare.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { FACET_INFO, type ComparisonFacet } from '#shared/types/comparison'
import { FACET_INFO } from '#shared/types/comparison'
import { useRouteQuery } from '@vueuse/router'

definePageMeta({
Expand Down
33 changes: 1 addition & 32 deletions app/pages/search.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { FilterChip, SortOption } from '#shared/types/preferences'
import type { FilterChip } from '#shared/types/preferences'
import { onKeyDown } from '@vueuse/core'
import { debounce } from 'perfect-debounce'
import { isValidNewPackageName, checkPackageExists } from '~/utils/package-name'
Expand Down Expand Up @@ -31,8 +31,6 @@ const updateUrlPage = debounce((page: number) => {
// The actual search query (from URL, used for API calls)
const query = computed(() => (route.query.q as string) ?? '')

const packageListRef = useTemplateRef('packageListRef')

// Track if page just loaded (for hiding "Searching..." during view transition)
const hasInteracted = shallowRef(false)
onMounted(() => {
Expand Down Expand Up @@ -78,23 +76,6 @@ const {
incremental: true,
}))

// Track previous query for UI continuity
const previousQuery = useState('search-previous-query', () => query.value)

// Update previous query when results change
watch(
() => results.value,
newResults => {
if (newResults && newResults.objects.length > 0) {
previousQuery.value = query.value
}
},
)

const resultsMatchQuery = computed(() => {
return previousQuery.value === query.value
})

// Results to display (directly from incremental search)
const rawVisibleResults = computed(() => results.value)

Expand Down Expand Up @@ -158,7 +139,6 @@ const {
toggleKeyword,
clearFilter,
clearAllFilters,
setSort,
} = useStructuredFilters({
packages: resultsArray,
initialSort: 'relevance-desc', // Default to search relevance
Expand All @@ -182,11 +162,6 @@ function handleClearFilter(chip: FilterChip) {
clearFilter(chip)
}

// Handle sort change from table
function handleSortChange(option: SortOption) {
setSort(option)
}

// Should we show the loading spinner?
const showSearching = computed(() => {
// Don't show during initial page load (view transition)
Expand All @@ -195,11 +170,6 @@ const showSearching = computed(() => {
return status.value === 'pending' && displayResults.value.length === 0
})

const totalPages = computed(() => {
if (!visibleResults.value) return 0
return Math.ceil(visibleResults.value.total / pageSize)
})

// Load more when triggered by infinite scroll
async function loadMore() {
if (isLoadingMore.value || !hasMore.value) return
Expand Down Expand Up @@ -757,7 +727,6 @@ defineOgImageComponent('Default', {

<PackageList
v-if="displayResults.length > 0"
ref="packageListRef"
:results="displayResults"
:search-query="query"
heading-level="h2"
Expand Down
8 changes: 8 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ export default defineNuxtConfig({
hydration: true,
},

typescript: {
tsConfig: {
compilerOptions: {
noUnusedLocals: true,
},
},
},

vite: {
optimizeDeps: {
include: [
Expand Down
Loading