Prefix clusterio/lib imports with lib

Use lib* prefix for the modules impored from the lib package to help
distinguish them more from ordinary variables.  Fix up the naming
convention for files to be consistently lowercase_underscore for
JavaScript files.
This commit is contained in:
Hornwitser committed 2020-10-23 21:22:43 +02:00
1 parent fbbaf3dd3a
commit 24397b75cc
55 files changed
+692 -668

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@ const fs = require("fs-extra");
const jszip = require("jszip");
const path = require("path");
const factorio = require("@clusterio/lib/factorio");
const libFactorio = require("@clusterio/lib/factorio");
const { slowTest } = require("./index");
@@ -17,7 +17,7 @@ describe("Integration of lib/factorio/patch", function() {
let savePath = path.join("temp", "test", "integration", "saves", "test.zip");
it("should patch a freeplay game", async function() {
slowTest(this);
await factorio.patch(savePath, [{
await libFactorio.patch(savePath, [{
name: "test",
version: "1.0.0",
dependencies: {},
@@ -39,7 +39,7 @@ describe("Integration of lib/factorio/patch", function() {
});
it("should remove old modules in a save", async function() {
slowTest(this);
await factorio.patch(savePath, []);
await libFactorio.patch(savePath, []);
let zip = await jszip.loadAsync(await fs.readFile(savePath));
assert.equal(zip.file("test/modules/test/test.lua"), null);
});