chore: update adonis app

This commit is contained in:
Valentin Kaelin 2023-09-14 22:00:15 +02:00
parent f156bddea5
commit e7e2b598be
7 changed files with 4464 additions and 2600 deletions

View file

@ -38,19 +38,66 @@
}, },
"list:routes": { "list:routes": {
"settings": { "settings": {
"loadApp": true "loadApp": true,
"stayAlive": true
}, },
"commandPath": "@adonisjs/core/build/commands/ListRoutes", "commandPath": "@adonisjs/core/build/commands/ListRoutes/index",
"commandName": "list:routes", "commandName": "list:routes",
"description": "List application routes", "description": "List application routes",
"args": [], "args": [],
"aliases": [], "aliases": [],
"flags": [ "flags": [
{
"name": "verbose",
"propertyName": "verbose",
"type": "boolean",
"description": "Display more information"
},
{
"name": "reverse",
"propertyName": "reverse",
"type": "boolean",
"alias": "r",
"description": "Reverse routes display"
},
{
"name": "methods",
"propertyName": "methodsFilter",
"type": "array",
"alias": "m",
"description": "Filter routes by method"
},
{
"name": "patterns",
"propertyName": "patternsFilter",
"type": "array",
"alias": "p",
"description": "Filter routes by the route pattern"
},
{
"name": "names",
"propertyName": "namesFilter",
"type": "array",
"alias": "n",
"description": "Filter routes by route name"
},
{ {
"name": "json", "name": "json",
"propertyName": "json", "propertyName": "json",
"type": "boolean", "type": "boolean",
"description": "Output as JSON" "description": "Output as JSON"
},
{
"name": "table",
"propertyName": "table",
"type": "boolean",
"description": "Output as Table"
},
{
"name": "max-width",
"propertyName": "maxWidth",
"type": "number",
"description": "Specify maximum rendering width. Ignored for JSON Output"
} }
] ]
}, },
@ -82,7 +129,7 @@
}, },
"commandPath": "@adonisjs/lucid/build/commands/DbSeed", "commandPath": "@adonisjs/lucid/build/commands/DbSeed",
"commandName": "db:seed", "commandName": "db:seed",
"description": "Execute database seeder files", "description": "Execute database seeders",
"args": [], "args": [],
"aliases": [], "aliases": [],
"flags": [ "flags": [
@ -106,11 +153,81 @@
"type": "array", "type": "array",
"description": "Define a custom set of seeders files names to run", "description": "Define a custom set of seeders files names to run",
"alias": "f" "alias": "f"
},
{
"name": "compact-output",
"propertyName": "compactOutput",
"type": "boolean",
"description": "A compact single-line output"
}
]
},
"db:wipe": {
"settings": {
"loadApp": true
},
"commandPath": "@adonisjs/lucid/build/commands/DbWipe",
"commandName": "db:wipe",
"description": "Drop all tables, views and types in database",
"args": [],
"aliases": [],
"flags": [
{
"name": "connection",
"propertyName": "connection",
"type": "string",
"description": "Define a custom database connection",
"alias": "c"
},
{
"name": "drop-views",
"propertyName": "dropViews",
"type": "boolean",
"description": "Drop all views"
},
{
"name": "drop-types",
"propertyName": "dropTypes",
"type": "boolean",
"description": "Drop all custom types (Postgres only)"
},
{
"name": "force",
"propertyName": "force",
"type": "boolean",
"description": "Explicitly force command to run in production"
}
]
},
"db:truncate": {
"settings": {
"loadApp": true
},
"commandPath": "@adonisjs/lucid/build/commands/DbTruncate",
"commandName": "db:truncate",
"description": "Truncate all tables in database",
"args": [],
"aliases": [],
"flags": [
{
"name": "connection",
"propertyName": "connection",
"type": "string",
"description": "Define a custom database connection",
"alias": "c"
},
{
"name": "force",
"propertyName": "force",
"type": "boolean",
"description": "Explicitly force command to run in production"
} }
] ]
}, },
"make:model": { "make:model": {
"settings": {}, "settings": {
"loadApp": true
},
"commandPath": "@adonisjs/lucid/build/commands/MakeModel", "commandPath": "@adonisjs/lucid/build/commands/MakeModel",
"commandName": "make:model", "commandName": "make:model",
"description": "Make a new Lucid model", "description": "Make a new Lucid model",
@ -138,6 +255,13 @@
"type": "boolean", "type": "boolean",
"alias": "c", "alias": "c",
"description": "Generate the controller for the model" "description": "Generate the controller for the model"
},
{
"name": "factory",
"propertyName": "factory",
"type": "boolean",
"alias": "f",
"description": "Generate a factory for the model"
} }
] ]
}, },
@ -202,13 +326,44 @@
"aliases": [], "aliases": [],
"flags": [] "flags": []
}, },
"make:factory": {
"settings": {},
"commandPath": "@adonisjs/lucid/build/commands/MakeFactory",
"commandName": "make:factory",
"description": "Make a new factory",
"args": [
{
"type": "string",
"propertyName": "model",
"name": "model",
"required": true,
"description": "The name of the model"
}
],
"aliases": [],
"flags": [
{
"name": "model-path",
"propertyName": "modelPath",
"type": "string",
"description": "The path to the model"
},
{
"name": "exact",
"propertyName": "exact",
"type": "boolean",
"description": "Create the factory with the exact name as provided",
"alias": "e"
}
]
},
"migration:run": { "migration:run": {
"settings": { "settings": {
"loadApp": true "loadApp": true
}, },
"commandPath": "@adonisjs/lucid/build/commands/Migration/Run", "commandPath": "@adonisjs/lucid/build/commands/Migration/Run",
"commandName": "migration:run", "commandName": "migration:run",
"description": "Run pending migrations", "description": "Migrate database by running pending migrations",
"args": [], "args": [],
"aliases": [], "aliases": [],
"flags": [ "flags": [
@ -229,7 +384,19 @@
"name": "dry-run", "name": "dry-run",
"propertyName": "dryRun", "propertyName": "dryRun",
"type": "boolean", "type": "boolean",
"description": "Print SQL queries, instead of running the migrations" "description": "Do not run actual queries. Instead view the SQL output"
},
{
"name": "compact-output",
"propertyName": "compactOutput",
"type": "boolean",
"description": "A compact single-line output"
},
{
"name": "disable-locks",
"propertyName": "disableLocks",
"type": "boolean",
"description": "Disable locks acquired to run migrations safely"
} }
] ]
}, },
@ -239,7 +406,7 @@
}, },
"commandPath": "@adonisjs/lucid/build/commands/Migration/Rollback", "commandPath": "@adonisjs/lucid/build/commands/Migration/Rollback",
"commandName": "migration:rollback", "commandName": "migration:rollback",
"description": "Rollback migrations to a given batch number", "description": "Rollback migrations to a specific batch number",
"args": [], "args": [],
"aliases": [], "aliases": [],
"flags": [ "flags": [
@ -260,13 +427,25 @@
"name": "dry-run", "name": "dry-run",
"propertyName": "dryRun", "propertyName": "dryRun",
"type": "boolean", "type": "boolean",
"description": "Print SQL queries, instead of running the migrations" "description": "Do not run actual queries. Instead view the SQL output"
}, },
{ {
"name": "batch", "name": "batch",
"propertyName": "batch", "propertyName": "batch",
"type": "number", "type": "number",
"description": "Define custom batch number for rollback. Use 0 to rollback to initial state" "description": "Define custom batch number for rollback. Use 0 to rollback to initial state"
},
{
"name": "compact-output",
"propertyName": "compactOutput",
"type": "boolean",
"description": "A compact single-line output"
},
{
"name": "disable-locks",
"propertyName": "disableLocks",
"type": "boolean",
"description": "Disable locks acquired to run migrations safely"
} }
] ]
}, },
@ -276,7 +455,7 @@
}, },
"commandPath": "@adonisjs/lucid/build/commands/Migration/Status", "commandPath": "@adonisjs/lucid/build/commands/Migration/Status",
"commandName": "migration:status", "commandName": "migration:status",
"description": "Check migrations current status.", "description": "View migrations status",
"args": [], "args": [],
"aliases": [], "aliases": [],
"flags": [ "flags": [
@ -289,6 +468,135 @@
} }
] ]
}, },
"migration:reset": {
"settings": {
"loadApp": true
},
"commandPath": "@adonisjs/lucid/build/commands/Migration/Reset",
"commandName": "migration:reset",
"description": "Rollback all migrations",
"args": [],
"aliases": [],
"flags": [
{
"name": "connection",
"propertyName": "connection",
"type": "string",
"description": "Define a custom database connection",
"alias": "c"
},
{
"name": "force",
"propertyName": "force",
"type": "boolean",
"description": "Explicitly force command to run in production"
},
{
"name": "dry-run",
"propertyName": "dryRun",
"type": "boolean",
"description": "Do not run actual queries. Instead view the SQL output"
},
{
"name": "disable-locks",
"propertyName": "disableLocks",
"type": "boolean",
"description": "Disable locks acquired to run migrations safely"
}
]
},
"migration:refresh": {
"settings": {
"loadApp": true
},
"commandPath": "@adonisjs/lucid/build/commands/Migration/Refresh",
"commandName": "migration:refresh",
"description": "Rollback and migrate database",
"args": [],
"aliases": [],
"flags": [
{
"name": "connection",
"propertyName": "connection",
"type": "string",
"description": "Define a custom database connection",
"alias": "c"
},
{
"name": "force",
"propertyName": "force",
"type": "boolean",
"description": "Explicitly force command to run in production"
},
{
"name": "dry-run",
"propertyName": "dryRun",
"type": "boolean",
"description": "Do not run actual queries. Instead view the SQL output"
},
{
"name": "seed",
"propertyName": "seed",
"type": "boolean",
"description": "Run seeders"
},
{
"name": "disable-locks",
"propertyName": "disableLocks",
"type": "boolean",
"description": "Disable locks acquired to run migrations safely"
}
]
},
"migration:fresh": {
"settings": {
"loadApp": true
},
"commandPath": "@adonisjs/lucid/build/commands/Migration/Fresh",
"commandName": "migration:fresh",
"description": "Drop all tables and re-migrate the database",
"args": [],
"aliases": [],
"flags": [
{
"name": "connection",
"propertyName": "connection",
"type": "string",
"description": "Define a custom database connection",
"alias": "c"
},
{
"name": "force",
"propertyName": "force",
"type": "boolean",
"description": "Explicitly force command to run in production"
},
{
"name": "seed",
"propertyName": "seed",
"type": "boolean",
"description": "Run seeders"
},
{
"name": "drop-views",
"propertyName": "dropViews",
"type": "boolean",
"description": "Drop all views"
},
{
"name": "drop-types",
"propertyName": "dropTypes",
"type": "boolean",
"description": "Drop all custom types (Postgres only)"
},
{
"name": "disable-locks",
"propertyName": "disableLocks",
"type": "boolean",
"description": "Disable locks acquired to run migrations safely"
}
]
},
"make:job": { "make:job": {
"settings": {}, "settings": {},
"commandPath": "@rocketseat/adonis-bull/build/commands/MakeJob", "commandPath": "@rocketseat/adonis-bull/build/commands/MakeJob",

View file

@ -6,7 +6,7 @@
*/ */
import Env from '@ioc:Adonis/Core/Env' import Env from '@ioc:Adonis/Core/Env'
import { DriveConfig } from '@ioc:Adonis/Core/Drive' import { driveConfig } from '@adonisjs/core/build/config'
import Application from '@ioc:Adonis/Core/Application' import Application from '@ioc:Adonis/Core/Application'
/* /*
@ -18,7 +18,7 @@ import Application from '@ioc:Adonis/Core/Application'
| defined inside the `contracts` directory. | defined inside the `contracts` directory.
| |
*/ */
const driveConfig: DriveConfig = { export default driveConfig({
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default disk | Default disk
@ -143,6 +143,4 @@ const driveConfig: DriveConfig = {
// usingUniformAcl: false // usingUniformAcl: false
// }, // },
}, },
} })
export default driveConfig

View file

@ -6,7 +6,7 @@
*/ */
import Env from '@ioc:Adonis/Core/Env' import Env from '@ioc:Adonis/Core/Env'
import { HashConfig } from '@ioc:Adonis/Core/Hash' import { hashConfig } from '@adonisjs/core/build/config'
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -17,7 +17,7 @@ import { HashConfig } from '@ioc:Adonis/Core/Hash'
| defined inside `contracts` directory. | defined inside `contracts` directory.
| |
*/ */
const hashConfig: HashConfig = { export default hashConfig({
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default hasher | Default hasher
@ -70,6 +70,4 @@ const hashConfig: HashConfig = {
rounds: 10, rounds: 10,
}, },
}, },
} })
export default hashConfig

View file

@ -5,19 +5,9 @@
* file. * file.
*/ */
import { InferDisksFromConfig } from '@adonisjs/core/build/config'
import driveConfig from '../config/drive'
declare module '@ioc:Adonis/Core/Drive' { declare module '@ioc:Adonis/Core/Drive' {
interface DisksList { interface DisksList extends InferDisksFromConfig<typeof driveConfig> {}
local: {
config: LocalDriverConfig
implementation: LocalDriverContract
}
// s3: {
// config: S3DriverConfig
// implementation: S3DriverContract
// }
// gcs: {
// config: GcsDriverConfig
// implementation: GcsDriverContract
// }
}
} }

View file

@ -20,7 +20,7 @@ export default Env.rules({
APP_KEY: Env.schema.string(), APP_KEY: Env.schema.string(),
APP_NAME: Env.schema.string(), APP_NAME: Env.schema.string(),
DRIVE_DISK: Env.schema.enum(['local'] as const), DRIVE_DISK: Env.schema.enum(['local'] as const),
NODE_ENV: Env.schema.enum(['development', 'production', 'testing'] as const), NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
DB_CONNECTION: Env.schema.string(), DB_CONNECTION: Env.schema.string(),
PG_HOST: Env.schema.string({ format: 'host' }), PG_HOST: Env.schema.string({ format: 'host' }),

6670
server/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -10,32 +10,32 @@
"format": "prettier --write ." "format": "prettier --write ."
}, },
"devDependencies": { "devDependencies": {
"@adonisjs/assembler": "^5.3.7", "@adonisjs/assembler": "^5.9.5",
"@types/pg": "^8.6.1", "@types/pg": "^8.10.2",
"adonis-preset-ts": "^2.1.0", "adonis-preset-ts": "^2.1.0",
"eslint": "^7.32.0", "eslint": "^8.49.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^9.0.0",
"eslint-plugin-adonis": "^1.3.3", "eslint-plugin-adonis": "^2.1.1",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^5.0.0",
"pino-pretty": "^7.0.0", "pino-pretty": "^10.2.0",
"prettier": "^2.4.0", "prettier": "^3.0.3",
"typescript": "~4.2", "typescript": "~4.6",
"youch": "^2.2.2", "youch": "^3.3.1",
"youch-terminal": "^1.1.1" "youch-terminal": "^2.2.2"
}, },
"dependencies": { "dependencies": {
"@adonisjs/core": "^5.3.4", "@adonisjs/core": "^5.9.0",
"@adonisjs/lucid": "^16.0.2", "@adonisjs/lucid": "^18.4.0",
"@adonisjs/redis": "^7.0.9", "@adonisjs/redis": "^7.3.4",
"@adonisjs/repl": "^3.1.6", "@adonisjs/repl": "^3.1.11",
"@rocketseat/adonis-bull": "^1.0.4", "@rocketseat/adonis-bull": "^1.0.4",
"got": "^11.8.5", "got": "^11.8.5",
"luxon": "^2.0.2", "luxon": "^3.4.3",
"pg": "^8.7.1", "pg": "^8.11.3",
"proxy-addr": "^2.0.7", "proxy-addr": "^2.0.7",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"request": "^2.88.2", "request": "^2.88.2",
"riot-ratelimiter": "^0.1.5", "riot-ratelimiter": "^0.1.5",
"source-map-support": "^0.5.20" "source-map-support": "^0.5.21"
} }
} }