container-superposition 0.1.3 â 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +365 -9
- package/dist/scripts/init.js +220 -94
- package/dist/scripts/init.js.map +1 -1
- package/dist/tool/commands/doctor.js +2 -2
- package/dist/tool/commands/explain.d.ts.map +1 -1
- package/dist/tool/commands/explain.js +88 -0
- package/dist/tool/commands/explain.js.map +1 -1
- package/dist/tool/commands/plan.d.ts +51 -0
- package/dist/tool/commands/plan.d.ts.map +1 -1
- package/dist/tool/commands/plan.js +523 -1
- package/dist/tool/commands/plan.js.map +1 -1
- package/dist/tool/questionnaire/composer.d.ts +12 -3
- package/dist/tool/questionnaire/composer.d.ts.map +1 -1
- package/dist/tool/questionnaire/composer.js +133 -20
- package/dist/tool/questionnaire/composer.js.map +1 -1
- package/dist/tool/schema/types.d.ts +18 -0
- package/dist/tool/schema/types.d.ts.map +1 -1
- package/dist/tool/utils/gitignore.d.ts +15 -0
- package/dist/tool/utils/gitignore.d.ts.map +1 -0
- package/dist/tool/utils/gitignore.js +41 -0
- package/dist/tool/utils/gitignore.js.map +1 -0
- package/dist/tool/utils/services-export.d.ts +14 -0
- package/dist/tool/utils/services-export.d.ts.map +1 -0
- package/dist/tool/utils/services-export.js +478 -0
- package/dist/tool/utils/services-export.js.map +1 -0
- package/dist/tool/utils/summary.d.ts +69 -0
- package/dist/tool/utils/summary.d.ts.map +1 -0
- package/dist/tool/utils/summary.js +260 -0
- package/dist/tool/utils/summary.js.map +1 -0
- package/docs/overlays.md +48 -5
- package/overlays/.presets/microservice.yml +32 -6
- package/overlays/.presets/web-api.yml +76 -56
- package/overlays/cloudflared/README.md +190 -0
- package/overlays/cloudflared/devcontainer.patch.json +3 -0
- package/overlays/cloudflared/overlay.yml +15 -0
- package/overlays/cloudflared/setup.sh +49 -0
- package/overlays/cloudflared/verify.sh +21 -0
- package/overlays/direnv/README.md +6 -4
- package/overlays/direnv/setup.sh +0 -12
- package/overlays/grpc-tools/README.md +242 -0
- package/overlays/grpc-tools/devcontainer.patch.json +14 -0
- package/overlays/grpc-tools/overlay.yml +14 -0
- package/overlays/grpc-tools/setup.sh +57 -0
- package/overlays/grpc-tools/verify.sh +47 -0
- package/overlays/keycloak/.env.example +5 -0
- package/overlays/keycloak/README.md +238 -0
- package/overlays/keycloak/devcontainer.patch.json +17 -0
- package/overlays/keycloak/docker-compose.yml +32 -0
- package/overlays/keycloak/overlay.yml +23 -0
- package/overlays/keycloak/verify.sh +54 -0
- package/overlays/mailpit/.env.example +4 -0
- package/overlays/mailpit/README.md +191 -0
- package/overlays/mailpit/devcontainer.patch.json +20 -0
- package/overlays/mailpit/docker-compose.yml +17 -0
- package/overlays/mailpit/overlay.yml +26 -0
- package/overlays/mailpit/verify.sh +52 -0
- package/overlays/ngrok/overlay.yml +2 -1
- package/overlays/python/README.md +51 -35
- package/overlays/python/devcontainer.patch.json +7 -4
- package/overlays/python/setup.sh +50 -23
- package/overlays/python/verify.sh +29 -1
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Verification script for Mailpit overlay
|
|
3
|
+
# Confirms Mailpit is running and accessible
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "đ Verifying Mailpit overlay..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Check if curl is available
|
|
11
|
+
echo "1ī¸âŖ Checking curl availability..."
|
|
12
|
+
if ! command -v curl &> /dev/null; then
|
|
13
|
+
echo " â curl not found"
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
16
|
+
echo " â
curl found"
|
|
17
|
+
|
|
18
|
+
# Check Mailpit web UI
|
|
19
|
+
echo ""
|
|
20
|
+
echo "2ī¸âŖ Checking Mailpit service..."
|
|
21
|
+
MAILPIT_HOST="${MAILPIT_HOST:-mailpit}"
|
|
22
|
+
MAILPIT_UI_PORT="${MAILPIT_UI_PORT:-8025}"
|
|
23
|
+
MAILPIT_READY=false
|
|
24
|
+
|
|
25
|
+
for i in {1..20}; do
|
|
26
|
+
if curl -sf "http://${MAILPIT_HOST}:${MAILPIT_UI_PORT}/api/v1/info" &> /dev/null; then
|
|
27
|
+
echo " â
Mailpit service is ready"
|
|
28
|
+
MAILPIT_READY=true
|
|
29
|
+
break
|
|
30
|
+
fi
|
|
31
|
+
sleep 2
|
|
32
|
+
done
|
|
33
|
+
|
|
34
|
+
if [ "$MAILPIT_READY" = false ]; then
|
|
35
|
+
echo " â Mailpit service not ready after 40 seconds"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Check Mailpit API
|
|
40
|
+
echo ""
|
|
41
|
+
echo "3ī¸âŖ Checking Mailpit API..."
|
|
42
|
+
if curl -sf "http://${MAILPIT_HOST}:${MAILPIT_UI_PORT}/api/v1/messages" &> /dev/null; then
|
|
43
|
+
echo " â
Mailpit API is accessible"
|
|
44
|
+
else
|
|
45
|
+
echo " â Mailpit API not accessible"
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
echo ""
|
|
50
|
+
echo "â
Mailpit overlay verification complete"
|
|
51
|
+
echo " Web UI: http://localhost:${MAILPIT_UI_PORT}"
|
|
52
|
+
echo " SMTP server: mailpit:1025 (from inside container)"
|
|
@@ -5,67 +5,84 @@ Adds Python 3.12 with development tools, linting, and formatting.
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **Python 3.12** with pip, setuptools, and wheel
|
|
8
|
+
- **Virtual environment** (`.venv`) created automatically in the workspace root
|
|
8
9
|
- **VS Code Extensions:**
|
|
9
10
|
- Python (ms-python.python)
|
|
10
11
|
- Pylance (ms-python.vscode-pylance)
|
|
11
12
|
- Black Formatter (ms-python.black-formatter)
|
|
12
13
|
- Ruff (charliermarsh.ruff)
|
|
13
|
-
- **Automatic dependency installation** from:
|
|
14
|
-
- `requirements.txt`
|
|
15
|
-
- `requirements-dev.txt`
|
|
14
|
+
- **Automatic dependency installation** into `.venv` from:
|
|
15
|
+
- `requirements.txt` (project production dependencies)
|
|
16
|
+
- `requirements-dev.txt` (project development dependencies)
|
|
16
17
|
- `pyproject.toml` (editable install)
|
|
17
18
|
- `setup.py` (legacy support)
|
|
18
19
|
- **Pre-configured settings:**
|
|
20
|
+
- VS Code interpreter pointed at `.venv/bin/python`
|
|
19
21
|
- Black as default formatter
|
|
20
22
|
- Format on save enabled
|
|
21
23
|
- Auto-organize imports
|
|
22
|
-
- PYTHONPATH set
|
|
24
|
+
- `PYTHONPATH`, `VIRTUAL_ENV`, and `PATH` set for the venv
|
|
25
|
+
- **`.gitignore`** â `.venv/`, `__pycache__/`, `*.pyc`, `.pytest_cache/`, and build artefacts added to the project root `.gitignore` automatically
|
|
23
26
|
|
|
24
|
-
## Virtual Environment
|
|
27
|
+
## Virtual Environment
|
|
25
28
|
|
|
26
|
-
This overlay
|
|
29
|
+
This overlay automatically creates a `.venv` virtual environment in the workspace root on container creation and installs all dependencies into it.
|
|
27
30
|
|
|
28
|
-
### Why
|
|
31
|
+
### Why venv?
|
|
29
32
|
|
|
30
|
-
1. **
|
|
31
|
-
2. **
|
|
32
|
-
3. **
|
|
33
|
-
4. **
|
|
33
|
+
1. **Clean isolation** â Dependencies are scoped to the project, not the system Python
|
|
34
|
+
2. **Production parity** â Matches how the app runs in CI/CD and production
|
|
35
|
+
3. **Tool compatibility** â Works seamlessly with pytest, mypy, ruff, and other dev tools
|
|
36
|
+
4. **VS Code integration** â The Python extension is pre-configured to use `.venv/bin/python`
|
|
34
37
|
|
|
35
|
-
###
|
|
38
|
+
### How It Works
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
On container creation, the setup script:
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
1. Creates `.venv` at `${workspaceFolder}/.venv` using `python -m venv`
|
|
43
|
+
2. Upgrades `pip`, `setuptools`, and `wheel` inside the venv
|
|
44
|
+
3. Installs overlay default packages from `.devcontainer/requirements-overlay-python.txt`
|
|
45
|
+
4. Installs project dependencies from `requirements.txt` (if present)
|
|
46
|
+
5. Installs dev dependencies from `requirements-dev.txt` (if present)
|
|
47
|
+
6. Installs project in editable mode if `pyproject.toml` or `setup.py` is present
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
### Activating the Virtual Environment
|
|
50
|
+
|
|
51
|
+
The `.venv/bin` directory is prepended to `PATH` automatically in the devcontainer, so tools like `python`, `pip`, `pytest`, and `ruff` resolve to the venv by default. You can also activate explicitly:
|
|
44
52
|
|
|
45
53
|
```bash
|
|
46
|
-
python -m venv .venv
|
|
47
54
|
source .venv/bin/activate
|
|
48
|
-
pip install -r requirements.txt
|
|
49
55
|
```
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
### Gitignore
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
When the Python overlay is selected, the composer automatically adds Python-specific entries to the **project root** `.gitignore` (creating the file if it doesnât exist, and never duplicating existing entries):
|
|
60
|
+
|
|
61
|
+
```gitignore
|
|
62
|
+
# python (container-superposition)
|
|
63
|
+
.venv/
|
|
64
|
+
__pycache__/
|
|
65
|
+
*.pyc
|
|
66
|
+
*.pyo
|
|
67
|
+
.pytest_cache/
|
|
68
|
+
*.egg-info/
|
|
69
|
+
dist/
|
|
70
|
+
build/
|
|
57
71
|
```
|
|
58
72
|
|
|
73
|
+
This happens at generation time â no container startup required.
|
|
74
|
+
|
|
59
75
|
## Automatic Setup
|
|
60
76
|
|
|
61
77
|
The overlay automatically runs on container creation:
|
|
62
78
|
|
|
63
|
-
1. â
|
|
64
|
-
2. â
|
|
65
|
-
3. â
|
|
66
|
-
4. â
Checks for `
|
|
67
|
-
5. â
Checks for `
|
|
68
|
-
6. â
|
|
79
|
+
1. â
Creates `.venv` virtual environment in the workspace root
|
|
80
|
+
2. â
Upgrades pip, setuptools, and wheel inside the venv
|
|
81
|
+
3. â
Installs overlay packages from `.devcontainer/requirements-overlay-python.txt`
|
|
82
|
+
4. â
Checks for `requirements.txt` â installs into venv
|
|
83
|
+
5. â
Checks for `requirements-dev.txt` â installs dev dependencies into venv
|
|
84
|
+
6. â
Checks for `pyproject.toml` â installs project in editable mode
|
|
85
|
+
7. â
Checks for `setup.py` â installs legacy projects in editable mode
|
|
69
86
|
|
|
70
87
|
## Customizing Overlay Packages
|
|
71
88
|
|
|
@@ -176,7 +193,7 @@ mytool = "mytool.cli:main"
|
|
|
176
193
|
1. **Pin versions** in requirements.txt for reproducibility
|
|
177
194
|
2. **Separate dev dependencies** in requirements-dev.txt
|
|
178
195
|
3. **Use pyproject.toml** for modern Python projects
|
|
179
|
-
4. **Add `.gitignore`**
|
|
196
|
+
4. **Add `.gitignore`** â handled automatically by the overlay
|
|
180
197
|
|
|
181
198
|
## Troubleshooting
|
|
182
199
|
|
|
@@ -200,17 +217,16 @@ Update `devcontainer.patch.json`:
|
|
|
200
217
|
}
|
|
201
218
|
```
|
|
202
219
|
|
|
203
|
-
###
|
|
220
|
+
### Customizing the Interpreter Path
|
|
204
221
|
|
|
205
|
-
|
|
222
|
+
The overlay pre-configures VS Code to use `${workspaceFolder}/.venv/bin/python`. If your venv is elsewhere, update `python.defaultInterpreterPath` in your workspace settings or `.devcontainer/custom/devcontainer.patch.json`:
|
|
206
223
|
|
|
207
224
|
```json
|
|
208
225
|
{
|
|
209
|
-
"postCreateCommand": "python -m venv .venv && .venv/bin/pip install -r requirements.txt",
|
|
210
226
|
"customizations": {
|
|
211
227
|
"vscode": {
|
|
212
228
|
"settings": {
|
|
213
|
-
"python.defaultInterpreterPath": "${workspaceFolder}
|
|
229
|
+
"python.defaultInterpreterPath": "${workspaceFolder}/my-custom-venv/bin/python"
|
|
214
230
|
}
|
|
215
231
|
}
|
|
216
232
|
}
|
|
@@ -26,16 +26,19 @@
|
|
|
26
26
|
"source.organizeImports": "explicit"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"python.defaultInterpreterPath": "/
|
|
29
|
+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
|
|
30
|
+
"python.terminal.activateEnvironment": true,
|
|
30
31
|
"files.exclude": {
|
|
31
32
|
"**/__pycache__": true,
|
|
32
|
-
"**/.pytest_cache": true
|
|
33
|
+
"**/.pytest_cache": true,
|
|
34
|
+
"**/.venv": true
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
39
|
"remoteEnv": {
|
|
38
|
-
"PATH": "${containerEnv:HOME}/.local/bin:${containerEnv:PATH}",
|
|
39
|
-
"PYTHONPATH": "${containerWorkspaceFolder}"
|
|
40
|
+
"PATH": "${containerWorkspaceFolder}/.venv/bin:${containerEnv:HOME}/.local/bin:${containerEnv:PATH}",
|
|
41
|
+
"PYTHONPATH": "${containerWorkspaceFolder}",
|
|
42
|
+
"VIRTUAL_ENV": "${containerWorkspaceFolder}/.venv"
|
|
40
43
|
}
|
|
41
44
|
}
|
package/overlays/python/setup.sh
CHANGED
|
@@ -1,47 +1,74 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Python setup script -
|
|
2
|
+
# Python setup script - Create virtual environment and install dependencies
|
|
3
3
|
|
|
4
4
|
set -e
|
|
5
5
|
|
|
6
6
|
# Extract overlay name from script filename (setup-<overlay>.sh -> <overlay>)
|
|
7
7
|
OVERLAY_NAME=$(basename "$0" | sed 's/setup-//;s/\.sh$//')
|
|
8
8
|
|
|
9
|
-
echo "đ Setting up Python environment..."
|
|
9
|
+
echo "đ Setting up Python virtual environment..."
|
|
10
|
+
|
|
11
|
+
# Determine workspace root (script is run from workspace root via postCreateCommand)
|
|
12
|
+
WORKSPACE_ROOT="${PWD}"
|
|
13
|
+
VENV_DIR="${WORKSPACE_ROOT}/.venv"
|
|
14
|
+
|
|
15
|
+
# Create virtual environment if it doesn't exist
|
|
16
|
+
if [ ! -d "${VENV_DIR}" ]; then
|
|
17
|
+
echo "đĻ Creating virtual environment at .venv..."
|
|
18
|
+
if ! command -v python3 >/dev/null 2>&1; then
|
|
19
|
+
echo "â python3 is not available on PATH. Please ensure python3 is installed."
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
python3 -m venv "${VENV_DIR}"
|
|
23
|
+
echo "â Virtual environment created"
|
|
24
|
+
else
|
|
25
|
+
echo "â Virtual environment already exists at .venv"
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Activate virtual environment
|
|
29
|
+
# shellcheck source=/dev/null
|
|
30
|
+
source "${VENV_DIR}/bin/activate"
|
|
31
|
+
|
|
32
|
+
# Upgrade pip, setuptools, and wheel inside the venv
|
|
33
|
+
echo "âŦī¸ Upgrading pip, setuptools, and wheel..."
|
|
34
|
+
pip install --upgrade pip setuptools wheel
|
|
35
|
+
echo "â pip, setuptools, and wheel upgraded"
|
|
10
36
|
|
|
11
37
|
# Install overlay-specific packages (if requirements-overlay.txt exists)
|
|
12
38
|
if [ -f ".devcontainer/requirements-overlay-${OVERLAY_NAME}.txt" ]; then
|
|
13
39
|
echo "đĻ Installing overlay packages from requirements-overlay-${OVERLAY_NAME}.txt..."
|
|
14
|
-
pip install
|
|
40
|
+
pip install -r ".devcontainer/requirements-overlay-${OVERLAY_NAME}.txt"
|
|
15
41
|
echo "â Overlay packages installed"
|
|
16
42
|
fi
|
|
17
43
|
|
|
18
|
-
#
|
|
44
|
+
# Install from root requirements.txt (project production dependencies)
|
|
19
45
|
if [ -f "requirements.txt" ]; then
|
|
20
|
-
echo "đĻ
|
|
21
|
-
pip install
|
|
46
|
+
echo "đĻ Installing dependencies from requirements.txt..."
|
|
47
|
+
pip install -r requirements.txt
|
|
22
48
|
echo "â Dependencies installed from requirements.txt"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Install from requirements-dev.txt (project development dependencies)
|
|
52
|
+
if [ -f "requirements-dev.txt" ]; then
|
|
53
|
+
echo "đĻ Installing dev dependencies from requirements-dev.txt..."
|
|
54
|
+
pip install -r requirements-dev.txt
|
|
26
55
|
echo "â Dev dependencies installed from requirements-dev.txt"
|
|
27
56
|
fi
|
|
28
57
|
|
|
29
|
-
#
|
|
58
|
+
# Install project in editable mode if pyproject.toml exists (modern Python projects)
|
|
30
59
|
if [ -f "pyproject.toml" ]; then
|
|
31
|
-
echo "đĻ Found pyproject.toml, installing project..."
|
|
32
|
-
pip install
|
|
60
|
+
echo "đĻ Found pyproject.toml, installing project in editable mode..."
|
|
61
|
+
pip install -e .
|
|
33
62
|
echo "â Project installed in editable mode"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
echo "đĻ Found setup.py, installing project..."
|
|
39
|
-
pip install --user -e .
|
|
63
|
+
elif [ -f "setup.py" ]; then
|
|
64
|
+
# Fallback for legacy Python projects
|
|
65
|
+
echo "đĻ Found setup.py, installing project in editable mode..."
|
|
66
|
+
pip install -e .
|
|
40
67
|
echo "â Project installed in editable mode"
|
|
41
68
|
fi
|
|
42
69
|
|
|
43
|
-
|
|
44
|
-
echo "
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
echo "
|
|
70
|
+
echo ""
|
|
71
|
+
echo "â Python virtual environment setup complete"
|
|
72
|
+
echo " Virtual environment: ${VENV_DIR}"
|
|
73
|
+
echo " Python interpreter: ${VENV_DIR}/bin/python"
|
|
74
|
+
echo " Activate manually: source .venv/bin/activate"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# Verification script for Python overlay
|
|
3
|
-
# Confirms Python and
|
|
3
|
+
# Confirms Python, pip, and virtual environment are installed and functional
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
@@ -28,5 +28,33 @@ else
|
|
|
28
28
|
exit 1
|
|
29
29
|
fi
|
|
30
30
|
|
|
31
|
+
# Check venv module is available
|
|
32
|
+
echo ""
|
|
33
|
+
echo "3ī¸âŖ Checking venv module..."
|
|
34
|
+
if python3 -m venv --help &> /dev/null; then
|
|
35
|
+
echo " â
venv module available"
|
|
36
|
+
else
|
|
37
|
+
echo " â venv module not available"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Check virtual environment was created (only if we are inside a devcontainer)
|
|
42
|
+
echo ""
|
|
43
|
+
echo "4ī¸âŖ Checking virtual environment..."
|
|
44
|
+
VENV_DIR="${PWD}/.venv"
|
|
45
|
+
if [ -d "${VENV_DIR}" ]; then
|
|
46
|
+
if [ -f "${VENV_DIR}/bin/python" ]; then
|
|
47
|
+
VENV_PYTHON_VERSION=$("${VENV_DIR}/bin/python" --version 2>&1)
|
|
48
|
+
echo " Virtual environment: ${VENV_DIR}"
|
|
49
|
+
echo " Python version: ${VENV_PYTHON_VERSION}"
|
|
50
|
+
echo " â
Virtual environment is functional"
|
|
51
|
+
else
|
|
52
|
+
echo " â ī¸ Virtual environment directory exists but python not found"
|
|
53
|
+
echo " âšī¸ Run setup script to create it: bash .devcontainer/scripts/setup-python.sh"
|
|
54
|
+
fi
|
|
55
|
+
else
|
|
56
|
+
echo " âšī¸ No .venv found â will be created on container start by setup-python.sh"
|
|
57
|
+
fi
|
|
58
|
+
|
|
31
59
|
echo ""
|
|
32
60
|
echo "â
Python overlay verification complete"
|