Skip to content

Commit

Permalink
docs: installation dev guide
Browse files Browse the repository at this point in the history
  • Loading branch information
tracy-french committed Nov 25, 2024
1 parent d8ea960 commit 2dc39f5
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/InstallingPackages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Installing packages

### Best practices

- Please only install dependencies using npm workspaces commands (see [useful commands](#useful-commands)) from the root of the project. Failure to do so may result in package versioning issues across the project.
- Only install dependencies at the mono-repo level (i.e., root level) if they act on the entire project. Otherwise, install the dependencies directly to the packages using them. The root package.json should not be used to share common dependencies.
- Ensure all depedency versions match across the project (i.e., don't have Typescript 5.5 in package-1 and 5.4 in package-2). If versions do not match, dependency resolution issues may occur.
- Read the documentation on npm workspaces and turbo repo.

### Useful commands

#### Install all dependencies

```sh
npm run install-ws
```

#### Install dependencies in the root package.json

```sh
npm install <dependency>
```

#### Install dependencies in every package except the root

```sh
npm install <dependency> --workspaces
```

#### Install dependencies in single package

```sh
npm install <dependency> --workspace=@iot-app-kit/<package>
```

#### Install dependencies in multiple packages

```sh
npm install <dependency> --workspace=@iot-app-kit/<package-1> --workspace=@iot-app-kit/<package-2> --workspace=@iot-app-kit/<package-3>
```

0 comments on commit 2dc39f5

Please sign in to comment.