Skip to content

Commit 911d5e3

Browse files
authored
feat(gatsby-cli): remove feature flag for new interactive gatsby new experience (#28125)
1 parent c993d52 commit 911d5e3

File tree

3 files changed

+53
-29
lines changed

3 files changed

+53
-29
lines changed

docs/docs/gatsby-cli.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,60 @@ You can also use the `package.json` script variant of these commands, typically
2727

2828
### `new`
2929

30+
#### Usage
31+
32+
```shell
33+
gatsby new
34+
```
35+
36+
The CLI will run an interactive shell asking for these options before creating a Gatsby site for you:
37+
38+
```shell
39+
gatsby new
40+
41+
What would you like to name the folder where your site will be created?
42+
my-gatsby-site
43+
44+
Will you be using a CMS? (single choice)
45+
No (or I'll add it later)
46+
47+
WordPress
48+
Contentful
49+
Sanity
50+
DatoCMS
51+
Shopify
52+
53+
Would you like to install a styling system? (single choice)
54+
No (or I'll add it later)
55+
56+
CSS Modules/PostCSS
57+
styled-components
58+
Emotion
59+
Sass
60+
Theme UI
61+
62+
Would you like to install additional features with other plugins? (multiple choice)
63+
◯ Add the Google Analytics tracking script
64+
◯ Add responsive images
65+
◯ Add page meta tags with React Helmet
66+
◯ Add an automatic sitemap
67+
◯ Enable offline functionality
68+
◯ Generate a manifest file
69+
◯ Add Markdown support (without MDX)
70+
◯ Add Markdown and MDX support
71+
```
72+
73+
#### Creating a site from a starter
74+
75+
To create a site from a starter instead, run the command while immediately specifying your site name and starter URL:
76+
3077
```shell
3178
gatsby new [<site-name> [<starter-url>]]
3279
```
3380
34-
#### Arguments
81+
Note that this will not prompt you to create a custom setup, but only clone the starter from the URL you specified.
82+
83+
##### Arguments
3584
3685
| Argument | Description |
3786
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -40,7 +89,7 @@ gatsby new [<site-name> [<starter-url>]]
4089
4190
> Note: The `site-name` should only consist of letters and numbers. If you specify a `.`, `./` or a `<space>` in the name, `gatsby new` will throw an error.
4291
43-
#### Examples
92+
##### Examples
4493
4594
- Create a Gatsby site named `my-awesome-site` using the default starter:
4695
@@ -54,20 +103,6 @@ gatsby new my-awesome-site
54103
gatsby new my-awesome-blog-site https://github.com/gatsbyjs/gatsby-starter-blog
55104
```
56105
57-
- If you leave out both of the arguments, the CLI will run an interactive shell asking for these inputs:
58-
59-
```shell
60-
gatsby new
61-
? What is your project called? › my-gatsby-project
62-
? What starter would you like to use? › - Use arrow-keys. Return to submit.
63-
❯ gatsby-starter-default
64-
gatsby-starter-hello-world
65-
gatsby-starter-blog
66-
(Use a different starter)
67-
```
68-
69-
_Note: you can try out the experimental interactive experience from the `create-gatsby` package with the `GATSBY_EXPERIMENTAL_GATSBY_NEW_FLOW=true` flag, which will prompt you with questions about the kind of site you're building, and install the plugins you'll need automatically._
70-
71106
See the [Gatsby starters docs](/docs/gatsby-starters/) for more details.
72107
73108
### `develop`

integration-tests/gatsby-cli/__tests__/new.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,7 @@ describe(`gatsby new`, () => {
7979
expect(code).toBe(1)
8080
})
8181

82-
it(`runs the prompted starter selection process when no arguments are passed`, () => {
83-
const [_, logs] = GatsbyCLI.from(cwd).invoke([`new`])
84-
85-
logs.should.contain(`What is your project called?`)
86-
})
87-
88-
it(`runs create-gatsby when no arguments are provided to gatsby new with the GATSBY_EXPERIMENTAL_GATSBY_NEW_FLOW flag set`, () => {
89-
process.env.GATSBY_EXPERIMENTAL_GATSBY_NEW_FLOW = true // when this flag is removed we can remove this line
82+
it(`runs create-gatsby when no arguments are provided to gatsby new`, () => {
9083
const [_, logs] = GatsbyCLI.from(cwd).invoke([`new`])
9184

9285
logs.should.contain(`Welcome to Gatsby!`)

packages/gatsby-cli/src/create-cli.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,7 @@ export const createCli = (argv: Array<string>): yargs.Arguments => {
504504
const rootPathStr = rootPath ? String(rootPath) : undefined
505505

506506
// We only run the interactive CLI when there are no arguments passed in
507-
if (
508-
process.env.GATSBY_EXPERIMENTAL_GATSBY_NEW_FLOW &&
509-
!starterStr &&
510-
!rootPathStr
511-
) {
507+
if (!starterStr && !rootPathStr) {
512508
await runCreateGatsby()
513509
} else {
514510
await initStarter(starterStr, rootPathStr)

0 commit comments

Comments
 (0)