mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-18 06:43:13 +09:00
Merge branch 'explosivegaming:main' into translate
This commit is contained in:
69 files changed
+218
-571
No files matched your search
@@ -24,7 +24,6 @@ export const plugin: lib.PluginDeclaration = {
|
||||
name: "exp_server_list",
|
||||
title: "ExpGaming - Server List",
|
||||
description: "Clusterio plugin sharing the details of every instance with the others",
|
||||
webEntrypoint: "./web",
|
||||
|
||||
controllerEntrypoint: "./dist/node/controller.js",
|
||||
instanceEntrypoint: "./dist/node/instance.js",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"type": "module",
|
||||
"main": "dist/node/index.js",
|
||||
"scripts": {
|
||||
"prepare": "tsc --build && webpack-cli --env production",
|
||||
"prepare": "tsc --build && vite build",
|
||||
"test": "tap --type-strip-only --disable-coverage --allow-empty-coverage test/*.test.js",
|
||||
"coverage": "tap --coverage-report=text test/*.test.js"
|
||||
},
|
||||
@@ -37,9 +37,7 @@
|
||||
"fengari": "^0.1.5",
|
||||
"tap": "^21.1.0",
|
||||
"typescript": "catalog:",
|
||||
"webpack": "catalog:",
|
||||
"webpack-cli": "catalog:",
|
||||
"webpack-merge": "catalog:"
|
||||
"vite": "catalog:"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sinclair/typebox": "catalog:",
|
||||
|
||||
@@ -35,18 +35,19 @@ async function startPlugin(t2, servers = [server(1), server(2)]) {
|
||||
instanceConfig.set("instance.id", 1);
|
||||
instanceConfig.set("instance.name", "test");
|
||||
|
||||
const instance = new Instance(
|
||||
{ assignGamePort: () => 1 }, new TestConnector(), t2.testdir(), "factorioDir", instanceConfig
|
||||
);
|
||||
|
||||
const state = { sent: [], rcons: [] };
|
||||
instance.server = {
|
||||
const server = {
|
||||
on: () => {},
|
||||
handle: () => {},
|
||||
sendRcon: async command => {
|
||||
state.rcons.push(command);
|
||||
return "";
|
||||
},
|
||||
};
|
||||
const instance = new Instance(
|
||||
{ assignGamePort: () => 1 }, new TestConnector(), t2.testdir(), instanceConfig, server
|
||||
);
|
||||
instance.sendTo = async (dst, request) => {
|
||||
if (request instanceof lib.InstanceStatusChangedEvent) {
|
||||
return undefined;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"extends": "../tsconfig.browser.json",
|
||||
"include": [ "web/**/*.tsx", "web/**/*.ts", "index.ts", "messages.ts", "package.json" ],
|
||||
"include": [ "index.ts", "messages.ts", "package.json" ],
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { clusterioPlugin } from "@clusterio/web_ui/vite.mjs";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [clusterioPlugin()],
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
export default function() {};
|
||||
@@ -1,29 +0,0 @@
|
||||
"use strict";
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const { merge } = require("webpack-merge");
|
||||
|
||||
const common = require("@clusterio/web_ui/webpack.common");
|
||||
|
||||
module.exports = (env = {}) => merge(common(env), {
|
||||
context: __dirname,
|
||||
entry: "./web/index.tsx",
|
||||
output: {
|
||||
path: path.resolve(__dirname, "dist", "web"),
|
||||
},
|
||||
plugins: [
|
||||
new webpack.container.ModuleFederationPlugin({
|
||||
name: "exp_server_list",
|
||||
library: { type: "window", name: "plugin_exp_server_list" },
|
||||
exposes: {
|
||||
"./": "./index.ts",
|
||||
"./package.json": "./package.json",
|
||||
"./web": "./web/index.tsx",
|
||||
},
|
||||
shared: {
|
||||
"@clusterio/lib": { import: false },
|
||||
"@clusterio/web_ui": { import: false },
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
Reference in new issue
Block a user