|
1 | 1 | # Quick Start
|
2 | 2 |
|
3 |
| -## Create a new Jwc project |
| 3 | +## Scaffolding Your First jwc.js Project |
4 | 4 |
|
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 | +::: |
6 | 8 |
|
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: |
8 | 10 |
|
9 | 11 | ::: code-group
|
10 |
| - |
11 | 12 | ```bash [npm]
|
12 |
| -npm install jwcjs |
| 13 | +npm init jwcjs@latest |
13 | 14 | ```
|
14 | 15 |
|
15 | 16 | ```bash [yarn]
|
16 |
| -yarn add jwcjs |
| 17 | +yarn create jwcjs@latest |
17 | 18 | ```
|
18 | 19 |
|
19 | 20 | ```bash [pnpm]
|
20 |
| -pnpm add jwcjs |
| 21 | +pnpm create jwcjs@latest |
21 | 22 | ```
|
22 | 23 | :::
|
23 | 24 |
|
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 | +``` |
25 | 35 |
|
26 |
| -### Create a new project |
| 36 | +```bash [yarn] |
| 37 | +yarn create jwcjs@latest <project-name> --template starter-vite-ts |
| 38 | +``` |
27 | 39 |
|
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 | +``` |
30 | 43 | :::
|
31 | 44 |
|
| 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 | + |
32 | 54 | Once the project is created, follow the instructions to install dependencies and start the dev server:
|
33 | 55 |
|
34 | 56 | ::: code-group
|
@@ -74,5 +96,29 @@ This will create a js file in the dist directory. You can use it in your project
|
74 | 96 | ```html
|
75 | 97 | <script src="/dist/index.js"></script>
|
76 | 98 |
|
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