mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
refactor: update devcontainer and Biome configuration (#27)
- Remove ESLint and Prettier in favor of Biome - Configure Biome as default formatter for TS/JS/JSON/MD - Add development helper extensions - Update VSCode settings for Biome integration Closes #27
This commit is contained in:
12
.devcontainer/Dockerfile
Normal file
12
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/acedanger/finance"
|
||||
LABEL org.opencontainers.image.description="Dev container for Finance App"
|
||||
|
||||
# Install additional OS packages
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends git-core \
|
||||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install global npm packages if needed
|
||||
RUN su node -c "npm install -g typescript"
|
||||
28
.devcontainer/build-and-push.sh
Normal file
28
.devcontainer/build-and-push.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
GITHUB_USERNAME=$1
|
||||
IMAGE_NAME="finance-devcontainer"
|
||||
IMAGE_TAG="latest"
|
||||
|
||||
if [ -z "$GITHUB_USERNAME" ]; then
|
||||
echo "Usage: $0 <github_username>"
|
||||
echo "Example: $0 acedanger"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FULL_IMAGE_NAME="ghcr.io/$GITHUB_USERNAME/$IMAGE_NAME:$IMAGE_TAG"
|
||||
|
||||
# Build the image
|
||||
echo "Building image: $FULL_IMAGE_NAME"
|
||||
docker build -t $FULL_IMAGE_NAME -f Dockerfile .
|
||||
|
||||
# Push to GitHub Container Registry
|
||||
echo "Pushing image to GHCR..."
|
||||
docker push $FULL_IMAGE_NAME
|
||||
|
||||
echo "Done! Now update your devcontainer.json to use this image:"
|
||||
echo "Replace the 'build' section with:"
|
||||
echo '{
|
||||
"image": "'$FULL_IMAGE_NAME'"
|
||||
}'
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "Finance App Development",
|
||||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
|
||||
"workspaceFolder": "/home/acedanger/dev/finance",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/home/acedanger/dev/finance,type=bind,consistency=cached",
|
||||
"image": "ghcr.io/acedanger/finance-devcontainer:latest",
|
||||
"workspaceFolder": "/workspaces/finance",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/finance,type=bind,consistency=cached",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/git:1": {},
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
|
||||
@@ -16,27 +16,39 @@
|
||||
"GitHub.copilot",
|
||||
"GitHub.copilot-chat",
|
||||
"ms-vscode.vscode-typescript-next",
|
||||
"bradlc.vscode-tailwindcss"
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"biomejs.biome",
|
||||
"PKief.material-icon-theme",
|
||||
"Gruntfuggly.todo-tree",
|
||||
"humao.rest-client"
|
||||
],
|
||||
"settings": {
|
||||
"editor.formatOnSave": true,
|
||||
"[typescript]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": null,
|
||||
"editor.defaultFormatter": "biomejs.biome",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true
|
||||
"source.fixAll.biome": "explicit",
|
||||
"source.organizeImports.biome": "explicit"
|
||||
}
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": null,
|
||||
"editor.defaultFormatter": "biomejs.biome",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true
|
||||
"source.fixAll.biome": "explicit",
|
||||
"source.organizeImports.biome": "explicit"
|
||||
}
|
||||
},
|
||||
"[astro]": {
|
||||
"editor.defaultFormatter": "astro-build.astro-vscode"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[markdown]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"typescript.updateImportsOnFileMove.enabled": "always",
|
||||
"editor.bracketPairColorization.enabled": true,
|
||||
"files.exclude": {
|
||||
@@ -48,7 +60,14 @@
|
||||
"terminal.integrated.defaultProfile.linux": "bash",
|
||||
"mcp.servers.github": {
|
||||
"command": "docker",
|
||||
"args": ["run", "-i", "--rm", "--env-file", "${containerWorkspaceFolder}/.devcontainer/.env", "ghcr.io/github/github-mcp-server"],
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"--env-file",
|
||||
"${containerWorkspaceFolder}/.devcontainer/.env",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {}
|
||||
}
|
||||
}
|
||||
@@ -58,8 +77,9 @@
|
||||
"postCreateCommand": "npm install && npm run check",
|
||||
"remoteUser": "node",
|
||||
"mounts": [
|
||||
"type=bind,source=${localEnv:HOME}/.ssh,target=/home/node/.ssh,readonly"
|
||||
"type=bind,source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/node/.ssh,readonly"
|
||||
],
|
||||
"updateRemoteUserUID": true,
|
||||
"remoteEnv": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${localEnv:GITHUB_PERSONAL_ACCESS_TOKEN}"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user