Onboarding
davidabrahams edited this page Apr 15, 2019
·
6 revisions
- Install nvm to manage your node versions.
- Restart your bash session and install node using nvm:
nvm install 10.15.3
(note, this is the node version we currently use in CI. Other versions are not guaranteed to be functional). - In the root directory of this repo, install the node packages, including webpack:
npm install
- Run
npm test
. This will run all the unit tests.
- Run
npm run lint:fix
. This lint your code and perform any fixes that can be done automatically. It will then give a report of what you still need to fix.
- Run
npm run build
. This will start webpack, which will "watch" the files insrc/
and will update the bundle automatically. This will also run eslint whenever your code changes so you can see if the linter fails. - You can append
:once
to the previous command to run webpack without watching the files for changes.
To run the bot in tagpro, you must first install and setup Tampermonkey in your browser of choice. Go to https://tampermonkey.net/ for the download.
- Allow Tampermonkey to have access to local files.
-
Google Chrome: edit your extension settings for Tampermonkey and check
Allow access to file URLs
. -
Firefox: within Tampermonkey, go to settings, under
General
setConfig mode
toAdvanced
, then underSecurity
setAllow scripts to access local files
toExternals (@require and @resource)
.
-
Google Chrome: edit your extension settings for Tampermonkey and check
- Open your Tampermonkey Dashboard, create a new user script, and paste the following code:
// ==UserScript==
// @name Chauncy-Crib TagproBot
// @description A ball of paint AI
// @author altodyte, billmwong, davidabrahams, shanek21
// @include http://*.newcompte.fr:*
// @require file:<PATH_TO_LOCAL_FILE>
// ==/UserScript==
For example,
// ==UserScript==
// @name Chauncy-Crib TagproBot
// @description A ball of paint AI
// @author altodyte, billmwong, davidabrahams, shanek21
// @include http://*.newcompte.fr:*
// @require file:/home/skelly1/Documents/tpb/tagprobot/public/bundle.js
// ==/UserScript==
Hit save on your user script. Now every time you run the website indicated in the @include
, Tampermonkey should read from your local specified file. Note: this will take ever so slightly longer than hard-coding a user script into the Tampermonkey editor, though I doubt this delay will cause any problems.