diff --git a/account/package-lock.json b/account/package-lock.json index 04fcf0e..b6e8482 100644 --- a/account/package-lock.json +++ b/account/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@lingdocs/inflect": "5.3.2", + "@lingdocs/inflect": "5.4.2", "base64url": "^3.0.1", "bcryptjs": "^2.4.3", "connect-redis": "^6.0.0", @@ -124,9 +124,9 @@ } }, "node_modules/@lingdocs/inflect": { - "version": "5.3.2", - "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.3.2.tgz", - "integrity": "sha512-5P/N+kKcbtcNv4bqAG+xGdaZAzVyPYvmudTZ614SaaN4lJraTrG81FtlUsqeDLMf+yW5IJcfgE31a1mr6t7gGQ==", + "version": "5.4.2", + "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.4.2.tgz", + "integrity": "sha512-AV/RwKPRtWJ+eRL7r/50LvfZJyjK0H425j5IBkObYsr9wCHNHiEewZtSm+T4NWME3YEYZVt7O58dqQBxlumefw==", "license": "MIT", "dependencies": { "pbf": "^3.2.1", @@ -2741,9 +2741,9 @@ } }, "@lingdocs/inflect": { - "version": "5.3.2", - "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.3.2.tgz", - "integrity": "sha512-5P/N+kKcbtcNv4bqAG+xGdaZAzVyPYvmudTZ614SaaN4lJraTrG81FtlUsqeDLMf+yW5IJcfgE31a1mr6t7gGQ==", + "version": "5.4.2", + "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.4.2.tgz", + "integrity": "sha512-AV/RwKPRtWJ+eRL7r/50LvfZJyjK0H425j5IBkObYsr9wCHNHiEewZtSm+T4NWME3YEYZVt7O58dqQBxlumefw==", "requires": { "pbf": "^3.2.1", "rambda": "^7.3.0" diff --git a/account/package.json b/account/package.json index 2ac9a6b..d8813c2 100644 --- a/account/package.json +++ b/account/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@lingdocs/inflect": "5.3.2", + "@lingdocs/inflect": "5.4.2", "base64url": "^3.0.1", "bcryptjs": "^2.4.3", "connect-redis": "^6.0.0", diff --git a/account/yarn.lock b/account/yarn.lock index 4023e7c..db843ae 100644 --- a/account/yarn.lock +++ b/account/yarn.lock @@ -45,10 +45,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@lingdocs/inflect@5.3.2": - "integrity" "sha512-5P/N+kKcbtcNv4bqAG+xGdaZAzVyPYvmudTZ614SaaN4lJraTrG81FtlUsqeDLMf+yW5IJcfgE31a1mr6t7gGQ==" - "resolved" "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.3.2.tgz" - "version" "5.3.2" +"@lingdocs/inflect@5.4.2": + "integrity" "sha512-AV/RwKPRtWJ+eRL7r/50LvfZJyjK0H425j5IBkObYsr9wCHNHiEewZtSm+T4NWME3YEYZVt7O58dqQBxlumefw==" + "resolved" "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.4.2.tgz" + "version" "5.4.2" dependencies: "pbf" "^3.2.1" "rambda" "^7.3.0" diff --git a/functions/package-lock.json b/functions/package-lock.json index a84462f..639c657 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -7,7 +7,7 @@ "name": "functions", "dependencies": { "@google-cloud/storage": "^5.8.1", - "@lingdocs/inflect": "5.3.2", + "@lingdocs/inflect": "5.4.2", "@types/cors": "^2.8.10", "@types/google-spreadsheet": "^3.0.2", "@types/react": "^18.0.21", @@ -1468,9 +1468,9 @@ } }, "node_modules/@lingdocs/inflect": { - "version": "5.3.2", - "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.3.2.tgz", - "integrity": "sha512-5P/N+kKcbtcNv4bqAG+xGdaZAzVyPYvmudTZ614SaaN4lJraTrG81FtlUsqeDLMf+yW5IJcfgE31a1mr6t7gGQ==", + "version": "5.4.2", + "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.4.2.tgz", + "integrity": "sha512-AV/RwKPRtWJ+eRL7r/50LvfZJyjK0H425j5IBkObYsr9wCHNHiEewZtSm+T4NWME3YEYZVt7O58dqQBxlumefw==", "license": "MIT", "dependencies": { "pbf": "^3.2.1", @@ -8050,9 +8050,9 @@ } }, "@lingdocs/inflect": { - "version": "5.3.2", - "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.3.2.tgz", - "integrity": "sha512-5P/N+kKcbtcNv4bqAG+xGdaZAzVyPYvmudTZ614SaaN4lJraTrG81FtlUsqeDLMf+yW5IJcfgE31a1mr6t7gGQ==", + "version": "5.4.2", + "resolved": "https://npm.lingdocs.com/@lingdocs%2finflect/-/inflect-5.4.2.tgz", + "integrity": "sha512-AV/RwKPRtWJ+eRL7r/50LvfZJyjK0H425j5IBkObYsr9wCHNHiEewZtSm+T4NWME3YEYZVt7O58dqQBxlumefw==", "requires": { "pbf": "^3.2.1", "rambda": "^7.3.0" diff --git a/functions/package.json b/functions/package.json index d1fe3a7..c648fca 100644 --- a/functions/package.json +++ b/functions/package.json @@ -15,7 +15,7 @@ "main": "lib/functions/src/index.js", "dependencies": { "@google-cloud/storage": "^5.8.1", - "@lingdocs/inflect": "5.3.2", + "@lingdocs/inflect": "5.4.2", "@types/cors": "^2.8.10", "@types/google-spreadsheet": "^3.0.2", "@types/react": "^18.0.21", diff --git a/functions/src/publish.ts b/functions/src/publish.ts index ab7cc45..e3f8caa 100644 --- a/functions/src/publish.ts +++ b/functions/src/publish.ts @@ -31,6 +31,7 @@ const dictionaryInfoFilename = "dict-info"; // const hunspellAffFileFilename = "ps_AFF.aff"; // const hunspellDicFileFilename = "ps_AFF.dic"; const allWordsJsonFilename = "all-words.json"; +const allWordsInfoFilename = "all-words-info.json"; const url = `${baseUrl}${dictionaryFilename}`; const infoUrl = `${baseUrl}${dictionaryInfoFilename}`; @@ -61,23 +62,21 @@ export default async function publish(): Promise { } uploadDictionaryToStorage(dictionary).catch(console.error); // TODO: make this async and run after publish response - doHunspellEtc(entries).catch(console.error); + doHunspellEtc(dictionary.info, entries).catch(console.error); return { ok: true, info: dictionary.info }; } -async function doHunspellEtc(entries: T.DictionaryEntry[]) { - console.log("getting word list"); +async function doHunspellEtc(info: T.DictionaryInfo, entries: T.DictionaryEntry[]) { const wordlistResponse = getWordList(entries); - console.log("got word list length", wordlistResponse.ok && wordlistResponse.wordlist.length); if (!wordlistResponse.ok) { throw new Error(JSON.stringify(wordlistResponse.errors)); } // const hunspell = makeHunspell(wordlistResponse.wordlist); // await uploadHunspellToStorage(hunspell); - await uploadAllWordsToStoarage(wordlistResponse.wordlist) + await uploadAllWordsToStoarage(info, wordlistResponse.wordlist) } /** @@ -236,8 +235,9 @@ async function upload(content: Buffer | string, filename: string) { // ]); // } -async function uploadAllWordsToStoarage(words: T.PsString[]) { - await upload(JSON.stringify(words), allWordsJsonFilename) +async function uploadAllWordsToStoarage(info: T.DictionaryInfo, words: T.PsString[]) { + await upload(JSON.stringify({ info, words }), allWordsJsonFilename); + await upload(JSON.stringify(info), allWordsInfoFilename); } async function uploadDictionaryToStorage(dictionary: T.Dictionary) { diff --git a/website/package.json b/website/package.json index 3618efa..e085d2a 100644 --- a/website/package.json +++ b/website/package.json @@ -7,7 +7,7 @@ "private": true, "dependencies": { "@fortawesome/fontawesome-free": "^5.15.2", - "@lingdocs/ps-react": "5.3.2", + "@lingdocs/ps-react": "5.4.2", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", diff --git a/website/yarn.lock b/website/yarn.lock index f1a6ef7..e43b8ec 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2349,10 +2349,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@lingdocs/ps-react@5.3.2": - version "5.3.2" - resolved "https://npm.lingdocs.com/@lingdocs%2fps-react/-/ps-react-5.3.2.tgz#ef0385df5463cd90b8a991f9bc2b4f132474c070" - integrity sha512-A9tuVZfSSjiS2tdFy/1w9lFo3g8Lgq3kMDzYIb6NuoGRcVVgAXhFihHY7U9RBiLrTmg65R8PIxiKYvjHUtEEKg== +"@lingdocs/ps-react@5.4.2": + version "5.4.2" + resolved "https://npm.lingdocs.com/@lingdocs%2fps-react/-/ps-react-5.4.2.tgz#cb6b7e665568f4c5d20d8ace032c87ac5baab1ff" + integrity sha512-P0gMe8GG5DKM5xGbXP1zt+J1Gga+Lzm27K75VEc07IiBwJ5l2CKtc5freqv02/qUPAwVauRNAoK68VTMm5TrLA== dependencies: "@formkit/auto-animate" "^1.0.0-beta.3" classnames "^2.2.6"