mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 05:50:00 -04:00
pkg fixes
This commit is contained in:
parent
5ce4f60514
commit
30bf6cb8f1
5 changed files with 22 additions and 6 deletions
|
@ -12,8 +12,20 @@ build({
|
||||||
platform: "node",
|
platform: "node",
|
||||||
// format: "esm",
|
// format: "esm",
|
||||||
bundle: true,
|
bundle: true,
|
||||||
|
minify: true,
|
||||||
|
|
||||||
outfile: "dist/main.js",
|
outfile: "dist/main.js",
|
||||||
plugins: [
|
plugins: [
|
||||||
makeAllPackagesExternalPlugin
|
makeAllPackagesExternalPlugin
|
||||||
],
|
],
|
||||||
|
})
|
||||||
|
build({
|
||||||
|
entryPoints: ["src/autoupdater.ts"],
|
||||||
|
platform: "node",
|
||||||
|
bundle: true,
|
||||||
|
minify: true,
|
||||||
|
outfile: "dist/autoupdater.js",
|
||||||
|
plugins: [
|
||||||
|
makeAllPackagesExternalPlugin
|
||||||
|
],
|
||||||
})
|
})
|
|
@ -4,9 +4,9 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "tsx src/main.ts",
|
"start": "tsx src/main.ts --start",
|
||||||
"dev": "nodemon -x tsx src/dev.ts",
|
"dev": "nodemon -x tsx src/dev.ts",
|
||||||
"prod": "node esbuild.bundle.js && pkg src/main.js"
|
"prod": "node esbuild.bundle.js && pkg dist/main.js --targets node18 -o dist/adrift-server && pkg dist/autoupdater.js --targets node18 -o dist/adrift-server-autoupdate"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
@ -45,4 +45,4 @@
|
||||||
"@types/ws": "^8.5.5",
|
"@types/ws": "^8.5.5",
|
||||||
"nodemon": "^3.0.1"
|
"nodemon": "^3.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -53,5 +53,4 @@ function start() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// downloadAndStart();
|
downloadAndStart();
|
||||||
start();
|
|
|
@ -20,6 +20,8 @@ import { exit } from "process";
|
||||||
import { datadir } from "./lib";
|
import { datadir } from "./lib";
|
||||||
import { PROTOCOL_VERSION } from "protocol";
|
import { PROTOCOL_VERSION } from "protocol";
|
||||||
|
|
||||||
|
export const SERVER_MILESTONE = "1.0";
|
||||||
|
|
||||||
|
|
||||||
async function config() {
|
async function config() {
|
||||||
let dir = datadir();
|
let dir = datadir();
|
||||||
|
@ -102,6 +104,7 @@ async function login(credentials: any) {
|
||||||
async function start() {
|
async function start() {
|
||||||
let dir = datadir();
|
let dir = datadir();
|
||||||
|
|
||||||
|
|
||||||
let conf;
|
let conf;
|
||||||
try {
|
try {
|
||||||
conf = JSON.parse(fs.readFileSync(`${dir}/config.json`).toString());
|
conf = JSON.parse(fs.readFileSync(`${dir}/config.json`).toString());
|
||||||
|
@ -111,6 +114,8 @@ async function start() {
|
||||||
let tracker = TrackerList[conf.tracker as keyof typeof TrackerList];
|
let tracker = TrackerList[conf.tracker as keyof typeof TrackerList];
|
||||||
|
|
||||||
console.log(chalk.blue("Starting server!"));
|
console.log(chalk.blue("Starting server!"));
|
||||||
|
console.log(chalk.blue(`Server version: ${SERVER_MILESTONE} - Protocol version: ${PROTOCOL_VERSION}`));
|
||||||
|
|
||||||
if (conf.type == "swarm") {
|
if (conf.type == "swarm") {
|
||||||
let connect = () => {
|
let connect = () => {
|
||||||
let trackerws = new WebSocket(`${tracker.tracker}/join?protocol=${PROTOCOL_VERSION}`);
|
let trackerws = new WebSocket(`${tracker.tracker}/join?protocol=${PROTOCOL_VERSION}`);
|
||||||
|
|
|
@ -26,5 +26,5 @@ let trackers = {
|
||||||
tracker: "wss://rafftracker.mercurywork.shop",
|
tracker: "wss://rafftracker.mercurywork.shop",
|
||||||
description: "a second official backup tracker",
|
description: "a second official backup tracker",
|
||||||
}
|
}
|
||||||
};
|
} as const;
|
||||||
export default trackers;
|
export default trackers;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue