Skip to content

Commit 6f0654a

Browse files
committed
Add dev containers support
1 parent 52a113f commit 6f0654a

8 files changed

+60
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 34 additions & 0 deletions
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
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3+
{
4+
"name": "grapoza/vue-tree (Ubuntu)",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/base:jammy",
7+
// Features to add to the dev container. More info: https://containers.dev/features.
8+
"features": {
9+
"ghcr.io/devcontainers/features/node:1": {
10+
"nodeGypDependencies": true,
11+
"version": "20"
12+
}
13+
},
14+
15+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16+
// "forwardPorts": [],
17+
18+
// Use 'postCreateCommand' to run commands after the container is created.
19+
"postCreateCommand": "chmod +x .devcontainer/init_container.sh && sed -i 's/\r$//' .devcontainer/init_container.sh &&.devcontainer/init_container.sh",
20+
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
"vscode": {
24+
// These are the extensions that are included in VS Code for the container
25+
"extensions": [
26+
"vitest.explorer",
27+
"Vue.volar"
28+
]
29+
}
30+
},
31+
32+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
33+
"remoteUser": "root"
34+
}

.devcontainer/init_container.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# This file contains commands that should be run only once upon container creation.
4+
5+
# Install tools
6+
sudo apt update -y
7+
8+
# allow ** globs in bash
9+
shopt -s globstar
3.89 MB
Binary file not shown.
-3.95 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can also submit an issue if you just have a question about the component. If
1010

1111
## Want to contribute a fix or implement a feature?
1212

13-
Great! Here are the things you'll need to know in order to start hacking on the project. While this should cover the general flow, feel free to reach out if anything isn't clear or you have any questions which are not covered here.
13+
Great! Here are the things you'll need to know in order to start hacking on the project. While this should cover the general flow, feel free to reach out if anything isn't clear or you have any questions which are not covered here.
1414

1515
Before starting on any fix, make sure the issue itself is documented in the [issues list](https://github.com/grapoza/vue-tree/issues).
1616

@@ -20,6 +20,16 @@ You can start by forking the [grapoza/vue-tree](https://github.com/grapoza/vue-t
2020

2121
### Get set up
2222

23+
If you have Docker desktop installed and will develop using a tool that supports dev containers, this project includes a `.devcontainer` folder with a configuration for the container. This will set up the environment for you, including installing the prerequisites. If you don't have Docker desktop or prefer to set up your environment manually, you'll need to install the prerequisites and set up the project manually.
24+
25+
To use Dev Containers, you'll need to have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed on your system and add the Dev Containers extension to VS Code (if that's the IDE you're using). You can find the Dev Containers extension [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
26+
27+
[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/grapoza/vue-tree)
28+
29+
If you already have VS Code and Docker Desktop installed, you can click the badge above or [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/grapoza/vue-tree) to get started. Clicking these links will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. **Due to the [speed and hot reload issues](https://vitejs.dev/config/server-options.html#server-watch) associated with mounting a local windows file system, this is the preferred method of using a development container.**
30+
31+
If you instead clone the solution to your local machine and open it in VS Code, it will prompt you to re-open the folder in a dev container. As mentioned previously, this development experience will be far less performant than using the links above if you are on a Windows file system.
32+
2333
Prerequisites:
2434

2535
- [Yarn](https://yarnpkg.com/) (latest)

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grapoza/vue-tree",
3-
"version": "7.0.1",
3+
"version": "7.0.2",
44
"description": "Tree components for Vue 3",
55
"author": "Gregg Rapoza <grapoza@gmail.com>",
66
"license": "MIT",
@@ -15,6 +15,10 @@
1515
"tree",
1616
"treeview"
1717
],
18+
"engines": {
19+
"node": "^20.12.2"
20+
},
21+
"packageManager": "yarn@4.4.0",
1822
"files": [
1923
"dist"
2024
],
@@ -71,6 +75,5 @@
7175
"browserslist": [
7276
"defaults",
7377
"not IE 11"
74-
],
75-
"packageManager": "yarn@4.4.0"
78+
]
7679
}

0 commit comments

Comments
 (0)