Skip to content

Commit 6af4e9d

Browse files
rschristianForsakenHarmony
andauthoredFeb 9, 2022
Chore/docs (#1658)
Co-authored-by: Leah <[email protected]>
1 parent d452863 commit 6af4e9d

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed
 

‎.changeset/shiny-poems-return.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-cli': patch
3+
---
4+
5+
Clarifies when the `--template` flag is necessary in the CLI help information.

‎README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The above command pulls the template from [preactjs-templates/default], prompts
6565

6666
The purpose of official preact project templates are to provide opinionated development tooling setups so that users can get started with actual app code as fast as possible. However, these templates are un-opinionated in terms of how you structure your app code and what libraries you use in addition to preact.js.
6767

68-
All official project templates are repos in the [preactjs-templates organization]. When a new template is added to the organization, you will be able to run `preact create <template-name> <project-name>` to use that template.
68+
All official project templates are repos in the [preactjs-templates organization]. When a new template is added to the organization, you will be able to run `npx preact-cli create <template-name> <project-name>` to use that template.
6969

7070
Current available templates include:
7171

@@ -81,7 +81,7 @@ Current available templates include:
8181

8282
- [widget-typescript] - Widget template implemented in TypeScript
8383

84-
> 💁 Tip: Any Github repo with a `'template'` folder can be used as a custom template: <br /> `preact create <username>/<repository> <project-name>`
84+
> 💁 Tip: Any Github repo with a `'template'` folder can be used as a custom template: <br /> `npx preact-cli create <username>/<repository> <project-name>`
8585
8686
### CLI Options
8787

@@ -90,7 +90,7 @@ Current available templates include:
9090
Create a project to quick start development.
9191

9292
```
93-
$ preact create <template-name> <project-name>
93+
$ npx preact-cli create <template-name> <project-name>
9494
9595
--name The application name.
9696
--cwd A directory to use instead of $PWD.
@@ -100,7 +100,7 @@ $ preact create <template-name> <project-name>
100100
--install Installs dependencies. [boolean] [default: true]
101101
```
102102

103-
Note: If you don't specify enough data to the `preact create` command, it will prompt the required questions.
103+
Note: If you don't specify enough data to the `npx preact-cli create` command, it will prompt the required questions.
104104

105105
#### preact build
106106

@@ -118,7 +118,7 @@ $ preact build
118118
--sw Generate and attach a Service Worker (default true)
119119
--babelConfig Path to custom Babel config (default .babelrc)
120120
--json Generate build stats for bundle analysis
121-
--template Path to custom HTML template
121+
--template Path to custom HTML template (default 'src/template.html')
122122
--preload Adds preload tags to the document its assets (default false)
123123
--analyze Launch interactive Analyzer to inspect production bundle(s)
124124
--prerender Renders route(s) into generated static HTML (default true)
@@ -150,7 +150,7 @@ $ preact watch
150150
--cacert Path to optional CA certificate override
151151
--prerender Pre-render static content on first run
152152
--prerenderUrls Path to pre-rendered routes config (default prerender-urls.json)
153-
--template Path to custom HTML template
153+
--template Path to custom HTML template (default 'src/template.html')
154154
--refresh Enables experimental preact-refresh functionality
155155
-c, --config Path to custom CLI config (default preact.config.js)
156156
-H, --host Set server hostname (default 0.0.0.0)
@@ -192,7 +192,7 @@ To make customizing your configuration easier, preact-cli supports plugins. Visi
192192

193193
#### Browserslist
194194

195-
You may customize your list of supported browser versions by declaring a [`"browserslist"`] key within your `package.json`. Changing these values will modify your JavaScript (via [`babel-preset-env`]) and your CSS (via [`autoprefixer`](https://github.com/postcss/autoprefixer)) output.
195+
You may customize your list of supported browser versions by declaring a [`"browserslist"`] key within your `package.json`. Changing these values will modify your JavaScript (via [`@babel/preset-env`]) and your CSS (via [`autoprefixer`](https://github.com/postcss/autoprefixer)) output.
196196

197197
By default, `preact-cli` emulates the following config:
198198

@@ -385,7 +385,7 @@ Automatic code splitting is applied to all JavaScript and TypeScript files in th
385385
[webpack config helpers wiki]: https://github.com/preactjs/preact-cli/wiki/Webpack-Config-Helpers
386386
[recipes wiki]: https://github.com/preactjs/preact-cli/wiki/Config-Recipes
387387
[prpl]: https://developers.google.com/web/fundamentals/performance/prpl-pattern
388-
[`babel-preset-env`]: https://github.com/babel/babel-preset-env#targetsbrowsers
388+
[`@babel/preset-env`]: https://babeljs.io/docs/en/babel-preset-env.html
389389
[proof]: https://googlechrome.github.io/lighthouse/viewer/?gist=142af6838482417af741d966e7804346
390390
[preact cli preset]: https://github.com/preactjs/preact-cli/blob/master/packages/cli/lib/lib/babel-config.js
391391
[service workers]: https://developers.google.com/web/fundamentals/getting-started/primers/service-workers

‎packages/cli/lib/commands/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const options = [
4242
},
4343
{
4444
name: '--template',
45-
description: 'Path to custom HTML template',
45+
description: 'Path to custom HTML template (default "src/template.html")',
4646
},
4747
{
4848
name: '--preload',

‎packages/cli/lib/commands/watch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const options = [
7070
},
7171
{
7272
name: '--template',
73-
description: 'Path to custom HTML template',
73+
description: 'Path to custom HTML template (default "src/template.html")',
7474
},
7575
{
7676
name: '--refresh',

0 commit comments

Comments
 (0)
Please sign in to comment.