From e1c47572a6235fd8fd20af888ac3a11c7ae1369d Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:37:40 -0700 Subject: updates --- bin/console.ts | 30 +++++++++++++++--------------- bin/server.ts | 30 +++++++++++++++--------------- bin/test.ts | 42 +++++++++++++++++++++--------------------- 3 files changed, 51 insertions(+), 51 deletions(-) (limited to 'bin') diff --git a/bin/console.ts b/bin/console.ts index 4b102ee..c92f633 100644 --- a/bin/console.ts +++ b/bin/console.ts @@ -11,14 +11,14 @@ | */ -import 'reflect-metadata' -import { Ignitor, prettyPrintError } from '@adonisjs/core' +import 'reflect-metadata'; +import { Ignitor, prettyPrintError } from '@adonisjs/core'; /** * URL to the application root. AdonisJS need it to resolve * paths to file and directories for scaffolding commands */ -const APP_ROOT = new URL('../', import.meta.url) +const APP_ROOT = new URL('../', import.meta.url); /** * The importer is used to import files in context of the @@ -26,22 +26,22 @@ const APP_ROOT = new URL('../', import.meta.url) */ const IMPORTER = (filePath: string) => { if (filePath.startsWith('./') || filePath.startsWith('../')) { - return import(new URL(filePath, APP_ROOT).href) + return import(new URL(filePath, APP_ROOT).href); } - return import(filePath) -} + return import(filePath); +}; new Ignitor(APP_ROOT, { importer: IMPORTER }) - .tap((app) => { + .tap(app => { app.booting(async () => { - await import('#start/env') - }) - app.listen('SIGTERM', () => app.terminate()) - app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()) + await import('#start/env'); + }); + app.listen('SIGTERM', () => app.terminate()); + app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()); }) .ace() .handle(process.argv.splice(2)) - .catch((error) => { - process.exitCode = 1 - prettyPrintError(error) - }) + .catch(error => { + process.exitCode = 1; + prettyPrintError(error); + }); diff --git a/bin/server.ts b/bin/server.ts index fe0fefb..40789e3 100644 --- a/bin/server.ts +++ b/bin/server.ts @@ -9,14 +9,14 @@ | */ -import 'reflect-metadata' -import { Ignitor, prettyPrintError } from '@adonisjs/core' +import 'reflect-metadata'; +import { Ignitor, prettyPrintError } from '@adonisjs/core'; /** * URL to the application root. AdonisJS need it to resolve * paths to file and directories for scaffolding commands */ -const APP_ROOT = new URL('../', import.meta.url) +const APP_ROOT = new URL('../', import.meta.url); /** * The importer is used to import files in context of the @@ -24,22 +24,22 @@ const APP_ROOT = new URL('../', import.meta.url) */ const IMPORTER = (filePath: string) => { if (filePath.startsWith('./') || filePath.startsWith('../')) { - return import(new URL(filePath, APP_ROOT).href) + return import(new URL(filePath, APP_ROOT).href); } - return import(filePath) -} + return import(filePath); +}; new Ignitor(APP_ROOT, { importer: IMPORTER }) - .tap((app) => { + .tap(app => { app.booting(async () => { - await import('#start/env') - }) - app.listen('SIGTERM', () => app.terminate()) - app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()) + await import('#start/env'); + }); + app.listen('SIGTERM', () => app.terminate()); + app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()); }) .httpServer() .start() - .catch((error) => { - process.exitCode = 1 - prettyPrintError(error) - }) + .catch(error => { + process.exitCode = 1; + prettyPrintError(error); + }); diff --git a/bin/test.ts b/bin/test.ts index fe7e950..abdfb72 100644 --- a/bin/test.ts +++ b/bin/test.ts @@ -10,17 +10,17 @@ | */ -process.env.NODE_ENV = 'test' +process.env.NODE_ENV = 'test'; -import 'reflect-metadata' -import { Ignitor, prettyPrintError } from '@adonisjs/core' -import { configure, processCLIArgs, run } from '@japa/runner' +import 'reflect-metadata'; +import { Ignitor, prettyPrintError } from '@adonisjs/core'; +import { configure, processCLIArgs, run } from '@japa/runner'; /** * URL to the application root. AdonisJS need it to resolve * paths to file and directories for scaffolding commands */ -const APP_ROOT = new URL('../', import.meta.url) +const APP_ROOT = new URL('../', import.meta.url); /** * The importer is used to import files in context of the @@ -28,33 +28,33 @@ const APP_ROOT = new URL('../', import.meta.url) */ const IMPORTER = (filePath: string) => { if (filePath.startsWith('./') || filePath.startsWith('../')) { - return import(new URL(filePath, APP_ROOT).href) + return import(new URL(filePath, APP_ROOT).href); } - return import(filePath) -} + return import(filePath); +}; new Ignitor(APP_ROOT, { importer: IMPORTER }) - .tap((app) => { + .tap(app => { app.booting(async () => { - await import('#start/env') - }) - app.listen('SIGTERM', () => app.terminate()) - app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()) + await import('#start/env'); + }); + app.listen('SIGTERM', () => app.terminate()); + app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()); }) .testRunner() - .configure(async (app) => { - const { runnerHooks, ...config } = await import('../tests/bootstrap.js') + .configure(async app => { + const { runnerHooks, ...config } = await import('../tests/bootstrap.js'); - processCLIArgs(process.argv.splice(2)) + processCLIArgs(process.argv.splice(2)); configure({ ...app.rcFile.tests, ...config, setup: runnerHooks.setup, teardown: [...runnerHooks.teardown, () => app.terminate()], - }) + }); }) .run(() => run()) - .catch((error) => { - process.exitCode = 1 - prettyPrintError(error) - }) + .catch(error => { + process.exitCode = 1; + prettyPrintError(error); + }); -- cgit v1.2.3-70-g09d2