[docs] Big Docs Update
This commit is contained in:
15
README.md
15
README.md
@@ -6,12 +6,21 @@ Screeps Typescript Starter is a starting point for a Screeps AI written in Types
|
|||||||
|
|
||||||
You will need:
|
You will need:
|
||||||
|
|
||||||
- Node.JS (Latest LTS is recommended)
|
- [Node.JS](https://nodejs.org/en/download) (>= 8.0.0)
|
||||||
- A Package Manager (Yarn or NPM)
|
- A Package Manager ([Yarn](https://yarnpkg.com/en/docs/getting-started) or [npm](https://docs.npmjs.com/getting-started/installing-node))
|
||||||
|
- Rollup CLI (Optional, install via `npm install -g rollup`)
|
||||||
|
|
||||||
Download the latest source [here](https://github.com/screepers/screeps-typescript-starter/archive/master.zip) and extract it to a folder.
|
Download the latest source [here](https://github.com/screepers/screeps-typescript-starter/archive/master.zip) and extract it to a folder.
|
||||||
|
|
||||||
Open the folder in your terminal and run `npm install` (or `yarn`) to install the dependencies.
|
Open the folder in your terminal and run your package manager to install install the required packages and TypeScript declaration files:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# npm
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
yarn
|
||||||
|
```
|
||||||
|
|
||||||
Fire up your preferred editor with typescript installed and you are good to go!
|
Fire up your preferred editor with typescript installed and you are good to go!
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Screeps Typescript Starter is a starting point for a Screeps AI written in [Typescript](http://www.typescriptlang.org/). It provides everything you need to start writing your AI whilst leaving `main.ts` as empty as possible.
|
Screeps Typescript Starter is a starting point for a Screeps AI written in [Typescript](http://www.typescriptlang.org/). It provides everything you need to start writing your AI whilst leaving `main.ts` as empty as possible.
|
||||||
|
|
||||||
|
[View on GitHub](https://github.com/screepers/screeps-typescript-starter)
|
||||||
|
|
||||||
## What's new (v3.0)
|
## What's new (v3.0)
|
||||||
|
|
||||||
### Simpler setup!
|
### Simpler setup!
|
||||||
|
|||||||
@@ -4,21 +4,19 @@
|
|||||||
|
|
||||||
You will need:
|
You will need:
|
||||||
|
|
||||||
- Node.JS (Latest LTS is recommended)
|
- [Node.JS](https://nodejs.org/en/download) (>= 8.0.0)
|
||||||
- A Package Manager (`yarn` or `npm`)
|
- A Package Manager ([Yarn](https://yarnpkg.com/en/docs/getting-started) or [npm](https://docs.npmjs.com/getting-started/installing-node))
|
||||||
- Rollup CLI (Optional, install via `npm install -g rollup`)
|
- Rollup CLI (Optional, install via `npm install -g rollup`)
|
||||||
|
|
||||||
## Installing `npm` modules
|
## Installing `npm` modules
|
||||||
|
|
||||||
Run the following the command to install the required packages and TypeScript declaration files:
|
Open the folder in your terminal and run your package manager to install install the required packages and TypeScript declaration files:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# npm
|
||||||
npm install
|
npm install
|
||||||
```
|
|
||||||
|
|
||||||
Or if you're running `yarn`:
|
# yarn
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn
|
yarn
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# One-line PowerShell setup
|
# One-line PowerShell setup
|
||||||
|
|
||||||
> **TODO:** Make sure this works with v3.0.
|
> **Note:** As of v3.0, this no longer works. This issue is being tracked [here](https://github.com/ChrisTaylorRocks/screeps-typescript-starter-setup/issues/1).
|
||||||
|
|
||||||
[@ChrisTaylorRocks](https://github.com/ChrisTaylorRocks) has made a PowerShell script to get the starter kit up and running with a single command. Go check it out [here](https://github.com/ChrisTaylorRocks/screeps-typescript-starter-setup)!
|
[@ChrisTaylorRocks](https://github.com/ChrisTaylorRocks) has made a PowerShell script to get the starter kit up and running with a single command. Go check it out [here](https://github.com/ChrisTaylorRocks/screeps-typescript-starter-setup)!
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ From version 3.0 onwards, the starter kit uses Rollup as its main module bundler
|
|||||||
* Advanced tree-shaking (eliminates unused modules from the final bundle)
|
* Advanced tree-shaking (eliminates unused modules from the final bundle)
|
||||||
* Simpler configuration (compared to Webpack)
|
* Simpler configuration (compared to Webpack)
|
||||||
|
|
||||||
If you're still comfortable with using Webpack, the old version of the starter kit is available here (**TODO:** legacy branch link), but moving forward, no new features will be added to the Webpack version.
|
If you're still comfortable with using Webpack, the old version of the starter kit is available [here](https://github.com/screepers/screeps-typescript-starter/tree/legacy/webpack), but moving forward, no new features will be added to the Webpack version.
|
||||||
|
|
||||||
### Note: Rollup and named exports
|
### Note: Rollup and named exports
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
TypeScript is, in our opinion, the best language to write your Screeps codebase in. It combines the familiarity of JavaScript with the power of static typing.
|
TypeScript is, in our opinion, the best language to write your Screeps codebase in. It combines the familiarity of JavaScript with the power of static typing.
|
||||||
|
|
||||||
Static typing helps reduce the amount of bugs in your code by detecting type errors during compile time. In general, static type checkers like TypeScript and Flow [can prevent about 15%](https://blog.acolyer.org/2017/09/19/to-type-or-not-to-type-quantifying-detectable-bugs-in-javascript/) of the bugs that end up in committed code. Not only static typing, TypeScript also provides various productivity enhancements like advanced statement completion, as well as smart code refactoring.
|
Static type checkers like TypeScript and [Flow](https://flow.org/) help reduce the amount of bugs in your code by detecting type errors during compile time. In general, using static typing in your JavaScript code [can help prevent about 15%](https://blog.acolyer.org/2017/09/19/to-type-or-not-to-type-quantifying-detectable-bugs-in-javascript/) of the bugs that end up in committed code. Not only static typing, TypeScript also provides various productivity enhancements like advanced statement completion, as well as smart code refactoring.
|
||||||
|
|
||||||
To read more about how TypeScript can help you in Screeps, read [this Screeps World article](https://screepsworld.com/2017/07/typescreeps-getting-started-with-ts-in-screeps/) by [@bonzaiferroni](https://github.com/bonzaiferroni).
|
To read more about how TypeScript can help you in Screeps, read [this Screeps World article](https://screepsworld.com/2017/07/typescreeps-getting-started-with-ts-in-screeps/) by [@bonzaiferroni](https://github.com/bonzaiferroni).
|
||||||
|
|
||||||
@@ -12,13 +12,14 @@ This section provides TypeScript-specific tips & tricks for you to make the
|
|||||||
|
|
||||||
The `--strict` compiler flag was introduced in TypeScript 2.3 which activates TypeScript's "strict mode". The strict mode sets all strict typechecking options to `true` by default.
|
The `--strict` compiler flag was introduced in TypeScript 2.3 which activates TypeScript's "strict mode". The strict mode sets all strict typechecking options to `true` by default.
|
||||||
|
|
||||||
As of TypeScript 2.6, the affected options are:
|
As of TypeScript 2.7, the affected options are:
|
||||||
|
|
||||||
* `--noImplicitAny`
|
* `--noImplicitAny`
|
||||||
* `--noImplicitThis`
|
* `--noImplicitThis`
|
||||||
* `--alwaysStrict`
|
* `--alwaysStrict`
|
||||||
* `--strictNullChecks`
|
* `--strictNullChecks`
|
||||||
* `--strictFunctionTypes`
|
* `--strictFunctionTypes`
|
||||||
|
* `--strictPropertyInitialization`
|
||||||
|
|
||||||
Starting from version 2.0 of the starter kit, we've enabled the `--strict` flag in `tsconfig.json`. If this gives you compile time errors, you can try setting `"strict"` to `false`, or by overriding one or more of the options listed above.
|
Starting from version 2.0 of the starter kit, we've enabled the `--strict` flag in `tsconfig.json`. If this gives you compile time errors, you can try setting `"strict"` to `false`, or by overriding one or more of the options listed above.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user