Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v12 #40

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
22 changes: 11 additions & 11 deletions compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const GREEN = "\x1b[32m%s\x1b[0m";
const YELLOW = "\x1b[33m%s\x1b[0m";
const RED = "\x1b[31m%s\x1b[0m";

const VERSION = 11;
const VERSION = 12;

Handlebars.registerHelper("or", function (param1, param2) {
return param1 || param2;
Expand All @@ -30,21 +30,21 @@ const fillTemplate = (template, { overwriteOptions = null } = {}) => {
return template
.replace(
/\{\{\s?nginxHost\s?\}\}/gi,
'<!--# echo var="http_host" default="" -->'
'<!--# echo var="http_host" default="" -->',
)
.replace(
/\{\{\s?nginxProxyHost\s?\}\}/gi,
'<!--# echo var="proxy_hostname" default="" --><!--# echo var="proxy_path" default="/simple" -->'
'<!--# echo var="proxy_hostname" default="" --><!--# echo var="proxy_path" default="/simple" -->',
)
.replace(
/\\?"\{\{\s?overwriteOptions\s?\}\}\\?"/gi,
overwriteOptions
? JSON.stringify(overwriteOptions).replace(/:"([^"]+)"/gi, ":$1")
: "{}"
: "{}",
)
.replace(
/"\{\{\s?cloudFlareCustomDomain\s?\}\}"/gi,
'INSTALL_OPTIONS.custom_domain || "queue.simpleanalyticscdn.com"'
'INSTALL_OPTIONS.custom_domain || "queue.simpleanalyticscdn.com"',
);
};

Expand Down Expand Up @@ -284,7 +284,7 @@ const files = templates.reduce((list, template) => {
if (template.variables.sri) {
list.push(
{ ...template, variables: { ...template.variables, sri: true } },
{ ...template, variables: { ...template.variables, sri: false } }
{ ...template, variables: { ...template.variables, sri: false } },
);
} else {
list.push(template);
Expand Down Expand Up @@ -346,7 +346,7 @@ for (const file of files) {
filename: originalFileName,
url: `${finalFileName}.map`,
},
}
},
)
: {
code: prepend + rawCode,
Expand Down Expand Up @@ -374,7 +374,7 @@ for (const file of files) {
RED,
`[${name}][ERROR] ${input
.split("/")
.pop()} ${description} at line ${lineNumber} position ${index}`
.pop()} ${description} at line ${lineNumber} position ${index}`,
);
continue;
}
Expand Down Expand Up @@ -402,15 +402,15 @@ for (const file of files) {

let write = code.replace(
/sourceMappingURL=latest\.js\.map/gi,
`sourceMappingURL=${cdnFileName}.map`
`sourceMappingURL=${cdnFileName}.map`,
);

fs.writeFileSync(versionFile, write);

if (compiledMap) {
let writeCompiled = compiledMap.replace(
/latest\.source\.js/gi,
cdnFileName
cdnFileName,
);

fs.writeFileSync(`${versionFile}.map`, writeCompiled);
Expand Down Expand Up @@ -438,7 +438,7 @@ for (const file of files) {
console.log(
` ${name.toLowerCase()} ${fill1}Compiled ${sourceName} ${fill2} ${bytesZeroFilled} bytes ${
variables.sri ? " (SRI)" : ""
}`
}`,
);
}

Expand Down
4 changes: 4 additions & 0 deletions dist/v12/app.js

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

1 change: 1 addition & 0 deletions dist/v12/app.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/v12/auto-events.js

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

Loading
Loading