Merge upstream/master and address review

Resolves the ESM conflicts in patch.ts, Instance.ts and host.ts. The
module gathering in Instance now goes through patch.loadModules with
the instance's loadedPlugins, and imports use explicit extensions.

Review changes: the existing-output check only treats ENOENT as
"does not exist" and rethrows anything else, a --zip option keeps the
output as a zip file for transfer (extracting stays the default), the
--scenario option describes that it takes a path and what the default
is, and the docs note that IPC is not available outside Clusterio.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Fable 5.1 committed 2026-09-12 22:21:46 +00:00
commit 187138bec5
297 files changed
+4980 -3274

No files matched your search

+9 -11
View File
@@ -1,14 +1,12 @@
"use strict";
const assert = require("assert").strict;
const events = require("events");
const fs = require("node:fs/promises");
const path = require("path");
import assert from "node:assert/strict";
import events from "node:events";
import fs from "node:fs/promises";
import path from "node:path";
const hostServer = require("@clusterio/host/dist/node/src/server");
const lib = require("@clusterio/lib");
const { wait } = lib;
const { testLines } = require("../lib/factorio/lines");
const { slowTest, externalTest } = require("../integration");
import * as hostServer from "@clusterio/host/dist/node/src/server.js";
import { Link, wait } from "@clusterio/lib";
import { testLines } from "../lib/factorio/lines.js";
import { slowTest, externalTest } from "../integration/index.js";
describe("host/server", function() {
@@ -326,7 +324,7 @@ describe("host/server", function() {
static jsonSchema = { type: "number" };
static fromJSON(json) { return new this(json); }
}
let eventFromJSON = lib.Link.eventFromJSON(NumberEvent, "NumberEvent");
let eventFromJSON = Link.eventFromJSON(NumberEvent, "NumberEvent");
ipcServer.handle("bad_event", async () => { eventFromJSON("not a number"); });
ipcServer.emit("ipc-bad_event", {});
await new Promise(resolve => setImmediate(resolve));