feat: add npm audit script, crowdin helpers now write data to disk
Node.js CI / Lint and Test (push) Failing after 34s

This commit is contained in:
2025-09-08 16:55:45 -07:00
parent 3541fdc411
commit b8d8ad35f9
11 changed files with 522 additions and 11 deletions
+41
View File
@@ -0,0 +1,41 @@
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { writeFile } from "node:fs/promises";
import { join } from "node:path";
import { getFiles } from "./utils/getFiles.js";
import { getStrings } from "./utils/getStrings.js";
const projectId = process.env.CROWDIN_PROJECT_ID;
const apiUrl = process.env.CROWDIN_API_URL;
const token = process.env.CROWDIN_TOKEN;
if (
projectId === undefined
|| projectId === ""
|| apiUrl === undefined
|| apiUrl === ""
|| token === undefined
|| token === ""
) {
throw new Error(`Project ID or API URL is missing! Did you run this script with 'op run'?`);
}
const files = await getFiles(projectId, apiUrl, token);
const strings = await getStrings(projectId, apiUrl, token);
await writeFile(
join(import.meta.dirname, "..", "..", "data", "crowdin-files.json"),
JSON.stringify(files, null, 2),
"utf-8",
);
await writeFile(
join(import.meta.dirname, "..", "..", "data", "crowdin-strings.json"),
JSON.stringify(strings, null, 2),
"utf-8",
);
console.log("Loaded files and strings!");