CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.
CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.
Path: blob/master/PHEx/build.mjs
Views: 713
"use strict";1// PHEx Build Script234/** Directory Zipper */5import zipdir from "zip-dir";678/** console.log prefix */9const prefix = "[PHEx Builder] ";1011// newline cuz it looks nicer in the terminal when i do.12console.log("\n");1314/** old console.log function */15var backup = console.log;1617// console.log plus prefix18console.log = ((message) => {19// im so smart lol20backup(prefix + message);21})222324// Tell the user that the chromium extension is being zipped25console.log("Zipping chromium extension...");262728// Zip ./src to ./build.extension.zip29zipdir("./src/", { saveTo: "./build/extension.zip" }, function (err, buffer) {3031// If this encounters an error, print the error and return.32if (err) return console.error(err);3334// If the program has gotten to this step, then the program has not encountered any errors.35// Tell the user that extension.zip has been built.36console.log(".ZIP chromium extension built -> extension.zip");3738// Tell the user that we've build the chromium extension successfully.39console.log("Chromium extension Success!\n");404142434445// Tell the user that the firefox extension is being zipped46console.log("Zipping firefox extension...");4748// Zip ./firefox to ./build.extension.zip49zipdir("./firefox/", { saveTo: "./build/extension.xpi" }, function (err, _buffer) {5051// If this encounters an error, print the error and return.52if (err) return console.error(err);5354// If the program has gotten to this step, then the program has not encountered any errors.55// Tell the user that extension.xpi has been built.56console.log(".XPI file built -> extension.xpi");5758// Tell the user that we've build the firefox extension successfully.59console.log("Firefox extension Success!\n");606162// When making .crx extensions, it needs to be signed with a private key file to work.63// Tell the user that extension.crx needs to be signed if it's a production-used release.64console.warn("IMPORTANT: IF YOU ARE MAKING AN OFFICIAL PHEx RELEASE, THEN PLEASE REMEMBER TO SIGN THE .CRX WITH A PRIVATE KEY FILE.\n");656667// Tell the user that we're done.68console.log("Done!");6970});717273});747576