Skip to content

Commit 0ee5451

Browse files
authored
docs: Adding readme for create-cli (#1728)
* docs: Adding readme for create-cli * feat: Initial publish * fix: Correcting broken readme links
1 parent 80803c7 commit 0ee5451

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

packages/create-cli/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# `create-preact-cli`
2+
3+
> Start building a [Preact](https://github.com/preactjs/preact) Progressive Web App in seconds 🔥
4+
5+
This will become the method for creating new Preact-CLI projects in v4.
6+
7+
### Requirements
8+
9+
> **Important**: [Node.js](https://nodejs.org/en/) >= v14 is required.
10+
11+
### Usage
12+
13+
```sh
14+
$ npm init preact-cli <template-name> <project-name>
15+
16+
$ yarn create preact-cli <template-name> <project-name>
17+
```
18+
19+
Example:
20+
21+
```sh
22+
$ npm init preact-cli default my-project
23+
```
24+
25+
The above command pulls the template from [preactjs-templates/default](https://github.com/preactjs-templates/default), prompts for some information, and generates the project at `./my-project`.
26+
27+
### Official Templates
28+
29+
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.
30+
31+
All official project templates are repos in the [preactjs-templates organization](https://github.com/preactjs-templates). When a new template is added to the organization, you will be able to run `npm init preact-cli <template-name> <project-name>` to use that template.
32+
33+
Current available templates include:
34+
35+
- [default](https://github.com/preactjs-templates/default) - Default template with all features
36+
37+
- [typescript](https://github.com/preactjs-templates/default) - Default template implemented in TypeScript
38+
39+
> 💁 Tip: Any Github repo with a `'template'` folder can be used as a custom template: <br /> `npm init preact-cli <username>/<repository> <project-name>`
40+
41+
### CLI Options
42+
43+
#### preact list
44+
45+
Lists all the official preactjs-cli repositories
46+
47+
```sh
48+
$ [npm init / yarn create] preact-cli list
49+
```
50+
51+
#### preact create
52+
53+
Create a project to quick start development.
54+
55+
```
56+
$ [npm init / yarn create] preact-cli <template-name> <project-name>
57+
58+
--name The application name.
59+
--cwd A directory to use instead of $PWD.
60+
--force Force option to create the directory for the new app [boolean] [default: false]
61+
--git Initialize version control using git. [boolean] [default: false]
62+
--install Installs dependencies. [boolean] [default: true]
63+
```

packages/create-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-preact-cli",
3-
"version": "3.4.0",
3+
"version": "0.0.1",
44
"description": "Start building a Preact Progressive Web App in seconds.",
55
"repository": "preactjs/preact-cli",
66
"main": "lib/index.js",
@@ -13,7 +13,7 @@
1313
"node": ">=14"
1414
},
1515
"files": [
16-
"dist"
16+
"lib"
1717
],
1818
"keywords": [
1919
"preact",

0 commit comments

Comments
 (0)