Use ESM syntax for compatability key script.

This commit is contained in:
Dillon Kearns 2023-02-07 10:27:34 -08:00
parent 3ef54d6275
commit 5613cbc028
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,3 @@
export const compatibilityKey = 6;
// TODO make it more automated to keep this in sync with package.json
export const packageVersion = "3.0.0-beta.20";

View File

@ -1,8 +1,11 @@
#!/usr/bin/node
const fs = require("node:fs");
import * as fs from "node:fs";
const currentCompatibilityKey = 6;
const currentPackageVersion = JSON.parse(
fs.readFileSync("./package.json")
).version;
fs.writeFileSync(
"src/Pages/Internal/Platform/CompatibilityKey.elm",
@ -17,7 +20,9 @@ currentCompatibilityKey =
fs.writeFileSync(
"generator/src/compatibility-key.js",
`module.exports = { compatibilityKey: ${currentCompatibilityKey} };
`export const compatibilityKey = ${currentCompatibilityKey};
export const packageVersion = "${currentPackageVersion}";
`
);