diff --git a/.devcontainer.json b/.devcontainer.json deleted file mode 100644 index 79ad867c5028a..0000000000000 --- a/.devcontainer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Dev Container Definition - AWS CDK", - "image": "jsii/superchain:1-buster-slim", - "postCreateCommand": "yarn build --skip-test --no-bail --skip-prereqs --skip-compat", - "extensions": [ - "dbaeumer.vscode-eslint@2.1.5" - ], - "remoteUser": "superchain" -} diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000000..84415387968ea --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +FROM jsii/superchain:1-buster-slim + +USER root + +# Change uid/guid of superchain so it can work with the docker-in-docker feature +RUN groupmod --gid 1000 superchain \ + && usermod --uid 1000 --gid 1000 superchain \ + && chown -R 1000:1000 /home/superchain + +USER superchain + +# Setup oh-my-zsh +RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && sudo apt-get -y install --no-install-recommends zsh vim \ + && sudo rm -rf /var/lib/apt/lists/* \ + && sudo chsh -s $(which zsh) $(whoami) +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \ + # Required, otherwise shell is extermly slow due the size of the aws-cdk + && sudo sh -c 'echo "[oh-my-zsh]\n hide-dirty = 1" > /etc/gitconfig' diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000..98e6bf94be412 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "aws-cdk", + "build": { + "dockerfile": "Dockerfile" + }, + + "customizations": { + "vscode": { + "extensions": ["dbaeumer.vscode-eslint"] + } + }, + + "postCreateCommand": "yarn install", + "remoteUser": "superchain", + "features": { + "docker-in-docker": { + "version": "latest", + "moby": true + } + } +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec8de994ef2b7..2b0de4e77dccc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,8 @@ This document describes how to set up a development environment and submit your let us know if it's not up-to-date (even better, submit a PR with your corrections ;-)). - [Getting Started](#getting-started) + - [Local setup](#setup) + - [Dev Container](#dev-container) - [Pull Requests](#pull-requests) - [Step 1: Find something to work on](#step-1-find-something-to-work-on) - [Step 2: Design (optional)](#step-2-design) @@ -23,7 +25,7 @@ let us know if it's not up-to-date (even better, submit a PR with your correcti - [Breaking Changes](#breaking-changes) - [Documentation](#documentation) - [Rosetta](#rosetta) -- [Tools](#tools) +- [Tools](#tools-advanced) - [Linters](#linters) - [cfn2ts](#cfn2ts) - [scripts/foreach.sh](#scriptsforeachsh) @@ -147,7 +149,14 @@ docker$ exit The `dist/` folder within each module contains the packaged up language artifacts. -## Gitpod (Alternative) +### Dev Container + +The AWS CDK provides a VS Code Dev Container with all dependencies pre-installed. +Please follow the [setup instructions](https://code.visualstudio.com/docs/remote/containers-tutorial) to configure VS Code. + +With VS Code setup, you will be prompted to open the `aws-cdk` repo in a Dev Container, or you can choos "Dev Containers: Reopen in Container" from the VS Code command palette. + +### Gitpod (Alternative) You may also set up your local development environment using [Gitpod](http://gitpod.io) - a service that allows you to spin up an in-browser Visual Studio Code-compatible editor,