forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial external release: repository skelaton
- Loading branch information
Elad Ben-Israel
committed
May 30, 2018
1 parent
b2073c4
commit 2db0565
Showing
11 changed files
with
4,751 additions
and
203 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
node_modules | ||
lerna-debug.log | ||
*.js | ||
|
||
|
||
# Created by https://www.gitignore.io/api/node | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
|
||
# End of https://www.gitignore.io/api/node |
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,2 +1,89 @@ | ||
# aws-cdk-js | ||
The AWS CDK is a rich class library for building services on top of the AWS Cloud. CfnObjects is the base layer of the CDK, providing language bindings to CloudFormation resources. | ||
# AWS Cloud Development Kit (AWS CDK) | ||
|
||
The **AWS Cloud Development Kit (AWS CDK)** is a software development framework | ||
for defining cloud infrastructure in code. | ||
|
||
# Development Environment | ||
|
||
This is a monorepo which uses [lerna](https://github.com/lerna/lerna). | ||
|
||
The CDK depends on [jsii](https://github.com/awslabs/jsii), which is still not | ||
published to npm. Therefore, the jsii tarballs are checked-in to this repository | ||
under `./local-npm` and the install script will install them in the repo-global | ||
node_modules directory. | ||
|
||
## Prerequisites | ||
|
||
Since this repo produces artifacts for multiple programming languages using | ||
__jsii__, it relies on the following toolchains: | ||
|
||
- [Node.js 8.11.0](https://nodejs.org/download/release/v8.11.0/) | ||
- [Java OpenJDK 8](http://openjdk.java.net/install/) | ||
- [.NET Core 2.0](https://www.microsoft.com/net/download) | ||
- [Python 3.6.5](https://www.python.org/downloads/release/python-365/) | ||
- [Ruby 2.5.1](https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-5-1-released/) | ||
|
||
When building on CodeBuild, these toolchains are all included in the | ||
[superchain](https://github.com/awslabs/superchain) docker image. This image can | ||
also be used locally as follows: | ||
|
||
```shell | ||
docker pull 260708760616.dkr.ecr.us-east-1.amazonaws.com/superchain:latest | ||
docker run --net=host -it -v $PWD:$PWD -w $PWD superchain | ||
``` | ||
|
||
This will get you into an interactive docker shell. You can then run | ||
./install.sh and ./build.sh as described below. | ||
|
||
## Bootstrapping | ||
|
||
1. Clone this repository (or run `git clean -fdx` to clean up all build artifacts). | ||
2. Run `./install.sh` - this will install all repo-level dependencies, including | ||
`lerna` and the unpublished modules from local-npm. | ||
3. Run `./build.sh` - this will invoke `lerna bootstrap` and `lerna run test`. | ||
All external dependencies will be installed and internal deps will be | ||
cross-linked. | ||
|
||
## Development Iteration | ||
|
||
After you've bootstrapped the repo, you would probably want to work on individual packages. | ||
|
||
All packages in the repo have a two useful scripts: `prepare` and `watch`. In order to execute | ||
these scripts, use `lerna run --stream --scope <package> <script>`. | ||
|
||
> The reason you can't use "npm" is because dev tools are installed at the repository level | ||
> and they are needed in the PATH when executing most of the package scripts. | ||
A useful shell alias would use the directory name as a scope: | ||
|
||
```bash | ||
# add to your ~/.zshrc or ~/.bashrc | ||
alias lr='lerna run --stream --scope $(basename $PWD)' | ||
|
||
# more sugar | ||
alias lw='lr watch &' | ||
alias lp='lr prepare' | ||
``` | ||
|
||
Then, you could just go into any of the package directories and use "lr" to run scripts. For example: | ||
|
||
```bash | ||
cd packages/aws-cdk-s3 | ||
lr watch | ||
``` | ||
|
||
## Package Linter | ||
|
||
The `pkglint` tool normalizes all packages in the repo. It verifies package.json | ||
is normalized and adheres to the set of rules. To evaluate (and potentially fix) | ||
all package linting issues in the repo, run the following command from the root | ||
of the repository (after boostrapping): | ||
|
||
```bash | ||
npm run pkglint | ||
``` | ||
|
||
## Updating jsii | ||
|
||
Run `./pack.sh` in the jsii repository and copy the tarballs to `./local-npm`. | ||
Make sure all tarballs are defined in the root `package.json`. |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
if [ ! -d node_modules ]; then | ||
/bin/bash ./install.sh | ||
fi | ||
|
||
export PATH=node_modules/.bin:$PATH | ||
|
||
echo "=============================================================================================" | ||
echo "boostrapping..." | ||
lerna bootstrap --loglevel=debug | ||
|
||
echo "=============================================================================================" | ||
echo "testing..." | ||
lerna run test --stream | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
commands: | ||
- /bin/bash ./install.sh | ||
build: | ||
commands: | ||
- /bin/bash ./build.sh | ||
|
Oops, something went wrong.