Optimization
Fixing optimization messages for duplicated imports.
This commit is contained in:
parent
2078992da3
commit
7158e60938
|
|
@ -5,9 +5,3 @@
|
||||||
* La fuente única de verdad es `app/stores/favorites.ts`.
|
* La fuente única de verdad es `app/stores/favorites.ts`.
|
||||||
*/
|
*/
|
||||||
export { useFavoritesStore as useFavorites } from '~/stores/favorites'
|
export { useFavoritesStore as useFavorites } from '~/stores/favorites'
|
||||||
export type {
|
|
||||||
FavoriteItem,
|
|
||||||
FavoritesFile,
|
|
||||||
ImportResult,
|
|
||||||
Collection
|
|
||||||
} from '~/stores/favorites'
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,3 @@
|
||||||
* La fuente única de verdad es `app/stores/history.ts`.
|
* La fuente única de verdad es `app/stores/history.ts`.
|
||||||
*/
|
*/
|
||||||
export { useHistoryStore as useHistory } from '~/stores/history'
|
export { useHistoryStore as useHistory } from '~/stores/history'
|
||||||
export type {
|
|
||||||
HistoryItem,
|
|
||||||
HistoryFile,
|
|
||||||
ImportResult,
|
|
||||||
Collection
|
|
||||||
} from '~/stores/history'
|
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ import type { SearchHit } from '~/types'
|
||||||
* cualquier otra que se sume en el futuro). El store no asume un set cerrado
|
* 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.
|
* para que añadir nuevos buscadores no requiera tocar este archivo.
|
||||||
*/
|
*/
|
||||||
export type Collection = string
|
export type FavoritesCollection = string
|
||||||
|
|
||||||
export interface FavoriteItem {
|
export interface FavoriteItem {
|
||||||
collection: Collection
|
collection: FavoritesCollection
|
||||||
_id: string | number
|
_id: string | number
|
||||||
/** Snapshot del documento de Meilisearch para que el favorito se pueda
|
/** Snapshot del documento de Meilisearch para que el favorito se pueda
|
||||||
* renderizar (título, fecha, ubicación, body) sin volver a consultar. */
|
* renderizar (título, fecha, ubicación, body) sin volver a consultar. */
|
||||||
|
|
@ -24,7 +24,7 @@ export interface FavoritesFile {
|
||||||
items: FavoriteItem[]
|
items: FavoriteItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ImportResult {
|
export interface ImportFavoritesResult {
|
||||||
added: number
|
added: number
|
||||||
skipped: number
|
skipped: number
|
||||||
invalid: 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
|
let parsed: unknown
|
||||||
try {
|
try {
|
||||||
parsed = JSON.parse(json)
|
parsed = JSON.parse(json)
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@ import type { SearchHit } from '~/types'
|
||||||
* - El identificador de colección no es un set cerrado — funciona con
|
* - El identificador de colección no es un set cerrado — funciona con
|
||||||
* cualquier colección que se sume en el futuro.
|
* cualquier colección que se sume en el futuro.
|
||||||
*/
|
*/
|
||||||
export type Collection = string
|
export type HistoryCollection = string
|
||||||
|
|
||||||
export interface HistoryItem {
|
export interface HistoryItem {
|
||||||
collection: Collection
|
collection: HistoryCollection
|
||||||
_id: string | number
|
_id: string | number
|
||||||
/** Snapshot del documento para poder mostrarlo en el historial sin volver a
|
/** Snapshot del documento para poder mostrarlo en el historial sin volver a
|
||||||
* consultar al backend (igual que hacemos con favoritos). */
|
* consultar al backend (igual que hacemos con favoritos). */
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,10 @@ export default defineNuxtConfig({
|
||||||
langDir: '../lang/',
|
langDir: '../lang/',
|
||||||
strategy: 'prefix',
|
strategy: 'prefix',
|
||||||
defaultLocale: 'es',
|
defaultLocale: 'es',
|
||||||
detectBrowserLanguage: false
|
detectBrowserLanguage: false,
|
||||||
// skipSettingLocaleOnNavigate: true
|
bundle: {
|
||||||
|
optimizeTranslationDirective: false,
|
||||||
// vueI18n: "./i18n.config.ts",
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
meilisearch: {
|
meilisearch: {
|
||||||
|
|
|
||||||
|
|
@ -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": {
|
"node_modules/@nuxt/cli/node_modules/std-env": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue