diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..22fb081f --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,46 @@ +# Use a base image for the development container +FROM mcr.microsoft.com/vscode/devcontainers/base:debian-12 + +# Install necessary dependencies for the development container +RUN apt-get update && apt-get install -y \ + curl \ + git \ + build-essential \ + libssl-dev \ + pkg-config \ + libgtk-3-dev \ + libwebkit2gtk-4.0-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install Node.js +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y nodejs + +# Install pnpm +RUN npm install -g pnpm + +# Add pnpm global bin directory to PATH +ENV PATH="/home/vscode/.local/share/pnpm:${PATH}" + +# Install storybook globally +RUN pnpm add @storybook/cli + +# Install Rust as root (into /root/.cargo) +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + +# Copy the Cargo installation to the vscode user's home directory +RUN mkdir -p /home/vscode && \ + cp -r /root/.cargo /home/vscode/ && \ + chown -R vscode:vscode /home/vscode/.cargo + +# Update PATH so that cargo binaries are available for the vscode user +ENV PATH="/home/vscode/.cargo/bin:${PATH}" + +# Switch to vscode user to set the default rust toolchain +USER vscode +RUN rustup default stable + +# Switch back to root if needed for subsequent commands +USER root + + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..4e2cbb9a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,14 @@ +{ + "name": "JDM Editor Dev Container", + "dockerFile": "Dockerfile", + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "editor.formatOnSave": true + }, + "extensions": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "ms-azuretools.vscode-docker", + "ms-vscode-remote.remote-containers" + ] +} diff --git a/.gitignore b/.gitignore index 3c24bae4..435ab4b5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist /node_modules node_modules /target +/.pnpm-store # Ignore *.log* diff --git a/package.json b/package.json index 6f7bfd0b..dfce68c8 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,11 @@ "prettier": "prettier --check .", "prettier:fix": "pnpm prettier --write", "format": "run-s lint prettier", - "format:fix": "run-s lint:fix prettier:fix" + "storybook": "lerna run storybook", + "clean": "rm -rf node_modules && rm -rf **/node_modules && rm -rf package-lock.json" }, "engines": { - "pnpm": "~9" + "pnpm": "~10" }, "devDependencies": { "@swc/core": "^1.7.26",