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

Added the create-keystone-app CLI argument documentation #2278

Merged
merged 10 commits into from
Jan 23, 2020
Merged
2 changes: 2 additions & 0 deletions docs/quick-start/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ You'll be prompted with a few questions:
2. **Select a starter project.** Select the `Todo` application if you wish to follow this guide.
3. **Select an adapter.** We'll go more into database adapters later. For now, simply choose `Mongoose` if you're running a MongoDB database and `Knex` if you're running a Postgres one.

If you want to perform an unattended app generation (i.e. skipping the prompts), see the [CLI arguments](/packages/create-keystone-app/README.md) of the `create-keystone-app` utility script.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍


Wait a few minutes for all the project dependencies to install. Once that's finished, run this:

```sh
Expand Down
30 changes: 28 additions & 2 deletions packages/create-keystone-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,41 @@ title: Create Keystone App

# Create Keystone App

A cli for Keystone 5 to help generate starter apps.
A CLI for Keystone 5 to help generate starter apps.

## Usage

### Arguments
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move the Arguments section to the end of this file - it's important info, but I'd prefer the actual command for running the CLI to sit above the fold where possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a6ef9af


| Argument | Type | Description |
| :----------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------- |
| `--name` | `String` | The Keystone app name visible in the Admin UI and page titles. |
| `--template` | `String` | One of the existing app templates (folder name). For example: `starter`, `todo`, etc. |
| `--adapter` | `String` | One of the adapters listed in the app template. Usually one of: `Mongoose`, `Knex`. |
| `--dry-run` | `Boolean` | Will go through the app generation process validating the user inputs or CLI arguments but in the end no app will be generated. |


### Interactive

```sh
yarn create keystone-app my-app
```

Follow the prompts, then:
and follow the prompts.

### Non-Interactive

A non-interactive Keystone app creation could be useful in unattended app generation. One such example is creating a Docker image with a generated Keystone app built in.

```sh
npm init keystone-app --name "My App" --template "starter" --adapter "Mongoose" my-app
```

The app generation will fall back to interactive prompts if any of the arguments are missing or have incorrect values.

**NOTE**: By the time this documentation was written, `yarn create` was not working because the CLI arguments were not passed to the `create-keystone-app` script.

## Run the App

```sh
cd my-app
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@keystonejs/website",
"description": "KeystoneJS documentation. Powered by Gatsby.",
"private": true,
"version": "5.0.4",
"version": "5.0.5",
Copy link
Contributor

Choose a reason for hiding this comment

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

Our release bot will increment this number for us, based on the contents of the changeset. Instead of incrementing this number manually, run yarn changeset and select @keystonejs/website as the package to release as a patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted in 5ea76ae

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changeset added in 0d7c1ac

"author": "The KeystoneJS Development Team",
"repository": "https://github.com/keystonejs/keystone.git",
"homepage": "https://github.com/keystonejs/keystone",
Expand Down