-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(create-astro): add astro checks to build script when user choose TypeScript #8853
feat(create-astro): add astro checks to build script when user choose TypeScript #8853
Conversation
🦋 Changeset detectedLatest commit: ff7d695 The changes in this PR will be included in the next version bump. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks so much for contributing!
Just wondering about always applying this if the user sets up TypeScript. I usually go with strict
but I'd still like this to be setup for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks so much for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick suggestion from docs re: the wording here! See whether you think the extra context is helpful!
.changeset/ninety-onions-bow.md
Outdated
'create-astro': minor | ||
--- | ||
|
||
Automatically setup `astro check` command when configuring TypeScript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically setup `astro check` command when configuring TypeScript | |
Automatically installs the required dependencies to run the `astro check` command when `strict` or `strictest` | |
TypeScript mode is selected. |
Since running astro check
requires both @astrojs/check
and typescript
, maybe makes sense to say "required dependencies" (plural) here, because these will be added to your project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree. But I have to adjust some wording at the end because astro check
will be applied to all TypeScript options (relaxed
, strict
, strictest
).
Let me know if this change looks good to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented above to clarify that this happens on relaxed
(which seems now far removed from the PR title itself, and maybe installs a dependency for people who won't really use it?) But, wording should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment, but feature looks fine to me. I do feel like we'll get support threads of people complaining that their project doesn't build with various errors, but meh, it's okay, people should and will learn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment to clarify with an optional suggestion, but also fine as is!
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Changes
strictest
, thecreate-astro
command will also addastro checks
to build script@astrojs/check
andtypescript
will be installed if user previously opt-in to install dependenciestypescript.ts
uses both async/sync ofnode:fs
. I also did some refactoring to be all asyncfixes #7031
Testing
package.json
is actually changedDocs
Maybe need to add extra docs to TypeScript to explain strictest behavior when use
pnpm create astro