From 50ce1de372abcfccf1c5599157c7f14fbcaf57ef Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 30 Oct 2026 11:10:38 +0000 Subject: [PATCH] feat: use `npmeta` for package name and info handling --- app/components/Compare/FacetCard.vue | 13 +- app/components/Compare/PackageSelector.vue | 2 + app/components/DependencyPathPopup.vue | 15 +- app/components/OgImage/Compare.takumi.vue | 2 +- app/components/Package/AccessControls.vue | 9 +- app/components/Package/Dependencies.vue | 2 +- app/components/Package/Maintainers.vue | 7 +- app/composables/npm/useNpmSearch.ts | 1 + app/composables/npm/useOrgPackages.ts | 1 + .../npm/useOutdatedDependencies.ts | 2 +- app/composables/npm/usePackage.ts | 2 + app/composables/npm/usePackageDownloads.ts | 2 + .../npm/useReplacementDependencies.ts | 2 +- app/composables/useCharts.ts | 1 + .../useCommandPalettePackageCommands.ts | 1 + app/composables/useCompareReplacements.ts | 2 +- app/composables/useDependencyAnalysis.ts | 2 + app/composables/usePackageAnalysis.ts | 3 +- app/composables/usePackageComparison.ts | 2 +- app/composables/usePackageRoute.ts | 2 + app/pages/compare.vue | 1 + app/pages/package/[[org]]/[name].vue | 1 + app/utils/install-command.ts | 4 +- app/utils/npm/api.ts | 1 + app/utils/package-name.ts | 11 +- app/utils/parse-package-json-deps.ts | 2 +- app/utils/platform-packages.ts | 4 +- app/utils/router.ts | 2 +- app/utils/run-command.ts | 12 +- modules/runtime/server/cache.ts | 40 +-- package.json | 1 + pnpm-lock.yaml | 9 + pnpm-workspace.yaml | 1 + scripts/generate-fixtures.ts | 9 +- .../changelog/info/[name]/v/[version].get.ts | 1 + server/api/registry/analysis/[...pkg].get.ts | 4 +- .../api/registry/badge/[type]/[...pkg].get.ts | 3 +- .../registry/license-change/[...pkg].get.ts | 2 +- .../api/registry/package-meta/[...pkg].get.ts | 2 +- server/api/registry/timeline/[...pkg].get.ts | 12 +- .../registry/timeline/sizes/[...pkg].get.ts | 10 +- server/utils/dependency-resolver.ts | 2 +- server/utils/docs/client.ts | 2 +- server/utils/file-tree.ts | 1 + server/utils/likes-leaderboard.ts | 2 +- server/utils/npm-website-versions.ts | 2 + server/utils/npm.ts | 1 + shared/types/npm-registry.ts | 1 + shared/utils/binary-detection.ts | 41 --- shared/utils/compare.ts | 2 +- shared/utils/dev-dependency.ts | 15 +- shared/utils/npm.ts | 92 ------ shared/utils/package-analysis.ts | 237 +------------- shared/utils/packument.ts | 2 +- shared/utils/parse-package-param.ts | 47 --- test/unit/app/utils/run-command.spec.ts | 68 ---- .../server/utils/npm-website-versions.spec.ts | 4 - test/unit/server/utils/npm.spec.ts | 1 - .../shared/utils/binary-detection.spec.ts | 90 ------ test/unit/shared/utils/npm.spec.ts | 77 ----- .../shared/utils/package-analysis.spec.ts | 292 +----------------- 61 files changed, 99 insertions(+), 1085 deletions(-) delete mode 100644 shared/utils/binary-detection.ts delete mode 100644 test/unit/shared/utils/binary-detection.spec.ts delete mode 100644 test/unit/shared/utils/npm.spec.ts diff --git a/app/components/Compare/FacetCard.vue b/app/components/Compare/FacetCard.vue index 1b69834bb0..447c9d3757 100644 --- a/app/components/Compare/FacetCard.vue +++ b/app/components/Compare/FacetCard.vue @@ -1,4 +1,6 @@