authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-08-02 23:48:23-04:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-10-14 02:40:46-07:00
log8d0985c06cb96067dc084cb17f5c3bfe8c43f56d
treedb5c47011c5faad04e8ba5ff767c6e81a09b92f4
parentddb832eb2c15c9c3c1e00ab6882fead93ffd8c4b
signature Commit is signed but in an unrecognized format.

fix: node 22 wasn't stopped by compat check


2 files changed, 23 insertions(+), 18 deletions(-)

framework/hot.ts-2
......@@ -19,8 +19,6 @@ export const load = createRequire(
1919};
2020export const { cache } = load;
2121
22load<any>("source-map-support").install({ hookRequire: true });
23
2422// Register extensions by overwriting `require.extensions`
2523const require = load;
2624const exts = require.extensions;
run.js+23-16
......@@ -3,37 +3,44 @@
33import * as util from "node:util";
44import * as zlib from "node:zlib";
55import * as url from "node:url";
6import * as module from "node:module";
67import process from "node:process";
78
8if (!zlib.zstdCompress) {
9// Disable experimental warnings (Type Stripping, etc)
10const { emit: originalEmit } = process;
11const warnings = ["ExperimentalWarning"];
12process.emit = function (event, error) {
13 return event === "warning" && warnings.includes(error.name)
14 ? false
15 : originalEmit.apply(process, arguments);
16};
17
18try {
19 // fails in a runtime without ts support
20 await import("#debug");
21
22 // required APIs
23 ASSERT(zlib.zstdCompress);
24
25 // seems to fail in bun
26 (await import("source-map-support")).install({ hookRequire: true });
27} catch {
928 const brand = process.versions.bun
1029 ? `bun ${process.versions.bun}`
1130 : process.versions.deno
1231 ? `deno ${process.versions.deno}`
1332 : null;
14
33 const brandText = brand ? ` (${brand})` : "";
1534 globalThis.console.error(
16 `sitegen depends on a node.js v24. your runtime is missing feature\n` +
17 `this is node.js version ${process.version}${
18 brand ? ` (${brand})` : ""
19 }\n\n` +
35 `sitegen depends on a node.js v24. your runtime is missing features.\n` +
36 `this is node.js version ${process.version}${brandText}\n\n` +
2037 `get node.js --> https://nodejs.org/en/download/current`,
2138 );
2239 process.exit(1);
2340}
2441
25// Disable experimental warnings (Type Stripping, etc)
26const { emit: originalEmit } = process;
27const warnings = ["ExperimentalWarning"];
28process.emit = function (event, error) {
29 return event === "warning" && warnings.includes(error.name)
30 ? false
31 : originalEmit.apply(process, arguments);
32};
33
3442// Init hooks
3543const hot = await import("./framework/hot.ts");
36await import("#debug");
3744
3845const console = hot.load("@paperclover/console");
3946globalThis.console["log"] = console.info;