Skip to content

Commit d58fc3a

Browse files
authored
[BREAKING] Version 6 (#322)
1 parent 830278d commit d58fc3a

File tree

157 files changed

+7907
-4699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+7907
-4699
lines changed

.circleci/config.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
version: 2
2+
jobs:
3+
test:
4+
docker:
5+
- image: node:latest
6+
steps:
7+
- checkout
8+
- restore_cache:
9+
key: dependency-cache-{{ checksum "package.json" }}
10+
- run:
11+
name: Install modules
12+
command: npm install
13+
- save_cache:
14+
key: dependency-cache-{{ checksum "package.json" }}
15+
paths:
16+
- node_modules
17+
- run:
18+
name: Test
19+
command: npm test
20+
build:
21+
docker:
22+
- image: docker:latest
23+
steps:
24+
- run:
25+
name: Git
26+
command: apk add --update git
27+
- checkout
28+
- setup_remote_docker
29+
- run:
30+
name: Initialize submodule
31+
command: git submodule update --init --remote
32+
- run:
33+
name: Build Docker image
34+
command: if [ "$CIRCLE_BRANCH" = "master" ]; then docker build -t dougley/wildbeast:latest --build-arg buildno=$CIRCLE_BUILD_NUM --build-arg commitsha=$CIRCLE_SHA1 .; else docker build -t dougley/wildbeast:$CIRCLE_BRANCH --build-arg buildno=$CIRCLE_BUILD_NUM --build-arg commitsha=$CIRCLE_SHA1 .; fi
35+
- run:
36+
name: Push image to Docker hub
37+
command: |
38+
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
39+
if [ "$CIRCLE_BRANCH" = "master" ]; then docker push dougley/wildbeast:latest; else docker push dougley/wildbeast:$CIRCLE_BRANCH; fi
40+
tagged-build:
41+
docker:
42+
- image: docker:latest
43+
steps:
44+
- run:
45+
name: Git
46+
command: apk add --update git
47+
- checkout
48+
- setup_remote_docker:
49+
docker_layer_caching: true
50+
- run:
51+
name: Initialize submodule
52+
command: git submodule update --init --remote
53+
- run:
54+
name: Build Docker image
55+
command: docker build -t dougley/wildbeast:$(git describe --abbrev=0 --tags) --build-arg buildno=$CIRCLE_BUILD_NUM --build-arg commitsha=$CIRCLE_SHA1 .
56+
- run:
57+
name: Push image to Docker hub
58+
command: |
59+
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
60+
docker push dougley/wildbeast:$(git describe --abbrev=0 --tags)
61+
docs-build:
62+
docker:
63+
- image: python:3.5
64+
steps:
65+
- checkout
66+
- restore_cache:
67+
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
68+
- run:
69+
command: |
70+
python3 -m venv venv
71+
. venv/bin/activate
72+
pip install -r requirements.txt
73+
- save_cache:
74+
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
75+
paths:
76+
- "venv"
77+
- run:
78+
name: Compile
79+
command: |
80+
. venv/bin/activate
81+
mkdocs build
82+
docs-deploy:
83+
docker:
84+
- image: python:3.5
85+
steps:
86+
- checkout
87+
- restore_cache:
88+
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
89+
- run:
90+
command: |
91+
python3 -m venv venv
92+
. venv/bin/activate
93+
pip install -r requirements.txt
94+
- save_cache:
95+
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
96+
paths:
97+
- "venv"
98+
- run:
99+
name: Compile
100+
command: |
101+
. venv/bin/activate
102+
mkdocs build
103+
- add_ssh_keys:
104+
fingerprints:
105+
- "cf:bd:5e:04:62:ce:4d:da:1e:11:87:a1:ab:3e:9f:df"
106+
- run:
107+
name: Deploy
108+
command: |
109+
. venv/bin/activate
110+
git config user.email [email protected]
111+
mkdocs gh-deploy
112+
workflows:
113+
version: 2
114+
docs:
115+
jobs:
116+
- docs-build
117+
- docs-deploy:
118+
requires:
119+
- docs-build
120+
filters:
121+
branches:
122+
only: master
123+
test_n_build:
124+
jobs:
125+
- test
126+
- build:
127+
requires:
128+
- test
129+
filters:
130+
branches:
131+
only: /master|experimental/
132+
- tagged-build:
133+
requires:
134+
- test
135+
filters:
136+
branches:
137+
ignore: /.*/
138+
tags:
139+
only: /v.+/

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

.eslintignore

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1 @@
1-
*.json
2-
*.md
3-
*.txt
4-
*.log
5-
*.mp3
6-
*.exe
7-
*.yml
8-
*.sh
9-
customize
10-
perms
11-
users
12-
ffmpeg
13-
ffprobe
14-
ffplay
15-
ffserver
16-
Dockerfile
1+
node_modules/**

.eslintrc.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"extends": "standard",
3-
"plugins": [
4-
"standard"
5-
]
2+
"extends": "standard",
3+
"globals": {
4+
"i18n": false,
5+
"logger": false,
6+
"bot": false
7+
}
68
}

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
* text=auto
2-
*.js text eol=crlf
2+
*.js text eol=crlf

.github/CODEOWNERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
* @SteamingMutt
2-
*.js @TheSharks/development
1+
* @Dougley
2+
*.js @TheSharks/development
3+
docs/* @linuswillner
4+
mkdocs.yml @linuswillner
File renamed without changes.

.github/CONTRIBUTING.md

Lines changed: 78 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,90 @@
11
**Thank you for taking the time to contribute to the development of WildBeast!**
2+
23
Please follow these rules when making contributions to this repository.
34

4-
# Contribution rules
5+
# Source code
6+
57
## Unwanted contributions
6-
1. Spelling/Grammar changes (Managed internally)
7-
2. Style violations fixes (Managed internally)
8-
3. ESLint rules changes
9-
4. Custom command issues (Except problems **within** the command framework itself)
10-
5. Alias additions (Only applies if no new default commands are provided)
11-
6. Issues stemming from usage of normal user accounts instead of OAuth bot accounts
8+
9+
1. Style violations fixes
10+
2. ESLint rules changes
11+
3. Alias additions (Only applies if no new commands are provided)
1212

1313
## Wanted contributions
14-
Everything that doesn't fit in the unwanted category is wanted :eyes: :thumbsup:
1514

16-
# Notes
17-
## Commands
18-
Make sure that the commands you're adding are suitable to be default commands and packaged within for instance WildBot. If you think that some commands are better off as custom ones, don't submit them but instead introduce them to your own instance. Given that you have one, of course.
15+
We welcome all contributions that aren't unwanted by the rules defined above.
16+
17+
## Code rules
18+
19+
### Verified as working
20+
21+
All code contributed to this repository should be verified as working, meaning you've tested the functionality at least once and didn't encounter unexpected behaviour.
22+
Please keep in mind that we might ask you to confirm if this is the case.
23+
24+
### ESLint
25+
26+
ESLint handles our style enforcement, when making contributions, **please confirm your code adheres to the style**, your build will fail otherwise and we're less inclined to merge it.
27+
To verify your code adheres to our styleguide, run `npm test` in the project root.
28+
29+
## Code practices
30+
31+
### Database operations
32+
33+
When performing database operations, **don't import a driver and call it directly**, instead, require `database-selector.js` and write abstractions.
34+
When writing abstractions, you only need to write them for the officially supported database at that time. (currently ArangoDB)
1935

20-
## When writing, keep the styleguide in mind
21-
1. We follow the [JavaScript Standard Style](https://github.com/feross/standard), please format your code according to that.
22-
2. [ESLint](http://eslint.org/) is used to identify other style violations.
36+
### Global objects
2337

24-
# Before you PR
25-
If you have gotten far enough to pull request (Written the code edits etc.) and have it all ready, do a few things first.
38+
Avoid polluting the global namespace unnecessarily, if something is not likely to be frequently used across the project, don't add it.
39+
When calling global objects, call them as you would a non-global object, for example: `global.logger.log('Hello world!')`.
2640

27-
1. Test your code. This means attempting to run a WildBeast instance with your edited code, if you have your own instance to test with. This is recommended as even partially broken code can be already identified here before running styleguide checks.
28-
2. Run the command `npm test` in the bot's folder to "lint" the code using ESlint. If it finds violations, fix them before continuing.
29-
3. Run the command `standard` in the same directory as above to test for JS Standard Code Style violations. Again, if violations are found, fix them before proceeding.
41+
### Promises and async
3042

31-
When all the above give you a green light, you can consider yourself free to make the pull request!
43+
**Always** chain promises where possible.
44+
45+
```js
46+
// ✗ bad
47+
aPromise().then(result => {
48+
anotherPromise(result).then(anotherresult => {
49+
console.log(anotherresult)
50+
}).catch(console.error)
51+
}).catch(console.error)
52+
```
53+
54+
```js
55+
// ✓ good
56+
aPromise().then(result => {
57+
return anotherPromise(result)
58+
}).then(anotherresult => {
59+
console.log(anotherresult)
60+
}).catch(console.error)
61+
```
62+
63+
```js
64+
// ✓ even better
65+
aPromise().then(async result => {
66+
const anotherresult = await anotherPromise(result)
67+
console.log(anotherresult)
68+
})
69+
```
70+
71+
# Docs
72+
73+
## General contribution rules
74+
75+
* Additions should be committed to a **docs/<your-changes-title\>** branch and PRed to the experimental branch.
76+
* Strive to submit grammatically correct changes.
77+
* Do not commit or PR to the **gh-pages** branch. The **gh-pages** branch is handled by our CI.
78+
* Follow the overall format in the docs.
79+
* Do not add extraneous material such as screenshots.
80+
* New pages must be added to the navbar in [mkdocs.yml](../mkdocs.yml). See [DOCS_GUIDE.md](DOCS_GUIDE.md) for more details.
81+
82+
## Unwanted contributions
83+
84+
* Unnecessary restructurations of the docs.
85+
* Untested changes (Changes must be verified as working)
86+
* Configuration changes, except when changes are necessary for the documentation to work properly.
87+
88+
## Wanted contributions
3289

33-
**NOTE:** Pull requests that break the rules provided above **will be rejected!**
90+
Anything not outlined in the above section is considered wanted.

.github/DOCS_GUIDE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Compilation guide
2+
3+
This is a guide for installing the required dependencies to modify the WildBeast documentation and compile it for your pull request.
4+
5+
**Note:** Windows users can use the bundled Batch file (**install_docs_deps.bat**) to easily install the dependencies. The installation process is far simpler on Linux and can be done by simply running `sudo python3.5 -m pip --upgrade -r requirements.txt`. (3.6 is also supported)
6+
7+
## Initial setup
8+
9+
When you have cloned the repository, you need to install the dependencies before making modifications.
10+
11+
These dependencies will use Python to install, and your Python installation has to comply with requirements for the MkDocs documentation generator engine. If you haven't set it up yet on your system, follow [MkDocs' guide](http://www.mkdocs.org/#installing-python) on doing so.
12+
13+
Remember to install the dependencies for the documentation as outlined above.
14+
15+
## Editing
16+
17+
Before you start making changes to the documents, open a command window in the repository folder and run the command `npm run start-docs`. This will start the MkDocs test server.
18+
19+
When the test environment is running, you can open the URL `http://localhost:8000` in your browser to preview your changes. Every time you save a document, the page will automatically refresh and display changes.
20+
21+
**Note:** If you add new pages, you need to add the page name and document into `mkdocs.yml` in the sitemap section or the page will not be added to the navbar. **New pages must always be added to the navbar!**

0 commit comments

Comments
 (0)