Skip to content

Commit

Permalink
docs: Adding readme for create-cli (#1728)
Browse files Browse the repository at this point in the history
* docs: Adding readme for create-cli

* feat: Initial publish

* fix: Correcting broken readme links
  • Loading branch information
rschristian committed Aug 8, 2022
1 parent 80803c7 commit 0ee5451
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
63 changes: 63 additions & 0 deletions packages/create-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# `create-preact-cli`

> Start building a [Preact](https://github.com/preactjs/preact) Progressive Web App in seconds 🔥
This will become the method for creating new Preact-CLI projects in v4.

### Requirements

> **Important**: [Node.js](https://nodejs.org/en/) >= v14 is required.
### Usage

```sh
$ npm init preact-cli <template-name> <project-name>

$ yarn create preact-cli <template-name> <project-name>
```

Example:

```sh
$ npm init preact-cli default my-project
```

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`.

### Official Templates

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.

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.

Current available templates include:

- [default](https://github.com/preactjs-templates/default) - Default template with all features

- [typescript](https://github.com/preactjs-templates/default) - Default template implemented in TypeScript

> 💁 Tip: Any Github repo with a `'template'` folder can be used as a custom template: <br /> `npm init preact-cli <username>/<repository> <project-name>`
### CLI Options

#### preact list

Lists all the official preactjs-cli repositories

```sh
$ [npm init / yarn create] preact-cli list
```

#### preact create

Create a project to quick start development.

```
$ [npm init / yarn create] preact-cli <template-name> <project-name>
--name The application name.
--cwd A directory to use instead of $PWD.
--force Force option to create the directory for the new app [boolean] [default: false]
--git Initialize version control using git. [boolean] [default: false]
--install Installs dependencies. [boolean] [default: true]
```
4 changes: 2 additions & 2 deletions packages/create-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-preact-cli",
"version": "3.4.0",
"version": "0.0.1",
"description": "Start building a Preact Progressive Web App in seconds.",
"repository": "preactjs/preact-cli",
"main": "lib/index.js",
Expand All @@ -13,7 +13,7 @@
"node": ">=14"
},
"files": [
"dist"
"lib"
],
"keywords": [
"preact",
Expand Down

0 comments on commit 0ee5451

Please sign in to comment.