Skip to content

Commit

Permalink
style: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
benelan committed Jul 14, 2023
1 parent db92c55 commit 06074cb
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 55 deletions.
4 changes: 2 additions & 2 deletions docs/global.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down Expand Up @@ -857,7 +857,7 @@ <h3>Global</h3>
<footer>
Documentation generated by
<a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Jul 13
2023 18:19:15 GMT-0700 (Pacific Daylight Time)
2023 18:34:29 GMT-0700 (Pacific Daylight Time)
</footer>

<script>
Expand Down
11 changes: 9 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down Expand Up @@ -101,6 +101,13 @@ <h3>Arguments</h3>
<li>Path to the build directory</li>
</ul>
<h3>Options</h3>
<p><strong>-l, --loader [boolean]</strong></p>
<ul>
<li>
Show a loading animation while determining the build size
(doesn't work when executed via npx)
</li>
</ul>
<p><strong>-b, --binary [boolean]</strong></p>
<ul>
<li>
Expand Down Expand Up @@ -302,7 +309,7 @@ <h3>Global</h3>
<footer>
Documentation generated by
<a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Jul 13
2023 18:19:15 GMT-0700 (Pacific Daylight Time)
2023 18:34:29 GMT-0700 (Pacific Daylight Time)
</footer>

<script>
Expand Down
32 changes: 16 additions & 16 deletions docs/index.js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down Expand Up @@ -46,7 +46,7 @@ <h1 class="page-title">Source: index.js</h1>
if (!bytes) return "0 B";
const k = binary ? 1024 : 1000;
const n = Math.floor(
binary ? Math.log10(bytes) / 3 : Math.log2(bytes) / 10
binary ? Math.log10(bytes) / 3 : Math.log2(bytes) / 10,
);

// I prefer human readable sizes, don't like it? byte me!
Expand All @@ -62,7 +62,7 @@ <h1 class="page-title">Source: index.js</h1>
"\n decimals:",
decimals,
"\n binary:",
binary
binary,
);
}
}
Expand All @@ -87,7 +87,7 @@ <h1 class="page-title">Source: index.js</h1>
} else {
// recursive calls for subdirectories
const subdirectoryFiles = await getFiles(
resolve(directoryPath, item.name)
resolve(directoryPath, item.name),
);

files.push(...subdirectoryFiles);
Expand All @@ -99,14 +99,14 @@ <h1 class="page-title">Source: index.js</h1>
if (err.code === "ENOENT") {
help(
"Error: Could not find build at specified path:\n ",
directoryPath
directoryPath,
);
} else {
help(
err,
"\n\nOccurred while finding build files.",
"Double check the file path:\n ",
directoryPath
directoryPath,
);
}
}
Expand Down Expand Up @@ -137,8 +137,8 @@ <h1 class="page-title">Source: index.js</h1>
err,
"\n\nOccurred while getting gzipped file size.",
"Double check the file path:\n ",
filePath
)
filePath,
),
);

/**
Expand All @@ -156,8 +156,8 @@ <h1 class="page-title">Source: index.js</h1>
err,
"\n\nOccurred while getting brotli compressed file size.",
"Double check the file path:\n ",
filePath
)
filePath,
),
);

/**
Expand All @@ -175,7 +175,7 @@ <h1 class="page-title">Source: index.js</h1>
// the file with the largest size by type
const mainBundleFile = filteredBuildFiles.length
? filteredBuildFiles.reduce((max, file) =>
max.size > file.size ? max : file
max.size > file.size ? max : file,
)
: null;

Expand Down Expand Up @@ -219,7 +219,7 @@ <h1 class="page-title">Source: index.js</h1>
"\n build path:",
resolve(buildPath),
"\n bundle filetype:",
bundleFileType
bundleFileType,
);
}
}
Expand All @@ -240,7 +240,7 @@ <h1 class="page-title">Source: index.js</h1>
} catch (err) {
if (err.code === "ENOENT" &amp;&amp; err.path === "package.json")
console.warn(
"No package.json file found in the current working directory. The package version will not be specified.\n"
"No package.json file found in the current working directory. The package version will not be specified.\n",
);
}

Expand Down Expand Up @@ -273,7 +273,7 @@ <h1 class="page-title">Source: index.js</h1>
err,
"\n\nOccurred while saving build sizes.",
"Double check the output path:\n ",
resolve(outputPath)
resolve(outputPath),
);
}
}
Expand All @@ -293,7 +293,7 @@ <h1 class="page-title">Source: index.js</h1>
function help(...messages) {
messages &amp;&amp; console.error(...messages);
console.error(
"\nAdd the -h or --help flag for usage information when on the CLI.\n\nRead the documentation for assistance with the exported functions:\n https://benelan.github.io/build-sizes/global.html\n"
"\nAdd the -h or --help flag for usage information when on the CLI.\n\nRead the documentation for assistance with the exported functions:\n https://benelan.github.io/build-sizes/global.html\n",
);
process.exit(1);
}
Expand Down Expand Up @@ -358,7 +358,7 @@ <h3>Global</h3>
<footer>
Documentation generated by
<a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Jul 13
2023 18:19:15 GMT-0700 (Pacific Daylight Time)
2023 18:34:29 GMT-0700 (Pacific Daylight Time)
</footer>

<script>
Expand Down
8 changes: 4 additions & 4 deletions docs/scripts/prettify/lang-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ PR.registerLangHandler(
["lit", /^#[\da-f]{3,6}/i],
["pln", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],
["pun", /^[^\s\w"']+/],
]
],
),
["css"]
["css"],
);
PR.registerLangHandler(
PR.createSimpleLexer(
[],
[["kwd", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]
[["kwd", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]],
),
["css-kw"]
["css-kw"],
);
PR.registerLangHandler(PR.createSimpleLexer([], [["str", /^[^"')]+/]]), [
"css-str",
Expand Down
26 changes: 13 additions & 13 deletions docs/scripts/prettify/prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
var f = a
.substring(1, a.length - 1)
.match(
/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g
/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g,
),
a = [],
b = [],
Expand Down Expand Up @@ -75,7 +75,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
function y(a) {
for (
var f = a.source.match(
/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g
/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g,
),
b = f.length,
d = [],
Expand Down Expand Up @@ -121,7 +121,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
if (g.ignoreCase) l = !0;
else if (
/[a-z]/i.test(
g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi, "")
g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi, ""),
)
) {
s = !0;
Expand Down Expand Up @@ -322,7 +322,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
"0123456789",
],
["pln", /^\\[\S\s]?/, q],
["pun", /^.[^\s\w"-$'./@\\`]*/, q]
["pun", /^.[^\s\w"-$'./@\\`]*/, q],
);
return x(m, e);
}
Expand Down Expand Up @@ -539,9 +539,9 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
["lang-js", /^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],
["lang-css", /^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],
["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i],
]
],
),
["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"]
["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"],
);
k(
x(
Expand All @@ -560,9 +560,9 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
["lang-css", /^style\s*=\s*"([^"]+)"/i],
["lang-css", /^style\s*=\s*'([^']+)'/i],
["lang-css", /^style\s*=\s*([^\s"'>]+)/i],
]
],
),
["in.tag"]
["in.tag"],
);
k(x([], [["atv", /^[\S\s]+/]]), ["uq.val"]);
k(u({ keywords: F, hashComments: !0, cStyleComments: !0, types: K }), [
Expand All @@ -582,7 +582,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
verbatimStrings: !0,
types: K,
}),
["cs"]
["cs"],
);
k(u({ keywords: G, cStyleComments: !0 }), ["java"]);
k(u({ keywords: v, hashComments: !0, multiLineStrings: !0 }), [
Expand All @@ -597,7 +597,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
multiLineStrings: !0,
tripleQuotedStrings: !0,
}),
["cv", "py"]
["cv", "py"],
);
k(
u({
Expand All @@ -607,7 +607,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
multiLineStrings: !0,
regexLiterals: !0,
}),
["perl", "pl", "pm"]
["perl", "pl", "pm"],
);
k(
u({
Expand All @@ -616,7 +616,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
multiLineStrings: !0,
regexLiterals: !0,
}),
["rb"]
["rb"],
);
k(u({ keywords: w, cStyleComments: !0, regexLiterals: !0 }), ["js"]);
k(
Expand All @@ -629,7 +629,7 @@ window.PR_SHOULD_USE_CONTINUATION = !0;
tripleQuotedStrings: !0,
regexLiterals: !0,
}),
["coffee"]
["coffee"],
);
k(x([], [["str", /^[\S\s]+/]]), ["regex"]);
window.prettyPrintOne = function (a, m, e) {
Expand Down
8 changes: 6 additions & 2 deletions docs/styles/jsdoc-default.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
font-weight: normal;
font-style: normal;
src: url("../fonts/OpenSans-Regular-webfont.eot");
src: local("Open Sans"), local("OpenSans"),
src:
local("Open Sans"),
local("OpenSans"),
url("../fonts/OpenSans-Regular-webfont.eot?#iefix")
format("embedded-opentype"),
url("../fonts/OpenSans-Regular-webfont.woff") format("woff"),
Expand All @@ -15,7 +17,9 @@
font-weight: normal;
font-style: normal;
src: url("../fonts/OpenSans-Light-webfont.eot");
src: local("Open Sans Light"), local("OpenSans Light"),
src:
local("Open Sans Light"),
local("OpenSans Light"),
url("../fonts/OpenSans-Light-webfont.eot?#iefix")
format("embedded-opentype"),
url("../fonts/OpenSans-Light-webfont.woff") format("woff"),
Expand Down
4 changes: 2 additions & 2 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const underline = (text) => `\x1b[4m${text}\x1b[0m`;
"\n --> brotli size:",
Number(brotliFormatted.slice(0, -2)),
sizeUnit(brotliFormatted),
`\n${line}\n`
`\n${line}\n`,
);
} catch (err) {
help(err);
Expand Down Expand Up @@ -214,7 +214,7 @@ function getUsageMessage() {
.map(
(f) =>
` -${f.charAt(0)}, --${f} ${req(f)} ${bool(f)}
${FLAG_INFO[f].description} ${def(f)}`
${FLAG_INFO[f].description} ${def(f)}`,
)
.join("\n\n");

Expand Down
Loading

0 comments on commit 06074cb

Please sign in to comment.