Skip to content
Closed
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
26 changes: 26 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"permissions": {
"allow": [
"Bash(ls:*)",
"Bash(cat:*)",
"Bash(wc:*)",
"Bash(docker-compose ps:*)",
"Bash(docker-compose logs:*)",
"Bash(timeout 60 docker-compose logs:*)",
"Bash(npm run build:*)",
"Bash(npm run push-pserver:*)",
"Bash(node scripts/upload-pserver.js:*)",
"Bash(curl:*)",
"Bash(docker exec:*)",
"Bash(docker-compose down:*)",
"Bash(docker-compose up:*)",
"Bash(timeout 120 docker-compose logs:*)",
"Bash(npm run test-unit:*)",
"Bash(npm run test-unit:win:*)",
"Bash(npx tsc:*)",
"Bash(npm run scenario:*)",
"Bash(npx ts-node:*)",
"Bash(docker-compose restart:*)"
]
}
}
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Screeps Private Server Configuration
# Copy this to .env and fill in your values

# Steam API Key (required for server authentication)
# Get one at: https://steamcommunity.com/dev/apikey
STEAM_KEY=your_steam_api_key_here
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

# Screeps Config
screeps.json
.screeps.json
Gruntfile.js

# Environment variables (contains API keys)
.env

# ScreepsServer data from integration tests
/server
Expand Down
5 changes: 5 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extension": ["ts"],
"require": ["ts-node/register", "tsconfig-paths/register"],
"spec": "test/unit/**/*.ts"
}
8 changes: 8 additions & 0 deletions .screeps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"host": "localhost",
"port": 21025,
//"username": "YOUR_USERNAME",
//"password": "YOUR_PASSWORD",
"branch": "default",
"ptr": false
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"editor.formatOnSave": false
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": true,
"editor.renderWhitespace": "boundary",
Expand Down
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "cmd.exe",
"args": [
"/c",
"npm run build"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Build and Deploy",
"type": "shell",
"command": "cmd.exe",
"args": [
"/c",
"npm run build && xcopy /Y /E D:\\repo\\DarkPhoenix\\dist\\main.js C:\\Users\\reini\\AppData\\Local\\Screeps\\scripts\\127_0_0_1___21025\\default\\"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}
71 changes: 71 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# DarkPhoenix Screeps Makefile
# Quick commands for development and testing

.PHONY: help build test sim-start sim-stop sim-cli deploy watch reset bench scenario

help:
@echo "DarkPhoenix Development Commands"
@echo ""
@echo "Build & Deploy:"
@echo " make build - Build the project"
@echo " make deploy - Build and deploy to private server"
@echo " make watch - Watch mode with auto-deploy"
@echo ""
@echo "Testing:"
@echo " make test - Run unit tests"
@echo " make scenario - Run all scenarios"
@echo ""
@echo "Simulation Server:"
@echo " make sim-start - Start Docker server"
@echo " make sim-stop - Stop Docker server"
@echo " make sim-cli - Open server CLI"
@echo " make reset - Reset world data"
@echo " make bench - Run benchmark (1000 ticks)"
@echo ""
@echo "Quick Combos:"
@echo " make quick - Build + deploy + run 100 ticks"
@echo " make full-test - Start server + deploy + scenarios"

# Build
build:
npm run build

# Deploy
deploy:
./scripts/sim.sh deploy

watch:
./scripts/sim.sh watch

# Testing
test:
npm test

scenario:
npm run scenario:all

# Simulation Server
sim-start:
./scripts/sim.sh start

sim-stop:
./scripts/sim.sh stop

sim-cli:
./scripts/sim.sh cli

reset:
./scripts/sim.sh reset

bench:
./scripts/sim.sh bench

# Quick iteration
quick: build deploy
./scripts/sim.sh tick 100

# Full test suite
full-test: sim-start
@sleep 5
@make deploy
@make scenario
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ Finally, there are also NPM scripts that serve as aliases for these commands in

#### Important! To upload code to a private server, you must have [screepsmod-auth](https://github.com/ScreepsMods/screepsmod-auth) installed and configured!

## Local Testing with Private Server

This project includes a Docker-based private server for local testing:

```bash
# Start the server
docker-compose up -d

# Deploy your code
npm run sim:deploy

# Run simulation scenarios
npm run scenario bootstrap
npm run scenario energy-flow
```

See [docs/in-depth/testing.md](docs/in-depth/testing.md) for full documentation on simulation testing.

## Typings

The type definitions for Screeps come from [typed-screeps](https://github.com/screepers/typed-screeps). If you find a problem or have a suggestion, please open an issue there.
Expand Down
Loading