Skip to content

Commit

Permalink
es5 and es6
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneT2000 committed Oct 22, 2020
1 parent c895f21 commit 491e06a
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 146 deletions.
365 changes: 229 additions & 136 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@lux-ai/2020-challenge",
"version": "1.1.17",
"version": "1.1.20",
"description": "The design for the first Lux AI Challenge",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "lib/es5/index.js",
"types": "lib/es5/index.d.ts",
"scripts": {
"test": "nyc --reporter=html mocha tests/*.spec.ts",
"build": "rm -rf lib && tsc -p tsconfig-build.json && tsc -p tsconfig-buildes5.json",
"prettier": "prettier --write 'src/**/*.ts' 'tests/**/*.ts'",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --fix --ext .ts",
"build": "rm -rf lib && tsc"
"lint:fix": "eslint . --fix --ext .ts"
},
"repository": {
"type": "git",
Expand All @@ -32,7 +32,7 @@
"dependencies": {
"@types/seedrandom": "^2.4.28",
"colors": "^1.4.0",
"dimensions-ai": "^4.6.0",
"dimensions-ai": "^4.6.8",
"nanoid": "^3.1.12",
"seedrandom": "^3.0.5"
},
Expand Down
3 changes: 2 additions & 1 deletion src/Game/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { GameMap } from '../GameMap';
import { Cart, Worker } from '../Unit';
import { LuxMatchConfigs } from '../types';
import { DEFAULT_CONFIGS } from '../defaults';
import { MatchEngine, MatchWarn, Match } from 'dimensions-ai';
import { MatchWarn } from 'dimensions-ai/lib/main/DimensionError';
import { MatchEngine, Match } from 'dimensions-ai';
import {
Action,
SpawnCartAction,
Expand Down
1 change: 1 addition & 0 deletions src/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export class LuxDesignLogic {
// check if any agents are terminated and finish game if so
const agentsTerminated = [false, false];
match.agents.forEach((agent) => {
// FRONTEND needs to pass in psuedo isTerminated() function that returns true on the turn an agent terminated itself
if (agent.isTerminated()) {
agentsTerminated[agent.id] = true;
}
Expand Down
20 changes: 20 additions & 0 deletions tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es6",
"module": "es6",
"moduleResolution": "node",
"outDir": "lib/es6",
"sourceMap": true,
"declaration": true,
"allowJs": true,
"esModuleInterop": true,
"isolatedModules": true,
"resolveJsonModule": true,
"types": [
"node"
]
},
"include": [
"src/**/*"
]
}
20 changes: 20 additions & 0 deletions tsconfig-buildes5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"module": "CommonJS",
"moduleResolution": "node",
"outDir": "lib/es5",
"sourceMap": true,
"declaration": true,
"allowJs": true,
"esModuleInterop": true,
"isolatedModules": true,
"resolveJsonModule": true,
"types": [
"node"
]
},
"include": [
"src/**/*"
]
}
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es6",
"module": "es6",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "lib/",
"sourceMap": true,
Expand All @@ -15,6 +15,7 @@
]
},
"include": [
"src/**/*"
"src/**/*",
"tests/**/*"
]
}

0 comments on commit 491e06a

Please sign in to comment.