2018-06-26 23:43:26 +02:00
# Contributing to Bitburner
2018-06-21 16:04:02 +02:00
2018-06-21 16:47:51 +02:00
## In General
2021-09-05 01:09:30 +02:00
2018-06-21 16:04:02 +02:00
The game is made better because the community as a whole speaks up about
ways to improve the game. Here's some of the ways you can make your voice
heard:
2021-09-05 01:09:30 +02:00
2022-01-04 22:44:17 +01:00
- [Discord ](https://discord.gg/XKEGvHqVr3 )
2021-09-05 01:09:30 +02:00
There is a dedicated Discord instance set up for more free-form chats
between all members of the community. Regular players, heavy scripters,
Bitburner contributors, and everyone in between can be found on the
server.
- [Github Issues ](https://github.com/danielyxie/bitburner/issues )
Although the term "issues" can have a negative connotation, they are a
means of communicating with the community. A new Issue can be a
interesting new feature that you feel would improve the game. It could be
an unexpected behavior within the game. Or because the game is about
scripting perhaps there is something that is conflicting with the
browser's Javascript interaction. So please do not be afraid to open a
[new issue ](https://github.com/danielyxie/bitburner/issues/new ).
2018-08-30 17:16:32 +02:00
2018-06-26 23:43:26 +02:00
## Reporting Bugs
2021-09-05 01:09:30 +02:00
2018-08-30 17:16:32 +02:00
The recommended method for reporting a bug is by opening a
[Github Issue ](https://github.com/danielyxie/bitburner/issues ).
2018-06-26 23:43:26 +02:00
2018-10-25 03:40:07 +02:00
Alternatively, you can post a bug by creating a post on the
[game's subreddit ](https://www.reddit.com/r/Bitburner/ ).
2018-08-30 17:16:32 +02:00
Before submitting a bug report, please check to make sure the bug has not
already been reported as an [Issue ](https://github.com/danielyxie/bitburner/issues ).
2018-06-26 23:43:26 +02:00
#### How to Submit a Good Bug Report
2021-09-05 01:09:30 +02:00
- **Use a clear and descriptive title** for the issue
- **State your browser, your browser's version, and your computer's OS**
- **Attach your save file**, if you think it would help solve the issue
- **Provide instructions on how to reproduce the bug** in as much detail
as possible. If you cannot reliably reproduce the bug, then just try
your best to explain what was happening when the bug occurred
- **Provide any scripts** that triggered the bug if the issue is Netscript-related
- **Open your browser's Dev Console and report any error-related output**
that may be printed there. The Dev Console can be opened on most modern
browsers by pressing F12
2018-06-21 16:04:02 +02:00
2018-06-21 16:47:51 +02:00
## As a Developer
2021-09-05 01:09:30 +02:00
2018-08-30 17:16:32 +02:00
Anyone is welcome to contribute to Bitburner code. However, please read
the [license ](https://github.com/danielyxie/bitburner/blob/dev/license.txt )
2018-06-26 23:43:26 +02:00
and the [readme ](https://github.com/danielyxie/bitburner/blob/dev/README.md )
before doing so.
To contribute to Bitburner code, you will need to have
2018-06-21 16:04:02 +02:00
[NodeJS ](https://nodejs.org ) installed. When installing NodeJS, a utility
called `npm` is installed as well.
2018-06-26 23:43:26 +02:00
#### What are you Allowed to Contribute?
2021-09-05 01:09:30 +02:00
2018-08-30 17:16:32 +02:00
Not all code contributions will be accepted. The safest way to ensure
that you don't waste time working on something that gets rejected is to
run your idea(s)/plan(s) past [danielyxie ](https://github.com/danielyxie ) first.
2018-06-26 23:43:26 +02:00
You can contact him through:
2021-09-05 01:09:30 +02:00
- Github
- Discord
- [Reddit ](https://www.reddit.com/user/chapt3r/ )
2018-06-26 23:43:26 +02:00
2018-08-30 17:16:32 +02:00
Otherwise, here are some general guidelines for determining what types of
changes are okay to contribute:
2018-06-26 23:43:26 +02:00
##### Contributions that Will Most Likely Be Accepted
2021-09-05 01:09:30 +02:00
- Bug Fixes
- Quality-of-Life Changes
- Adding a new, commonly-requested Netscript function
- Fixing or improving UI elements
- Adding game settings/options
- Adding a new Terminal command
- Code Refactors that conform to good/standard practices
2018-06-26 23:43:26 +02:00
##### Contributions that will not be Accepted without prior approval
2021-09-05 01:09:30 +02:00
- Changes that directly affect the game's balance
- New gameplay mechanics
2018-06-26 23:43:26 +02:00
2022-01-04 17:00:04 +01:00
---
## How to setup fork properly
2021-10-11 22:28:01 +02:00
Fork and clone the repo
```
# This will add the game original code as a repo in your local copy
$ git remote add danielyxie git@github.com:danielyxie/bitburner.git
# You can verify you did this right by doing the following command
$ git remote show
danielyxie
origin
# Then download all the branches from the game. (there might be more branches)
$ git fetch danielyxie
From github.com:danielyxie/bitburner
* [new branch] dev -> danielyxie/dev
* [new branch] master -> danielyxie/master
# Makes sure you always start from `danielyxie/dev` to avoid merge conflicts.
```
2022-01-04 17:00:04 +01:00
## Development Workflow Best Practices
- Work in a new branch forked from the `dev` branch to isolate your new code
- Keep code-changes on a branch as small as possible. This makes it easier for code review. Each branch should be its own independent feature.
- Regularly rebase your branch against `dev` to make sure you have the latest updates pulled.
- When merging, always merge your branch into `dev` . When releasing a new update, then merge `dev` into `master`
## Running locally.
2021-10-19 01:12:41 +02:00
Install
- `npm` (maybe via `nvm` )
- Github Desktop (windows only)
- Visual Studio code (optional)
Inside the root of the repo run
`npm install` to install all the dependencies
`npm run start:dev` to launch the game in dev mode.
2021-12-25 23:18:49 +01:00
After that you can open any browser and navigate to `localhost:8000` and play the game.
2021-10-19 01:12:41 +02:00
Saving a file will reload the game automatically.
2021-12-31 03:45:57 +01:00
### How to build the electron app
Tested on Node v16.13.1 (LTS) on Windows
These steps only work in a bash-like environment, like MinGW for Windows.
```sh
# Install the main game dependencies & build the app in debug mode
npm install
npm run build:dev
# Use electron-packager to build the app to the .build/ folder
npm run electron
# When launching the .exe directly, you'll need the steam_appid.txt file in the root
# If not using windows, change this line accordingly
cp .build/bitburner-win32-x64/resources/app/steam_appid.txt .build/bitburner-win32-x64/steam_appid.txt
# And run the game...
.build/bitburner-win32-x64/bitburner.exe
```
### Submitting a Pull Request
2021-09-05 01:09:30 +02:00
2018-08-30 17:16:32 +02:00
When submitting a pull request with your code contributions, please abide by
2018-06-26 23:43:26 +02:00
the following rules:
2021-09-05 01:09:30 +02:00
- Work in a branch forked from `dev` to isolate the new code
- Ensure you have latest from the [game's main
2022-09-25 07:37:28 +02:00
repository](../../../tree/dev)
2021-09-05 01:09:30 +02:00
- Rebase your branch if necessary
- Run the game locally to test out your changes
- When submitting the pull request, make sure that the base fork is
_danielyxie/bitburner_ and the base is _dev_ .
- If your changes affect the game's UI, attach some screenshots or GIFs showing
the changes to the UI
- If your changes affect Netscript, provide some
scripts that can be used to test the Netscript changes.
- Ensure you have run `npm run lint` to make sure your changes conform to the
rules enforced across the code base. The command will fail if any of the
linters find a violation.
- Do not check in any bundled files (`dist\*.bundle.js`) or the `index.html`
in the root of the repository. These will be updated as part of official
releases.
2018-06-21 16:04:02 +02:00
2018-06-21 16:47:51 +02:00
## As a Documentor
2021-09-05 01:09:30 +02:00
2022-01-04 17:00:04 +01:00
To contribute to and view your changes to the BitBurner documentation on [Read The
Docs](http://bitburner.readthedocs.io/), you will
2018-08-30 17:16:32 +02:00
need to have Python installed, along with [Sphinx ](http://www.sphinx-doc.org ).
2018-06-21 16:04:02 +02:00
2022-01-26 11:13:38 +01:00
To make change to the [in-game documentation ](../markdown/bitburner.md ), you will need to modify the [TypeScript definitions ](../src/ScriptEditor/NetscriptDefinitions.d.ts ), not the markdown files.
2022-01-04 17:00:04 +01:00
We are using [API Extractor ](https://api-extractor.com/pages/tsdoc/doc_comment_syntax/ ) (tsdoc hints) to generate the markdown doc. Make your changes to the TypeScript definitions and then run `npm run doc` .
2018-06-21 16:04:02 +02:00
Before submitting your code for a pull request, please try to follow these
rules:
2021-09-05 01:09:30 +02:00
- Work in a branch forked from `dev` to isolate the new code
- Ensure you have latest from the [game's main
2022-09-25 07:37:28 +02:00
repository](../../../tree/dev)
2021-09-05 01:09:30 +02:00
- Rebase your branch if necessary
- When submitting the pull request, make sure that the base fork is
_danielyxie/bitburner_ and the base is _dev_ .
- Do not check in any generated files under `doc\` . The documentation is built
automatically by ReadTheDocs.
2022-01-04 17:00:04 +01:00
## Deploying a new version
Update the following
- `src/Constants.ts` `Version` and `LatestUpdate`
- `package.json` `version`
- `doc/source/conf.py` `version` and `release`
- `doc/source/changelog.rst`
- post to discord
- post to reddit.com/r/Bitburner