From f78bda9ff09ab0cb884bdd83be75bcc1b3646e1f Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 14 May 2019 11:48:16 +0300 Subject: [PATCH] build: add recommended config files for VSCode remote development (#30450) Add some recommended config files to use (as is or as basis) for setting up [remote development using docker containers][1] with VSCode. This is an opt-in feature. See `.devcontainer/README.md` for more info. The configuration can be further tweaked/improved, but is a good starting point. [1]: https://code.visualstudio.com/docs/remote/containers PR Close #30450 --- .devcontainer/recommended-Dockerfile | 22 +++++++++++++++++++++ .devcontainer/recommended-devcontainer.json | 16 +++++++++++++++ .github/CODEOWNERS | 1 + .gitignore | 4 +++- .vscode/extensions.json | 3 +++ 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/recommended-Dockerfile create mode 100644 .devcontainer/recommended-devcontainer.json diff --git a/.devcontainer/recommended-Dockerfile b/.devcontainer/recommended-Dockerfile new file mode 100644 index 0000000000..a004714591 --- /dev/null +++ b/.devcontainer/recommended-Dockerfile @@ -0,0 +1,22 @@ +# Image metadata and config. +FROM circleci/node:10-browsers + +LABEL name="Angular dev environment" \ + description="This image can be used to create a dev environment for building Angular." \ + vendor="angular" \ + version="1.0" + +EXPOSE 4000 4200 4433 5000 8080 9876 + + +# Switch to `root` (CircleCI images use `circleci` as the user). +USER root + + +# Configure `Node.js`/`npm` and install utilities. +RUN npm config --global set user root +RUN npm install --global yarn@1.13.0 # This needs to be in sync with what we use on CI. + + +# Go! (And keep going.) +CMD ["tail", "--follow", "/dev/null"] diff --git a/.devcontainer/recommended-devcontainer.json b/.devcontainer/recommended-devcontainer.json new file mode 100644 index 0000000000..fa6320461b --- /dev/null +++ b/.devcontainer/recommended-devcontainer.json @@ -0,0 +1,16 @@ +// Reference: https://code.visualstudio.com/docs/remote/containers#_devcontainerjson-reference +{ + "name": "Angular dev container", + "dockerFile": "Dockerfile", + "appPort": [4000, 4200, 4433, 5000, 8080, 9876], + "postCreateCommand": "yarn install", + "extensions": [ + "devondcarew.bazel-code", + "gkalpak.aio-docs-utils", + "ms-vscode.vscode-typescript-tslint-plugin", + "xaver.clang-format", + // The following extensions are useful when working on angular.io (i.e. inside the `aio/` directory). + //"angular.ng-template", + //"dbaeumer.vscode-eslint", + ], +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5c7fe7b236..b274f730b9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -855,6 +855,7 @@ testing/** @angular/fw-test /.buildkite/** @angular/fw-dev-infra /.circleci/** @angular/fw-dev-infra /.codefresh/** @angular/fw-dev-infra +/.devcontainer/** @angular/fw-dev-infra /.github/** @angular/fw-dev-infra /.vscode/** @angular/fw-dev-infra /docs/BAZEL.md @angular/fw-dev-infra diff --git a/.gitignore b/.gitignore index d7d46f27fd..68ebb8b13a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,9 @@ tools/gulp-tasks/cldr/cldr-data/ pubspec.lock .c9 .idea/ -.devcontainer +.devcontainer/* +!.devcontainer/recommended-devcontainer.json +!.devcontainer/recommended-Dockerfile .settings/ .vscode/launch.json .vscode/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 5d121aa51d..30c3aca137 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -8,5 +8,8 @@ "gkalpak.aio-docs-utils", "ms-vscode.vscode-typescript-tslint-plugin", "xaver.clang-format", + // The following extensions are useful when working on angular.io (i.e. inside the `aio/` directory). + //"angular.ng-template", + //"dbaeumer.vscode-eslint", ], }