|
1 |
| -## Quick start for development |
| 1 | +## Development Quick Start |
2 | 2 |
|
3 |
| -1. Environment setup |
| 3 | +### Environment setup |
4 | 4 |
|
5 |
| -Ensure you have node version 16 and the latest version of yarn installed. |
| 5 | +Iot-App-Kit runs on node and uses yarn for package management. Specific versions are required in order to keep builds working with the current monorepo tooling. |
6 | 6 |
|
| 7 | +- Node: any `v16` or higher |
| 8 | +- Yarn: any `v1`, but not `v2` or higher |
7 | 9 |
|
8 |
| -To do this, execute the following commands: |
9 |
| -``` |
10 |
| -# Install `n`, a node package manager, globally to help switch between node versions. |
11 |
| -npm i n -g |
| 10 | +### Building Iot-App-Kit |
12 | 11 |
|
13 |
| -# Update to node version 16 |
14 |
| -sudo n 16 |
| 12 | +With supported versions of node and yarn installed, you're ready to connect to SiteWise and start building for Iot-App-Kit. You'll need to pull in credentials, specify the SiteWise assets you'd like to connect to, build the project, and then run locally. |
15 | 13 |
|
16 |
| -# Install the latest version of yarn |
17 |
| -npm i yarn@latest -g |
| 14 | +1. Copy a set of AWS JSON formatted credentials to the account with the access to the SiteWise resources you are requesting, at `<rootDir>/packages/components/creds.json`. |
18 | 15 |
|
19 |
| -# Optionally, install lerna |
20 |
| -npm i lerna -g |
21 |
| -``` |
22 |
| - |
23 |
| -2. Build project |
24 |
| - |
25 |
| -``` |
26 |
| -# Without installing lerna locally... |
27 |
| -npx lerna bootstrap |
28 |
| -
|
29 |
| -# With lerna installed locally |
30 |
| -lerna bootstrap |
31 |
| -``` |
32 |
| - |
33 |
| -4. Provide credentials |
34 |
| - Copy a set of AWS JSON formatted credentials to the account with the access to the SiteWise resources you are requesting, at `<rootDir>/packages/components/creds.json`. |
35 |
| - |
36 |
| -These credentials should not be uploaded to the repository. |
37 |
| - |
38 |
| -5. Point to valid SiteWise resources |
39 |
| - |
40 |
| -Alter the file `siteWiseQueries` within `@iot-app-kit/components` to point to valid SiteWise asset properties for the accounts credentials from the prior step. |
41 |
| - |
42 |
| -6. Test locally |
43 |
| - run `yarn run start` at the project root, and then view `localhost:3333`. Here you should see example IoT App Kit components requesting data from SiteWise. |
| 16 | +2. Alter the file `siteWiseQueries` within `@iot-app-kit/components` to point to valid SiteWise asset properties for the account credentials from the prior step. |
44 | 17 |
|
| 18 | +3. `yarn bootstrap` installs dependencies and builds the Iot-App-Kit packages. Note: this is different than using `lerna bootstrap`, which installs dependencies but doesn't build the packages. |
45 | 19 |
|
| 20 | +4. `yarn start` will run the project at `localhost:3333`. You should see example IoT App Kit components requesting data from SiteWise. |
0 commit comments