Skip to content

Commit 83dcfab

Browse files
docs: #210 init CLI docs and snippet updates (#234)
1 parent 2e031e8 commit 83dcfab

5 files changed

Lines changed: 25 additions & 23 deletions

File tree

src/components/get-started/get-started.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styles from "./get-started.module.css";
22

33
export default class GetStarted extends HTMLElement {
44
connectedCallback() {
5-
const code = "npx @greenwood/init@latest my-app";
5+
const code = "npx @greenwood/init@latest";
66

77
this.innerHTML = `
88
<div class="${styles.container}">

src/components/hero-banner/hero-banner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import emphasis from "../../assets/emphasis-corner.svg?type=raw";
33

44
export default class HeroBanner extends HTMLElement {
55
connectedCallback() {
6-
const code = "npx @greenwood/init@latest my-app";
6+
const code = "npx @greenwood/init@latest";
77

88
this.innerHTML = `
99
<div class="${styles.container}">

src/components/hero-banner/hero-banner.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
}
8686

8787
.snippet pre {
88-
font-size: 16px;
88+
font-size: 20px;
8989
height: 50px;
9090
align-content: center;
9191
display: inline-block;

src/pages/docs/introduction/setup.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,35 @@ Greenwood supports NodeJS LTS version >= 22.18.0.
1212

1313
## Init
1414

15-
The recommended way to start a new Greenwood project, our **init** CLI will scaffold out a starter project for you. Just run a single command and then follow the prompts. Make sure you have the [latest LTS version of Node](https://nodejs.org/en/download) installed.
15+
The recommended way to start a new Greenwood project is with our **init** CLI, which will scaffold out a new project for you. It will also prompt you for setting up TypeScript, package manager selection, and more!
1616

17-
To scaffold into the _current_ directory, run:
17+
Just run a single command and then follow the prompts:
1818

1919
<!-- prettier-ignore-start -->
20+
2021
<app-ctc-block variant="shell" paste-contents="npx @greenwood/init@latest">
2122

2223
```shell
23-
npx @greenwood/init@latest
24+
$ npx @greenwood/init@latest
2425
```
2526

2627
</app-ctc-block>
2728

2829
<!-- prettier-ignore-end -->
2930

30-
To scaffold into a _custom_ directory, run:
31-
32-
<!-- prettier-ignore-start -->
33-
<app-ctc-block variant="shell" paste-contents="npx @greenwood/init@latest my-app">
34-
35-
```shell
36-
# initialize a new directory called my-app for your Greenwood project
37-
$ npx @greenwood/init@latest my-app
38-
```
31+
See the full list of all options by running with the `--help` command:
3932

40-
</app-ctc-block>
41-
42-
<!-- prettier-ignore-end -->
33+
```shell
34+
Usage: @greenwood/init [options]
35+
36+
Options:
37+
-V, --version output the version number
38+
-y, --yes Accept all default options
39+
--name <name> Name and directory location to scaffold your application with
40+
--ts [choice] Optionally configure your project with TypeScript (choices: "yes", "no")
41+
-i, --install <choice> Install dependencies with the package manager of your choice (choices: "npm", "pnpm", "yarn", "no")
42+
-h, --help display help for command
43+
```
4344

4445
## Install
4546

src/pages/guides/getting-started/index.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ With NodeJS installed, you'll want to prepare a workspace for your project and u
3838
<app-ctc-block variant="shell" paste-contents="npx @greenwood/init@latest">
3939

4040
```shell
41-
# initialize a new Greenwood project into the my-app directory
42-
$ npx @greenwood/init@latest my-app
41+
# initialize a new Greenwood project into the my-app directory (or any name you want)
42+
# You can skip TypeScript for now, and select your package manager of choice
43+
$ npx @greenwood/init@latest --name my-app
4344
$ cd my-app
4445

4546
# clean up the src/ directory
@@ -50,17 +51,17 @@ With NodeJS installed, you'll want to prepare a workspace for your project and u
5051

5152
<!-- prettier-ignore-end -->
5253

53-
Or you can also manually initialize a repository setting up and installing the Greenwood CLI yourself, like so:
54+
Or you can manually initialize a workspace and installing the Greenwood CLI yourself:
5455

5556
```shell
5657
# make and change into your workspace directory
5758
$ mkdir my-app
5859
$ cd my-app
5960

6061
# initialize a package.json (you can accept all defaults)
61-
$ npm init
62+
$ npm init # or Yarn, or pnpm, etc...
6263

63-
# install Greenwood as a devDependency
64+
# install Greenwood as a dev dependency
6465
$ npm i -D @greenwood/cli@latest
6566
```
6667

0 commit comments

Comments
 (0)