Optimization #2

Merged
julioruiz merged 1 commits from jr-branch-1 into main 2026-05-19 04:32:05 +00:00
6 changed files with 12 additions and 46 deletions

View File

@ -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'

View File

@ -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'

View File

@ -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)

View File

@ -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). */

View File

@ -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: {

22
package-lock.json generated
View File

@ -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",