diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 26589d316b..c744a98197 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,5 +2,17 @@ "name": "Node.js", "image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:24-trixie", "postCreateCommand": "./scripts/setup-devcontainer.sh", - "remoteUser": "node" + "remoteUser": "node", + "customizations": { + "vscode": { + "extensions": [ + "SonarSource.sonarlint-vscode" + ], + "settings": { + "sonarlint.pathToNodeExecutable": "/usr/local/bin/node", + "sonarlint.ls.javaHome": "/usr/lib/jvm/java-25-openjdk-arm64", + "sonarlint.disableTelemetry": true + } + } + } } diff --git a/package.json b/package.json index 1dd4dcb0fb..1701775333 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "preview": "vite preview", "lint": "eslint .", "lint:fix": "eslint . --fix", + "type-check": "tsc --noEmit", "lint:staged": "eslint $(git diff --name-only --cached | xargs)", "cypress:open": "CYPRESS_ADMIN=$(cat cypress/fixtures/duos-automation-admin.json) CYPRESS_CHAIR=$(cat cypress/fixtures/duos-automation-chair.json) CYPRESS_MEMBER=$(cat cypress/fixtures/duos-automation-member.json) CYPRESS_RESEARCHER=$(cat cypress/fixtures/duos-automation-researcher.json) CYPRESS_SIGNING_OFFICIAL=$(cat cypress/fixtures/duos-automation-signing-official.json) cypress open", "cypress:open:component": "cypress open --component", diff --git a/scripts/setup-devcontainer.sh b/scripts/setup-devcontainer.sh index 5ea97d05f5..a0326a6ba8 100755 --- a/scripts/setup-devcontainer.sh +++ b/scripts/setup-devcontainer.sh @@ -17,6 +17,25 @@ install_gcloud_cli() { sudo apt install -y google-cloud-cli } +install_openjdk_25() { + sudo apt update + sudo apt install -y openjdk-25-jdk + + java_bin="$(readlink -f "$(command -v javac)")" + java_home="${java_bin%/bin/javac}" + + # Set JAVA_HOME in /etc/profile.d so it's available to all users in all shells + echo "export JAVA_HOME=\"$java_home\"" | sudo tee /etc/profile.d/java-home.sh >/dev/null + sudo chmod 644 /etc/profile.d/java-home.sh + + # Also update /etc/environment for non-interactive shells + if sudo grep -q '^JAVA_HOME=' /etc/environment; then + sudo sed -i "s|^JAVA_HOME=.*|JAVA_HOME=\"$java_home\"|" /etc/environment + else + echo "JAVA_HOME=\"$java_home\"" | sudo tee -a /etc/environment >/dev/null + fi +} + install_duos_cypress() { npm install npx cypress install @@ -42,6 +61,7 @@ dev_container() { cypress_requirements gcloud_cli_requirements install_gcloud_cli + install_openjdk_25 install_duos_cypress install_duos_config }