mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 04:47:27 +00:00
refactor: update Adonis to last October update
This commit is contained in:
parent
dda6fc3328
commit
6f63d67be0
9 changed files with 501 additions and 341 deletions
1
server/ace-manifest.json
Normal file
1
server/ace-manifest.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"dump:rcfile":{"settings":{},"commandPath":"@adonisjs/core/build/commands/DumpRc","commandName":"dump:rcfile","description":"Dump contents of .adonisrc.json file along with defaults","args":[],"flags":[]},"list:routes":{"settings":{"loadApp":true},"commandPath":"@adonisjs/core/build/commands/ListRoutes","commandName":"list:routes","description":"List application routes","args":[],"flags":[{"name":"json","propertyName":"json","type":"boolean","description":"Output as JSON"}]},"generate:key":{"settings":{},"commandPath":"@adonisjs/core/build/commands/GenerateKey","commandName":"generate:key","description":"Generate a new APP_KEY secret","args":[],"flags":[]},"mongodb:make:migration":{"settings":{"loadApp":true},"commandPath":"@zakodium/adonis-mongodb/lib/commands/MongodbMakeMigration","commandName":"mongodb:make:migration","description":"Make a new migration file","args":[{"type":"string","propertyName":"name","name":"name","required":true,"description":"Name of the migration file"}],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Database connection to use for the migration"}]},"mongodb:migration:run":{"settings":{"loadApp":true},"commandPath":"@zakodium/adonis-mongodb/lib/commands/MongodbMigrate","commandName":"mongodb:migration:run","description":"Execute pending migrations","args":[],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Database connection to use for the migration"}]},"mongodb:migration:status":{"settings":{"loadApp":true},"commandPath":"@zakodium/adonis-mongodb/lib/commands/MongodbListMigrations","commandName":"mongodb:migration:status","description":"Show pending migrations","args":[],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Database connection to use for the migration"}]}}
|
||||
|
|
@ -12,7 +12,7 @@ export interface JaxConfigRequestOptions {
|
|||
}
|
||||
|
||||
export const JAX_CONFIG: JaxConfig = {
|
||||
key: Env.getOrFail('API_KEY') as string,
|
||||
key: Env.get('API_KEY') as string,
|
||||
region: 'euw1',
|
||||
requestOptions: {
|
||||
retriesBeforeAbort: 3,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { listDirectoryFiles } from '@adonisjs/ace'
|
||||
import { listDirectoryFiles } from '@adonisjs/core/build/standalone'
|
||||
import Application from '@ioc:Adonis/Core/Application'
|
||||
|
||||
/*
|
||||
|
|
@ -13,7 +13,7 @@ import Application from '@ioc:Adonis/Core/Application'
|
|||
| Couple of things to note:
|
||||
|
|
||||
| 1. The file path must be relative from the project root and not this directory.
|
||||
| 2. We must ignore this file.
|
||||
| 2. We must ignore this file to avoid getting into an infinite loop
|
||||
|
|
||||
*/
|
||||
export default listDirectoryFiles(__dirname, Application.appRoot, ['./commands/index.js'])
|
||||
export default listDirectoryFiles(__dirname, Application.appRoot, ['./commands/index'])
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ type HttpConfig = RequestConfig & ResponseConfig
|
|||
| be decrypted.
|
||||
|
|
||||
*/
|
||||
export const appKey: string = Env.getOrFail('APP_KEY') as string
|
||||
export const appKey: string = Env.get('APP_KEY') as string
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ const config: MongodbConfig = {
|
|||
default: 'mongodb',
|
||||
connections: {
|
||||
mongodb: {
|
||||
url: Env.getOrFail('MONGODB_URL') as string,
|
||||
database: Env.getOrFail('MONGODB_DATABASE') as string,
|
||||
url: Env.get('MONGODB_URL') as string,
|
||||
database: Env.get('MONGODB_DATABASE') as string,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
23
server/contracts/env.ts
Normal file
23
server/contracts/env.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* Contract source: https://git.io/JTm6U
|
||||
*
|
||||
* Feel free to let us know via PR, if you find something broken in this contract
|
||||
* file.
|
||||
*/
|
||||
|
||||
declare module '@ioc:Adonis/Core/Env' {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Getting types for validated environment variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The `default` export from the "../env.ts" file exports types for the
|
||||
| validated environment variables. Here we merge them with the `EnvTypes`
|
||||
| interface so that you can enjoy intellisense when using the "Env"
|
||||
| module.
|
||||
|
|
||||
*/
|
||||
|
||||
type CustomTypes = typeof import('../env').default
|
||||
interface EnvTypes extends CustomTypes {}
|
||||
}
|
||||
18
server/env.ts
Normal file
18
server/env.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import Env from '@ioc:Adonis/Core/Env'
|
||||
|
||||
export default Env.rules({
|
||||
HOST: Env.schema.string({ format: 'host' }),
|
||||
PORT: Env.schema.number(),
|
||||
NODE_ENV: Env.schema.enum(['development', 'production', 'testing'] as const),
|
||||
APP_KEY: Env.schema.string(),
|
||||
|
||||
MONGODB_URL: Env.schema.string(),
|
||||
MONGODB_DATABASE: Env.schema.string(),
|
||||
|
||||
REDIS_CONNECTION: Env.schema.enum(['local'] as const),
|
||||
REDIS_HOST: Env.schema.string({ format: 'host' }),
|
||||
REDIS_PORT: Env.schema.number(),
|
||||
REDIS_PASSWORD: Env.schema.string.optional(),
|
||||
|
||||
API_KEY: Env.schema.string(),
|
||||
})
|
||||
765
server/package-lock.json
generated
765
server/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -9,23 +9,20 @@
|
|||
"lint": "eslint . --ext=.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@adonisjs/assembler": "^2.1.5",
|
||||
"adonis-preset-ts": "^1.0.4",
|
||||
"eslint": "^7.10.0",
|
||||
"@adonisjs/assembler": "^3.0.7",
|
||||
"adonis-preset-ts": "^1.1.0",
|
||||
"eslint": "^7.12.1",
|
||||
"eslint-plugin-adonis": "^1.0.15",
|
||||
"pino-pretty": "^4.2.1",
|
||||
"pino-pretty": "^4.3.0",
|
||||
"typescript": "^4.0.3",
|
||||
"youch": "^2.1.0",
|
||||
"youch": "^2.1.1",
|
||||
"youch-terminal": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@adonisjs/ace": "^6.9.4",
|
||||
"@adonisjs/core": "^5.0.0-preview-rc-1.12",
|
||||
"@adonisjs/fold": "^6.4.1",
|
||||
"@adonisjs/redis": "^4.1.2",
|
||||
"@fightmegg/riot-rate-limiter": "0.0.11",
|
||||
"@zakodium/adonis-mongodb": "^0.3.0",
|
||||
"got": "^11.7.0",
|
||||
"@adonisjs/core": "^5.0.4-preview-rc-2",
|
||||
"@adonisjs/redis": "^5.0.8",
|
||||
"@zakodium/adonis-mongodb": "^0.3.5",
|
||||
"got": "^11.8.0",
|
||||
"proxy-addr": "^2.0.6",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"request": "^2.88.2",
|
||||
|
|
|
|||
Loading…
Reference in a new issue