-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Development Quick Start Docs/Scripts (#148)
* add yarn bootstrap script to replace lerna bootstrap * specify supported node and yarn engines * simplify development docs and update build steps Co-authored-by: Thomas Juranek <thjurane@amazon.com>
- Loading branch information
Showing
2 changed files
with
16 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,20 @@ | ||
## Quick start for development | ||
## Development Quick Start | ||
|
||
1. Environment setup | ||
### Environment setup | ||
|
||
Ensure you have node version 16 and the latest version of yarn installed. | ||
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. | ||
|
||
- Node: any `v16` or higher | ||
- Yarn: any `v1`, but not `v2` or higher | ||
|
||
To do this, execute the following commands: | ||
``` | ||
# Install `n`, a node package manager, globally to help switch between node versions. | ||
npm i n -g | ||
### Building Iot-App-Kit | ||
|
||
# Update to node version 16 | ||
sudo n 16 | ||
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. | ||
|
||
# Install the latest version of yarn | ||
npm i yarn@latest -g | ||
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`. | ||
|
||
# Optionally, install lerna | ||
npm i lerna -g | ||
``` | ||
|
||
2. Build project | ||
|
||
``` | ||
# Without installing lerna locally... | ||
npx lerna bootstrap | ||
# With lerna installed locally | ||
lerna bootstrap | ||
``` | ||
|
||
4. Provide credentials | ||
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`. | ||
|
||
These credentials should not be uploaded to the repository. | ||
|
||
5. Point to valid SiteWise resources | ||
|
||
Alter the file `siteWiseQueries` within `@iot-app-kit/components` to point to valid SiteWise asset properties for the accounts credentials from the prior step. | ||
|
||
6. Test locally | ||
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. | ||
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. | ||
|
||
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. | ||
|
||
4. `yarn start` will run the project at `localhost:3333`. You should see example IoT App Kit components requesting data from SiteWise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters