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

create-astro updates #12083

Merged
merged 20 commits into from
Nov 4, 2024
Merged

create-astro updates #12083

merged 20 commits into from
Nov 4, 2024

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Sep 27, 2024

Changes

This PR includes a few changes to the experience of creating a new project in Astro:

  • The list of available templates is now the following:
    • Basics
    • Blog
    • Docs (Starlight)
    • Portfolio
    • In the stable version of Astro 5, Storefront will be added as well
  • The TypeScript question has been removed, the default value is now strict for everyone. The presets still exists for anyone wanting a more relaxed or strict experience. Remember, Astro is TypeScript.
    • // @ts-check has been added to all the examples config files
    • astro check is no longer enabled by default for the build command
  • create-astro now takes a --add flag, allowing one to add a bunch of integrations in one command.

Basic example rework

The basics template has been reworked to provide a more minimal template, allowing it to serve as a mix between "Basics" and "Minimal":

  • The theme of the basics template has been moved into a built-in "Welcome" component exported from Astro directly. The source code of that component is plain .astro, allowing one to still inspect how you'd achieve things in Astro. This component takes in a props to customise the title, still allowing for the implicit teaching of props. A very basic layout (similar to Emmet's doc command) is included, both to setup basic HTML stuff and teach the user about templates / slots

Testing

Added / updated tests

Docs

We'll update the docs:tm:

Copy link

changeset-bot bot commented Sep 27, 2024

🦋 Changeset detected

Latest commit: e6425d2

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

@Princesseuh Princesseuh marked this pull request as draft September 27, 2024 08:58
@github-actions github-actions bot added the pkg: create-astro Related to the `create-astro` package (scope) label Sep 27, 2024
@github-actions github-actions bot added the pkg: example Related to an example package (scope) label Sep 27, 2024
@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Sep 27, 2024
@TheOtterlord
Copy link
Member

TheOtterlord commented Sep 27, 2024

Todo:

@Princesseuh Princesseuh marked this pull request as ready for review September 27, 2024 19:42
packages/astro/components/index.ts Outdated Show resolved Hide resolved
.changeset/old-actors-learn.md Outdated Show resolved Hide resolved
@florian-lefebvre florian-lefebvre linked an issue Sep 28, 2024 that may be closed by this pull request
1 task
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
@Princesseuh Princesseuh marked this pull request as draft September 28, 2024 18:04
@Princesseuh Princesseuh marked this pull request as ready for review October 30, 2024 13:23
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Thanks for pinging, Erika!

So, off the top of my head (I'll make a task for myself to follow up):

  • We don't need anything in the Upgrade guide since technically this can't break an existing project. I suspect this will either be more of a "discovery" or something to hype for the blog post.

  • I will need to update the tutorial that is currently expecting the base TS setting, and the current "minimal" template

  • I will check the TypeScript/config pages that describe our settings to make sure nothing expects base and describes updating that

  • document the new --add flag

  • As much as we can manage (which might not be much depending on our whole sidebar recreation? This might have to be the next quarter project), we can look at updating code examples with Tabs for JS/TS, or showing more TS examples in docs now that we can expect the basic project to use strict and more people to need to avoid squiggles. 😅 I will see if I can wrangle some maintainers/contributors to start prepping for this at least.

.changeset/old-actors-learn.md Outdated Show resolved Hide resolved
.changeset/old-actors-learn.md Outdated Show resolved Hide resolved
.changeset/old-actors-learn.md Outdated Show resolved Hide resolved
.changeset/old-actors-learn.md Outdated Show resolved Hide resolved
.changeset/old-actors-learn.md Outdated Show resolved Hide resolved
packages/create-astro/src/actions/dependencies.ts Outdated Show resolved Hide resolved
packages/create-astro/src/actions/dependencies.ts Outdated Show resolved Hide resolved
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Princesseuh and others added 2 commits November 1, 2024 12:07
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

LGTM. Looks like the running the basics template locally causes some dynamic import errors with Vite. But I think that could be investigated separately in the future.

@Princesseuh Princesseuh merged commit 9263e96 into next Nov 4, 2024
14 checks passed
@Princesseuh Princesseuh deleted the feat/create-astro-changes branch November 4, 2024 15:15
ematipico pushed a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Reuben Tier <otterlord.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: create-astro Related to the `create-astro` package (scope) pkg: example Related to an example package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create astro --no => typescript == strict, instead of "no"
7 participants