From 7158e60938e665a62cb712d3effce2b4f80bfbb2 Mon Sep 17 00:00:00 2001 From: Julio Ruiz Date: Mon, 18 May 2026 23:18:49 -0500 Subject: [PATCH] Optimization Fixing optimization messages for duplicated imports. --- app/composables/useFavorites.ts | 8 +------- app/composables/useHistory.ts | 8 +------- app/stores/favorites.ts | 8 ++++---- app/stores/history.ts | 4 ++-- nuxt.config.ts | 8 ++++---- package-lock.json | 22 ---------------------- 6 files changed, 12 insertions(+), 46 deletions(-) diff --git a/app/composables/useFavorites.ts b/app/composables/useFavorites.ts index 0c7e3ba..e3df95a 100644 --- a/app/composables/useFavorites.ts +++ b/app/composables/useFavorites.ts @@ -4,10 +4,4 @@ * * La fuente única de verdad es `app/stores/favorites.ts`. */ -export { useFavoritesStore as useFavorites } from '~/stores/favorites' -export type { - FavoriteItem, - FavoritesFile, - ImportResult, - Collection -} from '~/stores/favorites' +export { useFavoritesStore as useFavorites } from '~/stores/favorites' \ No newline at end of file diff --git a/app/composables/useHistory.ts b/app/composables/useHistory.ts index 5cf5141..aa0592d 100644 --- a/app/composables/useHistory.ts +++ b/app/composables/useHistory.ts @@ -3,10 +3,4 @@ * * La fuente única de verdad es `app/stores/history.ts`. */ -export { useHistoryStore as useHistory } from '~/stores/history' -export type { - HistoryItem, - HistoryFile, - ImportResult, - Collection -} from '~/stores/history' +export { useHistoryStore as useHistory } from '~/stores/history' \ No newline at end of file diff --git a/app/stores/favorites.ts b/app/stores/favorites.ts index 199d90a..c1a8f59 100644 --- a/app/stores/favorites.ts +++ b/app/stores/favorites.ts @@ -7,10 +7,10 @@ import type { SearchHit } from '~/types' * cualquier otra que se sume en el futuro). El store no asume un set cerrado * para que añadir nuevos buscadores no requiera tocar este archivo. */ -export type Collection = string +export type FavoritesCollection = string export interface FavoriteItem { - collection: Collection + collection: FavoritesCollection _id: string | number /** Snapshot del documento de Meilisearch para que el favorito se pueda * renderizar (título, fecha, ubicación, body) sin volver a consultar. */ @@ -24,7 +24,7 @@ export interface FavoritesFile { items: FavoriteItem[] } -export interface ImportResult { +export interface ImportFavoritesResult { added: number skipped: number invalid: number @@ -221,7 +221,7 @@ export const useFavoritesStore = defineStore('favorites', () => { } } - function importFromJson(json: string, mode: 'merge' | 'replace' = 'merge'): ImportResult { + function importFromJson(json: string, mode: 'merge' | 'replace' = 'merge'): ImportFavoritesResult { let parsed: unknown try { parsed = JSON.parse(json) diff --git a/app/stores/history.ts b/app/stores/history.ts index 13f36b2..80b6aed 100644 --- a/app/stores/history.ts +++ b/app/stores/history.ts @@ -16,10 +16,10 @@ import type { SearchHit } from '~/types' * - El identificador de colección no es un set cerrado — funciona con * cualquier colección que se sume en el futuro. */ -export type Collection = string +export type HistoryCollection = string export interface HistoryItem { - collection: Collection + collection: HistoryCollection _id: string | number /** Snapshot del documento para poder mostrarlo en el historial sin volver a * consultar al backend (igual que hacemos con favoritos). */ diff --git a/nuxt.config.ts b/nuxt.config.ts index 0cb37a8..8526546 100755 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -62,10 +62,10 @@ export default defineNuxtConfig({ langDir: '../lang/', strategy: 'prefix', defaultLocale: 'es', - detectBrowserLanguage: false - // skipSettingLocaleOnNavigate: true - - // vueI18n: "./i18n.config.ts", + detectBrowserLanguage: false, + bundle: { + optimizeTranslationDirective: false, + }, }, meilisearch: { diff --git a/package-lock.json b/package-lock.json index 8d7fd43..1a3cffe 100755 --- a/package-lock.json +++ b/package-lock.json @@ -2432,28 +2432,6 @@ } } }, - "node_modules/@nuxt/cli/node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@nuxt/cli/node_modules/commander": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", - "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=18" - } - }, "node_modules/@nuxt/cli/node_modules/std-env": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz", -- 2.39.5