diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..3656ad5570 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,43 @@ +# Argument for the pnpm version to install +ARG PNPM_VERSION="latest" +# Which image to use as a base +ARG IMAGE="mcr.microsoft.com/devcontainers/javascript-node" +# Which tag to use for the image +ARG VARIANT="20-bookworm" + +# Arguments related to setting up a non-root user for the container +ARG USERNAME=node + +######################### +# Final image +######################### +FROM ${IMAGE}:${VARIANT} + +# Make sure arguments are available +ARG PNPM_VERSION +ARG USERNAME + +RUN apt update \ + # Upgrade the system + && apt upgrade -yq \ + # Install general utilities + && apt install -yq --no-install-recommends sudo software-properties-common ca-certificates apt-transport-https \ + git git-lfs bash-completion curl wget \ + # Update ca-certificates + && update-ca-certificates \ + # Install package managers + && npm i -g npm \ + && npm i -g yarn \ + && npm i -g pnpm@${PNPM_VERSION} \ + # Set up pnpm + && SHELL=bash pnpm setup \ + # Easier tabbing through files + && echo "bind TAB:menu-complete" >>/home/${USERNAME}/.bashrc \ + && echo "bind '\"\e[Z\":menu-complete-backward'" >>/home/${USERNAME}/.bashrc \ + # Make the user a sudo user + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME \ + # Remove some bloat + && apt clean + +EXPOSE 3000 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..34ea61ddb0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +{ + "name": "Tauri Docs", + "runArgs": [], + "forwardPorts": [], + "mounts": [], + "build": { + "dockerfile": "Dockerfile", + "args": {} + }, + "customizations": { + "settings": { + "extensions.installRecommended": true + }, + "extensions": [ + "dbaeumer.vscode-eslint", // ESLint + "waderyan.gitblame", // Shows blame in source code + "GitHub.vscode-pull-request-github", // Pull requests + "codezombiech.gitignore", // .gitignore + "numso.prettier-standard-vscode", // Prettier + "Gruntfuggly.todo-tree", // To do + "MarkosTh09.color-picker", // Color picker + "redhat.vscode-yaml", // Yaml + "astro-build.astro-vscode" // Astro + ] + }, + "features": {} +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6d4c0aa066..26cdb6de23 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ pnpm-debug.log* # macOS-specific files .DS_Store + +# PNPM +.pnpm-store diff --git a/.gitpod.yml b/.gitpod.yml index e30fd3d09b..7c705a86bf 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,10 @@ +image: + file: .devcontainer/Dockerfile tasks: - - init: pnpm install && pnpm dev:setup - command: pnpm run dev + - init: | + pnpm install + pnpm dev:setup + command: pnpm dev ports: - port: 3000 onOpen: open-browser diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 22a15055d6..285567f2f6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,4 +1,14 @@ { - "recommendations": ["astro-build.astro-vscode"], + "recommendations": [ + "dbaeumer.vscode-eslint", // ESLint + "waderyan.gitblame", // Shows blame in source code + "GitHub.vscode-pull-request-github", // Pull requests + "codezombiech.gitignore", // .gitignore + "numso.prettier-standard-vscode", // Prettier + "Gruntfuggly.todo-tree", // To do + "MarkosTh09.color-picker", // Color picker + "redhat.vscode-yaml", // Yaml + "astro-build.astro-vscode" // Astro + ], "unwantedRecommendations": [] }