From 8e26dbfa727f22b45dced968a4bfc9053191f126 Mon Sep 17 00:00:00 2001 From: Denys Date: Sat, 7 Feb 2026 13:23:59 +0000 Subject: [PATCH 1/4] feat: format numbers with Intl.NumberFormat --- app/components/Code/DirectoryListing.vue | 5 +- app/components/Compare/PackageSelector.vue | 6 +- app/components/Package/Card.vue | 4 +- app/components/Package/Dependencies.vue | 14 ++-- app/components/Package/DownloadAnalytics.vue | 8 +-- app/components/Settings/TranslationHelper.vue | 14 +++- app/composables/useNumberFormatter.ts | 35 +++++++++ app/composables/usePackageComparison.ts | 13 +++- app/pages/package-code/[...path].vue | 9 ++- app/pages/package/[[org]]/[name].vue | 35 +++++---- app/utils/formatters.ts | 34 --------- i18n/locales/en.json | 5 ++ lunaria/files/en-GB.json | 5 ++ lunaria/files/en-US.json | 5 ++ test/unit/app/utils/formatters.spec.ts | 71 +------------------ 15 files changed, 125 insertions(+), 138 deletions(-) create mode 100644 app/composables/useNumberFormatter.ts diff --git a/app/components/Code/DirectoryListing.vue b/app/components/Code/DirectoryListing.vue index 226a3a014..5450e8513 100644 --- a/app/components/Code/DirectoryListing.vue +++ b/app/components/Code/DirectoryListing.vue @@ -2,7 +2,6 @@ import type { PackageFileTree } from '#shared/types' import type { RouteLocationRaw } from 'vue-router' import { getFileIcon } from '~/utils/file-icons' -import { formatBytes } from '~/utils/formatters' const props = defineProps<{ tree: PackageFileTree[] @@ -51,6 +50,8 @@ function getCodeRoute(nodePath?: string): RouteLocationRaw { params: { path: pathSegments as [string, ...string[]] }, } } + +const bytesFormatter = useBytesFormatter()