diff --git a/docs/development.md b/docs/development.md index fec11c9b5..b88601aaf 100644 --- a/docs/development.md +++ b/docs/development.md @@ -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 `/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 `/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. \ No newline at end of file diff --git a/package.json b/package.json index 8965ef9cb..3839f33ef 100755 --- a/package.json +++ b/package.json @@ -5,6 +5,10 @@ "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/*" @@ -12,6 +16,7 @@ }, "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",