Skip to content

Commit

Permalink
🏷️ Fix types for api
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 committed Nov 26, 2023
1 parent f38d431 commit ef18260
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 25 deletions.
4 changes: 2 additions & 2 deletions apps/api/app/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
contact: process.env.contact || `contact@${domain}`,
title: process.env.title || "BGS",
inviteOnly: process.env.inviteOnly || false,
minPasswordLength: process.env.minPasswordLength || 6,
minPasswordLength: isNaN(parseInt(process.env.minPasswordLength)) ? 6 : parseInt(process.env.minPasswordLength),
sessionSecret: process.env.sessionSecret || "Quel est donc le secret mystère du succès de Gaia Project?!",
jwt: {
keys: {
Expand Down Expand Up @@ -50,7 +50,7 @@ export default {
nodebb: "mongodb://nodebb:NodeBBPassword@localhost:27017/nodebb",
},
isProduction: process.env.NODE_ENV === "production",
threads: process.env.threads || os.cpus().length,
threads: isNaN(parseInt(process.env.threads)) ? os.cpus().length : parseInt(process.env.threads),
/** Is the computer able to send emails? If not, let the main server send the emails */
automatedEmails: process.env.automatedEmails || false,
cron: process.env.chron || process.env.cron || false,
Expand Down
2 changes: 1 addition & 1 deletion apps/api/app/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async function run() {
const playerIds = (
await Game.aggregate()
.match({ _id: { $in: games.map((game) => game._id) } })
.project("players._id")
.project({"players._id": 1})
.unwind("players")
.group({ _id: "$players._id" })
).map((x) => x._id);
Expand Down
2 changes: 2 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@types/mocha": "^5.0.0",
"@types/node": "^13.11.1",
"@types/node-fetch": "^2",
"@types/passport": "^1.0.16",
"@types/passport-discord": "^0.1.3",
"@types/passport-facebook": "^2.1.10",
"@types/passport-google-oauth20": "^2.0.3",
Expand All @@ -70,6 +71,7 @@
"koa-cookie": "^1.0.0",
"luxon": "^1.23.0",
"mocha": "^7.1.1",
"passport": "^0.6.0",
"ts-node": "^10.4.0",
"ts-node-dev": "^1.1.8",
"tsconfig-paths": "^3.12.0"
Expand Down
50 changes: 31 additions & 19 deletions apps/api/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"moduleResolution": "node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"sourceMap": true,
"outDir": "./dist",
"experimentalDecorators": true,
Expand All @@ -11,9 +11,11 @@
"strict": false,
"strictNullChecks": false,
"resolveJsonModule": true,
"skipLibCheck": true,
"esModuleInterop": true,
"types": ["node", "mocha", "chai", "./app/types"],
"baseUrl": "."
},
"include": ["app/**/*.ts", "tests/**/*.ts", "scripts/**/*.ts", "server.ts"]
"include": ["app/**/*.ts", "tests/**/*.ts", "scripts/**/*.ts", "server.ts"],
"exclude": ["node_modules"]
}

0 comments on commit ef18260

Please sign in to comment.