Skip to content

Commit

Permalink
Update CLI (#159)
Browse files Browse the repository at this point in the history
* Update cli

* Update cli doc

* Update actions CI
  • Loading branch information
Willy Brauner committed Nov 2, 2023
1 parent 0d8d88e commit 5a88307
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
run: npm ci --unsafe-perm && cd apps/front && npm ci --unsafe-perm

- name: ⚡️build front
run: npm run build:front
run: npm run front:build

- name: 🙏🏽 test
run: npm run test:front
run: npm run front:test
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ docker compose exec node /bin/bash
- Install node dependencies for the root project and install dependencies for all apps:

```shell
npm run init
npm i
```

- Setup the project:
Expand All @@ -80,7 +80,7 @@ npm run setup
Then, start the dev server:

```shell
npm run dev:front
npm run front:dev
```

- Create a `apps/front/.env.local` file with your local IP (useful to access the frontend from other devices):
Expand All @@ -91,31 +91,9 @@ HOST="your local IP"

## CLI

- [init](#init)
- [dev:front](#dev-front)
- [setup](#setup)
- [scaffold](#scaffold)
- [scaffold-wp](#scaffold-wp)

npm scripts command line interface is available from the main [package.json](./package.json).
Each script can be executed from `npm run {task}` command.

### init

```shell
npm run init
```

Install node dependencies for the root project and install dependencies for all apps.

### dev front

```shell
npm run dev:front
```

Start the dev server for the front app.

### setup

```shell
Expand All @@ -130,10 +108,10 @@ npm run setup
- Create install file cache
- Reset this current `.git` and re-init it

### scaffold
### front:scaffold

```shell
npm run scaffold
npm run front:scaffold
```

Used to create a new component. [Components templates](cli/tasks/scaffold-component/templates)
Expand All @@ -157,10 +135,10 @@ bundleType: ["react", "dom"]
componentCompatibleFolders: ["components", "pages"]
```

### scaffold-wp
### back:scaffold-wp

```shell
npm run scaffold-wp
npm run back:scaffold-wp
```

Scaffold Page, Post type, Option pages for Wordpress.By default, it will create files in `apps/back/web/app/themes/CherAmi/`.
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"main": "src/index.tsx",
"type": "module",
"scripts": {
"init": "npm i && cd apps/front && npm install",
"dev:front": "cd apps/front && npm run dev",
"build:front": "cd apps/front && npm run build",
"test:front": "cd apps/front && npm run test",
"scaffold": "node cli/tasks/scaffold-component/scaffold-component.js",
"scaffold-wp": "node cli/tasks/scaffold-wp/scaffold-wp.js",
"front:dev": "cd apps/front && npm run dev",
"front:build": "cd apps/front && npm run build",
"front:test": "cd apps/front && npm run test",
"front:scaffold": "node cli/tasks/scaffold-component/scaffold-component.js",
"back:scaffold-wp": "node cli/tasks/scaffold-wp/scaffold-wp.js",
"setup": "node cli/tasks/setup/setup.js && npm run prepare",
"prepare": "husky install"
"prepare": "husky install",
"postinstall": "cd apps/front && npm i"
},
"devDependencies": {
"@cher-ami/debug": "^1.2.0",
Expand Down

0 comments on commit 5a88307

Please sign in to comment.