From 0000f1b14079bf7055b49ce61b8d0240b63631b3 Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Fri, 7 Jun 2024 10:16:54 +0200 Subject: [PATCH 1/4] chore: add a dev container definition --- .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ .github/dependabot.yml | 4 ++++ 2 files changed, 29 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..da1217be79 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm", + "features": { + "ghcr.io/devcontainers/features/git:1": {} + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "npm install && npm --prefix ./client install && npm --prefix ./server install && npm --prefix ./tests install" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ace4600a1..1ab3ef225f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,7 @@ updates: directory: "/" schedule: interval: "weekly" + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly From 7aa855eed7fce59b2b9c6a8cd7add2c161e65b2b Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Tue, 22 Apr 2025 13:54:41 +0000 Subject: [PATCH 2/4] wip --- .devcontainer/.npm/.gitkeep | 0 .devcontainer/devcontainer.json | 40 +++++++++++++------------------- .devcontainer/docker-compose.yml | 9 +++++++ client/vite.config.ts | 2 ++ 4 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 .devcontainer/.npm/.gitkeep create mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/.npm/.gitkeep b/.devcontainer/.npm/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index da1217be79..7ef0e003c4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,25 +1,17 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node { - "name": "Node.js & TypeScript", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm", - "features": { - "ghcr.io/devcontainers/features/git:1": {} - }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm install && npm --prefix ./client install && npm --prefix ./server install && npm --prefix ./tests install" - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} + "name": "UI devcontainer", + "dockerComposeFile": "docker-compose.yml", + "service": "repo", + "containerUser": "root", + "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", + "features": {}, + "postCreateCommand": "npm update --global npm && npm install && npm --prefix ./client install && npm --prefix ./server install && npm --prefix ./tests install", + "customizations": { + "vscode": { + "extensions": [ + "esbenp.prettier-vscode" + ] + } + } +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000000..297a73df0a --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,9 @@ +services: + repo: + image: "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm" + volumes: + - ../:/workspace:cached + - .npm:/home/node/.npm:delegated + entrypoint: sleep infinity + environment: + VITE_HOST: "0.0.0.0" diff --git a/client/vite.config.ts b/client/vite.config.ts index 5c5783ca97..9620545245 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -1,5 +1,6 @@ import eslintPlugin from "@nabla/vite-plugin-eslint"; import react from "@vitejs/plugin-react"; +import { env } from "node:process"; import { resolve } from "path"; import { defineConfig } from "vite"; @@ -11,6 +12,7 @@ export default defineConfig({ }, server: { allowedHosts: [".dev.renku.ch"], + ...(env.VITE_HOST ? { host: env.VITE_HOST } : {}), }, plugins: [react({ include: "/index.html" }), eslintPlugin()], resolve: { From 315a76fc89994b017a984db40aa687250745c158 Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Tue, 22 Apr 2025 13:58:37 +0000 Subject: [PATCH 3/4] prettier --- .devcontainer/devcontainer.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7ef0e003c4..c1dd7227ba 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,9 +9,7 @@ "postCreateCommand": "npm update --global npm && npm install && npm --prefix ./client install && npm --prefix ./server install && npm --prefix ./tests install", "customizations": { "vscode": { - "extensions": [ - "esbenp.prettier-vscode" - ] + "extensions": ["esbenp.prettier-vscode"] } } -} \ No newline at end of file +} From 5b49c949e558accc8a6a618a4d7847137d6e7015 Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Thu, 24 Apr 2025 11:49:03 +0000 Subject: [PATCH 4/4] install cypress --- .devcontainer/devcontainer.json | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c1dd7227ba..c2f18352f8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,11 +5,17 @@ "containerUser": "root", "workspaceFolder": "/workspace", "shutdownAction": "stopCompose", - "features": {}, - "postCreateCommand": "npm update --global npm && npm install && npm --prefix ./client install && npm --prefix ./server install && npm --prefix ./tests install", + "features": { + "ghcr.io/devcontainers-extra/features/apt-packages:1": { + "packages": "libgtk2.0-0,libgtk-3-0,libgbm-dev,libnotify-dev,libnss3,libxss1,libasound2,libxtst6,xauth,xvfb" + } + }, + "postCreateCommand": "npm update --global npm && npm install && npm --prefix ./client install && npm --prefix ./server install && npm --prefix ./tests install && npx --prefix ./tests cypress install", "customizations": { "vscode": { - "extensions": ["esbenp.prettier-vscode"] + "extensions": [ + "esbenp.prettier-vscode" + ] } } -} +} \ No newline at end of file