This commit is contained in:
adueck 2022-10-12 12:35:48 +05:00
parent de7abbffa2
commit a976b60f20
5 changed files with 5731 additions and 5722 deletions

11356
functions/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +1,37 @@
{
"name": "functions",
"scripts": {
"build": "tsc",
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "16"
},
"main": "lib/functions/src/index.js",
"dependencies": {
"@google-cloud/storage": "^5.8.1",
"@lingdocs/inflect": "5.1.2",
"@types/cors": "^2.8.10",
"@types/google-spreadsheet": "^3.0.2",
"@types/react": "^18.0.21",
"cors": "^2.8.5",
"firebase-admin": "^9.2.0",
"firebase-functions": "^3.24.1",
"google-spreadsheet": "^3.1.15",
"nano": "^9.0.3",
"node-fetch": "^2.6.1",
"react": "^17.0.1",
"react-bootstrap": "^1.5.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@types/jest": "^26.0.20",
"@types/node-fetch": "^2.5.12",
"firebase-functions-test": "^0.2.0",
"typescript": "^4.6.3"
}
}
"name": "functions",
"scripts": {
"build": "tsc",
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "16"
},
"main": "lib/functions/src/index.js",
"dependencies": {
"@google-cloud/storage": "^5.8.1",
"@lingdocs/inflect": "5.1.3",
"@types/cors": "^2.8.10",
"@types/google-spreadsheet": "^3.0.2",
"@types/react": "^18.0.21",
"cors": "^2.8.5",
"firebase-admin": "^9.2.0",
"firebase-functions": "^3.24.1",
"google-spreadsheet": "^3.1.15",
"nano": "^9.0.3",
"node-fetch": "^2.6.1",
"react": "^17.0.1",
"react-bootstrap": "^1.5.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@types/jest": "^26.0.20",
"@types/node-fetch": "^2.5.12",
"firebase-functions-test": "^0.2.0",
"typescript": "^4.6.3"
}
}

View File

@ -103,7 +103,16 @@ async function getRawEntries(): Promise<T.DictionaryEntry[]> {
}
function makeEntries(rows: any[], deleteRow: (r: number) => Promise<void>): T.DictionaryEntry[] {
const entries: T.DictionaryEntry[] = rows.map((row): T.DictionaryEntry => {
const entries: T.DictionaryEntry[] = [];
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
const nextRow = rows[i+1] || undefined;
if (row.ts === nextRow?.ts) {
// this looks like a duplicate entry made by the sheets api
// delete it and keep going
deleteRow(i);
continue;
}
const e: T.DictionaryEntry = {
i: 1,
ts: parseInt(row.ts),
@ -121,8 +130,8 @@ function makeEntries(rows: any[], deleteRow: (r: number) => Promise<void>): T.Di
dictionaryEntryBooleanFields.forEach((field: T.DictionaryEntryBooleanField) => {
if (row[field]) e[field] = true;
});
return standardizeEntry(e);
});
entries.push(standardizeEntry(e));
}
// add alphabetical index
entries.sort((a, b) => a.p.localeCompare(b.p, "ps"));
const entriesLength = entries.length;

View File

@ -7,7 +7,7 @@
"private": true,
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.2",
"@lingdocs/ps-react": "5.1.2",
"@lingdocs/ps-react": "5.1.3",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",

View File

@ -2349,10 +2349,10 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
"@lingdocs/ps-react@5.1.2":
version "5.1.2"
resolved "https://npm.lingdocs.com/@lingdocs%2fps-react/-/ps-react-5.1.2.tgz#16f318208e46010b069ba06ffec88b3c85c398be"
integrity sha512-Nyq/ACZej0BcV/3ePIH0CJRoCq/Ekw7gFHp8JFPBMUzYQcgLOB+Ad64CqsTNnljGzOQNEGsDQPz1+upO3Lux+g==
"@lingdocs/ps-react@5.1.3":
version "5.1.3"
resolved "https://npm.lingdocs.com/@lingdocs%2fps-react/-/ps-react-5.1.3.tgz#84a6e4eef606cdd73f818d2c5f5ebabd5c989ffe"
integrity sha512-qLlTLr56zSWd5xWgVk/2EynSWwsTwOu1/9tfkIbzWGDzo8xPXONqhDdpNpK7xhyj4RrUZqwtflym4FOjrdNa1g==
dependencies:
"@formkit/auto-animate" "^1.0.0-beta.3"
classnames "^2.2.6"