Skip to content

Commit

Permalink
Bump many deps
Browse files Browse the repository at this point in the history
Should be no change in functionality.
  • Loading branch information
nattthebear committed Mar 17, 2024
1 parent 5f31af6 commit 4641f79
Show file tree
Hide file tree
Showing 8 changed files with 1,208 additions and 1,131 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
/parcel-bundle-reports

/isolate-*.log

/diffcompare
33 changes: 33 additions & 0 deletions diffCompare.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as prettier from "prettier";
import { readdir, readFile, writeFile } from "node:fs/promises";

// Assumes the old build is in docs/ and the new build is in diff/
async function readdirRelativeNames(path: string) {
return (await readdir(path)).map(item => path + "/" + item);
}

const extensionsToParsers: { extension: string, parser: prettier.BuiltInParserName }[] = [
{ extension: "html", parser: "html" },
{ extension: "js", parser: "typescript" },
{ extension: "css", parser: "css" },
];

async function doFile(extension: string, parser: prettier.BuiltInParserName, names: string[], outName: string) {
names = names.filter(s => s.endsWith("." + extension));
if (names.length !== 1) {
throw new Error(`Couldn't find extension ${extension}`);
}
const content = await readFile(names[0], "utf-8");
const pretty = await prettier.format(content, { parser });
await writeFile(`./diffcompare/${outName}.${extension}`, pretty, "utf-8");
}

(async () => {
const oldFiles = await readdirRelativeNames("./docs");
const newFiles = await readdirRelativeNames("./build");

for (const { extension, parser } of extensionsToParsers) {
await doFile(extension, parser, oldFiles, "old");
await doFile(extension, parser, newFiles, "new");
}
})();
10 changes: 10 additions & 0 deletions docs/index.18de7e71.js

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions docs/index.378c7830.js

This file was deleted.

4 changes: 2 additions & 2 deletions docs/index.b38c99fa.css → docs/index.951fcd51.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="icon" href="data:,"><title>Final Fantasy 12 Character Planner</title><link rel="stylesheet" href="index.b38c99fa.css"><script defer type="module" src="index.378c7830.js"></script></head><body></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="icon" href="data:,"><title>Final Fantasy 12 Character Planner</title><link rel="stylesheet" href="index.951fcd51.css"><script defer type="module" src="index.18de7e71.js"></script></head><body></body></html>
Loading

0 comments on commit 4641f79

Please sign in to comment.