Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a TypeScript step to create-astro #4179

Merged
merged 3 commits into from
Aug 6, 2022
Merged

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Aug 5, 2022

Changes

This PR adds a step to create-astro to allow users to configure how strict they want their TypeScript install to be

image

I've set the "Strict" preset as the recommended one in hope of making everyone's code better as it's the one TypeScript itself recommend for new projects (same goes for all our other recommended settings)

The "Stricter" settings were mostly sourced from create-t3-app, it has very cool settings for TypeScript

Testing

Tested manually

Docs

Will PR docs if needed

@changeset-bot
Copy link

changeset-bot bot commented Aug 5, 2022

🦋 Changeset detected

Latest commit: b5a1f04

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-astro Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: create-astro Related to the `create-astro` package (scope) label Aug 5, 2022
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!

choices: [
{
title: 'Relaxed',
description: "Not a big fan of TypeScript? No issues, we'll keep this kind",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "Not a big fan of TypeScript? No issues, we'll keep this kind",
description: "Not a big fan of TypeScript? No worries, we'll keep things casual",

I LOVE this option! This is such user empathy! 😄

I would suggest adjusting the message a little bit, though. When I read it, I read "kind" expecting "kind of..." So, I thought it was going to say, "We'll keep this kind of...." and then it stopped.

Often designing messages for the widest audience possible, we would try to avoid slang etc. So, you can't go wrong with a very factual description here of what will/won't happen. But, I think if you want to convey this friendliness, there are still some choices that could work. Maybe like....

First part: I think "No worries" is much more common across an international audience than "No issues" (issues might make people think of bugs? or is there an "issue" with this process?) I'd consider "worries" instead.

Second part: this is a little harder, but here are some possibilities that might be a bit more accessible while still being fun, maybe?

  • we'll keep things casual
  • we'll take it easy on you
  • we won't make you use it / you don't have to use it
  • we'll turn off the red squigglies
  • we'll try to help, but won't insist
    ... ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! I used No issues because No worries is used earlier in the steps and my brain immediately went in "Find synonyms" mode 😄

For the second part, we can't say that the user won't have to use it or that it'll disable anything because it effectively doesn't. TypeScript is always enabled, just with friendlier settings. we'll keep things casual seems good to me!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here were my suggestions, lmk what you think! #4179 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thought on formatting: because this is the last question, what if the "don't love typescript" message came after "setup complete!" That way it wouldn't break up the series of prompts mid-way through.

@FredKSchott
Copy link
Member

FredKSchott commented Aug 5, 2022

With @Princesseuh's blessing I just took a pass on the prompts, here's where I landed. Feedback welcome!

Before

Screen Shot 2022-08-05 at 3 08 46 PM

After

Screen Shot 2022-08-05 at 3 38 30 PM

Screen Shot 2022-08-05 at 3 35 07 PM

@Princesseuh
Copy link
Member Author

Princesseuh commented Aug 5, 2022

I feel like giving the option "I don't want to use TS" and the text after are selling something that doesn't exist to users.

It's not just that Astro support TypeScript, it's TypeScript, even on the most relaxed settings, there will be TypeScript errors, even without a tsconfig.json etc

@FredKSchott
Copy link
Member

FredKSchott commented Aug 6, 2022

So I was trying to call that out here, basically saying "we understand that you prefer not to, but Astro needs to, so trust us and don't worry about it". Maybe this could be rewritten to be more clear?

Let me reword this to be more of a warning, since it sounds like the "Astro needs to" part of it was lost. Is this any better?

Screen Shot 2022-08-05 at 9 03 42 PM

Copy link
Member

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Merging to get this out in the next release but I'm happy to keep workshopping the wording in a future PR.

@FredKSchott FredKSchott merged commit d344f9e into main Aug 6, 2022
@FredKSchott FredKSchott deleted the create-astro-typescript branch August 6, 2022 04:06
@astrobot-houston astrobot-houston mentioned this pull request Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: create-astro Related to the `create-astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants