Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danyworks committed Feb 2, 2025
1 parent 2e832be commit 90254df
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 163 deletions.
18 changes: 0 additions & 18 deletions src/color/.devcontainer/devcontainer.json

This file was deleted.

17 changes: 0 additions & 17 deletions src/color/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions src/color/devcontainer-template.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/hello/.devcontainer/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions src/hello/.devcontainer/devcontainer.json

This file was deleted.

17 changes: 0 additions & 17 deletions src/hello/README.md

This file was deleted.

34 changes: 0 additions & 34 deletions src/hello/devcontainer-template.json

This file was deleted.

44 changes: 44 additions & 0 deletions src/wails/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "Wails Development Environment",
//"image": "mcr.microsoft.com/devcontainers/base:${templateOption:imageVariant}",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/go:1": {
"version": "1.22"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
}
},
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-vscode.vscode-typescript-next"
],
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true
}
}
},
"forwardPorts": [3000],
"remoteUser": "vscode",
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
// "features": {},

// 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

"postCreateCommand": "echo '${templateOption:favorite}' > /tmp/color.txt"
// "postCreateCommand": "go install github.com/wailsapp/wails/v2/cmd/wails@latest && wails doctor",
// 👇 Configure tool-specific properties.
// "customizations": {},

// 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
44 changes: 44 additions & 0 deletions src/wails/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Wails Development Container (wails-dev)

A development container template for building Wails applications with Go and Node.js.

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| imageVariant | Ubuntu version (use jammy on arm64/Apple Silicon): | string | jammy |
| nodeVersion | Default Node.js version to be installed via NVM: | string | 20 |
| goVersion | Go version to be installed: | string | 1.22 |
| installWailsVersion | Wails CLI version to install: | string | latest |

## Included Features

- Go (via devcontainer CLI feature)
- NVM for Node.js version management
- Wails CLI and dependencies
- Essential build tools
- VSCode extensions for Go and web development
- X11 forwarding support for GUI applications

## System Requirements

- libwebkit2gtk-4.0-dev
- libgtk-3-dev
- Build essentials
- NSIS (for Windows installers)
- UPX (optional, for compression)

## Port Forwarding

| Port | Description |
|-----|-----|
| 3000 | Default development server |
| 34115 | Wails development server |

## Container User

- `vscode` (non-root) with sudo access

---

_Note: This file was auto-generated from the [devcontainer-template.json](https://github.com/yourusername/wails-devcontainer/blob/main/devcontainer-template.json). Additional documentation can be found in [NOTES.md](NOTES.md)._
33 changes: 33 additions & 0 deletions src/wails/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "wails-development",
"version": "1.0.0",
"name": "Wails Development Environment",
"description": "A Template for building Wails applications with Go and Node.js",
"documentationURL": "https://github.com/tweekhub/devcontainers/tree/main/src/wails",
"publisher": "YourName",
"licenseURL": "https://github.com/tweekhub/devcontainers/blob/main/LICENSE",
"options": {
"imageVariant": {
"type": "string",
"description": "Ubuntu version:",
"proposals": [
"jammy",
"focal"
],
"default": "jammy"
},
"nodeVersion": {
"type": "string",
"description": "Node.js version:",
"proposals": [
"20",
"18",
"16"
],
"default": "20"
}
},
"platforms": [
"Any"
]
}
10 changes: 0 additions & 10 deletions test/color/test.sh

This file was deleted.

10 changes: 0 additions & 10 deletions test/hello/test.sh

This file was deleted.

17 changes: 17 additions & 0 deletions test/wails/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
cd $(dirname "$0")
source test-utils.sh

# Template specific tests
check "distro" lsb_release -c
check "Verify correct Ubuntu variant" lsb_release -c | grep $(jq -r '.options.imageVariant.default' .devcontainer/devcontainer-template.json)
check "Verify Go version" go version | grep "go1.22"
check "Verify Node.js version" node --version | grep "v20."
check "Verify VSCode Go extension" [ -d "/home/vscode/.vscode-server/extensions/golang.go-*" ]
check "Verify ESLint extension" [ -d "/home/vscode/.vscode-server/extensions/dbaeumer.vscode-eslint-*" ]
check "Verify Wails installation" command -v wails
check "Verify forwarded port" grep 3000 .devcontainer/devcontainer.json
check "Verify remote user" [ $(whoami) = "vscode" ]

# Report result
reportResults

0 comments on commit 90254df

Please sign in to comment.