Skip to content

Commit f43a5cb

Browse files
committed
docs: quick start
1 parent 400c5fd commit f43a5cb

File tree

1 file changed

+59
-13
lines changed

1 file changed

+59
-13
lines changed

docs/guide/quick-start.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,56 @@
11
# Quick Start
22

3-
## Create a new Jwc project
3+
## Scaffolding Your First jwc.js Project
44

5-
You can use npm, yarn or pnpm to install jwcjs. We recommend using pnpm, it is faster and more efficient.
5+
::: warning
6+
This guide assumes you have Node.js 14.18+, 16+ installed. If you don't have Node.js installed, please install it from [here](https://nodejs.org/en/download/).
7+
:::
68

7-
You can install it with the following command:
9+
We provide a CLI tool to help you get started with jwc.js. It is called `create-jwcjs`, and you can use it to create a new template project with a single command:
810

911
::: code-group
10-
1112
```bash [npm]
12-
npm install jwcjs
13+
npm init jwcjs@latest
1314
```
1415

1516
```bash [yarn]
16-
yarn add jwcjs
17+
yarn create jwcjs@latest
1718
```
1819

1920
```bash [pnpm]
20-
pnpm add jwcjs
21+
pnpm create jwcjs@latest
2122
```
2223
:::
2324

24-
These commands will install jwcjs. You can use Vite, Rollup, Webpack, or any other build tool to build your project.
25+
You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Vite + TypeScript + Jwc.js project, run:
26+
27+
::: code-group
28+
```bash [npm 6.x]
29+
npm init jwcjs@latest <project-name> --template starter-vite-ts
30+
```
31+
32+
```bash [npm 7.x+]
33+
npm init jwcjs@latest <project-name> -- --template starter-vite-ts
34+
```
2535

26-
### Create a new project
36+
```bash [yarn]
37+
yarn create jwcjs@latest <project-name> --template starter-vite-ts
38+
```
2739

28-
::: danger SORRY
29-
We have not yet published the package to npm, so you can only install it from github. And CLI is not yet available, so you can only use it in the project directory.
40+
```bash [pnpm]
41+
pnpm create jwcjs@latest <project-name> --template starter-vite-ts
42+
```
3043
:::
3144

45+
46+
### Our Templates
47+
48+
We provide a few templates to help you get started with jwc.js. You can use them as a starting point for your project.
49+
50+
| Template | Description |
51+
| --- | --- |
52+
| [`starter-vite-ts`](https://github.com/jwcjs/core/tree/main/packages/create-jwc/starter-vite-ts) | A starter template for Vite + TypeScript + Jwc.js |
53+
3254
Once the project is created, follow the instructions to install dependencies and start the dev server:
3355

3456
::: code-group
@@ -74,5 +96,29 @@ This will create a js file in the dist directory. You can use it in your project
7496
```html
7597
<script src="/dist/index.js"></script>
7698

77-
<app-element cound="1" ></app-element>
78-
```
99+
<app-element count="1" ></app-element>
100+
```
101+
102+
103+
## Install jwcjs in an Existing Project
104+
105+
You can use npm, yarn or pnpm to install jwcjs. We recommend using pnpm, it is faster and more efficient.
106+
107+
You can install it with the following command:
108+
109+
::: code-group
110+
111+
```bash [npm]
112+
npm install jwcjs
113+
```
114+
115+
```bash [yarn]
116+
yarn add jwcjs
117+
```
118+
119+
```bash [pnpm]
120+
pnpm add jwcjs
121+
```
122+
:::
123+
124+
These commands will install jwcjs. You can use Vite, Rollup, Webpack, or any other build tool to build your project.

0 commit comments

Comments
 (0)