Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Development Quick Start Docs/Scripts #148

Merged
merged 3 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 11 additions & 36 deletions docs/development.md
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.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
"main": "index.js",
"license": "Apache-2.0",
"repository": "git@github.com:awslabs/iot-app-kit.git",
"engines": {
"node": ">=16.0.0",
"yarn": ">=1.0.0 <2.0.0"
},
"workspaces": {
"packages": [
"packages/*"
]
},
"scripts": {
"start": "cd packages/components && yarn run start",
"bootstrap": "yarn install && yarn build",
"build": "lerna run build --stream",
"clean": "git clean -dxf -e /.idea -e /.vscode -e creds.json",
"fix": "npm-run-all -p fix:eslint fix:stylelint",
Expand Down