From 016b4b7b136f778936e1056ef55577c67dd289de Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 27 Mar 2024 19:21:30 +0000 Subject: [PATCH] [ci] format --- packages/db/src/core/integration/index.ts | 11 ++++++++--- packages/db/test/local-prod.test.js | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/db/src/core/integration/index.ts b/packages/db/src/core/integration/index.ts index d288475a5d..df03df9df4 100644 --- a/packages/db/src/core/integration/index.ts +++ b/packages/db/src/core/integration/index.ts @@ -5,6 +5,7 @@ import type { AstroConfig, AstroIntegration } from 'astro'; import { AstroError } from 'astro/errors'; import { mkdir, writeFile } from 'fs/promises'; import { blue, yellow } from 'kleur/colors'; +import { loadEnv } from 'vite'; import parseArgs from 'yargs-parser'; import { CONFIG_FILE_NAMES, DB_PATH } from '../consts.js'; import { resolveDbConfig } from '../load-file.js'; @@ -14,7 +15,6 @@ import { fileURLIntegration } from './file-url.js'; import { typegenInternal } from './typegen.js'; import { type LateSeedFiles, type LateTables, vitePluginDb } from './vite-plugin-db.js'; import { vitePluginInjectEnvTs } from './vite-plugin-inject-env-ts.js'; -import { loadEnv } from 'vite'; function astroDBIntegration(): AstroIntegration { let connectToStudio = false; @@ -115,9 +115,14 @@ function astroDBIntegration(): AstroIntegration { }); }, 'astro:build:start': async ({ logger }) => { - if(!connectToStudio && !databaseFileEnvDefined() && (output === 'server' || output === 'hybrid')) { + if ( + !connectToStudio && + !databaseFileEnvDefined() && + (output === 'server' || output === 'hybrid') + ) { const message = `Attempting to build without the --remote flag or the ASTRO_DATABASE_FILE environment variable defined. You probably want to pass --remote to astro build.`; - const hint = 'Learn more connecting to Studio: https://docs.astro.build/en/guides/astro-db/#connect-to-astro-studio'; + const hint = + 'Learn more connecting to Studio: https://docs.astro.build/en/guides/astro-db/#connect-to-astro-studio'; throw new AstroError(message, hint); } diff --git a/packages/db/test/local-prod.test.js b/packages/db/test/local-prod.test.js index 16682d57aa..150c2383f9 100644 --- a/packages/db/test/local-prod.test.js +++ b/packages/db/test/local-prod.test.js @@ -37,7 +37,7 @@ describe('astro:db local database', () => { let buildError = null; try { await fixture.build(); - } catch(err) { + } catch (err) { buildError = err; } @@ -55,7 +55,7 @@ describe('astro:db local database', () => { let buildError = null; try { await fixture2.build(); - } catch(err) { + } catch (err) { buildError = err; }