Move TypeScript Node.js build to dist/node

Use a separate folder for the TypeScript build for Node.js in the dist
folder.  This makes each type of build consistently have its own output
folder instead of being interleaved with the Node.js build.
This commit is contained in:
Hornwitser committed 2024-02-08 03:20:26 +01:00
1 parent 152eb7d454
commit 8c4d2db192
50 files changed
+82 -82

No files matched your search

+1 -1
View File
@@ -391,7 +391,7 @@ module.exports = {
"node/process-exit-as-throw": "error", "node/process-exit-as-throw": "error",
"node/shebang": ["error", { "node/shebang": ["error", {
"convertPath": { "convertPath": {
"*.ts": ["^(.+)\\.ts$", "dist/$1.js"], "*.ts": ["^(.+)\\.ts$", "dist/node/$1.js"],
}, },
}], }],
}, },
+1 -1
View File
@@ -78,7 +78,7 @@ import { BaseInstancePlugin } from "@clusterio/host";
Previously the info of a plugin would be loaded by requiring `./plugin_dir/info`, this has been changed to require `./plugin_dir` which in turn means that `info.js` is no longer the default entrypoint. Previously the info of a plugin would be loaded by requiring `./plugin_dir/info`, this has been changed to require `./plugin_dir` which in turn means that `info.js` is no longer the default entrypoint.
To solve this you can either add `"main": "info.js",` to package.json or rename `info.js` to `index.js` (the rest of this guide assumes the entrypoint was renamed to `index.js`). To solve this you can either add `"main": "info.js",` to package.json or rename `info.js` to `index.js` (the rest of this guide assumes the entrypoint was renamed to `index.js`).
The motivation behind this change was to allow TypeScript to output its build to a sub-folder of the plugin, if you're using TypeScript you'll likely have the entrypoint be located in `dist/index.js` instead. The motivation behind this change was to allow TypeScript to output its build to a sub-folder of the plugin, if you're using TypeScript you'll likely have the entrypoint be located in `dist/node/index.js` instead.
The expected place where the declaration of a plugin is exported has also changed from `module.exports` to `module.exports.plugin`: The expected place where the declaration of a plugin is exported has also changed from `module.exports` to `module.exports.plugin`:
+2 -2
View File
@@ -4,13 +4,13 @@
"author": "Hornwitser", "author": "Hornwitser",
"license": "MIT", "license": "MIT",
"version": "2.0.0-alpha.16", "version": "2.0.0-alpha.16",
"main": "dist/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build && webpack-cli --env production", "prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"bin": { "bin": {
"clusteriocontroller": "./dist/controller.js" "clusteriocontroller": "./dist/node/controller.js"
}, },
"keywords": [ "keywords": [
"factorio" "factorio"
+4 -4
View File
@@ -274,7 +274,7 @@ export default class Controller {
Controller.addAppRoutes(this.app, this.pluginInfos); Controller.addAppRoutes(this.app, this.pluginInfos);
if (!args.dev) { if (!args.dev) {
let manifestPath = path.join(__dirname, "..", "web", "manifest.json"); let manifestPath = path.join(__dirname, "..", "..", "web", "manifest.json");
let manifest = await Controller.loadJsonObject(manifestPath); let manifest = await Controller.loadJsonObject(manifestPath);
if (!manifest["main.js"]) { if (!manifest["main.js"]) {
@@ -333,7 +333,7 @@ export default class Controller {
if (args.dev) { if (args.dev) {
// eslint-disable-next-line node/no-missing-require // eslint-disable-next-line node/no-missing-require
webpackConfigs.push(require("../../webpack.config")({})); // Path outside of build webpackConfigs.push(require("../../../webpack.config")({})); // Path outside of build
} }
if (args.devPlugin) { if (args.devPlugin) {
let devPlugins = new Map(); let devPlugins = new Map();
@@ -737,7 +737,7 @@ export default class Controller {
// Set folder to serve static content from (the website) // Set folder to serve static content from (the website)
const staticOptions = { immutable: true, maxAge: 1000 * 86400 * 365 }; const staticOptions = { immutable: true, maxAge: 1000 * 86400 * 365 };
app.use("/static", app.use("/static",
express.static(path.join(__dirname, "..", "..", "dist", "web", "static"), staticOptions) express.static(path.join(__dirname, "..", "..", "web", "static"), staticOptions)
); );
app.use("/static", express.static("static", staticOptions)); // Used for data export files app.use("/static", express.static("static", staticOptions)); // Used for data export files
@@ -1226,7 +1226,7 @@ export default class Controller {
mainBundle = stats.toJson().assetsByChunkName["main"]; mainBundle = stats.toJson().assetsByChunkName["main"];
} }
fs.readFile(path.join(__dirname, "..", "..", "web", "index.html"), "utf8").then((content) => { fs.readFile(path.join(__dirname, "..", "..", "..", "web", "index.html"), "utf8").then((content) => {
res.type("text/html"); res.type("text/html");
res.send(content res.send(content
.replace(/__CLUSTER_NAME__/g, res.app.locals.controller.config.get("controller.name")) .replace(/__CLUSTER_NAME__/g, res.app.locals.controller.config.get("controller.name"))
+1 -1
View File
@@ -5,6 +5,6 @@
], ],
"include": ["index.ts", "controller.ts", "package.json", "src/**/*.ts"], "include": ["index.ts", "controller.ts", "package.json", "src/**/*.ts"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist/node",
}, },
} }
+2 -2
View File
@@ -4,13 +4,13 @@
"author": "Hornwitser", "author": "Hornwitser",
"license": "MIT", "license": "MIT",
"version": "2.0.0-alpha.16", "version": "2.0.0-alpha.16",
"main": "dist/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build", "prepare": "tsc --build",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"bin": { "bin": {
"clusterioctl": "./dist/ctl.js" "clusterioctl": "./dist/node/ctl.js"
}, },
"keywords": [ "keywords": [
"factorio" "factorio"
+1 -1
View File
@@ -5,6 +5,6 @@
], ],
"include": ["index.ts", "package.json", "ctl.ts", "src/**/*.ts"], "include": ["index.ts", "package.json", "ctl.ts", "src/**/*.ts"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist/node",
}, },
} }
+2 -2
View File
@@ -4,13 +4,13 @@
"author": "Hornwitser", "author": "Hornwitser",
"license": "MIT", "license": "MIT",
"version": "2.0.0-alpha.16", "version": "2.0.0-alpha.16",
"main": "dist/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build", "prepare": "tsc --build",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"bin": { "bin": {
"clusteriohost": "./dist/host.js" "clusteriohost": "./dist/node/host.js"
}, },
"keywords": [ "keywords": [
"factorio" "factorio"
+1 -1
View File
@@ -800,7 +800,7 @@ rcon.print(game.table_to_json(players))`.replace(/\r?\n/g, " ");
// Find stand alone modules to load // Find stand alone modules to load
// XXX for now only the included clusterio module is loaded // XXX for now only the included clusterio module is loaded
let modulesDirectory = path.join(__dirname, "..", "..", "modules"); let modulesDirectory = path.join(__dirname, "..", "..", "..", "modules");
for (let entry of await fs.readdir(modulesDirectory, { withFileTypes: true })) { for (let entry of await fs.readdir(modulesDirectory, { withFileTypes: true })) {
if (entry.isDirectory()) { if (entry.isDirectory()) {
if (modules.has(entry.name)) { if (modules.has(entry.name)) {
+2 -2
View File
@@ -5,7 +5,7 @@ import Jimp from "jimp";
import JSZip from "jszip"; import JSZip from "jszip";
import * as lib from "@clusterio/lib"; import * as lib from "@clusterio/lib";
import * as libBuildMod from "@clusterio/lib/dist/build_mod"; import * as libBuildMod from "@clusterio/lib/dist/node/build_mod";
import type { FactorioServer } from "./server"; import type { FactorioServer } from "./server";
interface Prototype { interface Prototype {
@@ -62,7 +62,7 @@ async function generateExportMod(server: FactorioServer) {
clean: false, clean: false,
build: true, build: true,
pack: true, pack: true,
sourceDir: path.join(__dirname, "..", "..", "lua", "export"), sourceDir: path.join(__dirname, "..", "..", "..", "lua", "export"),
outputDir: server.writePath("mods"), outputDir: server.writePath("mods"),
bumpPatch: false, bumpPatch: false,
factorioVersion: server.version.replace(/\.\d+$/, ""), factorioVersion: server.version.replace(/\.\d+$/, ""),
+1 -1
View File
@@ -5,6 +5,6 @@
], ],
"include": ["index.ts", "host.ts", "package.json", "src/**/*.ts", "src/**/*.js"], "include": ["index.ts", "host.ts", "package.json", "src/**/*.ts", "src/**/*.js"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist/node",
}, },
} }
+1 -1
View File
@@ -8,7 +8,7 @@
"prepare": "tsc --build && pnpm run compile_validator", "prepare": "tsc --build && pnpm run compile_validator",
"compile_validator": "node scripts/compile_validator.js" "compile_validator": "node scripts/compile_validator.js"
}, },
"main": "dist/index.js", "main": "dist/node/index.js",
"browser": "browser.ts", "browser": "browser.ts",
"keywords": [ "keywords": [
"factorio" "factorio"
+3 -3
View File
@@ -7,9 +7,9 @@ const standaloneCode = require("ajv/dist/standalone").default;
/* eslint-disable node/no-sync */ /* eslint-disable node/no-sync */
// Provide an empty file for message_core to load // Provide an empty file for message_core to load
fs.outputFileSync(path.join(__dirname, "../dist/src/data/message_validate.js"), ""); fs.outputFileSync(path.join(__dirname, "../dist/node/src/data/message_validate.js"), "");
const { Message } = require("../dist/src/data/messages_core"); const { Message } = require("../dist/node/src/data/messages_core");
const ajv = new Ajv({ const ajv = new Ajv({
allowUnionTypes: true, allowUnionTypes: true,
@@ -28,5 +28,5 @@ function write(output) {
`// generated by scripts/compile_validator.js\n// @ts-nocheck\n/* eslint-disable */\n${moduleCode}` `// generated by scripts/compile_validator.js\n// @ts-nocheck\n/* eslint-disable */\n${moduleCode}`
); );
} }
write("../dist/src/data/message_validate.js"); write("../dist/node/src/data/message_validate.js");
write("../src/data/message_validate.js"); write("../src/data/message_validate.js");
+1 -1
View File
@@ -2,7 +2,7 @@
"extends": "../../tsconfig.node.json", "extends": "../../tsconfig.node.json",
"include": ["index.ts", "browser.ts", "build_mod.js", "src/**/*.ts", "src/**/*.js"], "include": ["index.ts", "browser.ts", "build_mod.js", "src/**/*.ts", "src/**/*.js"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist/node",
"allowJs": true, "allowJs": true,
}, },
} }
+2 -2
View File
@@ -6,8 +6,8 @@ export const plugin: lib.PluginDeclaration = {
name: "global_chat", name: "global_chat",
title: "Global Chat", title: "Global Chat",
description: "Forwards chat between instances.", description: "Forwards chat between instances.",
instanceEntrypoint: "dist/plugin/instance", instanceEntrypoint: "dist/node/instance",
ctlEntrypoint: "dist/plugin/control", ctlEntrypoint: "dist/node/control",
messages: [ messages: [
ChatEvent, ChatEvent,
+1 -1
View File
@@ -6,7 +6,7 @@
"homepage": "https://github.com/clusterio/clusterio#readme", "homepage": "https://github.com/clusterio/clusterio#readme",
"license": "MIT", "license": "MIT",
"repository": "clusterio/clusterio", "repository": "clusterio/clusterio",
"main": "dist/plugin/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build && webpack-cli --env production", "prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
+3 -3
View File
@@ -4,9 +4,9 @@ const lib = require("@clusterio/lib");
const mock = require("../../../test/mock"); const mock = require("../../../test/mock");
const lines = require("../../../test/lib/factorio/lines"); const lines = require("../../../test/lib/factorio/lines");
const instance = require("../dist/plugin/instance"); const instance = require("../dist/node/instance");
const info = require("../dist/plugin/index").plugin; const info = require("../dist/node/index").plugin;
const { ChatEvent } = require("../dist/plugin/messages"); const { ChatEvent } = require("../dist/node/messages");
describe("global_chat plugin", function() { describe("global_chat plugin", function() {
+1 -1
View File
@@ -6,6 +6,6 @@
"include": ["./**/*.ts"], "include": ["./**/*.ts"],
"exclude": ["test/*", "./dist/*"], "exclude": ["test/*", "./dist/*"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist/plugin", "outDir": "dist/node",
}, },
} }
+2 -2
View File
@@ -22,7 +22,7 @@ export const plugin: lib.PluginDeclaration = {
title: "Inventory sync", title: "Inventory sync",
description: "Synchronizes players inventories between instances", description: "Synchronizes players inventories between instances",
instanceEntrypoint: "dist/plugin/instance", instanceEntrypoint: "dist/node/instance",
instanceConfigFields: { instanceConfigFields: {
"inventory_sync.rcon_chunk_size": { "inventory_sync.rcon_chunk_size": {
title: "Rcon inventory chunk size", title: "Rcon inventory chunk size",
@@ -33,7 +33,7 @@ export const plugin: lib.PluginDeclaration = {
}, },
}, },
controllerEntrypoint: "dist/plugin/controller", controllerEntrypoint: "dist/node/controller",
controllerConfigFields: { controllerConfigFields: {
"inventory_sync.player_lock_timeout": { "inventory_sync.player_lock_timeout": {
title: "Player Lock Timeout", title: "Player Lock Timeout",
+1 -1
View File
@@ -6,7 +6,7 @@
"homepage": "https://github.com/clusterio/factorioClusterio#readme", "homepage": "https://github.com/clusterio/factorioClusterio#readme",
"license": "MIT", "license": "MIT",
"repository": "clusterio/factorioClusterio", "repository": "clusterio/factorioClusterio",
"main": "dist/plugin/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build && webpack-cli --env production", "prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
+1 -1
View File
@@ -6,6 +6,6 @@
"include": ["./**/*.ts"], "include": ["./**/*.ts"],
"exclude": ["test/*", "./dist/*"], "exclude": ["test/*", "./dist/*"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist/plugin", "outDir": "dist/node",
}, },
} }
+2 -2
View File
@@ -15,8 +15,8 @@ export const plugin: lib.PluginDeclaration = {
name: "player_auth", name: "player_auth",
title: "Player Auth", title: "Player Auth",
description: "Provides authentication to the cluster via logging into a Factorio server.", description: "Provides authentication to the cluster via logging into a Factorio server.",
controllerEntrypoint: "dist/plugin/controller", controllerEntrypoint: "dist/node/controller",
instanceEntrypoint: "dist/plugin/instance", instanceEntrypoint: "dist/node/instance",
webEntrypoint: "./web", webEntrypoint: "./web",
controllerConfigFields: { controllerConfigFields: {
"player_auth.code_length": { "player_auth.code_length": {
+1 -1
View File
@@ -6,7 +6,7 @@
"homepage": "https://github.com/clusterio/clusterio#readme", "homepage": "https://github.com/clusterio/clusterio#readme",
"license": "MIT", "license": "MIT",
"repository": "clusterio/clusterio", "repository": "clusterio/clusterio",
"main": "dist/plugin/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build && webpack-cli --env production", "prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
+4 -4
View File
@@ -5,10 +5,10 @@ const jwt = require("jsonwebtoken");
const mock = require("../../../test/mock"); const mock = require("../../../test/mock");
const controller = require("../dist/plugin/controller"); const controller = require("../dist/node/controller");
const instance = require("../dist/plugin/instance"); const instance = require("../dist/node/instance");
const info = require("../dist/plugin/index").plugin; const info = require("../dist/node/index").plugin;
const { FetchPlayerCodeRequest, SetVerifyCodeRequest } = require("../dist/plugin/messages"); const { FetchPlayerCodeRequest, SetVerifyCodeRequest } = require("../dist/node/messages");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
+1 -1
View File
@@ -6,6 +6,6 @@
"include": ["./**/*.ts"], "include": ["./**/*.ts"],
"exclude": ["test/*", "./dist/*"], "exclude": ["test/*", "./dist/*"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist/plugin", "outDir": "dist/node",
}, },
} }
+2 -2
View File
@@ -6,8 +6,8 @@ export const plugin: lib.PluginDeclaration = {
name: "research_sync", name: "research_sync",
title: "Research Sync", title: "Research Sync",
description: "Synchronises technology research progress between instances.", description: "Synchronises technology research progress between instances.",
instanceEntrypoint: "dist/plugin/instance", instanceEntrypoint: "dist/node/instance",
controllerEntrypoint: "dist/plugin/controller", controllerEntrypoint: "dist/node/controller",
messages: [ messages: [
messages.ContributionEvent, messages.ContributionEvent,
+1 -1
View File
@@ -6,7 +6,7 @@
"homepage": "https://github.com/clusterio/clusterio#readme", "homepage": "https://github.com/clusterio/clusterio#readme",
"license": "MIT", "license": "MIT",
"repository": "clusterio/clusterio", "repository": "clusterio/clusterio",
"main": "dist/plugin/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build && webpack-cli --env production", "prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
+2 -2
View File
@@ -2,5 +2,5 @@
// required here in order to track coverage for them. // required here in order to track coverage for them.
"use strict"; "use strict";
require("../dist/plugin/instance"); require("../dist/node/instance");
require("../dist/plugin/controller"); require("../dist/node/controller");
+1 -1
View File
@@ -6,6 +6,6 @@
"include": ["./**/*.ts"], "include": ["./**/*.ts"],
"exclude": ["test/*", "./dist/*"], "exclude": ["test/*", "./dist/*"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist/plugin", "outDir": "dist/node",
}, },
} }
+1 -1
View File
@@ -12,7 +12,7 @@ export const plugin: lib.PluginDeclaration = {
description: description:
"Provides in-game item/fluid production, builds, kills, and pollution "+ "Provides in-game item/fluid production, builds, kills, and pollution "+
"statistics to the cluster's Prometheus endpoint.", "statistics to the cluster's Prometheus endpoint.",
instanceEntrypoint: "dist/plugin/instance", instanceEntrypoint: "dist/node/instance",
instanceConfigFields: { instanceConfigFields: {
"statistics_exporter.command_timeout": { "statistics_exporter.command_timeout": {
title: "Command Timeout", title: "Command Timeout",
+1 -1
View File
@@ -6,7 +6,7 @@
"homepage": "https://github.com/clusterio/clusterio#readme", "homepage": "https://github.com/clusterio/clusterio#readme",
"license": "MIT", "license": "MIT",
"repository": "clusterio/clusterio", "repository": "clusterio/clusterio",
"main": "dist/plugin/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build && webpack-cli --env production", "prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
+2 -2
View File
@@ -2,8 +2,8 @@
const assert = require("assert").strict; const assert = require("assert").strict;
const mock = require("../../../test/mock"); const mock = require("../../../test/mock");
const instance = require("../dist/plugin/instance"); const instance = require("../dist/node/instance");
const info = require("../dist/plugin/index").plugin; const info = require("../dist/node/index").plugin;
describe("statistics_exporter plugin", function() { describe("statistics_exporter plugin", function() {
+1 -1
View File
@@ -6,6 +6,6 @@
"include": ["./**/*.ts"], "include": ["./**/*.ts"],
"exclude": ["test/*", "./dist/*"], "exclude": ["test/*", "./dist/*"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist/plugin", "outDir": "dist/node",
}, },
} }
+2 -2
View File
@@ -22,7 +22,7 @@ export const plugin: lib.PluginDeclaration = {
name: "subspace_storage", name: "subspace_storage",
title: "Subspace Storage", title: "Subspace Storage",
description: "Provides shared storage across instances for the Subspace Storage mod", description: "Provides shared storage across instances for the Subspace Storage mod",
instanceEntrypoint: "dist/plugin/instance", instanceEntrypoint: "dist/node/instance",
instanceConfigFields: { instanceConfigFields: {
"subspace_storage.log_item_transfers": { "subspace_storage.log_item_transfers": {
title: "Log Item Transfers", title: "Log Item Transfers",
@@ -32,7 +32,7 @@ export const plugin: lib.PluginDeclaration = {
}, },
}, },
controllerEntrypoint: "dist/plugin/controller", controllerEntrypoint: "dist/node/controller",
controllerConfigFields: { controllerConfigFields: {
"subspace_storage.division_method": { "subspace_storage.division_method": {
title: "Division Method", title: "Division Method",
+1 -1
View File
@@ -6,7 +6,7 @@
"homepage": "https://github.com/clusterio/clusterio#readme", "homepage": "https://github.com/clusterio/clusterio#readme",
"license": "MIT", "license": "MIT",
"repository": "clusterio/clusterio", "repository": "clusterio/clusterio",
"main": "dist/plugin/index.js", "main": "dist/node/index.js",
"scripts": { "scripts": {
"prepare": "tsc --build && webpack-cli --env production", "prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
+4 -4
View File
@@ -2,7 +2,7 @@
// required here in order to track coverage for them. // required here in order to track coverage for them.
"use strict"; "use strict";
require("../dist/plugin/instance"); require("../dist/node/instance");
require("../dist/plugin/controller"); require("../dist/node/controller");
require("../dist/plugin/dole"); require("../dist/node/dole");
require("../dist/plugin/dole_nn_base"); require("../dist/node/dole_nn_base");
+1 -1
View File
@@ -1,7 +1,7 @@
"use strict"; "use strict";
const assert = require("assert").strict; const assert = require("assert").strict;
const routes = require("../dist/plugin/routes"); const routes = require("../dist/node/routes");
const { get } = require("../../../test/integration"); const { get } = require("../../../test/integration");
+1 -1
View File
@@ -6,6 +6,6 @@
"include": ["./**/*.ts"], "include": ["./**/*.ts"],
"exclude": ["test/*", "./dist/*"], "exclude": ["test/*", "./dist/*"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist/plugin", "outDir": "dist/node",
}, },
} }
+1 -1
View File
@@ -7,7 +7,7 @@ const util = require("util");
const phin = require("phin"); const phin = require("phin");
const HttpCloser = require("@clusterio/controller/dist/src/HttpCloser").default; const HttpCloser = require("@clusterio/controller/dist/node/src/HttpCloser").default;
// Time to wait during async operations to ensure they happened in order. // Time to wait during async operations to ensure they happened in order.
const tick = 20; const tick = 20;
+1 -1
View File
@@ -7,7 +7,7 @@ const http = require("http");
const phin = require("phin"); const phin = require("phin");
const { wait } = require("@clusterio/lib"); const { wait } = require("@clusterio/lib");
const routes = require("@clusterio/controller/dist/src/routes"); const routes = require("@clusterio/controller/dist/node/src/routes");
const mock = require("../mock"); const mock = require("../mock");
+2 -2
View File
@@ -3,8 +3,8 @@ const assert = require("assert").strict;
const path = require("path"); const path = require("path");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
const Host = require("@clusterio/host/dist/src/Host").default; const Host = require("@clusterio/host/dist/node/src/Host").default;
const { _discoverInstances } = require("@clusterio/host/dist/src/Host"); const { _discoverInstances } = require("@clusterio/host/dist/node/src/Host");
describe("Host testing", function() { describe("Host testing", function() {
describe("discoverInstances()", function() { describe("discoverInstances()", function() {
+1 -1
View File
@@ -4,7 +4,7 @@ const path = require("path");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
const { PlayerStats, wait } = lib; const { PlayerStats, wait } = lib;
const Instance = require("@clusterio/host/dist/src/Instance").default; const Instance = require("@clusterio/host/dist/node/src/Instance").default;
const { MockConnector, MockServer } = require("../mock"); const { MockConnector, MockServer } = require("../mock");
const addr = lib.Address.fromShorthand; const addr = lib.Address.fromShorthand;
+2 -2
View File
@@ -2,8 +2,8 @@
const assert = require("assert").strict; const assert = require("assert").strict;
const path = require("path"); const path = require("path");
const { FactorioServer } = require("@clusterio/host/dist/src/server"); const { FactorioServer } = require("@clusterio/host/dist/node/src/server");
const { _exportLocale } = require("@clusterio/host/dist/src/export"); const { _exportLocale } = require("@clusterio/host/dist/node/src/export");
describe("host/src/export", function() { describe("host/src/export", function() {
+1 -1
View File
@@ -5,7 +5,7 @@ const JSZip = require("jszip");
const path = require("path"); const path = require("path");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
const patch = require("@clusterio/host/dist/src/patch"); const patch = require("@clusterio/host/dist/node/src/patch");
describe("host/patch", function() { describe("host/patch", function() {
+1 -1
View File
@@ -4,7 +4,7 @@ const events = require("events");
const fs = require("fs-extra"); const fs = require("fs-extra");
const path = require("path"); const path = require("path");
const hostServer = require("@clusterio/host/dist/src/server"); const hostServer = require("@clusterio/host/dist/node/src/server");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
const { wait } = lib; const { wait } = lib;
const { testLines } = require("../lib/factorio/lines"); const { testLines } = require("../lib/factorio/lines");
+2 -2
View File
@@ -2,8 +2,8 @@
const assert = require("assert").strict; const assert = require("assert").strict;
const path = require("path"); const path = require("path");
const { _exportLocale } = require("@clusterio/host/dist/src/export"); const { _exportLocale } = require("@clusterio/host/dist/node/src/export");
const { FactorioServer } = require("@clusterio/host/dist/src/server"); const { FactorioServer } = require("@clusterio/host/dist/node/src/server");
describe("Integration of lib/factorio/export", function() { describe("Integration of lib/factorio/export", function() {
+5 -5
View File
@@ -12,11 +12,11 @@ const lib = require("@clusterio/lib");
const { LineSplitter, ConsoleTransport, logger } = lib; const { LineSplitter, ConsoleTransport, logger } = lib;
// Make sure permissions from plugins are loaded // Make sure permissions from plugins are loaded
require("../../plugins/global_chat/dist/plugin/index"); require("../../plugins/global_chat/dist/node/index");
require("../../plugins/player_auth/dist/plugin/index"); require("../../plugins/player_auth/dist/node/index");
require("../../plugins/research_sync/dist/plugin/index"); require("../../plugins/research_sync/dist/node/index");
require("../../plugins/statistics_exporter/dist/plugin/index"); require("../../plugins/statistics_exporter/dist/node/index");
require("../../plugins/subspace_storage/dist/plugin/index"); require("../../plugins/subspace_storage/dist/node/index");
const subspaceStorageVersion = "1.99.8"; const subspaceStorageVersion = "1.99.8";
const subspaceStorageGitHubTag = "1.99.6"; // Tag subspaceStorageVersion was released under on GitHub const subspaceStorageGitHubTag = "1.99.6"; // Tag subspaceStorageVersion was released under on GitHub
+1 -1
View File
@@ -4,7 +4,7 @@ const fs = require("fs-extra");
const JSZip = require("jszip"); const JSZip = require("jszip");
const path = require("path"); const path = require("path");
const { patch, SaveModule } = require("@clusterio/host/dist/src/patch"); const { patch, SaveModule } = require("@clusterio/host/dist/node/src/patch");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
const { slowTest } = require("./index"); const { slowTest } = require("./index");
+1 -1
View File
@@ -5,7 +5,7 @@ const fs = require("fs-extra");
const path = require("path"); const path = require("path");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
const { FactorioServer, _getVersion } = require("@clusterio/host/dist/src/server"); const { FactorioServer, _getVersion } = require("@clusterio/host/dist/node/src/server");
const { logger } = lib; const { logger } = lib;
const { slowTest } = require("./index"); const { slowTest } = require("./index");
+2 -2
View File
@@ -5,8 +5,8 @@ const express = require("express");
const lib = require("@clusterio/lib"); const lib = require("@clusterio/lib");
const UserManager = require("@clusterio/controller/dist/src/UserManager").default; const UserManager = require("@clusterio/controller/dist/node/src/UserManager").default;
const ControllerUser = require("@clusterio/controller/dist/src/ControllerUser").default; const ControllerUser = require("@clusterio/controller/dist/node/src/ControllerUser").default;
const addr = lib.Address.fromShorthand; const addr = lib.Address.fromShorthand;