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(...@@ -19,8 +19,6 @@ export const load = createRequire(
19};19};
20export const { cache } = load;20export const { cache } = load;
2121
22load<any>("source-map-support").install({ hookRequire: true });
23
24// Register extensions by overwriting `require.extensions`22// Register extensions by overwriting `require.extensions`
25const require = load;23const require = load;
26const exts = require.extensions;24const exts = require.extensions;
run.js+23-16
...@@ -3,37 +3,44 @@...@@ -3,37 +3,44 @@
3import * as util from "node:util";3import * as util from "node:util";
4import * as zlib from "node:zlib";4import * as zlib from "node:zlib";
5import * as url from "node:url";5import * as url from "node:url";
6import * as module from "node:module";
6import process from "node:process";7import 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 {
9 const brand = process.versions.bun28 const brand = process.versions.bun
10 ? `bun ${process.versions.bun}`29 ? `bun ${process.versions.bun}`
11 : process.versions.deno30 : process.versions.deno
12 ? `deno ${process.versions.deno}`31 ? `deno ${process.versions.deno}`
13 : null;32 : null;
1433 const brandText = brand ? ` (${brand})` : "";
15 globalThis.console.error(34 globalThis.console.error(
16 `sitegen depends on a node.js v24. your runtime is missing feature\n` +35 `sitegen depends on a node.js v24. your runtime is missing features.\n` +
17 `this is node.js version ${process.version}${36 `this is node.js version ${process.version}${brandText}\n\n` +
18 brand ? ` (${brand})` : ""
19 }\n\n` +
20 `get node.js --> https://nodejs.org/en/download/current`,37 `get node.js --> https://nodejs.org/en/download/current`,
21 );38 );
22 process.exit(1);39 process.exit(1);
23}40}
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
34// Init hooks42// Init hooks
35const hot = await import("./framework/hot.ts");43const hot = await import("./framework/hot.ts");
36await import("#debug");
3744
38const console = hot.load("@paperclover/console");45const console = hot.load("@paperclover/console");
39globalThis.console["log"] = console.info;46globalThis.console["log"] = console.info;