-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(devcontainer): restructure with project-specific templates #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c28d034
f331cb9
895912a
1bf5251
ad38d85
6892e9c
4696a23
1ce6304
5daca0b
eb08976
e17ce9d
85a366a
1acf5ee
b54be85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| { | ||
| "recommendations": [ | ||
| "davidanson.vscode-markdownlint", | ||
| "ms-azuretools.vscode-containers", | ||
| "redhat.vscode-yaml", | ||
| "streetsidesoftware.code-spell-checker", | ||
| "redhat.vscode-yaml" | ||
| ] | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "id": "fnm", | ||
| "version": "1.0.0", | ||
| "name": "Fast Node Manager (fnm)", | ||
| "description": "Installs fnm and optionally a Node.js version.", | ||
| "options": { | ||
| "nodeVersion": { | ||
| "type": "string", | ||
| "default": "lts", | ||
| "description": "Node.js version to install with fnm. Use 'none' to skip." | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/usr/bin/env bash | ||
| if [ -z "${BASH_VERSION:-}" ] || [ "$(id -un)" != "$_REMOTE_USER" ]; then | ||
| exec su "$_REMOTE_USER" -c "bash -lc '$0'" | ||
| fi | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| curl -fsSL https://fnm.vercel.app/install | bash | ||
|
|
||
| FNM_PATH="$HOME/.local/share/fnm" | ||
| export PATH="$FNM_PATH:$PATH" | ||
|
Comment on lines
+10
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing fnm shell initialization for persistent activation. While the PATH is set for the current session, fnm requires shell initialization to work correctly across sessions. The installation script should configure shell startup files to automatically initialize fnm. 🔧 Add fnm shell initializationAfter line 11, add shell initialization to the user's shell configuration: FNM_PATH="$HOME/.local/share/fnm"
export PATH="$FNM_PATH:$PATH"
+
+# Initialize fnm in shell startup files
+cat >> "$HOME/.bashrc" <<'EOF'
+
+# fnm
+export FNM_PATH="$HOME/.local/share/fnm"
+export PATH="$FNM_PATH:$PATH"
+eval "$(fnm env)"
+EOFThis ensures fnm is available in all future shell sessions and enables features like automatic version switching. 🤖 Prompt for AI Agents |
||
|
|
||
| NODE_VERSION="${NODE_VERSION:-lts}" | ||
| if [ "$NODE_VERSION" != "none" ]; then | ||
| if [ "$NODE_VERSION" = "lts" ]; then | ||
| fnm install --lts | ||
| else | ||
| fnm install "$NODE_VERSION" | ||
| fi | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "id": "uv", | ||
| "version": "1.0.0", | ||
| "name": "uv", | ||
| "description": "Installs uv and optionally a Python version.", | ||
| "options": { | ||
| "pythonVersion": { | ||
| "type": "string", | ||
| "default": "3", | ||
| "description": "Python version to install with uv. Use 'none' to skip." | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+1
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Well-structured manifest. Consider adding optional metadata. The feature manifest is correctly structured with a pythonVersion option that aligns with the install script. The default value of "3" and "none" skip behavior are clearly documented. 📝 Optional: Add additional metadataConsider enriching the manifest with optional fields: {
"id": "uv",
"version": "1.0.0",
"name": "uv",
"description": "Installs uv and optionally a Python version.",
+ "documentationURL": "https://docs.astral.sh/uv/",
+ "licenseURL": "https://github.com/astral-sh/uv/blob/main/LICENSE-MIT",
"options": {
"pythonVersion": {
"type": "string",
"default": "3",
"description": "Python version to install with uv. Use 'none' to skip."
}
}
}🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env bash | ||
| if [ -z "${BASH_VERSION:-}" ] || [ "$(id -un)" != "$_REMOTE_USER" ]; then | ||
| exec su "$_REMOTE_USER" -c "bash -lc '$0'" | ||
| fi | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| curl -fsSL https://astral.sh/uv/install.sh | sh | ||
| . "$HOME/.local/bin/env" | ||
|
|
||
| PYTHON_VERSION="${PYTHON_VERSION:-3}" | ||
| if [ "$PYTHON_VERSION" != "none" ]; then | ||
| uv python install --default "$PYTHON_VERSION" | ||
| fi |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,11 +1,11 @@ | ||||||
| { | ||||||
| "name": "${localEnv:VSCODE_CONTAINER_PROJECT}", | ||||||
| "dockerComposeFile": [ | ||||||
| "../../../compose-base/docker-compose.yaml", | ||||||
| "../docker-compose.yaml" | ||||||
| "dockerComposeFile": "../docker-compose.yaml", | ||||||
| "mounts": [ | ||||||
| "source=workspace,target=${containerWorkspaceFolder},type=volume" | ||||||
| ], | ||||||
| "name": "${localWorkspaceFolderBasename}", | ||||||
| "overrideCommand": true, | ||||||
| "postCreateCommand": "sudo chown $(id -un) ${containerWorkspaceFolder}", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider enhancing the ownership change command. The ♻️ Suggested enhancementConsider adding the - "postCreateCommand": "sudo chown $(id -un) ${containerWorkspaceFolder}",
+ "postCreateCommand": "sudo chown -R $(id -un):$(id -gn) ${containerWorkspaceFolder}",This ensures all files in the workspace have the correct ownership and group membership. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "service": "devcontainer", | ||||||
| "workspaceFolder": "/mnt/${localEnv:VSCODE_CONTAINER_PROJECT}", | ||||||
| "postCreateCommand": "sudo chown vscode ${containerWorkspaceFolder}", | ||||||
| "overrideCommand": true | ||||||
| } | ||||||
| "workspaceFolder": "/mnt/${localWorkspaceFolderBasename}" | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| services: | ||
| devcontainer: | ||
| # Base settings come from ../../compose-base/docker-compose.yaml via dockerComposeFile. | ||
| build: | ||
| # Pick the Dockerfile that matches your dev environment. | ||
| dockerfile: images/base/Dockerfile | ||
| dockerfile: ../../images/base/Dockerfile | ||
| args: | ||
| # Optional: toolchain version for Dockerfiles that accept SDK_VERSION. | ||
| SDK_VERSION: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Well-structured manifest. Consider adding optional metadata.
The feature manifest is correctly structured with appropriate options that align with the install script. The nodeVersion option properly defaults to "lts" and clearly documents the "none" skip behavior.
📝 Optional: Add additional metadata
Consider enriching the manifest with optional fields for better discoverability:
{ "id": "fnm", "version": "1.0.0", "name": "Fast Node Manager (fnm)", "description": "Installs fnm and optionally a Node.js version.", + "documentationURL": "https://github.com/Schniz/fnm", + "licenseURL": "https://github.com/Schniz/fnm/blob/master/LICENSE", "options": { "nodeVersion": { "type": "string", "default": "lts", "description": "Node.js version to install with fnm. Use 'none' to skip." } } }📝 Committable suggestion
🤖 Prompt for AI Agents