Skip to content

Commit

Permalink
Fixed build files for server
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbrandsen authored Dec 22, 2023
1 parent 0fb6eeb commit 068b14a
Show file tree
Hide file tree
Showing 7 changed files with 36,364 additions and 36,354 deletions.
72,404 changes: 36,202 additions & 36,202 deletions package-lock.json

Large diffs are not rendered by default.

211 changes: 106 additions & 105 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,107 +1,108 @@
{
"name": "the-international-screeps-bot",
"version": "2.117.0",
"description": "",
"files": [
"dist"
],
"main": "dist/main.js",
"scripts": {
"init": "npm i",
"init-rust": "cd src/wasm && cargo build && rustup default nightly",
"init-total": "npm i && npm run init-rust",
"build-total": "npm run build-wasm && npm run build",
"build": "rollup -c",
"build-wasm": "cd src/wasm && wasm-pack build --target web --config build.rustflags=['-Ctarget-cpu=mvp'] -Z build-std=std,panic_abort && git add --force pkg/* && git rm --force pkg/.gitignore",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"push-mmo": "rollup -c --environment DEST:mmo",
"push-pserver": "rollup -c --environment DEST:pserver",
"watch-mmo": "rollup -cw --environment DEST:mmo",
"watch-pserver": "rollup -cw --environment DEST:pserver",
"server": "node server",
"test": "jest",
"test-watch": "jest --watch",
"test-cov": "jest --coverage",
"test-only": "bash -c 'jest --watch --coverage --verbose --collectCoverageFrom=\"**/*$1*\" $1' -- ",
"release": "semantic-release",
"compodoc": "npx @compodoc/compodoc -p tsconfig.json --disableSourceCode --output docs",
"compodoc:serve": "npx @compodoc/compodoc -p tsconfig.json --disableSourceCode -s --output docs"
},
"repository": {
"type": "git",
"url": "https://github.com/The-International-Screeps-Bot/The-International-Open-Source"
},
"bugs": {
"url": "https://github.com/The-International-Screeps-Bot/The-International-Open-Source/issues"
},
"author": "Carson Burke",
"contributors": [
"Pieterbrandsen"
],
"license": "GNU GPLv3",
"homepage": "https://github.com/The-International-Screeps-Bot/The-International-Open-Source",
"keywords": [
"screeps",
"screeps bot",
"commie bot",
"the international",
"the international screeps bot"
],
"devDependencies": {
"@compodoc/compodoc": "^1.1.19",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^11.0.1",
"@types/chai": "^4.3.0",
"@types/jest": "^27.0.1",
"@types/lodash": "3.10.2",
"@types/node": "^13.13.1",
"@types/screeps": "^3.3.3",
"@types/sinon": "^5.0.5",
"@types/sinon-chai": "^3.2.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"chai": "^4.2.0",
"dotenv": "^16.0.2",
"eslint": "^7.23.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsdoc": "^31.6.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-screeps": "^2.1.0",
"fastestsmallesttextencoderdecoder-encodeinto": "^1.0.22",
"javascript-obfuscator": "^4.0.2",
"jest": "^27.1.0",
"lodash": "^3.10.1",
"prettier": "^2.3.2",
"rollup": "^2.79.1",
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-screeps-world": "^1.0.4",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.36.0",
"screeps-grafana-go_carbon": "^1.0.5",
"screeps-jest": "^2.0.2",
"screeps-performance-server": "^1.12.1",
"screeps-viz": "^2.1.3",
"sinon": "^6.3.5",
"sinon-chai": "^3.2.0",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.0",
"tsconfig-paths": "^3.10.1",
"typescript": "4.4",
"yaml": "^1.10.2"
},
"dependencies": {
"base32768": "^3.0.1",
"mermaid": "^10.3.0",
"semantic-release": "^21.0.7",
"source-map": "~0.6.1"
},
"screeps_bot": true
"name": "the-international-screeps-bot",
"version": "2.117.0",
"description": "",
"files": [
"dist"
],
"main": "dist/main.js",
"scripts": {
"init": "npm i",
"init-rust": "cd src/wasm && cargo build && rustup default nightly",
"init-total": "npm i && npm run init-rust",
"build-total": "npm run build-wasm && npm run build",
"build": "rollup -c",
"build-wasm": "cd src/wasm && wasm-pack build --target web --config build.rustflags=['-Ctarget-cpu=mvp'] -Z build-std=std,panic_abort && git add --force pkg/* && git rm --force pkg/.gitignore",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"push-mmo": "rollup -c --environment DEST:mmo",
"push-pserver": "rollup -c --environment DEST:pserver",
"watch-mmo": "rollup -cw --environment DEST:mmo",
"watch-pserver": "rollup -cw --environment DEST:pserver",
"server": "node server",
"server-debug": "node server --debug",
"test": "jest",
"test-watch": "jest --watch",
"test-cov": "jest --coverage",
"test-only": "bash -c 'jest --watch --coverage --verbose --collectCoverageFrom=\"**/*$1*\" $1' -- ",
"release": "semantic-release",
"compodoc": "npx @compodoc/compodoc -p tsconfig.json --disableSourceCode --output docs",
"compodoc:serve": "npx @compodoc/compodoc -p tsconfig.json --disableSourceCode -s --output docs"
},
"repository": {
"type": "git",
"url": "https://github.com/The-International-Screeps-Bot/The-International-Open-Source"
},
"bugs": {
"url": "https://github.com/The-International-Screeps-Bot/The-International-Open-Source/issues"
},
"author": "Carson Burke",
"contributors": [
"Pieterbrandsen"
],
"license": "GNU GPLv3",
"homepage": "https://github.com/The-International-Screeps-Bot/The-International-Open-Source",
"keywords": [
"screeps",
"screeps bot",
"commie bot",
"the international",
"the international screeps bot"
],
"devDependencies": {
"@compodoc/compodoc": "^1.1.19",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^11.0.1",
"@types/chai": "^4.3.0",
"@types/jest": "^27.0.1",
"@types/lodash": "3.10.2",
"@types/node": "^13.13.1",
"@types/screeps": "^3.3.3",
"@types/sinon": "^5.0.5",
"@types/sinon-chai": "^3.2.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"chai": "^4.2.0",
"dotenv": "^16.0.2",
"eslint": "^7.23.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsdoc": "^31.6.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-screeps": "^2.1.0",
"fastestsmallesttextencoderdecoder-encodeinto": "^1.0.22",
"javascript-obfuscator": "^4.0.2",
"jest": "^27.1.0",
"lodash": "^3.10.1",
"prettier": "^2.3.2",
"rollup": "^2.79.1",
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-screeps-world": "^1.0.4",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.36.0",
"screeps-grafana-go_carbon": "^1.0.5",
"screeps-jest": "^2.0.2",
"screeps-performance-server": "^1.12.1",
"screeps-viz": "^2.1.3",
"sinon": "^6.3.5",
"sinon-chai": "^3.2.0",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.0",
"tsconfig-paths": "^3.10.1",
"typescript": "4.4",
"yaml": "^1.10.2"
},
"dependencies": {
"base32768": "^3.0.1",
"mermaid": "^10.3.0",
"semantic-release": "^21.0.7",
"source-map": "~0.6.1"
},
"screeps_bot": true
}
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ export default {

// warn about everything else
console.warn(warning.message)
}
},
}
25 changes: 20 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { join } = require('path')
const { execSync } = require('child_process')
require('dotenv').config()
const minimist = require('minimist')
const fs = require('fs')

const argv = minimist(process.argv.slice(2))

Expand All @@ -25,19 +26,33 @@ function getPorts() {
const ports = getPorts()

const options = { stdio: 'inherit' }
const srcPath = join(__dirname, 'src')
const botPath = join(__dirname, 'dist')
console.log('START')
// execSync(
// `npx screeps-grafana-go_carbon setup && npx screeps-grafana-go_carbon --grafanaPort=${ports.grafanaPort} --relayPort=${ports.relayPort} --force ${argv.debug ? '--debug' : ''} --deleteLogs --deleteWhisper`,
// options,
// )

function customCopyFile(src, dest, searchText, replaceText) {
const text = fs.readFileSync(src, 'utf8')

const regex = new RegExp(searchText, 'g')
const result = text.replace(regex, replaceText)
fs.writeFileSync(dest, result, 'utf8')
}

customCopyFile(join(srcPath,"settings.example.ts"), join(srcPath,"settings.ts"),'Example','')
customCopyFile(join(srcPath,"other/userScript/userScript.example.ts"), join(srcPath,"other/userScript/userScript.ts"),'Example','')
execSync('npm run build', options)

const cmdString = `npx screeps-performance-server --maxTickCount=${argv.maxTicks || 20000} --maxBots=10 --botFilePath=${botPath} --steamKey=${
process.env.STEAM_KEY
} --exportUrl=${process.env.EXPORT_API_URL} --serverPort=${ports.serverPort} --cliPort=${ports.cliPort} --force ${
argv.debug ? '--debug' : ''
} --deleteLogs --tickDuration=${argv.tickDuration || 250} --logFilter='Error:'`;
execSync(
`npx screeps-performance-server --maxTickCount=${argv.maxTicks || 20000} --maxBots=10 --botFilePath=${botPath} --steamKey=${
process.env.STEAM_KEY
} --exportUrl=${process.env.EXPORT_API_URL} --serverPort=${ports.serverPort} --cliPort=${ports.cliPort} --force ${
argv.debug ? '--debug' : ''
} --deleteLogs --tickDuration=${argv.tickDuration || 250} --logFilter='Error:'`,
cmdString,
options,
)
// if (argv.stopGrafana) execSync('npx screeps-grafana stop')
Expand Down
14 changes: 4 additions & 10 deletions src/other/userScript/userScript.example.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
// IMPORTANT: If you want to use the userScript, copy this file, name it userScript.ts, and rename references to userScriptExample to userScript and UserScriptExample to UserScript

class UserScriptExample implements UserScriptTemplate {
initialRun() {

}
run() {

}
endRun() {

}
initialRun() {}
run() {}
endRun() {}
}

global.userScriptExample = new UserScriptExample()
global.userScript = new UserScriptExample()
12 changes: 6 additions & 6 deletions src/settings.example.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { defaultSettings } from "./settingsDefault";
import { defaultSettings } from './settingsDefault'

// IMPORTANT: To setup your settings, copy this file, name it settings.ts, and rename settingsExample to settings

/**
* Edit these settings to your preference
*/
global.settingsExample = {
// Assigns the default settings
...defaultSettings,
// Your preferences here
roomVisuals: false,
// etc...
// Assigns the default settings
...defaultSettings,
// Your preferences here
roomVisuals: true,
// etc...
}

// Some examples for what you would have in settings.ts
Expand Down
50 changes: 25 additions & 25 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"compilerOptions": {
"allowJs": true,
"experimentalDecorators": true,
"module": "esnext",
"lib": ["es2019", "dom"],
"target": "es2019",
"moduleResolution": "Node",
"outDir": "dist",
"baseUrl": "src/",
"strict": true,
"noImplicitAny": true,
"removeComments": true,
"noImplicitReturns": true,
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": true,
"strictNullChecks": false,
"esModuleInterop": true,
"sourceMap": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
},
"exclude": ["node_modules", "dist", "docs"],
"typedocOptions": {
"out": "./docs"
}
"compilerOptions": {
"allowJs": true,
"experimentalDecorators": true,
"module": "esnext",
"lib": ["es2019", "dom"],
"target": "es2019",
"moduleResolution": "Node",
"outDir": "dist",
"baseUrl": "src/",
"strict": true,
"noImplicitAny": true,
"removeComments": true,
"noImplicitReturns": true,
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": true,
"strictNullChecks": false,
"esModuleInterop": true,
"sourceMap": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"exclude": ["node_modules", "dist", "docs"],
"typedocOptions": {
"out": "./docs"
}
}

0 comments on commit 068b14a

Please sign in to comment.