Skip to content

Commit ed6f258

Browse files
author
Michael Brewer
authored
feat: Add codespaces/gitpod support (#485)
* feat: initial codespaces support * chore: example commit to disable a plugin * fix: rather use lerna-ci * fix: forgot to remove "cd "to examples * feat: Add gitpod support * chore: move to node 14 for both gitpod and codespaces * fix: gitpod specific way * chore: use nvmrc to ease shared config * docs: comment out docs for gitpod * fix: force npm to be 8 * feat: finalize extensions * chore: remove ones that don't work * fix: container typo
1 parent 014c5bd commit ed6f258

File tree

4 files changed

+59
-1
lines changed

4 files changed

+59
-1
lines changed

Diff for: .devcontainer/Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.212.0/containers/javascript-node/.devcontainer/base.Dockerfile
2+
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
3+
ARG VARIANT="14-bullseye"
4+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
5+
6+
# This section to install additional OS packages.
7+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
8+
&& apt-get -y install --no-install-recommends bash-completion
9+
10+
# [Optional] Uncomment if you want to install an additional version of node using nvm
11+
# ARG EXTRA_NODE_VERSION=10
12+
# RUN su node -c "umask 0002 && ./usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
13+
14+
# Global node modules
15+
RUN su node -c "npm install -g npm-check-updates npm@next-8"

Diff for: .devcontainer/devcontainer.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.212.0/containers/javascript-node
3+
{
4+
"name": "Node.js",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
8+
// Append -bullseye or -buster to pin to an OS version.
9+
// Use -bullseye variants on local arm64/Apple Silicon.
10+
"args": { "VARIANT": "14-bullseye" }
11+
},
12+
13+
// Set *default* container specific settings.json values on container create.
14+
"settings": {
15+
"git.enableCommitSigning": true
16+
},
17+
18+
// Add the IDs of extensions you want installed when the container is created.
19+
"extensions": [
20+
"dbaeumer.vscode-eslint",
21+
"esbenp.prettier-vscode",
22+
"firsttris.vscode-jest-runner",
23+
"visualstudioexptteam.vscodeintellicode",
24+
"amazonwebservices.aws-toolkit-vscode",
25+
"ms-vscode.vscode-typescript-tslint-plugin",
26+
"ms-azuretools.vscode-docker"
27+
],
28+
29+
// Use 'postCreateCommand' to run commands after the container is created.
30+
"postCreateCommand": "npm ci; npm run lerna-ci; npm run init-environment",
31+
32+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
33+
"remoteUser": "node"
34+
}

Diff for: .gitpod.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
tasks:
2+
- init: nvm install; nvm use; npm i -g npm@next-8; npm ci; npm run lerna-ci; npm run init-environment
3+
vscode:
4+
extensions:
5+
- dbaeumer.vscode-eslint
6+
- esbenp.prettier-vscode
7+
- firsttris.vscode-jest-runner
8+
- ms-azuretools.vscode-docker
9+
- ms-vscode.vscode-typescript-tslint-plugin

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Work your magic. Before starting make sure to check the [Getting Started](#Getti
108108
## Getting Started
109109

110110
The following steps describe how to set up the AWS Lambda Powertools (Typescript) repository on your local machine.
111-
<!-- The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [Codespaces](https://github.com/features/codespaces) for your development. -->
111+
The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [Codespaces](https://github.com/features/codespaces) for your development.
112112

113113
### Setup
114114

0 commit comments

Comments
 (0)