From ce3711e1384952d255769b9495f9bfadfb327291 Mon Sep 17 00:00:00 2001 From: akutruff <874049+akutruff@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:39:21 +0000 Subject: [PATCH] add VSCode dev container support and documenation --- .devcontainer/devcontainer.json | 22 ++++++++++++++++++++++ CONTRIBUTING.md | 11 +++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..85dc4388d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,22 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "yarn install" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 64dd15151..3954411ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,17 @@ The following steps will get you setup to contribute changes to this repo: 4. Start playing with the code! You can do some simple experimentation in [`playground.ts`](playground.ts) (see `yarn play` below) or start implementing a feature right away. +## Alternative: VSCode Dev Container setup + +For an officially supported isolated dev environment that automatically installs dependencies for you: + +1. `F1` in VSCode and start typing `Dev Containers: Clone Repository in Named Container Volume` to run the command. +2. For the repo, paste `git@github.com:{your_username}/zod.git` if you're using ssh. +3. Click `Create a new volume...` and name it `zod` and the folder name as `zod`. + +Note: if you can't see `Dev Containers` in the `F1` menu, follow [this guide](https://code.visualstudio.com/docs/devcontainers/tutorial) to install the needed extension. +In the OSS version of VSCode the extension may be not available. + ### Commands **`yarn build`**