Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 0 additions & 2 deletions app/components/BuildEnvironment.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { BuildInfo } from '#shared/types'
const { footer = false, buildInfo: buildInfoProp } = defineProps<{
footer?: boolean
buildInfo?: BuildInfo
Expand Down
1 change: 0 additions & 1 deletion app/components/Code/DirectoryListing.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { PackageFileTree } from '#shared/types'
import type { RouteLocationRaw } from 'vue-router'
import type { RouteNamedMap } from 'vue-router/auto-routes'
import { ADDITIONAL_ICONS, getFileIcon } from '~/utils/file-icons'
Expand Down
1 change: 0 additions & 1 deletion app/components/Code/FileTree.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { PackageFileTree } from '#shared/types'
import type { RouteLocationRaw } from 'vue-router'
import type { RouteNamedMap } from 'vue-router/auto-routes'
import { ADDITIONAL_ICONS, getFileIcon } from '~/utils/file-icons'
Expand Down
1 change: 0 additions & 1 deletion app/components/Code/MobileTreeDrawer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { PackageFileTree } from '#shared/types'
import type { RouteNamedMap } from 'vue-router/auto-routes'

defineProps<{
Expand Down
2 changes: 0 additions & 2 deletions app/components/Compare/FacetCard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { FacetValue } from '#shared/types'

const props = defineProps<{
/** Facet label */
label: string
Expand Down
2 changes: 0 additions & 2 deletions app/components/Compare/FacetRow.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { FacetValue } from '#shared/types'

const props = defineProps<{
/** Facet label */
label: string
Expand Down
2 changes: 0 additions & 2 deletions app/components/Package/DeprecatedTree.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { DependencyDepth } from '#shared/types'

const props = defineProps<{
packageName: string
version: string
Expand Down
1 change: 0 additions & 1 deletion app/components/Package/Header.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { PackumentVersion, ProvenanceDetails, SlimVersion, SlimPackument } from '#shared/types'
import type { RouteLocationRaw } from 'vue-router'
import { SCROLL_TO_TOP_THRESHOLD } from '~/composables/useScrollToTop'
import { useModal } from '~/composables/useModal'
Expand Down
10 changes: 0 additions & 10 deletions app/components/Package/List.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
<script setup lang="ts">
import type { NpmSearchResult } from '#shared/types'
import type { WindowVirtualizerHandle } from '~/composables/useVirtualInfiniteScroll'
import type {
ColumnConfig,
PageSize,
PaginationMode,
SortOption,
ViewMode,
} from '#shared/types/preferences'
import { DEFAULT_COLUMNS } from '#shared/types/preferences'
import { WindowVirtualizer } from 'virtua/vue'

/** Number of items to render statically during SSR */
Expand Down
2 changes: 0 additions & 2 deletions app/components/Package/Playgrounds.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { PlaygroundLink } from '#shared/types'

const props = defineProps<{
links: PlaygroundLink[]
}>()
Expand Down
2 changes: 0 additions & 2 deletions app/components/Package/SkillsCard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { SkillListItem } from '#shared/types'

defineProps<{
skills: SkillListItem[]
packageName: string
Expand Down
2 changes: 0 additions & 2 deletions app/components/Package/SkillsModal.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { SkillListItem } from '#shared/types'

const props = defineProps<{
skills: SkillListItem[]
packageName: string
Expand Down
11 changes: 0 additions & 11 deletions app/components/Package/Versions.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
<script setup lang="ts">
import type { PackageVersionInfo, SlimVersion } from '#shared/types'
import { compare, validRange } from 'semver'
import type { RouteLocationRaw } from 'vue-router'
import { fetchAllPackageVersions } from '~/utils/npm/api'
import { NPMX_DOCS_SITE } from '#shared/utils/constants'
import {
buildVersionToTagsMap,
filterExcludedTags,
filterVersions,
getPrereleaseChannel,
getVersionGroupKey,
getVersionGroupLabel,
isSameVersionGroup,
} from '~/utils/versions'

const props = defineProps<{
packageName: string
Expand Down
3 changes: 0 additions & 3 deletions app/components/Package/VulnerabilityTree.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<script setup lang="ts">
import { SEVERITY_LEVELS } from '#shared/types'
import { SEVERITY_COLORS } from '#shared/utils/severity'

const props = defineProps<{
packageName: string
version: string
Expand Down
2 changes: 0 additions & 2 deletions app/components/PackageProvenanceSection.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { ProvenanceDetails } from '#shared/types'

defineProps<{
details: ProvenanceDetails
}>()
Expand Down
2 changes: 0 additions & 2 deletions app/components/Settings/TranslationHelper.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { I18nLocaleStatus } from '#shared/types'

const props = defineProps<{
status: I18nLocaleStatus
}>()
Expand Down
1 change: 0 additions & 1 deletion app/components/VersionSelector.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { PackageVersionInfo } from '#shared/types'
import { onClickOutside } from '@vueuse/core'
import { compare } from 'semver'
import {
Expand Down
2 changes: 0 additions & 2 deletions app/components/diff/FileTree.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { FileChange } from '#shared/types'

interface DiffTreeNode {
name: string
path: string
Expand Down
4 changes: 1 addition & 3 deletions app/components/diff/Hunk.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup lang="ts">
import type { DiffHunk as DiffHunkType } from '#shared/types'

defineProps<{
hunk: DiffHunkType
hunk: DiffHunk
}>()
</script>

Expand Down
4 changes: 1 addition & 3 deletions app/components/diff/Line.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup lang="ts">
import type { DiffLine as DiffLineType } from '#shared/types'

const props = defineProps<{
line: DiffLineType
line: DiffLine
}>()

const diffContext = inject<{
Expand Down
3 changes: 0 additions & 3 deletions app/components/diff/MobileSidebarDrawer.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<script setup lang="ts">
import type { CompareResponse, FileChange } from '#shared/types'
import type { SlimPackument } from '#shared/types'

const props = defineProps<{
compare: CompareResponse
groupedDeps: Map<string, CompareResponse['dependencyChanges']>
Expand Down
1 change: 0 additions & 1 deletion app/components/diff/SidebarPanel.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { CompareResponse, FileChange } from '#shared/types'
import { packageRoute } from '~/utils/router'

const props = defineProps<{
Expand Down
2 changes: 0 additions & 2 deletions app/components/diff/Table.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { DiffHunk, DiffSkipBlock } from '#shared/types'

const props = defineProps<{
hunks: (DiffHunk | DiffSkipBlock)[]
type: 'add' | 'delete' | 'modify'
Expand Down
1 change: 0 additions & 1 deletion app/components/diff/ViewerPanel.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { FileDiffResponse, FileChange } from '#shared/types'
import { onClickOutside } from '@vueuse/core'

const bytesFormatter = useBytesFormatter()
Expand Down
2 changes: 0 additions & 2 deletions app/composables/npm/search-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { NpmSearchResponse, NpmSearchResult, PackageMetaResponse } from '#shared/types'

export function metaToSearchResult(meta: PackageMetaResponse): NpmSearchResult {
return {
package: {
Expand Down
1 change: 0 additions & 1 deletion app/composables/npm/useAlgoliaSearch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { NpmSearchResponse, NpmSearchResult } from '#shared/types'
import {
liteClient as algoliasearch,
type LiteClient,
Expand Down
1 change: 0 additions & 1 deletion app/composables/npm/useNpmSearch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { NpmSearchResponse, PackageMetaResponse } from '#shared/types'
import { emptySearchResponse, metaToSearchResult } from './search-utils'

export interface NpmSearchOptions {
Expand Down
4 changes: 0 additions & 4 deletions app/composables/npm/useOrgPackages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import type { NpmSearchResponse, NpmSearchResult, PackageMetaResponse } from '#shared/types'
import { emptySearchResponse, metaToSearchResult } from './search-utils'
import { mapWithConcurrency } from '#shared/utils/async'

/**
* Fetch all packages for an npm organization.
*
Expand Down
10 changes: 0 additions & 10 deletions app/composables/npm/usePackage.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
import type {
Packument,
SlimPackument,
SlimVersion,
SlimPackumentVersion,
PackumentVersion,
PublishTrustLevel,
} from '#shared/types'
import { extractInstallScriptsInfo } from '~/utils/install-scripts'

/** Number of recent versions to include in initial payload */
const RECENT_VERSIONS_COUNT = 5

Expand Down
2 changes: 0 additions & 2 deletions app/composables/npm/usePackageDownloads.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { NpmDownloadCount } from '#shared/types'

export function usePackageDownloads(
name: MaybeRefOrGetter<string>,
period: MaybeRefOrGetter<'last-day' | 'last-week' | 'last-month' | 'last-year'> = 'last-week',
Expand Down
6 changes: 0 additions & 6 deletions app/composables/npm/useSearch.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import type { NpmSearchResponse, NpmSearchResult } from '#shared/types'
import type { SearchProvider } from '~/composables/useSettings'
import type { AlgoliaMultiSearchChecks } from './useAlgoliaSearch'
import { type SearchSuggestion, emptySearchResponse, parseSuggestionIntent } from './search-utils'
import { isValidNewPackageName, checkPackageExists } from '~/utils/package-name'

function emptySearchPayload() {
return {
searchResponse: emptySearchResponse(),
Expand Down
3 changes: 0 additions & 3 deletions app/composables/npm/useUserPackages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import type { NpmSearchResponse, NpmSearchResult } from '#shared/types'
import { emptySearchResponse } from './search-utils'

/** Default page size for incremental loading (npm registry path) */
const PAGE_SIZE = 50 as const

Expand Down
13 changes: 0 additions & 13 deletions app/composables/useCharts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { MaybeRefOrGetter } from 'vue'
import { toValue } from 'vue'
import type {
DailyDataPoint,
DailyRawPoint,
Expand All @@ -8,18 +6,7 @@ import type {
WeeklyDataPoint,
YearlyDataPoint,
} from '~/types/chart'
import type { RepoRef } from '#shared/utils/git-providers'
import { parseRepoUrl } from '#shared/utils/git-providers'
import type { PackageMetaResponse } from '#shared/types'
import { encodePackageName } from '#shared/utils/npm'
import { fetchNpmDownloadsRange } from '~/utils/npm/api'
import { parseIsoDate, toIsoDate, addDays } from '~/utils/date'
import {
buildDailyEvolution,
buildWeeklyEvolution,
buildMonthlyEvolution,
buildYearlyEvolution,
} from '~/utils/chart-data-buckets'

export type PackumentLikeForTime = {
time?: Record<string, string>
Expand Down
10 changes: 0 additions & 10 deletions app/composables/useFacetSelection.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
import type { ComparisonFacet, FacetInfo } from '#shared/types'
import {
ALL_FACETS,
CATEGORY_ORDER,
DEFAULT_FACETS,
FACET_INFO,
FACETS_BY_CATEGORY,
} from '#shared/types/comparison'
import { useRouteQuery } from '@vueuse/router'

/** Facet info enriched with i18n labels */
export interface FacetInfoWithLabels extends Omit<FacetInfo, 'id'> {
id: ComparisonFacet
Expand Down
2 changes: 0 additions & 2 deletions app/composables/useI18nStatus.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { I18nStatus, I18nLocaleStatus } from '#shared/types'

/**
* Composable for accessing translation status data from Lunaria.
* Provides information about translation progress for each locale.
Expand Down
1 change: 0 additions & 1 deletion app/composables/useInstallSizeDiff.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { compare, prerelease, valid } from 'semver'
import type { InstallSizeResult, SlimPackument } from '#shared/types'

export interface InstallSizeDiff {
comparisonVersion: string
Expand Down
11 changes: 0 additions & 11 deletions app/composables/usePackageComparison.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import type {
FacetValue,
ComparisonFacet,
ComparisonPackage,
Packument,
VulnerabilityTreeResult,
} from '#shared/types'
import type { PackageLikes } from '#shared/types/social'
import { encodePackageName } from '#shared/utils/npm'
import type { PackageAnalysisResponse } from './usePackageAnalysis'
import { isBinaryOnlyPackage } from '#shared/utils/binary-detection'
import { getDependencyCount } from '~/utils/npm/dependency-count'

/** Special identifier for the "What Would James Do?" comparison column */
Expand Down
6 changes: 2 additions & 4 deletions app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script setup lang="ts">
import type { CompareResponse, FileChange } from '#shared/types'
import type { RouteLocationRaw } from 'vue-router'
import { diffRoute, packageRoute } from '~/utils/router'

definePageMeta({
name: 'diff',
Expand Down Expand Up @@ -99,8 +97,8 @@ const latestVersionDetailed = computed(() => {
return pkg.value.versions[latestTag] ?? null
})

const normalizeRoutePath = (route: RouteLocationRaw) => {
const resolvedHref = router.resolve(route).href
const normalizeRoutePath = (routeLocation: RouteLocationRaw) => {
const resolvedHref = router.resolve(routeLocation).href
return resolvedHref.replace(/%7B/g, '{').replace(/%7D/g, '}')
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<script setup lang="ts">
import type {
PackageFileTree,
PackageFileTreeResponse,
PackageFileContentResponse,
} from '#shared/types'
import { isBinaryFilePath } from '~/utils/file-types'

definePageMeta({
name: 'code',
path: '/package-code/:org?/:packageName/v/:version/:filePath(.*)?',
Expand Down
2 changes: 0 additions & 2 deletions app/pages/package-docs/[...path].vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script setup lang="ts">
import { setResponseHeader } from 'h3'
import type { DocsResponse } from '#shared/types'
import { assertValidPackageName, fetchLatestVersion } from '#shared/utils/npm'

definePageMeta({
name: 'docs',
Expand Down
10 changes: 0 additions & 10 deletions app/pages/package/[[org]]/[name].vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
<script setup lang="ts">
import type {
InstallSizeResult,
NpmVersionDist,
PackageVersionInfo,
PackumentVersion,
ProvenanceDetails,
ReadmeResponse,
ReadmeMarkdownResponse,
SkillsListResponse,
} from '#shared/types'
import type { JsrPackageInfo } from '#shared/types/jsr'
import type { IconClass } from '~/types'
import { assertValidPackageName } from '#shared/utils/npm'
Expand Down
2 changes: 0 additions & 2 deletions app/utils/install-scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Also extracts npx package calls from those scripts.
*/

import type { InstallScriptsInfo } from '#shared/types'

// Scripts that run when installing a package as a dependency
const INSTALL_SCRIPTS = new Set(['preinstall', 'install', 'postinstall'])

Expand Down
1 change: 0 additions & 1 deletion app/utils/npm/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { PackageVersionInfo } from '#shared/types'
import { getVersions } from 'fast-npm-meta'
import { compare } from 'semver'

Expand Down
2 changes: 0 additions & 2 deletions app/utils/npm/dependency-count.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { PackumentVersion } from '#shared/types'

export function getDependencyCount(version: PackumentVersion | null): number {
if (!version?.dependencies) return 0
return Object.keys(version.dependencies).length
Expand Down
1 change: 0 additions & 1 deletion app/utils/publish-security.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { PackageVersionInfo, PublishTrustLevel } from '#shared/types'
import { compare, major } from 'semver'

export interface PublishSecurityDowngrade {
Expand Down
Loading
Loading