sitegen/run.js
chloe caruso af60d1172f i accidentally deleted the repo, but recovered it. i'll start committing
it was weird. i pressed delete on a subfolder, i think one of the
pages.off folders that i was using. and then, suddenly, nvim on windows
7 decided to delete every file in the directory. they weren't shred off
the space time continuum, but just marked deleted. i had to pay $80 to
get access to a software that could see them. bleh!

just seeing all my work, a little over a week, was pretty heart
shattering. but i remembered that long ago, a close friend said i could
call them whenever i was feeling sad. i finally took them up on that
offer. the first time i've ever called someone for emotional support.
but it's ok. i got it back. and the site framework is better than ever.

i'm gonna commit and push more often. the repo is private anyways.
2025-06-06 23:38:02 -07:00

38 lines
1.2 KiB
JavaScript

// This file allows using Node.js in combination with
// available plugins. Usage: "node run <script>"
import * as path from "node:path";
import process from "node:process";
// Disable experimental warnings (Type Stripping, etc)
{
const { emit: originalEmit } = process;
const warnings = ["ExperimentalWarning"];
process.emit = function (event, error) {
return event === "warning" && warnings.includes(error.name)
? false
: originalEmit.apply(process, arguments);
};
}
// Init hooks
const hot = await import("./framework/hot.ts");
const console = hot.load("@paperclover/console");
globalThis.console.log = console.info;
globalThis.console.info = console.info;
globalThis.console.warn = console.warn;
globalThis.console.error = console.error;
globalThis.console.debug = console.scoped("dbg");
// Load with hooks
if (process.argv[1].startsWith(import.meta.filename.slice(0, -".js".length))) {
if (process.argv.length == 2) {
console.error("usage: node run <script> [...args]");
process.exit(1);
}
const file = path.resolve(process.argv[2]);
process.argv = [process.argv[0], ...process.argv.slice(2)];
hot.load(file).main?.();
}
export { hot };