Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all dependencies, tooling cleanup #208

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
[*]
charset=utf-8
end_of_line=crlf
end_of_line=lf
insert_final_newline=false
indent_style=space
indent_size=4

[{.babelrc,.stylelintrc,.eslintrc,jest.config,*.json,*.jsb3,*.jsb2,*.bowerrc}]
indent_style=space
indent_size=2
end_of_line=lf
trim_trailing_whitespace=true

[{*.ats,*.ts}]
[{*.ats,*.ts,*.js}]
indent_style=tab
tab_width=4
end_of_line=lf
trim_trailing_whitespace=true

[tslint.json]
indent_style=space
indent_size=2

end_of_line=lf
trim_trailing_whitespace=true
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.11.0
28 changes: 28 additions & 0 deletions obfuscator.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compact": false,
"controlFlowFlattening": false,
"deadCodeInjection": false,
"debugProtection": false,
"debugProtectionInterval": 0,
"disableConsoleOutput": false,
"identifierNamesGenerator": "hexadecimal",
"log": false,
"numbersToExpressions": false,
"renameGlobals": false,
"selfDefending": true,
"simplify": true,
"splitStrings": false,
"stringArray": true,
"stringArrayCallsTransform": false,
"stringArrayCallsTransformThreshold": 0.5,
"stringArrayEncoding": ["rc4"],
"stringArrayIndexShift": true,
"stringArrayRotate": true,
"stringArrayShuffle": true,
"stringArrayWrappersCount": 1,
"stringArrayWrappersChainedCalls": true,
"stringArrayWrappersParametersMaxCount": 2,
"stringArrayWrappersType": "variable",
"stringArrayThreshold": 1,
"unicodeEscapeSequence": false
}
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Overmind",
"name": "overmind",
"version": "0.6.0",
"description": "Overmind Screeps AI",
"author": "Ben Bartlett",
Expand All @@ -16,7 +16,7 @@
"build": "tsc -p .",
"lint": "tslint \"src/**/*.ts\"",
"clean": "rm -rf tsc-out && rm -rf dist",
"obfuscate": "tsc && javascript-obfuscator tsc-out/Overmind.js --output src/Overmind_obfuscated.js --compact false --self-defending true --string-array true --string-array-threshold 1 --string-array-encoding rc4 && javascript-obfuscator tsc-out/assimilation/Assimilator.js --output src/assimilation/Assimilator_obfuscated.js --compact false --self-defending true --string-array true --string-array-threshold 1 --string-array-encoding rc4",
"obfuscate": "tsc && javascript-obfuscator --config obfuscator.config.json tsc-out/Overmind.js --output src/Overmind_obfuscated.js && javascript-obfuscator --config obfuscator.config.json tsc-out/assimilation/Assimilator.js --output src/assimilation/Assimilator_obfuscated.js",
"compile": "rollup -c",
"push-main": "rollup -c --environment DEST:main",
"push-seasonal": "rollup -c --environment DEST:seasonal",
Expand All @@ -28,23 +28,24 @@
"node": "^20.11"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@rollup/plugin-commonjs": "^25.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@types/columnify": "^1.5.1",
"@types/lodash": "3.10.2",
"@types/node": "^20.11.16",
"@types/screeps": "^3.3.7",
"javascript-obfuscator": "^4.1.0",
"rollup": "^2.6.0",
"rollup-plugin-progress": "^1.1.1",
"rollup-plugin-screeps": "^1.0.0",
"rollup-plugin-typescript2": "^0.27.0",
"tslint": "^5.20.0",
"typedoc": "^0.14.2",
"rollup": "^3.27.1",
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-screeps": "^1.0.1",
"rollup-plugin-typescript2": "^0.35.0",
"tslint": "^6.1.3",
"typedoc": "^0.25.7",
"typescript": "5.3.3"
},
"dependencies": {
"@tensorflow/tfjs": "^1.2.11",
"columnify": "1.5.4",
"columnify": "^1.6.0",
"onnxjs": "^0.1.6",
"source-map": "0.7.3"
}
Expand Down
17 changes: 7 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import commonjs from '@rollup/plugin-commonjs';
import progress from "rollup-plugin-progress";
import typescript from "rollup-plugin-typescript2";
import screeps from "rollup-plugin-screeps";
import { readFileSync } from 'fs';

let cfg;
const dest = process.env.DEST;
if (!dest) {
console.log('\x1b[46m%s\x1b[0m \x1b[36m%s\x1b[0m', 'Compiling Overmind...', '(deploy destination: none)');
} else if ((cfg = require("./screeps")[dest]) == null) {
throw new Error("Invalid upload destination");
} else {
cfg = JSON.parse(readFileSync("./screeps.json"))[dest];
if (!cfg) {
throw new Error("Invalid upload destination");
}
console.log('\x1b[46m%s\x1b[0m \x1b[36m%s\x1b[0m', 'Compiling Overmind...', `(deploy destination: ${dest})`);
console.log(`Pushing at time: ${new Date()})`);
}
Expand All @@ -28,13 +31,7 @@ export default {
plugins: [
progress({clearLine: true}),
resolve(),
commonjs({
namedExports: {
'src/Overmind_obfuscated': ['_Overmind'],
'screeps-profiler': ['profiler'],
'columnify': ['columnify']
}
}),
commonjs(),
typescript({tsconfig: "./tsconfig.json"}),
screeps({config: cfg, dryRun: cfg == null})
],
Expand Down Expand Up @@ -70,4 +67,4 @@ export default {
'//\n'
},

}
}
1 change: 0 additions & 1 deletion src/declarations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

// declare module 'screeps-profiler'; // I stopped using the typings for this because it was fucking up the Game typings

declare module 'columnify';

// If TS2451 gets thrown, change "declare let Game: Game;" to "declare var Game: Game;"
// in typed-screeps index.d.ts file. (See issue #61 until the package is updated)
Expand Down