pirc-extension 0.1.9-dev+69800ee67711
Igor Soarez igor@soarez.org
Sun, 25 Oct 2026 20:03:05 +0000
4 files changed,
22 insertions(+),
6 deletions(-)
M
README.md
→
README.md
@@ -7,7 +7,8 @@ client. You need a relay of your own; PiRC's self-hosting guide covers
running one. This repository holds releases only: the extension built into one file -(`index.js`). Its source is in PiRC's repository. +(`pirc.js`), and `loader.js`, which loads it. Its source is in PiRC's +repository. ## Install
M
index.js
→
pirc.js
@@ -1,4 +1,4 @@
-// PiRC extension 0.1.9-dev+3bc256ad5274. Third-party code in this file: @bufbuild/protobuf@2.16.0, ws@8.22.0; see NOTICE. +// PiRC extension 0.1.9-dev+69800ee67711. Third-party code in this file: @bufbuild/protobuf@2.16.0, ws@8.22.0; see NOTICE. import { createRequire as __pircCreateRequire } from "node:module"; const require = __pircCreateRequire(import.meta.url); var __create = Object.create;@@ -8717,7 +8717,7 @@ return v?.requestId ?? "";
} // extension/src/index.ts -var EXTENSION_VERSION = true ? "0.1.9-dev+3bc256ad5274" : "dev"; +var EXTENSION_VERSION = true ? "0.1.9-dev+69800ee67711" : "dev"; function piVersion() { try { let dir = dirname3(realpathSync(process.argv[1]));@@ -8732,7 +8732,7 @@ } catch {
} return "unknown"; } -var LOAD = true ? "0.1.9-dev+3bc256ad5274" : `dev ${randomBytes3(4).toString("hex")}`; +var LOAD = true ? "0.1.9-dev+69800ee67711" : `dev ${randomBytes3(4).toString("hex")}`; var KEY = /* @__PURE__ */ Symbol.for("pirc.extension"); var proc = globalThis[KEY] ??= {}; if (!proc.host || proc.load !== LOAD) {
A
loader.js
@@ -0,0 +1,15 @@
+// The published extension's entry point. pi's /reload imports the +// extension again, but Node keeps every JavaScript module it has imported, +// so a bundle updated in place would not run until pi restarted. This file +// imports the bundle beside it by a URL that changes when the file does, +// so a reload after an update runs the new code, and is the same in every +// version, so that its own copy, which Node keeps, is never stale. Not +// index.js: versions before it had their bundle there, which Node would +// still hold after updating from one of them. +import { statSync } from "node:fs"; + +export default async function (pi) { + const bundle = new URL("./pirc.js", import.meta.url); + const { default: factory } = await import(`${bundle.href}?t=${statSync(bundle).mtimeMs}`); + return factory(pi); +}
M
package.json
→
package.json
@@ -1,6 +1,6 @@
{ "name": "pirc-extension", - "version": "0.1.9-dev+3bc256ad5274", + "version": "0.1.9-dev+69800ee67711", "description": "PiRC: puts every interactive pi session on a PiRC relay", "license": "MIT", "homepage": "https://pirc.dev",@@ -10,7 +10,7 @@ "pi-package"
], "pi": { "extensions": [ - "./index.js" + "./loader.js" ] }, "peerDependencies": {