Finalise docs
Notes: * Will fill in the 'What's new' section after @arcath is finished with his article draft * Will add the legacy branch link when it's available
This commit is contained in:
39
CONTRIBUTING.md
Normal file
39
CONTRIBUTING.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Contributing guidelines
|
||||
|
||||
This document outlines guides to get started on developing the starter kit.
|
||||
|
||||
## Contributing to the docs
|
||||
|
||||
We welcome contributions to the docs! We're looking for ways to make the starter kit documentation better, as well as many other tips and tricks about Screeps AI development in TypeScript.
|
||||
|
||||
You can start working on the docs locally as well. First, you'll need to install the [Gitbook](https://www.gitbook.com/) CLI.
|
||||
|
||||
```bash
|
||||
npm install -g gitbook-cli
|
||||
```
|
||||
|
||||
To run a local Gitbook server, run the following command on the project's root directory.
|
||||
|
||||
```bash
|
||||
gitbook serve
|
||||
```
|
||||
|
||||
## The Five Golden Rules
|
||||
|
||||
The simple steps of contributing to any GitHub project are as follows:
|
||||
|
||||
1. [Fork the repository](https://github.com/screepers/screeps-typescript-starter/fork)
|
||||
2. Create your feature branch: `git checkout -b my-new-feature`
|
||||
3. Commit your changes: `git commit -am 'Add some feature'`
|
||||
4. Push to the branch: `git push -u origin my-new-feature`
|
||||
5. Create a [Pull Request](https://github.com/screepers/screeps-typescript-starter/pulls)!
|
||||
|
||||
To keep your fork of in sync with this repository, [follow this guide](https://help.github.com/articles/syncing-a-fork/).
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
We accept almost all pull requests, as long as the following criterias are met:
|
||||
|
||||
* Your code must pass all of the linter checks (`npm run lint`)
|
||||
* When adding a new feature, make sure it doesn't increase the complexity of the tooling. We want this starter kit to be approachable to folks who have little to no knowledge of TypeScript, or even JavaScript.
|
||||
* When making changes that are potentially breaking, careful discussion must be done with the community at large. Generally we do this either on the [#typescript](https://screeps.slack.com/messages/typecript/) channel on the Screeps Slack, or on the corresponding pull request discussion thread.
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Screeps Typescript Starter is a starting point for a Screeps AI written in Typescript. It provides everything you need to start writing your AI whilst leaving `main.ts` as empty as possible.
|
||||
|
||||
## What's New
|
||||
## What's new
|
||||
|
||||
[TODO]
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* [Deploy destinations](./in-depth/deploy-destinations.md)
|
||||
* [TypeScript](./in-depth/typescript.md)
|
||||
* [Cookbook](./in-depth/cookbook.md)
|
||||
* [TODO]
|
||||
|
||||
---
|
||||
|
||||
* [FAQ & Troubleshooting](./faq-troubleshooting.md)
|
||||
* [Troubleshooting](./troubleshooting.md)
|
||||
* [Contributing guidelines](./contributing.md)
|
||||
|
||||
39
docs/contributing.md
Normal file
39
docs/contributing.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Contributing guidelines
|
||||
|
||||
This document outlines guides to get started on developing the starter kit.
|
||||
|
||||
## Contributing to the docs
|
||||
|
||||
We welcome contributions to the docs! We're looking for ways to make the starter kit documentation better, as well as many other tips and tricks about Screeps AI development in TypeScript.
|
||||
|
||||
You can start working on the docs locally as well. First, you'll need to install the [Gitbook](https://www.gitbook.com/) CLI.
|
||||
|
||||
```bash
|
||||
npm install -g gitbook-cli
|
||||
```
|
||||
|
||||
To run a local Gitbook server, run the following command on the project's root directory.
|
||||
|
||||
```bash
|
||||
gitbook serve
|
||||
```
|
||||
|
||||
## The Five Golden Rules
|
||||
|
||||
The simple steps of contributing to any GitHub project are as follows:
|
||||
|
||||
1. [Fork the repository](https://github.com/screepers/screeps-typescript-starter/fork)
|
||||
2. Create your feature branch: `git checkout -b my-new-feature`
|
||||
3. Commit your changes: `git commit -am 'Add some feature'`
|
||||
4. Push to the branch: `git push -u origin my-new-feature`
|
||||
5. Create a [Pull Request](https://github.com/screepers/screeps-typescript-starter/pulls)!
|
||||
|
||||
To keep your fork of in sync with this repository, [follow this guide](https://help.github.com/articles/syncing-a-fork/).
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
We accept almost all pull requests, as long as the following criterias are met:
|
||||
|
||||
* Your code must pass all of the linter checks (`npm run lint`)
|
||||
* When adding a new feature, make sure it doesn't increase the complexity of the tooling. We want this starter kit to be approachable to folks who have little to no knowledge of TypeScript, or even JavaScript.
|
||||
* When making changes that are potentially breaking, careful discussion must be done with the community at large. Generally we do this either on the [#typescript](https://screeps.slack.com/messages/typecript/) channel on the Screeps Slack, or on the corresponding pull request discussion thread.
|
||||
@@ -1,5 +0,0 @@
|
||||
# FAQ & Troubleshooting
|
||||
|
||||
This page outlines any common issues that you'll run into while setting up the TypeScript starter, as well as how to fix them.
|
||||
|
||||
[TODO]
|
||||
@@ -12,8 +12,6 @@ Then you can import these libraries just like you would any other `npm` module.
|
||||
|
||||
Some module bundlers even support performing further optimisations like eliminating unused module functions from your final bundled code (aka. _tree-shaking_), reducing the size of your final bundled JS even further.
|
||||
|
||||
[TODO: more advantages of bundling code, if any]
|
||||
|
||||
## Rollup
|
||||
|
||||
From version 3.0 onwards, the starter kit uses Rollup as its main module bundler. Some useful features of Rollup include:
|
||||
|
||||
@@ -22,7 +22,14 @@ Starting from version 2.0 of the starter kit, we've enabled the `--strict` flag
|
||||
|
||||
TSLint checks your TypeScript code for readability, maintainability, and functionality errors, and can also enforce coding style standards.
|
||||
|
||||
[TODO: describe TSlint rules used in brief]
|
||||
This project provides TSLint rules through a `tslint.json` file, which extends the recommended rules from TSLint defined [here](https://github.com/palantir/tslint/blob/next/src/configs/recommended.ts).
|
||||
|
||||
We've made some changes to these rules, which we considered necessary and/or relevant to a proper Screeps project:
|
||||
|
||||
- set the [forin](http://palantir.github.io/tslint/rules/forin/) rule to `false`, it was forcing `for ( ... in ...)` loops to check if object members were not coming from the class prototype.
|
||||
- set the [interface-name](http://palantir.github.io/tslint/rules/interface-name/) rule to `false`, in order to allow interfaces that are not prefixed with `I`.
|
||||
- set the [no-console](http://palantir.github.io/tslint/rules/no-console/) rule to `false`, in order to allow using `console`.
|
||||
- in the [variable-name](http://palantir.github.io/tslint/rules/variable-name/) rule, added `allow-leading-underscore`.
|
||||
|
||||
### Customising TSLint
|
||||
|
||||
|
||||
13
docs/troubleshooting.md
Normal file
13
docs/troubleshooting.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Troubleshooting
|
||||
|
||||
This page outlines any common issues that you'll run into while setting up the TypeScript starter, as well as how to fix them.
|
||||
|
||||
## Unable to upload code to Screeps private server
|
||||
|
||||
If you're getting the following error:
|
||||
|
||||
```
|
||||
(node:80116) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot POST /api/auth/signin
|
||||
```
|
||||
|
||||
Make sure you have [screepsmod-auth](https://github.com/ScreepsMods/screepsmod-auth) installed on your private server, and you've set a password on the account in your private server as well.
|
||||
Reference in New Issue
Block a user