Giter VIP home page Giter VIP logo

screeps-typescript-starter's Introduction

screeps-typescript-starter v2.0

Starter kit for TypeScript-based Screeps AI codes.


screeps-typescript-starter is a starter kit for building Screeps AIs in TypeScript. It is based on the original starter kit by Marko Sulamägi, but with extra tools for easy compiling/deploying of scripts to the Screeps server, as well as a base framework for running tests.

Download the latest zipped copy here.

What's new

  • @bonzaiferroni has put out some really useful guides to get started with TypeScript development on Screeps. Go read them! (Guide #1, Guide #2)
  • We've consolidated all of our guides into the wiki page. This README will be simplified to include the essentials to get you up and running. Feel free to contribute to the wiki as well!

Table of contents

Features

  • Automated deploy to public and private Screeps servers
  • Live reload compiling of typescript code
  • Highly configurable environment with sane defaults
  • Pre-configured linting rules customized for screeps
  • Typescript Screeps typings
  • Logger which links with source code and git repo
  • Screeps profiler
  • "Snippets" directory for code you want to save, but don't want compiled or linted
  • Modest starter code to get you started, but not hold your hand

Quick start

By far, the easiest and quickest way to get started with TypeScript development on Screeps is to follow @bonzaiferroni's guides on Screeps World. Go read them!

Requirements

We'll assume you have already downloaded/cloned the starter kit.

  • Node.js (latest LTS is recommended)
  • Typings
  • Yarn - Optional. You can use npm if you don't want to, but this is for your own sanity.

Why Yarn? Yarn has a stronger dependency tree, supports lockfiles, and fixes most of the issues pre-npm@5. It also has a host of unique features as described on their website, and is entirely compatible with npm.

Installing the modules

Run the following the command to install the required packages and TypeScript declaration files if you are using yarn:

$ yarn

or, for npm:

$ npm install

Initial configuration

Configuring Screeps credentials

Create a copy of config/credentials.example.json and rename it to config/credentials.json.

WARNING: This file contains your secret credentials. DO NOT commit it into your repository!

# config/credentials.json
$ cp config/credentials.example.json config/credentials.json

In the newly created credentials.json file, change the email and password properties with your Screeps credentials. The serverPassword, token, and gzip options are only for private servers that support them. If you are uploading to the public Screeps server, you should delete these fields from your credentials file.

Changing the upload branch

Go to config/config.dev.ts, and you'll find the following lines:

const credentials: Credentials = require("./credentials.json");
credentials.branch = "dev";

Change the credentials.branch property you want to initially build and upload to, e.g. "default". Note that due to the Screeps API limitations, you still have to create a branch with a matching name in the Screeps client by cloning an existing branch. The compiler will yell at you when you forgot to do so.

Advanced configuration

See Configuration page on the screeps-typescript-starter wiki for more in-depth info on configuration options.

Running the compiler

# To compile and upload your TypeScript files on the fly in "watch mode":
$ npm start

# To compile and deploy once:
$ npm run deploy

Further reading

To find out more about what else you can do with screeps-typescript-starter, head over to the screeps-typescript-starter wiki to find more guides, tips and tricks.

Contributing

Issues, Pull Requests, and Wiki contributions are welcome! Please read the Contributing Guidelines beforehand.

Special thanks

Marko Sulamägi, for the original Screeps/TypeScript sample project.

screeps-typescript-starter's People

Contributors

alinanova21 avatar bryanbecker avatar ezolenko avatar ratuple avatar resir014 avatar rickpelletier avatar ruemic avatar sean-brown avatar valerian avatar viezevingertjes avatar wavehack avatar

Watchers

 avatar  avatar

Forkers

hnbc1130

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.