Skip to content

Commit 2c080cf

Browse files
authored
Merge pull request #6144 from github/repo-sync
repo sync
2 parents 8bd57a1 + 7a8bd34 commit 2c080cf

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

content/codespaces/getting-started-with-codespaces/getting-started-with-your-nodejs-project-in-codespaces.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,19 @@ This guide shows you how to set up your JavaScript, Node.js, or TypeScript proje
3030

3131
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Node.js, JavaScript, Typescript, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
3232

33-
You can customize your codespace by adjusting the amount of vCPUs and RAM], [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
33+
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
3434

3535
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
3636

37-
The next section shows you how to modify your tools by adding a dev container.
38-
3937
### Step 2: Add a dev container to your codespace from a template
4038

4139
The default codespaces container will support running Node.js projects like [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) out of the box. By setting up a custom container you can customize the tools and scripts that run as part of codespace creation and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
4240

43-
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see [Configuring your codespace](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project).
44-
45-
This example guides you through adding a `devcontainer.json` file from a template.
41+
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
4642

4743
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
4844
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
49-
3. For this example, click **Node.js**. In practice, you could select any container that’s specific to Node or a combination of tools such as Node and MongoDB.
45+
3. For this example, click **Node.js**. If you need additional features you can select any container that’s specific to Node or a combination of tools such as Node and MongoDB.
5046
![Select Node option from the list](/assets/images/help/codespaces/add-node-prebuilt-container.png)
5147
4. Click the recommended version of Node.js.
5248
![Node.js version selection](/assets/images/help/codespaces/add-node-version.png)
@@ -96,18 +92,18 @@ The newly added `devcontainer.json` file defines a few properties that are descr
9692
}
9793
```
9894

99-
- **Name** - We can name our dev container anything, this is just the default
100-
- **Build** - Our build properties
101-
- **Dockerfile** - In our build object, Dockerfile is a reference to the Dockerfile in the same folder that was the second file added to our project. This is the reference path.
95+
- **Name** - You can name your dev container anything, this is just the default.
96+
- **Build** - The build properties.
97+
- **dockerfile** - In the build object, dockerfile is a reference to the Dockerfile that was also added from the template.
10298
- **Args**
103-
- **Variant**: We only have one build argument here which is the node variant we want to use which is passed into our Dockerfile.
104-
- **Settings** - These are {% data variables.product.prodname_vscode %} settings we wish to set
105-
- **Terminal.integrated.shell.linux** - While bash is the default here, we could use zsh for example by modifying this.
99+
- **Variant**: This file only contains one build argument, which is the node variant we want to use that is passed into the Dockerfile.
100+
- **Settings** - These are {% data variables.product.prodname_vscode %} settings that you can set.
101+
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
106102
- **Extensions** - These are extensions included by default.
107103
- **Dbaeumer.vscode-eslint** - ES lint is a great extension for linting, but for JavaScript there are a number of great Marketplace extensions you could also include.
108-
- **forwardPorts** - By default we can forward a port, like port 3000, but these will also forward automatically
109-
- **postCreateCommand** - If we want to run anything after we land in our codespace that’s not defined in our Dockerfile, like yarn install or npm install, we can do that here
110-
- **remoteUser** - We’re running as the node user, but you can optionally set this to root
104+
- **forwardPorts** - Any ports listed here will be forwarded automatically.
105+
- **postCreateCommand** - If you want to run anything after you land in your codespace that’s not defined in the Dockerfile, you can do that here.
106+
- **remoteUser** - By default, you’re running as the vscode user, but you can optionally set this to root.
111107

112108
##### Dockerfile
113109

@@ -145,7 +141,7 @@ With your dev container added and a basic understanding of what everything does,
145141
"forwardPorts": [4000],
146142
```
147143

148-
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) on the Visual Studio Code docs.
144+
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) in the {% data variables.product.prodname_vscode %} docs.
149145

150146
3. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
151147

content/codespaces/working-with-your-codespace/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Working with your codespace
3-
intro: 'You can use {% data variables.product.prodname_github_codespaces %} settings to manage information that your codespace might need'
3+
intro: 'You can use {% data variables.product.prodname_github_codespaces %} settings to manage information that your codespace might need.'
44
product: '{% data reusables.gated-features.codespaces %}'
55
versions:
66
free-pro-team: '*'

0 commit comments

Comments
 (0)