-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
1,208 additions
and
1,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
/parcel-bundle-reports | ||
|
||
/isolate-*.log | ||
|
||
/diffcompare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
})(); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.