@pokepc/dataset 6.5.0 → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{build-DlK17pH-.mjs → build-GIV09lTc.mjs} +14 -7
- package/build/build-GIV09lTc.mjs.map +1 -0
- package/build/lib/fs.d.mts +6 -6
- package/build/lib/schemas.d.mts +1 -1
- package/build/lib/types.d.mts +1 -1
- package/build/lib-next/_build.mjs +1 -1
- package/build/lib-next/schemas.d.mts +8 -8
- package/build/{schemas-DpUlSCk0.d.mts → schemas-CiojUbKN.d.mts} +12 -12
- package/build/{schemas-DpUlSCk0.d.mts.map → schemas-CiojUbKN.d.mts.map} +1 -1
- package/build/utils-internal-Czgdbnkv.mjs.map +1 -1
- package/data/games/pokopia-bubblybasin.json +42 -0
- package/data/games/pokopia.json +1 -1
- package/data/indices/games.json +1 -0
- package/data/indices/pokedexes.json +1 -0
- package/data/pokedexes/paldea-kitakami.json +0 -2
- package/data/pokedexes/pokopia-basin.json +63 -0
- package/data/pokedexes/pokopia-event.json +6 -2
- package/data/pokemon/annihilape.json +1 -1
- package/data/pokemon/barbaracle.json +2 -1
- package/data/pokemon/blaziken-f.json +7 -2
- package/data/pokemon/blaziken.json +2 -1
- package/data/pokemon/dragalge.json +2 -1
- package/data/pokemon/eelektross.json +2 -1
- package/data/pokemon/falinks.json +1 -1
- package/data/pokemon/gholdengo.json +1 -1
- package/data/pokemon/grimmsnarl.json +1 -1
- package/data/pokemon/houndstone.json +1 -1
- package/data/pokemon/malamar.json +2 -1
- package/data/pokemon/mareanie.json +1 -2
- package/data/pokemon/mawile.json +2 -1
- package/data/pokemon/metagross.json +2 -1
- package/data/pokemon/musharna.json +2 -1
- package/data/pokemon/overqwil.json +1 -1
- package/data/pokemon/pangoro.json +2 -1
- package/data/pokemon/qwilfish.json +2 -1
- package/data/pokemon/sceptile.json +2 -1
- package/data/pokemon/scolipede.json +2 -1
- package/data/pokemon/scrafty.json +2 -1
- package/data/pokemon/staraptor-f.json +2 -1
- package/data/pokemon/staraptor.json +2 -1
- package/data/pokemon/swampert.json +2 -1
- package/data/pokemon/toxapex.json +2 -1
- package/data/pokemon/vileplume-f.json +7 -2
- package/data/pokemon/vileplume.json +2 -1
- package/data-next/champions/abilities.json +2 -0
- package/data-next/champions/items.json +34 -0
- package/package.json +1 -1
- package/build/build-DlK17pH-.mjs.map +0 -1
|
@@ -33,12 +33,19 @@ async function fetchPokeApiResourceIndex(kind, options) {
|
|
|
33
33
|
name: resource.name
|
|
34
34
|
};
|
|
35
35
|
const idKey = String(id);
|
|
36
|
-
|
|
36
|
+
const existingIdEntry = index.byId.get(idKey);
|
|
37
|
+
if (existingIdEntry !== void 0 && existingIdEntry.name !== resource.name) throw new Error(`Duplicate PokeAPI ${kind} resource id ${idKey}: ${existingIdEntry.name}, ${resource.name}`);
|
|
37
38
|
index.byId.set(idKey, entry);
|
|
38
39
|
for (const nameKey of pokeApiResourceNameKeys(resource.name)) {
|
|
39
40
|
const existingEntry = index.byName.get(nameKey);
|
|
40
|
-
if (existingEntry
|
|
41
|
-
|
|
41
|
+
if (existingEntry === void 0 || existingEntry.id === id) {
|
|
42
|
+
index.byName.set(nameKey, entry);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (existingEntry.name !== resource.name) throw new Error(`Duplicate PokeAPI ${kind} resource lookup key ${nameKey}: ${existingEntry.name}, ${resource.name}`);
|
|
46
|
+
const keptEntry = existingEntry.id < id ? existingEntry : entry;
|
|
47
|
+
console.warn(`Duplicate PokeAPI ${kind} resource name ${resource.name} (ids ${existingEntry.id}, ${id}); keeping id ${keptEntry.id} for lookup key ${nameKey}`);
|
|
48
|
+
index.byName.set(nameKey, keptEntry);
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
51
|
return index;
|
|
@@ -183,7 +190,7 @@ async function enrichChampionsDataWithPokeApiIds(options = {}) {
|
|
|
183
190
|
missing: preparedDomain.missing
|
|
184
191
|
}];
|
|
185
192
|
}));
|
|
186
|
-
if (Object.values(result).reduce((count, domainResult) => count + domainResult.missing.length, 0) > 0) console.warn(
|
|
193
|
+
if (Object.values(result).reduce((count, domainResult) => count + domainResult.missing.length, 0) > 0) console.warn(formatMissingPokeApiResourcesWarning(result));
|
|
187
194
|
for (const preparedDomain of preparedDomains) writeJsonFile(preparedDomain.filePath, preparedDomain.records);
|
|
188
195
|
return result;
|
|
189
196
|
}
|
|
@@ -282,8 +289,8 @@ function formatDomainSummary(domain, result) {
|
|
|
282
289
|
const missing = result.missing.length === 0 ? "" : `, ${result.missing.length} unmatched`;
|
|
283
290
|
return `${result.matched} ${domain} with PokeAPI IDs${missing}`;
|
|
284
291
|
}
|
|
285
|
-
function
|
|
286
|
-
const lines = ["Missing PokeAPI resources;
|
|
292
|
+
function formatMissingPokeApiResourcesWarning(result) {
|
|
293
|
+
const lines = ["Missing PokeAPI resources; they were written without a pokeApiId."];
|
|
287
294
|
for (const [domain, domainResult] of Object.entries(result)) {
|
|
288
295
|
if (domainResult.missing.length === 0) continue;
|
|
289
296
|
lines.push(`${domain}: ${domainResult.missing.length} missing`);
|
|
@@ -301,4 +308,4 @@ console.log(formatEnrichChampionsDataSummary(result));
|
|
|
301
308
|
//#endregion
|
|
302
309
|
export {};
|
|
303
310
|
|
|
304
|
-
//# sourceMappingURL=build-
|
|
311
|
+
//# sourceMappingURL=build-GIV09lTc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-GIV09lTc.mjs","names":[],"sources":["../src/upstream-adapters/projectpokemon-champout/fixtures/pokeapi.ts","../src/upstream-adapters/pokeapi/client.ts","../src/upstream-adapters/pokeapi/enrich-champions.ts","../src/upstream-adapters/pokeapi/build.ts"],"sourcesContent":["export const champoutPokeApiResourceNameAliases: Partial<\n Record<'ability' | 'item' | 'move', Record<string, readonly string[]>>\n> = {\n move: {\n visegrip: ['vicegrip', 'vice-grip'],\n },\n}\n","import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\n\nexport const DEFAULT_POKEAPI_BASE_URL = 'https://pokeapi.co/api/v2'\nexport const DEFAULT_POKEAPI_CACHE_DIR = join(process.cwd(), '.local/pokeapi')\n\nexport const pokeApiResourceKinds = ['ability', 'item', 'move'] as const\nexport type PokeApiResourceKind = (typeof pokeApiResourceKinds)[number]\n\nexport type PokeApiResourceSummary = {\n name: string\n url: string\n}\n\nexport type PokeApiResourceIndexEntry = {\n id: number\n name: string\n}\n\nexport type PokeApiResourceIndex = {\n byId: Map<string, PokeApiResourceIndexEntry>\n byName: Map<string, PokeApiResourceIndexEntry>\n}\nexport type PokeApiResourceIndexes = Record<PokeApiResourceKind, PokeApiResourceIndex>\n\nexport type PokeApiFetchOptions = {\n baseUrl?: string\n cache?: boolean\n cacheDir?: string\n forceRefresh?: boolean\n retries?: number\n}\n\ntype PokeApiResourceListResponse = {\n count: number\n results: PokeApiResourceSummary[]\n}\n\nexport async function fetchPokeApiResourceIndexes(\n baseUrlOrOptions: string | PokeApiFetchOptions = DEFAULT_POKEAPI_BASE_URL,\n): Promise<PokeApiResourceIndexes> {\n const options = normalizePokeApiFetchOptions(baseUrlOrOptions)\n const [ability, item, move] = await Promise.all(\n pokeApiResourceKinds.map((kind) => fetchPokeApiResourceIndex(kind, options)),\n )\n\n return { ability, item, move }\n}\n\nasync function fetchPokeApiResourceIndex(\n kind: PokeApiResourceKind,\n options: PokeApiFetchOptions,\n): Promise<PokeApiResourceIndex> {\n const list = await fetchPokeApiResourceList(kind, options)\n const index: PokeApiResourceIndex = {\n byId: new Map(),\n byName: new Map(),\n }\n\n for (const resource of list.results) {\n const id = parsePokeApiResourceId(resource.url, kind)\n const entry = { id, name: resource.name }\n const idKey = String(id)\n const existingIdEntry = index.byId.get(idKey)\n\n if (existingIdEntry !== undefined && existingIdEntry.name !== resource.name) {\n throw new Error(\n `Duplicate PokeAPI ${kind} resource id ${idKey}: ${existingIdEntry.name}, ${resource.name}`,\n )\n }\n\n index.byId.set(idKey, entry)\n\n for (const nameKey of pokeApiResourceNameKeys(resource.name)) {\n const existingEntry = index.byName.get(nameKey)\n\n if (existingEntry === undefined || existingEntry.id === id) {\n index.byName.set(nameKey, entry)\n continue\n }\n\n if (existingEntry.name !== resource.name) {\n throw new Error(\n `Duplicate PokeAPI ${kind} resource lookup key ${nameKey}: ${existingEntry.name}, ${resource.name}`,\n )\n }\n\n // Upstream sometimes lists the same resource name under two ids; keep the lowest so\n // lookups stay stable when a newer duplicate row appears.\n const keptEntry = existingEntry.id < id ? existingEntry : entry\n\n console.warn(\n `Duplicate PokeAPI ${kind} resource name ${resource.name} (ids ${existingEntry.id}, ${id}); keeping id ${keptEntry.id} for lookup key ${nameKey}`,\n )\n index.byName.set(nameKey, keptEntry)\n }\n }\n\n return index\n}\n\nasync function fetchPokeApiResourceList(\n kind: PokeApiResourceKind,\n options: PokeApiFetchOptions,\n): Promise<PokeApiResourceListResponse> {\n const baseUrl = options.baseUrl ?? DEFAULT_POKEAPI_BASE_URL\n const url = new URL(`${baseUrl.replace(/\\/+$/, '')}/${kind}/`)\n url.searchParams.set('limit', '100000')\n url.searchParams.set('offset', '0')\n\n const json = await fetchPokeApiJson(url, options)\n\n if (!isPokeApiResourceListResponse(json)) {\n throw new Error(`Unexpected PokeAPI ${kind} list response shape`)\n }\n\n if (json.results.length < json.count) {\n throw new Error(\n `Expected all PokeAPI ${kind} resources in one list response, got ${json.results.length} of ${json.count}`,\n )\n }\n\n return json\n}\n\nexport async function fetchPokeApiJson(\n pathnameOrUrl: string | URL,\n options: PokeApiFetchOptions = {},\n): Promise<unknown> {\n const resolvedOptions = normalizePokeApiFetchOptions(options)\n const url = resolvePokeApiUrl(pathnameOrUrl, resolvedOptions.baseUrl)\n const cacheEnabled = resolvedOptions.cache ?? process.env.POKEAPI_CACHE !== '0'\n const cachePath = pokeApiCachePath(url, resolvedOptions.cacheDir)\n\n if (cacheEnabled && !resolvedOptions.forceRefresh) {\n const cachedJson = readCachedPokeApiJson(cachePath)\n\n if (cachedJson !== undefined) {\n return cachedJson\n }\n }\n\n const json = await fetchPokeApiJsonFromNetwork(url, resolvedOptions.retries)\n\n if (cacheEnabled) {\n writeCachedPokeApiJson(cachePath, json)\n }\n\n return json\n}\n\nfunction normalizePokeApiFetchOptions(\n options: string | PokeApiFetchOptions,\n): Required<PokeApiFetchOptions> {\n const input = typeof options === 'string' ? { baseUrl: options } : options\n\n return {\n baseUrl: input.baseUrl ?? DEFAULT_POKEAPI_BASE_URL,\n cache: input.cache ?? process.env.POKEAPI_CACHE !== '0',\n cacheDir: input.cacheDir ?? process.env.POKEAPI_CACHE_DIR ?? DEFAULT_POKEAPI_CACHE_DIR,\n forceRefresh: input.forceRefresh ?? process.env.POKEAPI_REFRESH_CACHE === '1',\n retries: input.retries ?? 3,\n }\n}\n\nfunction resolvePokeApiUrl(pathnameOrUrl: string | URL, baseUrl: string): URL {\n if (pathnameOrUrl instanceof URL) {\n return pathnameOrUrl\n }\n\n if (/^https?:\\/\\//i.test(pathnameOrUrl)) {\n return new URL(pathnameOrUrl)\n }\n\n const base = baseUrl.replace(/\\/+$/, '')\n const pathname = pathnameOrUrl.replace(/^\\/+/, '').replace(/\\/?$/, '/')\n return new URL(`${base}/${pathname}`)\n}\n\nasync function fetchPokeApiJsonFromNetwork(url: URL, retries: number): Promise<unknown> {\n let lastError: unknown\n\n for (let attempt = 1; attempt <= retries; attempt += 1) {\n try {\n const response = await fetch(url, {\n headers: {\n accept: 'application/json',\n },\n })\n\n if (response.ok) {\n return await response.json()\n }\n\n const body = await response.text()\n lastError = new Error(\n `${response.status} ${response.statusText}${body.length > 0 ? `: ${body.slice(0, 240)}` : ''}`,\n )\n\n if (response.status !== 429 && response.status < 500) {\n break\n }\n } catch (error) {\n lastError = error\n }\n\n await sleep(backoffMs(attempt))\n }\n\n throw lastError instanceof Error ? lastError : new Error(String(lastError))\n}\n\nfunction readCachedPokeApiJson(cachePath: string): unknown | undefined {\n if (!existsSync(cachePath)) {\n return undefined\n }\n\n try {\n return JSON.parse(readFileSync(cachePath, 'utf8'))\n } catch {\n return undefined\n }\n}\n\nfunction writeCachedPokeApiJson(cachePath: string, json: unknown): void {\n mkdirSync(dirname(cachePath), { recursive: true })\n writeFileSync(cachePath, `${JSON.stringify(json)}\\n`)\n}\n\nfunction pokeApiCachePath(url: URL, cacheDir: string): string {\n const segments = [\n sanitizeCachePathSegment(url.hostname),\n ...url.pathname.split('/').filter(Boolean).map(sanitizeCachePathSegment),\n ]\n const searchSuffix = url.search.length > 0 ? `-${stableSearchSuffix(url.searchParams)}` : ''\n const filename = `${segments.pop() ?? 'index'}${searchSuffix}.json`\n\n return join(cacheDir, ...segments, filename)\n}\n\nfunction stableSearchSuffix(searchParams: URLSearchParams): string {\n return Array.from(searchParams.entries())\n .sort(([leftKey, leftValue], [rightKey, rightValue]) =>\n `${leftKey}=${leftValue}`.localeCompare(`${rightKey}=${rightValue}`),\n )\n .map(([key, value]) => `${sanitizeCachePathSegment(key)}-${sanitizeCachePathSegment(value)}`)\n .join('-')\n}\n\nfunction sanitizeCachePathSegment(value: string): string {\n const sanitized = value.replace(/[^a-zA-Z0-9._-]+/g, '-').replace(/^-+|-+$/g, '')\n return sanitized.length > 0 ? sanitized : '_'\n}\n\nfunction backoffMs(attempt: number): number {\n return Math.min(15_000, 750 * 2 ** Math.max(0, attempt - 1))\n}\n\nasync function sleep(ms: number): Promise<void> {\n if (ms <= 0) {\n return\n }\n\n await new Promise((resolveSleep) => setTimeout(resolveSleep, ms))\n}\n\nfunction isPokeApiResourceListResponse(value: unknown): value is PokeApiResourceListResponse {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n\n const response = value as Record<string, unknown>\n\n return (\n typeof response.count === 'number' &&\n Array.isArray(response.results) &&\n response.results.every(isPokeApiResourceSummary)\n )\n}\n\nfunction isPokeApiResourceSummary(value: unknown): value is PokeApiResourceSummary {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n\n const resource = value as Record<string, unknown>\n\n return typeof resource.name === 'string' && typeof resource.url === 'string'\n}\n\nfunction parsePokeApiResourceId(resourceUrl: string, kind: PokeApiResourceKind): number {\n const url = new URL(resourceUrl)\n const segments = url.pathname.split('/').filter(Boolean)\n const kindIndex = segments.lastIndexOf(kind)\n const id = kindIndex === -1 ? undefined : segments[kindIndex + 1]\n\n if (id === undefined || !/^\\d+$/.test(id)) {\n throw new Error(`Could not parse PokeAPI ${kind} id from URL: ${resourceUrl}`)\n }\n\n return Number(id)\n}\n\nexport function pokeApiResourceNameKeys(value: string): string[] {\n return Array.from(\n new Set([\n value.toLowerCase(),\n value\n .toLowerCase()\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/[^a-z0-9]+/g, ''),\n ]),\n ).filter((key) => key.length > 0)\n}\n","import { readFileSync, writeFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { champoutPokeApiResourceNameAliases } from '../projectpokemon-champout/fixtures/pokeapi'\nimport {\n DEFAULT_POKEAPI_BASE_URL,\n fetchPokeApiResourceIndexes,\n pokeApiResourceNameKeys,\n type PokeApiResourceIndex,\n type PokeApiResourceIndexEntry,\n type PokeApiResourceKind,\n} from './client'\n\nexport const DEFAULT_CHAMPIONS_DATA_ROOT = join(process.cwd(), 'data-next/champions')\n\nexport type EnrichChampionsDataOptions = {\n championsDataRoot?: string\n pokeApiBaseUrl?: string\n}\n\nexport type EnrichedChampionsDomainResult = {\n filePath: string\n matched: number\n missing: MissingPokeApiResource[]\n}\n\nexport type EnrichChampionsDataResult = Record<\n 'abilities' | 'items' | 'moves',\n EnrichedChampionsDomainResult\n>\n\nexport type MissingPokeApiResource = {\n id: string\n championsId: string\n slug: string\n name: string\n triedIdCandidates: string[]\n championsIdMatchedResource?: PokeApiResourceIndexEntry\n}\n\ntype ChampionsDomain = {\n key: keyof EnrichChampionsDataResult\n kind: PokeApiResourceKind\n fileName: string\n}\n\ntype JsonRecord = Record<string, unknown>\n\ntype PreparedChampionsDomain = EnrichedChampionsDomainResult & {\n records: JsonRecord[]\n}\n\nconst championsDomains = [\n { key: 'abilities', kind: 'ability', fileName: 'abilities.json' },\n { key: 'items', kind: 'item', fileName: 'items.json' },\n { key: 'moves', kind: 'move', fileName: 'moves.json' },\n] as const satisfies readonly ChampionsDomain[]\n\nexport async function enrichChampionsDataWithPokeApiIds(\n options: EnrichChampionsDataOptions = {},\n): Promise<EnrichChampionsDataResult> {\n const championsDataRoot = options.championsDataRoot ?? DEFAULT_CHAMPIONS_DATA_ROOT\n const pokeApiBaseUrl = options.pokeApiBaseUrl ?? DEFAULT_POKEAPI_BASE_URL\n const resourceIndexes = await fetchPokeApiResourceIndexes(pokeApiBaseUrl)\n const preparedDomains = championsDomains.map((domain) =>\n prepareChampionsDomainWithPokeApiIds(\n domain.kind,\n join(championsDataRoot, domain.fileName),\n resourceIndexes[domain.kind],\n ),\n )\n const result = Object.fromEntries(\n championsDomains.map((domain, index) => {\n const preparedDomain = preparedDomains[index]\n\n return [\n domain.key,\n {\n filePath: preparedDomain.filePath,\n matched: preparedDomain.matched,\n missing: preparedDomain.missing,\n },\n ]\n }),\n ) as EnrichChampionsDataResult\n\n const missingCount = Object.values(result).reduce(\n (count, domainResult) => count + domainResult.missing.length,\n 0,\n )\n\n if (missingCount > 0) {\n console.warn(formatMissingPokeApiResourcesWarning(result))\n }\n\n for (const preparedDomain of preparedDomains) {\n writeJsonFile(preparedDomain.filePath, preparedDomain.records)\n }\n\n return result\n}\n\nexport function formatEnrichChampionsDataSummary(result: EnrichChampionsDataResult): string {\n return [\n formatDomainSummary('abilities', result.abilities),\n formatDomainSummary('items', result.items),\n formatDomainSummary('moves', result.moves),\n ].join(', ')\n}\n\nfunction prepareChampionsDomainWithPokeApiIds(\n kind: PokeApiResourceKind,\n filePath: string,\n resourceIndex: PokeApiResourceIndex,\n): PreparedChampionsDomain {\n const records = readJsonRecordArray(filePath)\n const missing: MissingPokeApiResource[] = []\n let matched = 0\n\n const enrichedRecords = records.map((record, index) => {\n const id = requiredString(record, 'id', filePath, index)\n const championsId = requiredString(record, 'championsId', filePath, index)\n const slug = requiredString(record, 'slug', filePath, index)\n const name = requiredString(record, 'name', filePath, index)\n const triedIdCandidates = pokeApiIdCandidates(kind, id)\n const championsIdMatchedResource = resourceIndex.byId.get(championsId)\n const pokeApiId = findPokeApiId(resourceIndex, championsId, triedIdCandidates)\n\n if (pokeApiId === undefined) {\n missing.push({\n id,\n championsId,\n slug,\n name,\n triedIdCandidates,\n championsIdMatchedResource,\n })\n } else {\n matched += 1\n }\n\n return withPokeApiId(record, pokeApiId)\n })\n\n return { filePath, matched, missing, records: enrichedRecords }\n}\n\nfunction findPokeApiId(\n resourceIndex: PokeApiResourceIndex,\n championsId: string,\n idCandidates: string[],\n): number | undefined {\n for (const candidate of idCandidates) {\n const resource = findPokeApiResourceByName(resourceIndex, candidate)\n\n if (resource !== undefined) {\n return resource.id\n }\n }\n\n const resourceByChampionsId = resourceIndex.byId.get(championsId)\n\n if (resourceByChampionsId === undefined) {\n return undefined\n }\n\n return resourceByChampionsId.id\n}\n\nfunction findPokeApiResourceByName(\n resourceIndex: PokeApiResourceIndex,\n candidate: string,\n): PokeApiResourceIndexEntry | undefined {\n for (const key of pokeApiResourceNameKeys(candidate)) {\n const resource = resourceIndex.byName.get(key)\n\n if (resource !== undefined) {\n return resource\n }\n }\n\n return undefined\n}\n\nfunction pokeApiIdCandidates(kind: PokeApiResourceKind, id: string): string[] {\n return uniqueStrings([id, ...(champoutPokeApiResourceNameAliases[kind]?.[id] ?? [])])\n}\n\nfunction withPokeApiId(record: JsonRecord, pokeApiId: number | undefined): JsonRecord {\n const { id, championsId, slug, ...rest } = record\n delete rest.pokeApiId\n\n if (pokeApiId === undefined) {\n return { id, championsId, slug, ...rest }\n }\n\n return { id, championsId, pokeApiId, slug, ...rest }\n}\n\nfunction readJsonRecordArray(filePath: string): JsonRecord[] {\n const json: unknown = JSON.parse(readFileSync(filePath, 'utf8'))\n\n if (!Array.isArray(json)) {\n throw new Error(`Expected ${filePath} to contain an array`)\n }\n\n return json.map((record, index) => {\n if (typeof record !== 'object' || record === null || Array.isArray(record)) {\n throw new Error(`Expected ${filePath}[${index}] to contain an object`)\n }\n\n return record as JsonRecord\n })\n}\n\nfunction writeJsonFile(filePath: string, data: unknown): void {\n writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\\n`)\n}\n\nfunction requiredString(record: JsonRecord, key: string, filePath: string, index: number): string {\n const value = record[key]\n\n if (typeof value !== 'string' || value.length === 0) {\n throw new Error(`Expected ${filePath}[${index}].${key} to be a non-empty string`)\n }\n\n return value\n}\n\nfunction uniqueStrings(values: readonly unknown[]): string[] {\n return Array.from(new Set(values.filter((value): value is string => typeof value === 'string')))\n}\n\nfunction formatDomainSummary(\n domain: keyof EnrichChampionsDataResult,\n result: EnrichedChampionsDomainResult,\n): string {\n const missing = result.missing.length === 0 ? '' : `, ${result.missing.length} unmatched`\n\n return `${result.matched} ${domain} with PokeAPI IDs${missing}`\n}\n\nfunction formatMissingPokeApiResourcesWarning(result: EnrichChampionsDataResult): string {\n const lines = ['Missing PokeAPI resources; they were written without a pokeApiId.']\n\n for (const [domain, domainResult] of Object.entries(result)) {\n if (domainResult.missing.length === 0) {\n continue\n }\n\n lines.push(`${domain}: ${domainResult.missing.length} missing`)\n\n for (const missing of domainResult.missing) {\n const championsIdMatch =\n missing.championsIdMatchedResource === undefined\n ? 'no PokeAPI resource with that numeric id'\n : `numeric id belongs to ${missing.championsIdMatchedResource.name}`\n\n lines.push(\n `- ${missing.id} (${missing.name}; championsId ${missing.championsId}; tried id candidates ${missing.triedIdCandidates.join(', ')}; ${championsIdMatch})`,\n )\n }\n }\n\n return lines.join('\\n')\n}\n","import {\n enrichChampionsDataWithPokeApiIds,\n formatEnrichChampionsDataSummary,\n} from './enrich-champions'\n\nconst result = await enrichChampionsDataWithPokeApiIds()\n\nconsole.log(formatEnrichChampionsDataSummary(result))\n"],"mappings":";;;AAAA,MAAa,qCAET,EACF,MAAM,EACJ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,EAAE,IAAI,iBAAiB,EACzJ;EACF;CACF;CAEA,OAAO,MAAM,KAAK,IAAI;AACxB;;;ACnQA,MAAM,SAAS,MAAM,kCAAkC;AAEvD,QAAQ,IAAI,iCAAiC,MAAM,CAAC"}
|
package/build/lib/fs.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ declare const itemsFs: import("yolodb").YoloDbTable<{
|
|
|
9
9
|
gen: number;
|
|
10
10
|
shortDesc: string;
|
|
11
11
|
desc: string | null;
|
|
12
|
-
category: "
|
|
12
|
+
category: "berry" | "other" | "ball" | "medicine" | "battle" | "machine" | "megastone" | "zcrystal" | "treasure" | "ingredient" | "material" | "key";
|
|
13
13
|
unholdable?: boolean | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
declare const pokeballsFs: import("yolodb").YoloDbTable<{
|
|
@@ -18,7 +18,7 @@ declare const pokeballsFs: import("yolodb").YoloDbTable<{
|
|
|
18
18
|
gen: number;
|
|
19
19
|
shortDesc: string;
|
|
20
20
|
desc: string | null;
|
|
21
|
-
category: "
|
|
21
|
+
category: "special" | "other" | "regular" | "hisuian";
|
|
22
22
|
unusable?: boolean | undefined;
|
|
23
23
|
}>;
|
|
24
24
|
declare const abilitiesFs: import("yolodb").YoloDbTable<{
|
|
@@ -28,7 +28,7 @@ declare const abilitiesFs: import("yolodb").YoloDbTable<{
|
|
|
28
28
|
gen: number;
|
|
29
29
|
shortDesc: string;
|
|
30
30
|
desc: string | null;
|
|
31
|
-
tags: ("other" | "alert" | "ally-helper" | "stat-boost" | "move-boost" | "bypass" | "
|
|
31
|
+
tags: ("defense" | "other" | "alert" | "ally-helper" | "stat-boost" | "move-boost" | "bypass" | "handicap" | "heal" | "items" | "priority-control" | "damage" | "target-weaken" | "status-trigger" | "status-immunity" | "steal" | "weather" | "terrain" | "trap" | "ability-change" | "type-change" | "species-specific")[];
|
|
32
32
|
immunities?: ("normal" | "fire" | "water" | "electric" | "grass" | "ice" | "fighting" | "poison" | "ground" | "flying" | "psychic" | "bug" | "rock" | "ghost" | "dragon" | "dark" | "steel" | "fairy" | "stellar")[] | undefined;
|
|
33
33
|
weaknesses?: ("normal" | "fire" | "water" | "electric" | "grass" | "ice" | "fighting" | "poison" | "ground" | "flying" | "psychic" | "bug" | "rock" | "ghost" | "dragon" | "dark" | "steel" | "fairy" | "stellar")[] | undefined;
|
|
34
34
|
}>;
|
|
@@ -43,7 +43,7 @@ declare const movesFs: import("yolodb").YoloDbTable<{
|
|
|
43
43
|
power: number;
|
|
44
44
|
accuracy: number;
|
|
45
45
|
pp: number;
|
|
46
|
-
category: "
|
|
46
|
+
category: "physical" | "special" | "status";
|
|
47
47
|
priority: number;
|
|
48
48
|
isZ: boolean;
|
|
49
49
|
isGmax: boolean;
|
|
@@ -85,8 +85,8 @@ declare const typesFs: import("yolodb").YoloDbTable<{
|
|
|
85
85
|
declare const naturesFs: import("yolodb").YoloDbTable<{
|
|
86
86
|
id: string;
|
|
87
87
|
name: string;
|
|
88
|
-
raises: "
|
|
89
|
-
lowers: "
|
|
88
|
+
raises: "def" | "hp" | "atk" | "spa" | "spd" | "spe" | "acc" | "eva" | null;
|
|
89
|
+
lowers: "def" | "hp" | "atk" | "spa" | "spd" | "spe" | "acc" | "eva" | null;
|
|
90
90
|
}>;
|
|
91
91
|
declare const personalitiesFs: import("yolodb").YoloDbTable<{
|
|
92
92
|
id: string;
|
package/build/lib/schemas.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, a as boxPresetMapSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, i as boxPresetIndexItemSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-
|
|
1
|
+
import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, a as boxPresetMapSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, i as boxPresetIndexItemSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-CiojUbKN.mjs";
|
|
2
2
|
export { abilitySchema, boxPresetBoxPokemonSchema, boxPresetBoxSchema, boxPresetIndexItemSchema, boxPresetMapSchema, boxPresetSchema, characterSchema, colorSchema, gameFeaturesSchema, gameSchema, generationSchema, i18nTextSchema, itemSchema, languageSchema, markSchema, modernBoxPresetBoxSchema, modernBoxPresetIndexSchema, modernBoxPresetSchema, modernBoxPresetSlotSchema, modernBoxPresetTags, moveSchema, natureSchema, onlineFeaturesSchema, originMarkSchema, personalitySchema, pokeballSchema, pokedexEntrySchema, pokedexSchema, pokemonRefsSchema, pokemonSchema, pokemonSearchFilterSchema, regionSchema, ribbonSchema, typeSchema };
|
package/build/lib/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as statIds, a as gameType, c as ivJudgeValues, d as languageInGameCodes, f as moveCategory, g as ribbonCategory, h as raidStyles, i as gameSeries, l as languageAlpha3Codes, m as pokemonSizes, n as battleStyles, o as genders, p as pokeballCategory, r as gamePlatforms, s as itemCategory, t as abilityTagIds, u as languageIds, v as titleTypes, y as typeIds } from "../enums-CCbmORM6.mjs";
|
|
2
|
-
import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-
|
|
2
|
+
import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-CiojUbKN.mjs";
|
|
3
3
|
import z$1 from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/types.d.ts
|
|
@@ -2,7 +2,7 @@ import { n as writeJsonDataFile } from "../fs-B5MIz_Bs.mjs";
|
|
|
2
2
|
import { i as appLangs } from "../languages-CY-Q1SED.mjs";
|
|
3
3
|
//#region src/lib-next/_build.ts
|
|
4
4
|
await import("../build-DeFbpXmN.mjs");
|
|
5
|
-
await import("../build-
|
|
5
|
+
await import("../build-GIV09lTc.mjs");
|
|
6
6
|
writeJsonDataFile("languages.json", appLangs);
|
|
7
7
|
console.log(`Exported ${appLangs.length} app languages`);
|
|
8
8
|
//#endregion
|
|
@@ -78,8 +78,8 @@ declare const moveSchema: z.ZodObject<{
|
|
|
78
78
|
fairy: "fairy";
|
|
79
79
|
}>;
|
|
80
80
|
category: z.ZodEnum<{
|
|
81
|
-
special: "special";
|
|
82
81
|
physical: "physical";
|
|
82
|
+
special: "special";
|
|
83
83
|
status: "status";
|
|
84
84
|
}>;
|
|
85
85
|
power: z.ZodNumber;
|
|
@@ -145,8 +145,8 @@ declare const movesSchema: z.ZodArray<z.ZodObject<{
|
|
|
145
145
|
fairy: "fairy";
|
|
146
146
|
}>;
|
|
147
147
|
category: z.ZodEnum<{
|
|
148
|
-
special: "special";
|
|
149
148
|
physical: "physical";
|
|
149
|
+
special: "special";
|
|
150
150
|
status: "status";
|
|
151
151
|
}>;
|
|
152
152
|
power: z.ZodNumber;
|
|
@@ -211,13 +211,13 @@ declare const itemSchema: z.ZodObject<{
|
|
|
211
211
|
description: z.ZodString;
|
|
212
212
|
pluralName: z.ZodString;
|
|
213
213
|
categories: z.ZodArray<z.ZodEnum<{
|
|
214
|
-
berry: "berry";
|
|
215
|
-
other: "other";
|
|
216
|
-
defense: "defense";
|
|
217
214
|
power_boost: "power_boost";
|
|
218
215
|
recovery: "recovery";
|
|
216
|
+
defense: "defense";
|
|
219
217
|
stat_boost: "stat_boost";
|
|
220
218
|
effect_extend: "effect_extend";
|
|
219
|
+
berry: "berry";
|
|
220
|
+
other: "other";
|
|
221
221
|
mega_stone: "mega_stone";
|
|
222
222
|
}>>;
|
|
223
223
|
}, z.core.$strip>;
|
|
@@ -231,13 +231,13 @@ declare const itemsSchema: z.ZodArray<z.ZodObject<{
|
|
|
231
231
|
description: z.ZodString;
|
|
232
232
|
pluralName: z.ZodString;
|
|
233
233
|
categories: z.ZodArray<z.ZodEnum<{
|
|
234
|
-
berry: "berry";
|
|
235
|
-
other: "other";
|
|
236
|
-
defense: "defense";
|
|
237
234
|
power_boost: "power_boost";
|
|
238
235
|
recovery: "recovery";
|
|
236
|
+
defense: "defense";
|
|
239
237
|
stat_boost: "stat_boost";
|
|
240
238
|
effect_extend: "effect_extend";
|
|
239
|
+
berry: "berry";
|
|
240
|
+
other: "other";
|
|
241
241
|
mega_stone: "mega_stone";
|
|
242
242
|
}>>;
|
|
243
243
|
}, z.core.$strip>>;
|
|
@@ -22,13 +22,13 @@ declare const abilitySchema: z.ZodObject<{
|
|
|
22
22
|
shortDesc: z.ZodString;
|
|
23
23
|
desc: z.ZodNullable<z.ZodString>;
|
|
24
24
|
tags: z.ZodArray<z.ZodEnum<{
|
|
25
|
+
defense: "defense";
|
|
25
26
|
other: "other";
|
|
26
27
|
alert: "alert";
|
|
27
28
|
"ally-helper": "ally-helper";
|
|
28
29
|
"stat-boost": "stat-boost";
|
|
29
30
|
"move-boost": "move-boost";
|
|
30
31
|
bypass: "bypass";
|
|
31
|
-
defense: "defense";
|
|
32
32
|
handicap: "handicap";
|
|
33
33
|
heal: "heal";
|
|
34
34
|
items: "items";
|
|
@@ -137,8 +137,8 @@ declare const onlineFeaturesSchema: z.ZodObject<{
|
|
|
137
137
|
trades: z.ZodBoolean;
|
|
138
138
|
raids: z.ZodBoolean;
|
|
139
139
|
raidStyles: z.ZodArray<z.ZodEnum<{
|
|
140
|
-
dynamax: "dynamax";
|
|
141
140
|
tera: "tera";
|
|
141
|
+
dynamax: "dynamax";
|
|
142
142
|
}>>;
|
|
143
143
|
coop: z.ZodBoolean;
|
|
144
144
|
}, z.core.$strip>;
|
|
@@ -149,15 +149,15 @@ declare const gameSchema: z.ZodObject<{
|
|
|
149
149
|
nameSlug: z.ZodString;
|
|
150
150
|
codename: z.ZodNullable<z.ZodString>;
|
|
151
151
|
type: z.ZodEnum<{
|
|
152
|
-
superset: "superset";
|
|
153
152
|
set: "set";
|
|
153
|
+
superset: "superset";
|
|
154
154
|
game: "game";
|
|
155
155
|
dlc: "dlc";
|
|
156
156
|
}>;
|
|
157
157
|
series: z.ZodEnum<{
|
|
158
|
+
storage: "storage";
|
|
158
159
|
main: "main";
|
|
159
160
|
spinoff: "spinoff";
|
|
160
|
-
storage: "storage";
|
|
161
161
|
legends: "legends";
|
|
162
162
|
}>;
|
|
163
163
|
gameSet: z.ZodNullable<z.ZodString>;
|
|
@@ -218,8 +218,8 @@ declare const gameSchema: z.ZodObject<{
|
|
|
218
218
|
trades: z.ZodBoolean;
|
|
219
219
|
raids: z.ZodBoolean;
|
|
220
220
|
raidStyles: z.ZodArray<z.ZodEnum<{
|
|
221
|
-
dynamax: "dynamax";
|
|
222
221
|
tera: "tera";
|
|
222
|
+
dynamax: "dynamax";
|
|
223
223
|
}>>;
|
|
224
224
|
coop: z.ZodBoolean;
|
|
225
225
|
}, z.core.$strip>>;
|
|
@@ -237,10 +237,11 @@ declare const itemSchema: z.ZodObject<{
|
|
|
237
237
|
shortDesc: z.ZodString;
|
|
238
238
|
desc: z.ZodNullable<z.ZodString>;
|
|
239
239
|
category: z.ZodEnum<{
|
|
240
|
+
berry: "berry";
|
|
241
|
+
other: "other";
|
|
240
242
|
ball: "ball";
|
|
241
243
|
medicine: "medicine";
|
|
242
244
|
battle: "battle";
|
|
243
|
-
berry: "berry";
|
|
244
245
|
machine: "machine";
|
|
245
246
|
megastone: "megastone";
|
|
246
247
|
zcrystal: "zcrystal";
|
|
@@ -248,7 +249,6 @@ declare const itemSchema: z.ZodObject<{
|
|
|
248
249
|
ingredient: "ingredient";
|
|
249
250
|
material: "material";
|
|
250
251
|
key: "key";
|
|
251
|
-
other: "other";
|
|
252
252
|
}>;
|
|
253
253
|
unholdable: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
254
254
|
}, z.core.$strip>;
|
|
@@ -259,9 +259,9 @@ declare const pokeballSchema: z.ZodObject<{
|
|
|
259
259
|
shortDesc: z.ZodString;
|
|
260
260
|
desc: z.ZodNullable<z.ZodString>;
|
|
261
261
|
category: z.ZodEnum<{
|
|
262
|
+
special: "special";
|
|
262
263
|
other: "other";
|
|
263
264
|
regular: "regular";
|
|
264
|
-
special: "special";
|
|
265
265
|
hisuian: "hisuian";
|
|
266
266
|
}>;
|
|
267
267
|
unusable: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
@@ -356,9 +356,9 @@ declare const natureSchema: z.ZodObject<{
|
|
|
356
356
|
id: z.ZodString;
|
|
357
357
|
name: z.ZodString;
|
|
358
358
|
raises: z.ZodNullable<z.ZodEnum<{
|
|
359
|
+
def: "def";
|
|
359
360
|
hp: "hp";
|
|
360
361
|
atk: "atk";
|
|
361
|
-
def: "def";
|
|
362
362
|
spa: "spa";
|
|
363
363
|
spd: "spd";
|
|
364
364
|
spe: "spe";
|
|
@@ -366,9 +366,9 @@ declare const natureSchema: z.ZodObject<{
|
|
|
366
366
|
eva: "eva";
|
|
367
367
|
}>>;
|
|
368
368
|
lowers: z.ZodNullable<z.ZodEnum<{
|
|
369
|
+
def: "def";
|
|
369
370
|
hp: "hp";
|
|
370
371
|
atk: "atk";
|
|
371
|
-
def: "def";
|
|
372
372
|
spa: "spa";
|
|
373
373
|
spd: "spd";
|
|
374
374
|
spe: "spe";
|
|
@@ -408,8 +408,8 @@ declare const moveSchema: z.ZodObject<{
|
|
|
408
408
|
accuracy: z.ZodCoercedNumber<unknown>;
|
|
409
409
|
pp: z.ZodCoercedNumber<unknown>;
|
|
410
410
|
category: z.ZodEnum<{
|
|
411
|
-
special: "special";
|
|
412
411
|
physical: "physical";
|
|
412
|
+
special: "special";
|
|
413
413
|
status: "status";
|
|
414
414
|
}>;
|
|
415
415
|
priority: z.ZodCoercedNumber<unknown>;
|
|
@@ -802,4 +802,4 @@ declare const pokemonSearchFilterSchema: z.ZodObject<{
|
|
|
802
802
|
}, z.core.$strip>;
|
|
803
803
|
//#endregion
|
|
804
804
|
export { pokemonSchema as A, onlineFeaturesSchema as C, pokedexEntrySchema as D, pokeballSchema as E, regionSchema as M, ribbonSchema as N, pokedexSchema as O, typeSchema as P, natureSchema as S, personalitySchema as T, modernBoxPresetIndexSchema as _, boxPresetMapSchema as a, modernBoxPresetTags as b, colorSchema as c, generationSchema as d, i18nTextSchema as f, modernBoxPresetBoxSchema as g, markSchema as h, boxPresetIndexItemSchema as i, pokemonSearchFilterSchema as j, pokemonRefsSchema as k, gameFeaturesSchema as l, languageSchema as m, boxPresetBoxPokemonSchema as n, boxPresetSchema as o, itemSchema as p, boxPresetBoxSchema as r, characterSchema as s, abilitySchema as t, gameSchema as u, modernBoxPresetSchema as v, originMarkSchema as w, moveSchema as x, modernBoxPresetSlotSchema as y };
|
|
805
|
-
//# sourceMappingURL=schemas-
|
|
805
|
+
//# sourceMappingURL=schemas-CiojUbKN.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas-
|
|
1
|
+
{"version":3,"file":"schemas-CiojUbKN.d.mts","names":[],"sources":["../src/lib/schemas.ts"],"mappings":";;;cAkEa,cAAA,EAAc,CAAA,CAAA,SAAA,CAAA,CAAA,CAAA,OAAA;;;;;;;;;;;;;cAEd,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKb,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;cAKjB,eAAA,EAAe,CAAA,CAAA,SAAA;;;;cAGf,WAAA,EAAW,CAAA,CAAA,SAAA;;;;;cAGX,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;cAwBlB,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;cAQpB,UAAA,EAAU,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,SAAA,GAAA,CAAA,CAAA,SAAA;;;;;;cASzB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;cAKlB,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cAWf,kBAAA,EAAkB,CAAA,CAAA,SAAA,CAAA,CAAA,CAAA,SAAA,EAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAAA,SAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cAElB,mBAAA;AAAA,cAUA,0BAAA,EAA0B,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,SAAA;AAAA,cAE1B,yBAAA,EAAyB,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,SAAA,GAAA,CAAA,CAAA,SAAA;;;;;;cAWzB,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;;;cAOxB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBrB,yBAAA,EAAyB,CAAA,CAAA,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-internal-Czgdbnkv.mjs","names":[],"sources":["../src/utils/utils-internal.ts"],"sourcesContent":["export function capitalizeFirstLetter(string: string): string {\n return string.charAt(0).toUpperCase() + string.slice(1)\n}\n\nexport function arrayUnique<T>(array: T[]): T[] {\n return Array.from(new Set(array))\n}\n\nexport function sanitizeSearchQuery(query?: string | null) {\n if (query === undefined || query === null) {\n return ''\n }\n return query\n .toLowerCase()\n .replace(/\\s{2,}/, ' ')\n .replace(/,/g, ' ')\n .replace(/\\s{2,}/, ' ')\n}\n\nexport function sanitizeFormStringSpaces(str: string | FormDataEntryValue | null | undefined) {\n if (!str) {\n return ''\n }\n return str.toString().replace(/\\s+/g, ' ').trim()\n}\n\nexport function splitSearchQueryTokens(query?: string | null): {\n positive: string[]\n negative: string[]\n} {\n const tokens = sanitizeSearchQuery(query).trim().split(/\\s+/).filter(Boolean)\n\n return tokens.reduce(\n (result, token) => {\n if (token.startsWith('!')) {\n const negatedToken = token.slice(1).trim()\n if (negatedToken) {\n result.negative.push(negatedToken)\n }\n } else {\n result.positive.push(token)\n }\n\n return result\n },\n { positive: [] as string[], negative: [] as string[] },\n )\n}\n\nexport function matchesSearchQuery(haystack: string, query?: string | null): boolean {\n const { positive, negative } = splitSearchQueryTokens(query)\n if (positive.length === 0 && negative.length === 0) {\n return true\n }\n\n const normalizedHaystack = sanitizeSearchQuery(haystack)\n\n return (\n positive.every((token) => normalizedHaystack.includes(token)) &&\n negative.every((token) => !normalizedHaystack.includes(token))\n )\n}\n"],"mappings":";AAAA,SAAgB,sBAAsB,QAAwB;CAC5D,OAAO,OAAO,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,OAAO,MAAM,CAAC;AACxD;AAEA,SAAgB,YAAe,OAAiB;CAC9C,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;AAClC;
|
|
1
|
+
{"version":3,"file":"utils-internal-Czgdbnkv.mjs","names":[],"sources":["../src/utils/utils-internal.ts"],"sourcesContent":["export function capitalizeFirstLetter(string: string): string {\n return string.charAt(0).toUpperCase() + string.slice(1)\n}\n\nexport function arrayUnique<T>(array: T[]): T[] {\n return Array.from(new Set(array))\n}\n\nexport function sortStringsInGivenOrder(strs: string[] | undefined, rightOrder: string[]) {\n return [...(strs ?? [])].sort((a, b) => {\n const aIndex = rightOrder.indexOf(a)\n const bIndex = rightOrder.indexOf(b)\n return aIndex - bIndex\n })\n}\n\nexport function sanitizeSearchQuery(query?: string | null) {\n if (query === undefined || query === null) {\n return ''\n }\n return query\n .toLowerCase()\n .replace(/\\s{2,}/, ' ')\n .replace(/,/g, ' ')\n .replace(/\\s{2,}/, ' ')\n}\n\nexport function sanitizeFormStringSpaces(str: string | FormDataEntryValue | null | undefined) {\n if (!str) {\n return ''\n }\n return str.toString().replace(/\\s+/g, ' ').trim()\n}\n\nexport function splitSearchQueryTokens(query?: string | null): {\n positive: string[]\n negative: string[]\n} {\n const tokens = sanitizeSearchQuery(query).trim().split(/\\s+/).filter(Boolean)\n\n return tokens.reduce(\n (result, token) => {\n if (token.startsWith('!')) {\n const negatedToken = token.slice(1).trim()\n if (negatedToken) {\n result.negative.push(negatedToken)\n }\n } else {\n result.positive.push(token)\n }\n\n return result\n },\n { positive: [] as string[], negative: [] as string[] },\n )\n}\n\nexport function matchesSearchQuery(haystack: string, query?: string | null): boolean {\n const { positive, negative } = splitSearchQueryTokens(query)\n if (positive.length === 0 && negative.length === 0) {\n return true\n }\n\n const normalizedHaystack = sanitizeSearchQuery(haystack)\n\n return (\n positive.every((token) => normalizedHaystack.includes(token)) &&\n negative.every((token) => !normalizedHaystack.includes(token))\n )\n}\n"],"mappings":";AAAA,SAAgB,sBAAsB,QAAwB;CAC5D,OAAO,OAAO,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,OAAO,MAAM,CAAC;AACxD;AAEA,SAAgB,YAAe,OAAiB;CAC9C,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;AAClC;AAUA,SAAgB,oBAAoB,OAAuB;CACzD,IAAI,UAAU,KAAA,KAAa,UAAU,MACnC,OAAO;CAET,OAAO,MACJ,YAAY,CAAC,CACb,QAAQ,UAAU,GAAG,CAAC,CACtB,QAAQ,MAAM,GAAG,CAAC,CAClB,QAAQ,UAAU,GAAG;AAC1B;AASA,SAAgB,uBAAuB,OAGrC;CAGA,OAFe,oBAAoB,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAEzD,CAAC,CAAC,QACX,QAAQ,UAAU;EACjB,IAAI,MAAM,WAAW,GAAG,GAAG;GACzB,MAAM,eAAe,MAAM,MAAM,CAAC,CAAC,CAAC,KAAK;GACzC,IAAI,cACF,OAAO,SAAS,KAAK,YAAY;EAErC,OACE,OAAO,SAAS,KAAK,KAAK;EAG5B,OAAO;CACT,GACA;EAAE,UAAU,CAAC;EAAe,UAAU,CAAC;CAAc,CACvD;AACF;AAEA,SAAgB,mBAAmB,UAAkB,OAAgC;CACnF,MAAM,EAAE,UAAU,aAAa,uBAAuB,KAAK;CAC3D,IAAI,SAAS,WAAW,KAAK,SAAS,WAAW,GAC/C,OAAO;CAGT,MAAM,qBAAqB,oBAAoB,QAAQ;CAEvD,OACE,SAAS,OAAO,UAAU,mBAAmB,SAAS,KAAK,CAAC,KAC5D,SAAS,OAAO,UAAU,CAAC,mBAAmB,SAAS,KAAK,CAAC;AAEjE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "pokopia-bubblybasin",
|
|
3
|
+
"name": "Bubbly Basin",
|
|
4
|
+
"gen": 0,
|
|
5
|
+
"nameSlug": "bubbly-basin",
|
|
6
|
+
"codename": null,
|
|
7
|
+
"type": "dlc",
|
|
8
|
+
"series": "spinoff",
|
|
9
|
+
"gameSet": "pokopia",
|
|
10
|
+
"gameSuperSet": null,
|
|
11
|
+
"releaseDate": "2026-08-05",
|
|
12
|
+
"region": "kanto",
|
|
13
|
+
"originMark": "none",
|
|
14
|
+
"pokedexes": ["pokopia-basin"],
|
|
15
|
+
"maxBoxes": 0,
|
|
16
|
+
"maxBoxSize": 0,
|
|
17
|
+
"platforms": ["switch2"],
|
|
18
|
+
"features": {
|
|
19
|
+
"storage": false,
|
|
20
|
+
"pokedex": true,
|
|
21
|
+
"training": false,
|
|
22
|
+
"shiny": false,
|
|
23
|
+
"items": false,
|
|
24
|
+
"gender": false,
|
|
25
|
+
"pokerus": false,
|
|
26
|
+
"nature": false,
|
|
27
|
+
"ribbons": false,
|
|
28
|
+
"marks": false,
|
|
29
|
+
"markings": false,
|
|
30
|
+
"shadow": false,
|
|
31
|
+
"ball": false,
|
|
32
|
+
"mega": false,
|
|
33
|
+
"zmove": false,
|
|
34
|
+
"gmax": false,
|
|
35
|
+
"alpha": false,
|
|
36
|
+
"tera": false,
|
|
37
|
+
"plusmvs": false,
|
|
38
|
+
"mints": false,
|
|
39
|
+
"sizes": false,
|
|
40
|
+
"abilities": false
|
|
41
|
+
}
|
|
42
|
+
}
|
package/data/games/pokopia.json
CHANGED
package/data/indices/games.json
CHANGED
|
@@ -157,9 +157,7 @@
|
|
|
157
157
|
{ "pid": "oricorio-pau", "dexNum": 115, "isForm": true },
|
|
158
158
|
{ "pid": "oricorio-sensu", "dexNum": 115, "isForm": true },
|
|
159
159
|
{ "pid": "sandshrew", "dexNum": 116, "isForm": false },
|
|
160
|
-
{ "pid": "sandshrew-alola", "dexNum": 116, "isForm": true },
|
|
161
160
|
{ "pid": "sandslash", "dexNum": 117, "isForm": false },
|
|
162
|
-
{ "pid": "sandslash-alola", "dexNum": 117, "isForm": true },
|
|
163
161
|
{ "pid": "gastly", "dexNum": 118, "isForm": false },
|
|
164
162
|
{ "pid": "haunter", "dexNum": 119, "isForm": false },
|
|
165
163
|
{ "pid": "gengar", "dexNum": 120, "isForm": false },
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "pokopia-basin",
|
|
3
|
+
"name": "Pokopia Basin Pokédex",
|
|
4
|
+
"gen": 0,
|
|
5
|
+
"region": "kanto",
|
|
6
|
+
"isNational": false,
|
|
7
|
+
"baseDex": "pokopia",
|
|
8
|
+
"pkApiId": null,
|
|
9
|
+
"entries": [
|
|
10
|
+
{ "pid": "shellder", "dexNum": 1, "isForm": false },
|
|
11
|
+
{ "pid": "cloyster", "dexNum": 2, "isForm": false },
|
|
12
|
+
{ "pid": "horsea", "dexNum": 3, "isForm": false },
|
|
13
|
+
{ "pid": "seadra", "dexNum": 4, "isForm": false },
|
|
14
|
+
{ "pid": "kingdra", "dexNum": 5, "isForm": false },
|
|
15
|
+
{ "pid": "staryu", "dexNum": 6, "isForm": false },
|
|
16
|
+
{ "pid": "starmie", "dexNum": 7, "isForm": false },
|
|
17
|
+
{ "pid": "totodile", "dexNum": 8, "isForm": false },
|
|
18
|
+
{ "pid": "croconaw", "dexNum": 9, "isForm": false },
|
|
19
|
+
{ "pid": "feraligatr", "dexNum": 10, "isForm": false },
|
|
20
|
+
{ "pid": "chinchou", "dexNum": 11, "isForm": false },
|
|
21
|
+
{ "pid": "lanturn", "dexNum": 12, "isForm": false },
|
|
22
|
+
{ "pid": "corsola", "dexNum": 13, "isForm": false },
|
|
23
|
+
{ "pid": "mudkip", "dexNum": 14, "isForm": false },
|
|
24
|
+
{ "pid": "marshtomp", "dexNum": 15, "isForm": false },
|
|
25
|
+
{ "pid": "swampert", "dexNum": 16, "isForm": false },
|
|
26
|
+
{ "pid": "carvanha", "dexNum": 17, "isForm": false },
|
|
27
|
+
{ "pid": "sharpedo", "dexNum": 18, "isForm": false },
|
|
28
|
+
{ "pid": "barboach", "dexNum": 19, "isForm": false },
|
|
29
|
+
{ "pid": "whiscash", "dexNum": 20, "isForm": false },
|
|
30
|
+
{ "pid": "corphish", "dexNum": 21, "isForm": false },
|
|
31
|
+
{ "pid": "crawdaunt", "dexNum": 22, "isForm": false },
|
|
32
|
+
{ "pid": "luvdisc", "dexNum": 23, "isForm": false },
|
|
33
|
+
{ "pid": "buizel", "dexNum": 24, "isForm": false },
|
|
34
|
+
{ "pid": "floatzel", "dexNum": 25, "isForm": false },
|
|
35
|
+
{ "pid": "finneon", "dexNum": 26, "isForm": false },
|
|
36
|
+
{ "pid": "lumineon", "dexNum": 27, "isForm": false },
|
|
37
|
+
{ "pid": "frillish", "dexNum": 28, "isForm": false },
|
|
38
|
+
{ "pid": "frillish-f", "dexNum": 28, "isForm": true },
|
|
39
|
+
{ "pid": "jellicent", "dexNum": 29, "isForm": false },
|
|
40
|
+
{ "pid": "jellicent-f", "dexNum": 29, "isForm": true },
|
|
41
|
+
{ "pid": "alomomola", "dexNum": 30, "isForm": false },
|
|
42
|
+
{ "pid": "stunfisk", "dexNum": 31, "isForm": false },
|
|
43
|
+
{ "pid": "inkay", "dexNum": 32, "isForm": false },
|
|
44
|
+
{ "pid": "malamar", "dexNum": 33, "isForm": false },
|
|
45
|
+
{ "pid": "popplio", "dexNum": 34, "isForm": false },
|
|
46
|
+
{ "pid": "brionne", "dexNum": 35, "isForm": false },
|
|
47
|
+
{ "pid": "primarina", "dexNum": 36, "isForm": false },
|
|
48
|
+
{ "pid": "mareanie", "dexNum": 37, "isForm": false },
|
|
49
|
+
{ "pid": "toxapex", "dexNum": 38, "isForm": false },
|
|
50
|
+
{ "pid": "wimpod", "dexNum": 39, "isForm": false },
|
|
51
|
+
{ "pid": "golisopod", "dexNum": 40, "isForm": false },
|
|
52
|
+
{ "pid": "bruxish", "dexNum": 41, "isForm": false },
|
|
53
|
+
{ "pid": "dhelmise", "dexNum": 42, "isForm": false },
|
|
54
|
+
{ "pid": "chewtle", "dexNum": 43, "isForm": false },
|
|
55
|
+
{ "pid": "drednaw", "dexNum": 44, "isForm": false },
|
|
56
|
+
{ "pid": "pincurchin", "dexNum": 45, "isForm": false },
|
|
57
|
+
{ "pid": "wiglett", "dexNum": 46, "isForm": false },
|
|
58
|
+
{ "pid": "wugtrio", "dexNum": 47, "isForm": false },
|
|
59
|
+
{ "pid": "veluza", "dexNum": 48, "isForm": false },
|
|
60
|
+
{ "pid": "phione", "dexNum": 49, "isForm": false },
|
|
61
|
+
{ "pid": "manaphy", "dexNum": 50, "isForm": false }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
"gen": 0,
|
|
5
5
|
"region": "kanto",
|
|
6
6
|
"isNational": false,
|
|
7
|
-
"baseDex":
|
|
7
|
+
"baseDex": "pokopia",
|
|
8
8
|
"pkApiId": null,
|
|
9
9
|
"entries": [
|
|
10
10
|
{ "pid": "hoppip", "dexNum": 1, "isForm": false },
|
|
11
11
|
{ "pid": "skiploom", "dexNum": 2, "isForm": false },
|
|
12
|
-
{ "pid": "jumpluff", "dexNum": 3, "isForm": false }
|
|
12
|
+
{ "pid": "jumpluff", "dexNum": 3, "isForm": false },
|
|
13
|
+
{ "pid": "sableye", "dexNum": 4, "isForm": false },
|
|
14
|
+
{ "pid": "jirachi", "dexNum": 5, "isForm": false },
|
|
15
|
+
{ "pid": "feebas", "dexNum": 6, "isForm": false },
|
|
16
|
+
{ "pid": "milotic", "dexNum": 7, "isForm": false }
|
|
13
17
|
]
|
|
14
18
|
}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"debutIn": "sv",
|
|
37
37
|
"obtainableIn": ["go", "sv-s", "sv-v", "lza"],
|
|
38
38
|
"eventOnlyIn": [],
|
|
39
|
-
"storableIn": ["go", "home", "sv-s", "sv-v", "lza"],
|
|
39
|
+
"storableIn": ["go", "home", "sv-s", "sv-v", "lza", "champions"],
|
|
40
40
|
"shinyReleased": true,
|
|
41
41
|
"baseHp": 110,
|
|
42
42
|
"baseAtk": 115,
|
|
@@ -85,7 +85,8 @@
|
|
|
85
85
|
"bdsp-sp",
|
|
86
86
|
"sv-s",
|
|
87
87
|
"sv-v",
|
|
88
|
-
"lza"
|
|
88
|
+
"lza",
|
|
89
|
+
"champions"
|
|
89
90
|
],
|
|
90
91
|
"shinyReleased": true,
|
|
91
92
|
"baseHp": 80,
|
|
@@ -113,7 +114,11 @@
|
|
|
113
114
|
},
|
|
114
115
|
"evolvesFrom": "combusken",
|
|
115
116
|
"evoFromLevel": 36,
|
|
116
|
-
"names": {
|
|
117
|
+
"names": {
|
|
118
|
+
"eng": "Blaziken (Female)",
|
|
119
|
+
"fra": "Braségali (Female)",
|
|
120
|
+
"deu": "Lohgock (Female)"
|
|
121
|
+
},
|
|
117
122
|
"genus": {
|
|
118
123
|
"eng": "Blaze Pokémon",
|
|
119
124
|
"esp": "Pokémon Llameante",
|