diff options
Diffstat (limited to 'packages/create-astro/src')
-rw-r--r-- | packages/create-astro/src/actions/context.ts | 2 | ||||
-rw-r--r-- | packages/create-astro/src/actions/dependencies.ts | 8 | ||||
-rw-r--r-- | packages/create-astro/src/actions/git.ts | 6 | ||||
-rw-r--r-- | packages/create-astro/src/actions/intro.ts | 6 | ||||
-rw-r--r-- | packages/create-astro/src/actions/next-steps.ts | 2 | ||||
-rw-r--r-- | packages/create-astro/src/actions/project-name.ts | 2 | ||||
-rw-r--r-- | packages/create-astro/src/actions/template.ts | 6 | ||||
-rw-r--r-- | packages/create-astro/src/actions/typescript.ts | 14 | ||||
-rw-r--r-- | packages/create-astro/src/actions/verify.ts | 4 | ||||
-rw-r--r-- | packages/create-astro/src/messages.ts | 12 | ||||
-rw-r--r-- | packages/create-astro/src/shell.ts | 2 |
11 files changed, 32 insertions, 32 deletions
diff --git a/packages/create-astro/src/actions/context.ts b/packages/create-astro/src/actions/context.ts index 4bb76fe71..83a13eda7 100644 --- a/packages/create-astro/src/actions/context.ts +++ b/packages/create-astro/src/actions/context.ts @@ -53,7 +53,7 @@ export async function getContext(argv: string[]): Promise<Context> { '-n': '--no', '-h': '--help', }, - { argv, permissive: true } + { argv, permissive: true }, ); const packageManager = detectPackageManager() ?? 'npm'; diff --git a/packages/create-astro/src/actions/dependencies.ts b/packages/create-astro/src/actions/dependencies.ts index dbca1ee0c..6a9b6fccb 100644 --- a/packages/create-astro/src/actions/dependencies.ts +++ b/packages/create-astro/src/actions/dependencies.ts @@ -6,7 +6,7 @@ import { shell } from '../shell.js'; import type { Context } from './context.js'; export async function dependencies( - ctx: Pick<Context, 'install' | 'yes' | 'prompt' | 'packageManager' | 'cwd' | 'dryRun' | 'tasks'> + ctx: Pick<Context, 'install' | 'yes' | 'prompt' | 'packageManager' | 'cwd' | 'dryRun' | 'tasks'>, ) { let deps = ctx.install ?? ctx.yes; if (deps === undefined) { @@ -33,8 +33,8 @@ export async function dependencies( error( 'error', `Dependencies failed to install, please run ${color.bold( - ctx.packageManager + ' install' - )} to install them manually after setup.` + ctx.packageManager + ' install', + )} to install them manually after setup.`, ); }, while: () => install({ packageManager: ctx.packageManager, cwd: ctx.cwd }), @@ -42,7 +42,7 @@ export async function dependencies( } else { await info( ctx.yes === false ? 'deps [skip]' : 'No problem!', - 'Remember to install dependencies after setup.' + 'Remember to install dependencies after setup.', ); } } diff --git a/packages/create-astro/src/actions/git.ts b/packages/create-astro/src/actions/git.ts index d75ed18cc..1ecf8c542 100644 --- a/packages/create-astro/src/actions/git.ts +++ b/packages/create-astro/src/actions/git.ts @@ -7,7 +7,7 @@ import { error, info, title } from '../messages.js'; import { shell } from '../shell.js'; export async function git( - ctx: Pick<Context, 'cwd' | 'git' | 'yes' | 'prompt' | 'dryRun' | 'tasks'> + ctx: Pick<Context, 'cwd' | 'git' | 'yes' | 'prompt' | 'dryRun' | 'tasks'>, ) { if (fs.existsSync(path.join(ctx.cwd, '.git'))) { await info('Nice!', `Git has already been initialized`); @@ -41,7 +41,7 @@ export async function git( } else { await info( ctx.yes === false ? 'git [skip]' : 'Sounds good!', - `You can always run ${color.reset('git init')}${color.dim(' manually.')}` + `You can always run ${color.reset('git init')}${color.dim(' manually.')}`, ); } } @@ -58,7 +58,7 @@ async function init({ cwd }: { cwd: string }) { 'Initial commit from Astro', '--author="houston[bot] <astrobot-houston@users.noreply.github.com>"', ], - { cwd, stdio: 'ignore' } + { cwd, stdio: 'ignore' }, ); } catch {} } diff --git a/packages/create-astro/src/actions/intro.ts b/packages/create-astro/src/actions/intro.ts index 8a0c10907..0249e63c8 100644 --- a/packages/create-astro/src/actions/intro.ts +++ b/packages/create-astro/src/actions/intro.ts @@ -4,7 +4,7 @@ import { color, label } from '@astrojs/cli-kit'; import { banner, say } from '../messages.js'; export async function intro( - ctx: Pick<Context, 'skipHouston' | 'welcome' | 'hat' | 'tie' | 'version' | 'username' | 'fancy'> + ctx: Pick<Context, 'skipHouston' | 'welcome' | 'hat' | 'tie' | 'version' | 'username' | 'fancy'>, ) { banner(); @@ -17,13 +17,13 @@ export async function intro( 'to', label('astro', color.bgGreen, color.black), Promise.resolve(ctx.version).then( - (version) => (version ? color.green(`v${version}`) : '') + ',' + (version) => (version ? color.green(`v${version}`) : '') + ',', ), Promise.resolve(ctx.username).then((username) => `${username}!`), ], welcome ?? "Let's build something awesome!", ] as string[], - { clear: true, hat, tie } + { clear: true, hat, tie }, ); } } diff --git a/packages/create-astro/src/actions/next-steps.ts b/packages/create-astro/src/actions/next-steps.ts index 384ad61eb..91536cc46 100644 --- a/packages/create-astro/src/actions/next-steps.ts +++ b/packages/create-astro/src/actions/next-steps.ts @@ -4,7 +4,7 @@ import type { Context } from './context.js'; import { nextSteps, say } from '../messages.js'; export async function next( - ctx: Pick<Context, 'hat' | 'tie' | 'cwd' | 'packageManager' | 'skipHouston'> + ctx: Pick<Context, 'hat' | 'tie' | 'cwd' | 'packageManager' | 'skipHouston'>, ) { let projectDir = path.relative(process.cwd(), ctx.cwd); diff --git a/packages/create-astro/src/actions/project-name.ts b/packages/create-astro/src/actions/project-name.ts index 2c2d95fb9..26938de80 100644 --- a/packages/create-astro/src/actions/project-name.ts +++ b/packages/create-astro/src/actions/project-name.ts @@ -7,7 +7,7 @@ import { info, log, title } from '../messages.js'; import { isEmpty, toValidName } from './shared.js'; export async function projectName( - ctx: Pick<Context, 'cwd' | 'yes' | 'dryRun' | 'prompt' | 'projectName' | 'exit'> + ctx: Pick<Context, 'cwd' | 'yes' | 'dryRun' | 'prompt' | 'projectName' | 'exit'>, ) { await checkCwd(ctx.cwd); diff --git a/packages/create-astro/src/actions/template.ts b/packages/create-astro/src/actions/template.ts index 5169c63e3..d67b54ee0 100644 --- a/packages/create-astro/src/actions/template.ts +++ b/packages/create-astro/src/actions/template.ts @@ -7,7 +7,7 @@ import { downloadTemplate } from 'giget'; import { error, info, title } from '../messages.js'; export async function template( - ctx: Pick<Context, 'template' | 'prompt' | 'yes' | 'dryRun' | 'exit' | 'tasks'> + ctx: Pick<Context, 'template' | 'prompt' | 'yes' | 'dryRun' | 'exit' | 'tasks'>, ) { if (!ctx.template && ctx.yes) ctx.template = 'basics'; @@ -64,9 +64,9 @@ const FILES_TO_UPDATE = { JSON.stringify( Object.assign(JSON.parse(value), Object.assign(overrides, { private: undefined })), null, - indent + indent, ), - 'utf-8' + 'utf-8', ); }), }; diff --git a/packages/create-astro/src/actions/typescript.ts b/packages/create-astro/src/actions/typescript.ts index 9013d338b..c0034fe4f 100644 --- a/packages/create-astro/src/actions/typescript.ts +++ b/packages/create-astro/src/actions/typescript.ts @@ -53,8 +53,8 @@ export async function typescript(ctx: PickedTypeScriptContext) { error( 'Error', `Unknown TypeScript option ${color.reset(ts)}${color.dim( - '! Expected strict | strictest | relaxed' - )}` + '! Expected strict | strictest | relaxed', + )}`, ); ctx.exit(1); } @@ -84,7 +84,7 @@ export async function typescript(ctx: PickedTypeScriptContext) { const FILES_TO_UPDATE = { 'package.json': async ( file: string, - options: { value: string; ctx: PickedTypeScriptContext } + options: { value: string; ctx: PickedTypeScriptContext }, ) => { try { // inject additional command to build script @@ -127,7 +127,7 @@ const FILES_TO_UPDATE = { await writeFile(file, JSON.stringify(result, null, 2)); } else { throw new Error( - "There was an error applying the requested TypeScript settings. This could be because the template's tsconfig.json is malformed" + "There was an error applying the requested TypeScript settings. This could be because the template's tsconfig.json is malformed", ); } } catch (err) { @@ -135,7 +135,7 @@ const FILES_TO_UPDATE = { // If the template doesn't have a tsconfig.json, let's add one instead await writeFile( file, - JSON.stringify({ extends: `astro/tsconfigs/${options.value}` }, null, 2) + JSON.stringify({ extends: `astro/tsconfigs/${options.value}` }, null, 2), ); } } @@ -145,7 +145,7 @@ const FILES_TO_UPDATE = { export async function setupTypeScript(value: string, ctx: PickedTypeScriptContext) { await Promise.all( Object.entries(FILES_TO_UPDATE).map(async ([file, update]) => - update(path.resolve(path.join(ctx.cwd, file)), { value, ctx }) - ) + update(path.resolve(path.join(ctx.cwd, file)), { value, ctx }), + ), ); } diff --git a/packages/create-astro/src/actions/verify.ts b/packages/create-astro/src/actions/verify.ts index 605b6959d..e620a9ca8 100644 --- a/packages/create-astro/src/actions/verify.ts +++ b/packages/create-astro/src/actions/verify.ts @@ -6,7 +6,7 @@ import { bannerAbort, error, info, log } from '../messages.js'; import { getTemplateTarget } from './template.js'; export async function verify( - ctx: Pick<Context, 'version' | 'dryRun' | 'template' | 'ref' | 'exit'> + ctx: Pick<Context, 'version' | 'dryRun' | 'template' | 'ref' | 'exit'>, ) { if (!ctx.dryRun) { const online = await isOnline(); @@ -33,7 +33,7 @@ export async function verify( function isOnline(): Promise<boolean> { return dns.lookup('github.com').then( () => true, - () => false + () => false, ); } diff --git a/packages/create-astro/src/messages.ts b/packages/create-astro/src/messages.ts index 2ea25f220..ba765f723 100644 --- a/packages/create-astro/src/messages.ts +++ b/packages/create-astro/src/messages.ts @@ -111,8 +111,8 @@ export const nextSteps = async ({ projectDir, devCmd }: { projectDir: string; de await sleep(200); log( `\n ${color.bgCyan(` ${color.black('next')} `)} ${color.bold( - 'Liftoff confirmed. Explore your project!' - )}` + 'Liftoff confirmed. Explore your project!', + )}`, ); await sleep(100); @@ -126,13 +126,13 @@ export const nextSteps = async ({ projectDir, devCmd }: { projectDir: string; de log(enter.join(len > max ? '\n' + prefix : ' ')); } log( - `${prefix}Run ${color.cyan(devCmd)} to start the dev server. ${color.cyan('CTRL+C')} to stop.` + `${prefix}Run ${color.cyan(devCmd)} to start the dev server. ${color.cyan('CTRL+C')} to stop.`, ); await sleep(100); log( `${prefix}Add frameworks like ${color.cyan(`react`)} or ${color.cyan( - 'tailwind' - )} using ${color.cyan('astro add')}.` + 'tailwind', + )} using ${color.cyan('astro add')}.`, ); await sleep(100); log(`\n${prefix}Stuck? Join us at ${color.cyan(`https://astro.build/chat`)}`); @@ -174,7 +174,7 @@ export function printHelp({ if (headline) { message.push( linebreak(), - `${title(commandName)} ${color.green(`v${process.env.PACKAGE_VERSION ?? ''}`)} ${headline}` + `${title(commandName)} ${color.green(`v${process.env.PACKAGE_VERSION ?? ''}`)} ${headline}`, ); } diff --git a/packages/create-astro/src/shell.ts b/packages/create-astro/src/shell.ts index 8ce3031be..7c3e22622 100644 --- a/packages/create-astro/src/shell.ts +++ b/packages/create-astro/src/shell.ts @@ -22,7 +22,7 @@ const text = (stream: NodeJS.ReadableStream | Readable | null) => export async function shell( command: string, flags: string[], - opts: ExecaOptions = {} + opts: ExecaOptions = {}, ): Promise<Output> { let child: ChildProcess; let stdout = ''; |