Skip to content

Commit

Permalink
fred pass
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Aug 6, 2022
1 parent 899c6c6 commit b5a1f04
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions packages/create-astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,38 +294,52 @@ export async function main() {
{
type: 'select',
name: 'typescript',
message:
'Astro is a TypeScript-first framework. How strict would you like the typechecking to be?',
message: 'How would you like to setup TypeScript?',
choices: [
{
title: 'Relaxed',
description: "Not a big fan of TypeScript? No issues, we'll keep this kind",
value: 'default',
},
{
title: 'Strict (recommended)',
description: 'Will enable `strict`',
description: 'Enable `strict` typechecking rules',
value: 'strict',
},
{
title: 'Stricter',
description: 'Will enable `strict` and some stricter settings',
title: 'Strictest',
description: 'Enable all typechecking rules',
value: 'stricter',
},
{
title: 'I prefer not to use TypeScript',
description: `That's cool too!`,
value: 'optout',
},
],
},
{
onCancel: () => {
ora().info(
dim(
'Operation cancelled. No worries, your project folder has already been created and TypeScript settings have been set to "Relaxed"'
'Operation cancelled. Your project folder has been created but no TypeScript configuration file was created.'
)
);
process.exit(1);
},
}
);

if (tsResponse.typescript === 'optout') {
console.log(``);
ora().warn(yellow(bold(`Astro ❤️ TypeScript!`)));
console.log(` Astro supports TypeScript inside of ".astro" component scripts, so`);
console.log(` we still need to create some TypeScript-related files in your project.`);
console.log(` You can safely ignore these files, but don't delete them!`);
console.log(dim(' (ex: tsconfig.json, src/types.d.ts)'));
console.log(``);
tsResponse.typescript = 'default';
await wait(300);
}
if (args.dryRun) {
ora().info(dim(`--dry-run enabled, skipping.`));
} else if (tsResponse.typescript) {
Expand Down

0 comments on commit b5a1f04

Please sign in to comment.