Skip to content

Commit

Permalink
docs: add NX to README.md (#2822)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoBorzi authored Mar 17, 2024
1 parent b62743f commit 9c4db93
Showing 1 changed file with 43 additions and 21 deletions.
64 changes: 43 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,12 @@ To use Keira3, you don't need to install any dependency. Just [download](https:/

You need to first install [node](https://nodejs.org) in order to have `npm` available in your system.

Install dependencies with npm :
This project uses [NX](https://nx.dev/), you can install it globally using `npm install -g nx@latest`

``` bash
npm install
```

If you want to generate Angular components with Angular-cli , you **MUST** install `@angular/cli` in npm global context.
Please follow [Angular-cli documentation](https://github.com/angular/angular-cli) if you had installed a previous version of `angular-cli`.
Then install the dependencies using:

``` bash
npm install -g @angular/cli
npm install
```

Only for **Windows** ([Windows 7 or older versions](https://github.com/azerothcore/Keira3/issues/2212) are not officially supported), install `windows-build-tools` as administrator:
Expand All @@ -67,7 +62,35 @@ npm install --global-production windows-build-tools
```
This installation will take time and probably your PC will **reboot** during the installation.

### Build
### Running checks on projects

The entire codebse is organised in [NX](https://nx.dev/) projects (apps and libraries), that are located in:

- `apps/*`
- `libs/*`

All lib paths are declared in the [tsconfig.base.json](https://github.com/azerothcore/Keira3/blob/master/tsconfig.base.json) and their names are:

- `keira-path-name-of-the-project`

Examples:

- `keira-features-smart-scripts`
- `keira-main-connection-window`
- `keira-shared-base-editor-components`

You can run checks such as `lint` or `test` of any project using:

- `nx lint project-name`
- `nx test project-name`

Examples:

- `nx lint keira`
- `nx lint keira-shared-utils`
- `nx test keira-features-creature`

### Run the app

To run the app in local development with hot reload:

Expand All @@ -77,18 +100,17 @@ npm start

More commands:

|Command|Description|
|--|--|
|`npm run ng:serve:web`| Execute the app in the browser with hot reload (NOTE: no Electron/Node lib will work in this case) |
|`npm run build`| Build the app. Your built files are in the /dist folder. |
|`npm run build:prod`| Build the app with Angular aot. Your built files are in the /dist folder. |
|`npm run electron:local`| Builds your application and start electron
|`npm run electron:linux`| Builds your application and creates an app consumable on linux system |
|`npm run electron:windows`| On a Windows OS, builds your application and creates an app consumable in windows 32/64 bit systems |
|`npm run electron:mac`| On a MAC OS, builds your application and generates a `.app` file of your application that can be run on Mac |
|`npm run test-ci`| Run unit tests once |
|`npm run test`| Run unit tests in watch mode |
|`npm run e2e`| Run e2e tests. It requires to run `npm run build:prod` first |
| Command | Description |
|----------------------------|-------------------------------------------------------------------------------------------------------------|
| `npm run lint` | Run lint of affected projects |
| `npm run test` | Run unit tests of affected projects |
| `npm run e2e` | Run e2e tests. It requires to run `npm run build:prod` first |
| `npm run build` | Build the app. Your built files are in the /dist folder. |
| `npm run build:prod` | Build the app with Angular aot. Your built files are in the /dist folder. |
| `npm run electron:local` | Builds your application and start electron
| `npm run electron:linux` | Builds your application and creates an app consumable on linux system |
| `npm run electron:windows` | On a Windows OS, builds your application and creates an app consumable in windows 32/64 bit systems |
| `npm run electron:mac` | On a MAC OS, builds your application and generates a `.app` file of your application that can be run on Mac |

**Note: Only /dist folder and node dependencies will be included in the executable.**

Expand Down

0 comments on commit 9c4db93

Please sign in to comment.