Skip to content

Commit 8519f3a

Browse files
authored
Merge pull request #39 from cbartel/develop
Develop
2 parents eab5ae3 + f973f36 commit 8519f3a

18 files changed

+369
-50
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main, beta ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ main, beta ]
9+
schedule:
10+
- cron: '44 8 * * 0'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [ 'javascript' ]
25+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
26+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v2
31+
32+
# Initializes the CodeQL tools for scanning.
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v1
35+
with:
36+
languages: ${{ matrix.language }}
37+
# If you wish to specify custom queries, you can do so here or in a config file.
38+
# By default, queries listed here will override any specified in a config file.
39+
# Prefix the list here with "+" to use these queries and those in the config file.
40+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
41+
42+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
43+
# If this step fails, then you should remove it and run the build manually (see below)
44+
- name: Autobuild
45+
uses: github/codeql-action/autobuild@v1
46+
47+
# ℹ️ Command-line programs to run using the OS shell.
48+
# 📚 https://git.io/JvXDl
49+
50+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
51+
# and modify them (or add more) to build your code if your project
52+
# uses a compiled language
53+
54+
#- run: |
55+
# make bootstrap
56+
# make release
57+
58+
- name: Perform CodeQL Analysis
59+
uses: github/codeql-action/analyze@v1

README.md

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,68 @@
1-
# ⛏ New World Company Tool 🔨
2-
3-
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/J3J37247V)
4-
5-
<a href="https://discord.gg/rm9Gzf3HCH"><img alt="Discord" src="https://img.shields.io/discord/911515391371665429?label=Discord&style=for-the-badge"></a>
6-
7-
![GitHub Repo stars](https://img.shields.io/github/stars/cbartel/nw-company-tool?style=social)
8-
![GitHub watchers](https://img.shields.io/github/watchers/cbartel/nw-company-tool?style=social)
9-
10-
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/cbartel/nw-company-tool?style=flat-square)
11-
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/cbartel/nw-company-tool?include_prereleases&label=beta&style=flat-square)
12-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/cbartel/nw-company-tool/Release?style=flat-square)
13-
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cbartel/nw-company-tool/develop?style=flat-square)
14-
![GitHub all releases](https://img.shields.io/github/downloads/cbartel/nw-company-tool/total?style=flat-square)
15-
![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/cbartel/nw-company-tool?style=flat-square)
16-
## ❓ What is this ❓
17-
18-
This tool is intended to use with the game New World from Amazon Game Studios. It aims to give all your company members
1+
<link rel="preconnect" href="https://fonts.googleapis.com">
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3+
<link href="https://fonts.googleapis.com/css2?family=IM+Fell+DW+Pica&display=swap" rel="stylesheet">
4+
5+
<h1 align="center" style="font-family: 'IM Fell DW Pica', serif;font-size: xxx-large">
6+
⛏ New World Company Tool 🔨
7+
</h1>
8+
9+
<div align='center' style='display: flex;flex-direction: column;align-content: center'>
10+
<div>
11+
<a href="https://ko-fi.com/J3J37247V" target='_blank'><img alt="Support me on Ko-fi" src="https://ko-fi.com/img/githubbutton_sm.svg" /></a>
12+
</div>
13+
<div>
14+
<a href="https://discord.gg/rm9Gzf3HCH"><img alt="Discord" src="https://img.shields.io/discord/911515391371665429?label=Discord&style=for-the-badge"></a>
15+
</div>
16+
<div>
17+
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/cbartel/nw-company-tool?style=social" />
18+
<img alt="GitHub watchers" src="https://img.shields.io/github/watchers/cbartel/nw-company-tool?style=social">
19+
</div>
20+
<div>
21+
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/cbartel/nw-company-tool?style=flat-square">
22+
<img alt="GitHub release (latest SemVer including pre-releases)" src="https://img.shields.io/github/v/release/cbartel/nw-company-tool?include_prereleases&label=beta&style=flat-square">
23+
<img alt="GitHub Workflow Status (branch)" src="https://img.shields.io/github/workflow/status/cbartel/nw-company-tool/Release/main?style=flat-square">
24+
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/cbartel/nw-company-tool?style=flat-square">
25+
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/cbartel/nw-company-tool/total?style=flat-square">
26+
<img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed/cbartel/nw-company-tool?style=flat-square">
27+
</div>
28+
</div>
29+
30+
<h2 style="font-family: 'IM Fell DW Pica', serif">
31+
❓ What is this ❓
32+
</h2>
33+
34+
This tool is intended to be used with the game New World from Amazon Game Studios. It aims to give all your company members
1935
an overview about other members, their skills and attributes. The tool uses Discord's login and enables all your members
2036
to reach out to other company members easily.
2137

2238
The server is written in [nest.js](https://nestjs.com/) and uses [prisma](https://www.prisma.io/) and
2339
[SQLite](https://www.sqlite.org/index.html). It runs on [nodejs](https://nodejs.dev/). The webapp is written in
2440
[angular](https://angular.io/).
2541

26-
The tool is currently in an early development state but already usable and stable. It provides your company members with
27-
the ability to maintain their level, gear score, attributes, weapon- and trade skills and shows the data on a company table.
28-
29-
### 🛣️ Roadmap 🛣️
42+
<h3 style="font-family: 'IM Fell DW Pica', serif">
43+
🛣️ Roadmap 🛣️
44+
</h3>
3045

3146
- develop a plugin system to enable other developers to create content for this tool
3247
- create a war planner to make it easier for your company to organize their war efforts
33-
- create an expedition planner
48+
- ~~create an expedition planner~~ ✅ (Release 2.1.0)
3449
- integrate [NWDB.info](https://nwdb.info/) or a similar website
3550
- enable users to create skill tree builds in this tool to share their builds with your company
3651

37-
### 📸 Footage 📸
52+
<h3 style="font-family: 'IM Fell DW Pica', serif">
53+
📸 Footage 📸
54+
</h3>
3855

3956
#### Company Overview
4057
![Company Table](docs/img/company_table.png)
4158
#### My Character
4259
![My Character](docs/img/my_character.png)
4360

4461

45-
## 🚀 How to install 🚀
62+
<h2 style="font-family: 'IM Fell DW Pica', serif">
63+
🚀 How to install 🚀
64+
</h2>
65+
4666
### Download
4767
Make sure you have [nodejs](https://nodejs.dev/) installed!
4868

@@ -107,7 +127,7 @@ as you see, you need to set up a discord application with OAuth2, this is pretty
107127
- create a new application at https://discord.com/developers/applications
108128
- navigate to OAuth2, there you will find your `CLIENT_ID` and `CLIENT_SECRET`
109129
- edit your redirects, in this example your NWCT server uses `http://www.example.com:8080` as `BASE_URL`, the redirect would
110-
then be `http://www.example.com:8080/api/login/callback`. Be careful to not any unwanted forward slashes or your login will not work properly.
130+
then be `http://www.example.com:8080/api/login/callback`. Be careful not to add any unwanted forward slashes or your login will not work properly.
111131

112132
Go back to your `config.json` file, insert the needed values and save this file.
113133

@@ -122,7 +142,7 @@ node dist/main.js --dataPath "/opt/nwct/nwct-data/"
122142
```
123143

124144
### PM2, nginx and SSL
125-
I would highly recommend the run NWCT via [pm2](https://pm2.keymetrics.io/) behind a
145+
I would highly recommend to run NWCT via [pm2](https://pm2.keymetrics.io/) behind a
126146
[nginx proxy server](https://www.nginx.com/) using [certbot](https://certbot.eff.org/instructions).
127147
Reach out for the documentation of pm2 and nginx on how to install it on your machine.
128148

@@ -189,8 +209,6 @@ server {
189209
# Enter your fully qualified domain name or leave blank
190210
server_name www.example.com;
191211
192-
# Listen on port 80 without SSL certificates
193-
194212
# Sets the Max Upload size to 300 MB
195213
client_max_body_size 300M;
196214

server/package-lock.json

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"start:dev": "nest start --watch -- --dataPath \"./../data/\" --development",
2828
"start:debug": "nest start --debug --watch -- --dataPath \"./../data/\" --development",
2929
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
30-
"test": "jest",
31-
"test:watch": "jest --watch",
32-
"test:cov": "jest --coverage",
33-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
34-
"test:e2e": "jest --config ./test/jest-e2e.json"
30+
"test": "jest --config test/jest.config.json",
31+
"test:watch": "jest --config test/jest.config.json --watch",
32+
"test:cov": "jest --config test/jest.config.json --coverage",
33+
"test:debug": "node --config test/jest.config.json --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
34+
"test:e2e": "jest --config test/jest.config-e2e.json"
3535
},
3636
"dependencies": {
3737
"@nestjs/axios": "^0.0.3",
@@ -74,6 +74,7 @@
7474
"eslint-config-prettier": "^8.3.0",
7575
"eslint-plugin-prettier": "^4.0.0",
7676
"jest": "^27.2.5",
77+
"nock": "^13.2.1",
7778
"prettier": "^2.3.2",
7879
"source-map-support": "^0.5.20",
7980
"supertest": "^6.1.3",

server/src/github/github.service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ export class GithubService {
2525

2626
public async getLatestBetaRelease(): Promise<GithubRelease> {
2727
const releases = await this.getReleases();
28-
return releases
29-
.filter((release) => release.prerelease)
30-
.reduce((previousValue, currentValue) =>
31-
semver.gt(previousValue.name.substring(1), currentValue.name.substring(1)) ? previousValue : currentValue,
32-
);
28+
return releases.reduce((previousValue, currentValue) =>
29+
semver.gt(previousValue.name.substring(1), currentValue.name.substring(1)) ? previousValue : currentValue,
30+
);
3331
}
3432

3533
public getReleases(): Promise<GithubRelease[]> {

server/test/app.e2e-spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Test, TestingModule } from '@nestjs/testing';
22
import { INestApplication } from '@nestjs/common';
3-
import * as request from 'supertest';
4-
import { AppModule } from './../src/app.module';
3+
import request from 'supertest';
4+
import { AppModule } from '../src/app.module';
55

66
describe('AppController (e2e)', () => {
77
let app: INestApplication;
@@ -16,9 +16,6 @@ describe('AppController (e2e)', () => {
1616
});
1717

1818
it('/ (GET)', () => {
19-
return request(app.getHttpServer())
20-
.get('/')
21-
.expect(200)
22-
.expect('Hello World!');
19+
return request(app.getHttpServer()).get('/').expect(200).expect('Hello World!');
2320
});
2421
});

0 commit comments

Comments
 (0)