@forwardimpact/libdoc
Advanced tools
+4
-1
@@ -16,2 +16,3 @@ #!/usr/bin/env node | ||
| import { createLogger } from "@forwardimpact/libtelemetry"; | ||
| import { createDefaultRuntime } from "@forwardimpact/libutil/runtime"; | ||
| import { PagesBuilder, PagesServer } from "../src/index.js"; | ||
@@ -147,2 +148,4 @@ import { parseFrontMatter } from "../src/frontmatter.js"; | ||
| async function main() { | ||
| const runtime = createDefaultRuntime(); | ||
| const parsed = cli.parse(process.argv.slice(2)); | ||
@@ -182,3 +185,3 @@ if (!parsed) process.exit(0); | ||
| } else { | ||
| const server = new PagesServer(fs, Hono, serve, builder); | ||
| const server = new PagesServer(fs, Hono, serve, builder, { runtime }); | ||
| await runServe(builder, server, pagesDir, distDir, { | ||
@@ -185,0 +188,0 @@ port: parseInt(values.port || "3000", 10), |
+2
-1
| { | ||
| "name": "@forwardimpact/libdoc", | ||
| "version": "0.2.33", | ||
| "version": "0.2.34", | ||
| "description": "Static documentation sites from markdown — publish docs without a framework.", | ||
@@ -44,2 +44,3 @@ "keywords": [ | ||
| "@forwardimpact/libtelemetry": "^0.1.22", | ||
| "@forwardimpact/libutil": "^0.1.0", | ||
| "@hono/node-server": "^2.0.4", | ||
@@ -46,0 +47,0 @@ "hono": "^4.12.23", |
+10
-3
@@ -14,2 +14,3 @@ import { createLogger } from "@forwardimpact/libtelemetry"; | ||
| #watcher; | ||
| #proc; | ||
@@ -22,4 +23,5 @@ /** | ||
| * @param {import("./builder.js").PagesBuilder} builder - PagesBuilder instance | ||
| * @param {{ runtime?: import("@forwardimpact/libutil/runtime").Runtime }} [opts] - Optional injected runtime bag | ||
| */ | ||
| constructor(fs, HonoConstructor, serveFn, builder) { | ||
| constructor(fs, HonoConstructor, serveFn, builder, opts) { | ||
| if (!fs) throw new Error("fs is required"); | ||
@@ -33,2 +35,4 @@ if (!builder) throw new Error("builder is required"); | ||
| this.#watcher = null; | ||
| // Fall back to the ambient process when no runtime is injected (BC shim). | ||
| this.#proc = opts?.runtime?.proc ?? process; | ||
| } | ||
@@ -63,6 +67,9 @@ | ||
| // Keep process alive | ||
| // Keep process alive. Signal registration is inherently global — the | ||
| // `runtime.proc` surface deliberately omits `.on` (like librpc's server) — | ||
| // so SIGINT is wired on the ambient `process`; only the exit routes through | ||
| // the injected `proc` so tests can observe it. | ||
| process.on("SIGINT", () => { | ||
| this.stopWatch(); | ||
| process.exit(0); | ||
| this.#proc.exit(0); | ||
| }); | ||
@@ -69,0 +76,0 @@ } |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
47174
1.49%973
0.93%12
9.09%4
33.33%