From 4847a6bd9c8b33df061921418b35547c1b50a683 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sun, 17 Nov 2024 11:48:56 +0100 Subject: [PATCH] Revert "infra: unique and sort person script" This reverts commit 10f3ff720faf45dfab035ce491fc4d7447612c24. --- scripts/generate-locales.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index a7a135cf444..13fe70fd26f 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -18,7 +18,6 @@ import { constants } from 'node:fs'; import { access, readFile, readdir, stat, writeFile } from 'node:fs/promises'; import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; -import type { PersonEntryDefinition } from '../dist'; import type { LocaleDefinition, MetadataDefinition } from '../src/definitions'; import { keys } from '../src/internal/keys'; import { formatMarkdown, formatTypescript } from './apidocs/utils/format'; @@ -327,25 +326,6 @@ async function updateLocaleFileHook( console.log(`${filePath} <-> ${locale} @ ${definitionKey} -> ${entryName}`); } - if (definitionKey === 'person' && entryName != null) { - const { default: data } = (await import(`file:${filePath}`)) as { - default: PersonEntryDefinition; - }; - const { female = [], generic = [], male = [] } = data ?? {}; - - const newData = { - generic: generic.length > 0 ? [...new Set(generic)].sort() : undefined, - female: female.length > 0 ? [...new Set(female)].sort() : undefined, - male: male.length > 0 ? [...new Set(male)].sort() : undefined, - }; - - const newContent = `export default ${JSON.stringify(newData)};`; - - if (female.length > 0 || generic.length > 0 || male.length > 0) { - await writeFile(filePath, await formatTypescript(newContent)); - } - } - return normalizeLocaleFile(filePath, definitionKey); }