diff --git a/package.json b/package.json index f60aef8f..e4b99444 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "format": "npx prettier --write .", "check-lint": "eslint . --ext ts --ext tsx --ext js", "pre-commit": "npm run check-format && npm run check-lint && npm run check-types", - "update-projects": "node updateProject.js" + "update-projects": "node updateProject.mjs" }, "dependencies": { "clsx": "^2.0.0", diff --git a/updateProject.js b/updateProject.mjs similarity index 94% rename from updateProject.js rename to updateProject.mjs index c739dc14..442a6195 100644 --- a/updateProject.js +++ b/updateProject.mjs @@ -1,6 +1,10 @@ -// updateProjects.js -const fs = require("fs"); -const path = require("path"); +// updateProjects.mjs +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); async function getCurrentProjects() { const query = `query getCurrentProjects {