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

chore(docs): update main tutorial to incorporate TS Updates to create-gatsby #34890

Merged
merged 12 commits into from
Feb 22, 2022
41 changes: 35 additions & 6 deletions docs/docs/tutorial/part-1/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To create your first Gatsby site, you're going to use a command from the Gatsby

<Announcement style={{marginBottom: "1.5rem"}}>

**Note:** For this Tutorial, your Gatsby CLI should be v3 or newer. To check what version you have installed, run the following command:
**Note:** For this Tutorial, your Gatsby CLI should be v4.8 or newer. To check what version you have installed, run the following command:

```shell
gatsby --version
Expand Down Expand Up @@ -88,6 +88,17 @@ gatsby new

<Announcement style={{marginBottom: "1.5rem"}}>

You can also generate a Gatsby site without needing to go through all the prompts. In this case, the the defaults will be used except for the site name which you'll need to pass.
You can do this by running the following command from the command line:

```shell:title=Desktop
gatsby new <site-name> -y
```

</Announcement>

<Announcement style={{marginBottom: "1.5rem"}}>

**Having trouble with `gatsby new`?** If you had trouble globally installing `gatsby-cli` in Part 0, you can also create a new site by running `npm init gatsby` from the command line instead of `gatsby new`.

</Announcement>
Expand All @@ -106,9 +117,27 @@ What would you like to name the folder where your site will be created?
✔ Desktop/ my-first-gatsby-site
```

5. When the prompt asks, **"Will you be using a CMS?"** select **"No (or I'll add it later)"**.
5. When the prompt asks, **"Will you be using JavaScript or TypeScript?"** choose between JavaScript or TypeScript.

```shell
? Will you be using JavaScript or TypeScript?
(Single choice) Arrow keys to move, enter to confirm
JavaScript
❯ TypeScript
```

<Announcement style={{marginBottom: "1.5rem"}}>

This question will be skipped if you passed in a `-ts` flag at the beginning i.e `gatsby new -ts`.
This indicates that you want to use TypeScript hence our [Minimal Typescript Starter](https://github.com/gatsbyjs/gatsby/tree/master/starters/gatsby-starter-minimal-ts) will be pulled in as the template.
Using TypeScript? Also checkout our [TypeScript Docs](/how-to/custom-configuration/typescript/)

</Announcement>

6. When the prompt asks, **"Will you be using a CMS?"** select **"No (or I'll add it later)"**.

```shell

✔ Will you be using a CMS?
· No (or I'll add it later)
```
Expand All @@ -121,21 +150,21 @@ But in this first site, you'll set things up manually to learn about how Gatsby'

</Announcement>

6. When the prompt asks, **"Would you like to install a styling system?"** select **"No (or I'll add it later)"**. (You'll add styles manually later.)
7. When the prompt asks, **"Would you like to install a styling system?"** select **"No (or I'll add it later)"**. (You'll add styles manually later.)

```shell
✔ Would you like to install a styling system?
· No (or I'll add it later)
```

7. When the prompt asks, **"Would you like to install additional features with other plugins?"** use the arrow and Enter keys to select **"Done"**.
8. When the prompt asks, **"Would you like to install additional features with other plugins?"** use the arrow and Enter keys to select **"Done"**.

```shell
✔ Would you like to install additional features with other plugins?
· Done
```

8. The prompt will show you a summary of what `gatsby new` will do. It should look something like the output below.
9. The prompt will show you a summary of what `gatsby new` will do. It should look something like the output below.

```shell
Thanks! Here's what we'll now do:
Expand All @@ -146,7 +175,7 @@ Thanks! Here's what we'll now do:
? Shall we do this? (Y/n) › Yes
```

9. When the prompt asks, **"Shall we do this?"** enter **"Y"**. The `gatsby new` command will start building your site. Your internet download speed will affect how long this command takes to run. After it finishes, you should see a message like this:
10. When the prompt asks, **"Shall we do this?"** enter **"Y"**. The `gatsby new` command will start building your site. Your internet download speed will affect how long this command takes to run. After it finishes, you should see a message like this:

```shell
🎉 Your new Gatsby site My First Gatsby Site has been successfully
Expand Down