Skip to content

Commit

Permalink
fred pass
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Aug 5, 2022
1 parent 899c6c6 commit ca731f0
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions packages/create-astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,38 +294,55 @@ 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().info(cyan(bold(`Don't love TypeScript? That's okay!`)));
console.log(` Astro supports TypeScript inside of ".astro" Astro component scripts,`);
console.log(` so we still need to create a few TypeScript-related files in your project.`);
console.log(
` You can safely ignore them, but don't delete them! ${dim(
'(ex: tsconfig.json, 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 ca731f0

Please sign in to comment.