diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cea8dd89635..2af0291724a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,13 @@ -FROM mcr.microsoft.com/devcontainers/javascript-node:24 +FROM mcr.microsoft.com/devcontainers/base:ubuntu -RUN npm install -g pnpm +# Install mise for toolchain management (node, pnpm, etc.) +RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh \ + && echo 'eval "$(/usr/local/bin/mise activate bash)"' >> /home/vscode/.bashrc \ + && echo 'eval "$(/usr/local/bin/mise activate zsh)"' >> /home/vscode/.zshrc + +# Pre-install all toolchain versions pinned in mise.toml/mise.lock into the image +COPY mise.toml mise.lock /tmp/mise-setup/ +RUN chown -R vscode:vscode /tmp/mise-setup +USER vscode +RUN cd /tmp/mise-setup && mise trust && mise install +USER root diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f6a0d44226a..bc90b1deeda 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,8 +1,10 @@ { "name": "Standard", "build": { - "dockerfile": "Dockerfile" + "dockerfile": "Dockerfile", + "context": ".." }, + "postCreateCommand": "mise trust && pnpm install", "customizations": { // Configure properties specific to VS Code. "vscode": { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e3e55323483..fea01790f55 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,13 +4,37 @@ This section goes over the setup of the repo for development. ## Repo setup -- Install [Node.js](https://nodejs.org/) 24 LTS -- Install [pnpm](https://pnpm.io/) +You need [Node.js](https://nodejs.org/) and [pnpm](https://pnpm.io/). Pick +whichever of the following options you prefer to install them. + +### Option 1: Use mise (recommended) + +[mise](https://mise.jdx.dev/getting-started.html) installs the repository's +development tools consistently across platforms. Install mise and +[activate it for your shell](https://mise.jdx.dev/getting-started.html#activate-mise), +then, from the repository root, run: + +```bash +mise install +``` + +This installs the exact tool versions recorded in `mise.toml` and `mise.lock` +(Node.js and pnpm). + +### Option 2: Install the tools yourself + +If you prefer to manage tools yourself (or use another version manager), just +install [Node.js](https://nodejs.org/). We support all active +[Node.js LTS](https://nodejs.org/en/about/previous-releases) versions, so any of +them works. pnpm self-manages its version from the `packageManager` field in +`package.json`, so you only need to install pnpm itself: ```bash npm install -g pnpm ``` +### Install and build + - Install dependencies ```bash diff --git a/mise.lock b/mise.lock new file mode 100644 index 00000000000..c19381f9d88 --- /dev/null +++ b/mise.lock @@ -0,0 +1,73 @@ +# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html + +[[tools.node]] +version = "26.5.1" +backend = "core:node" + +[tools.node."platforms.linux-arm64"] +checksum = "sha256:21194bbf41c18d9ec277545c4d14cce8597d57a9d9f494c323d8121a25de33e8" +url = "https://nodejs.org/dist/v26.5.1/node-v26.5.1-linux-arm64.tar.gz" + +[tools.node."platforms.linux-arm64-musl"] +checksum = "sha256:21194bbf41c18d9ec277545c4d14cce8597d57a9d9f494c323d8121a25de33e8" +url = "https://nodejs.org/dist/v26.5.1/node-v26.5.1-linux-arm64.tar.gz" + +[tools.node."platforms.linux-x64"] +checksum = "sha256:2b07f09c218d473a26442bff5a90151f53f7b7c0a23bad244eda2c26303a2ba7" +url = "https://nodejs.org/dist/v26.5.1/node-v26.5.1-linux-x64.tar.gz" + +[tools.node."platforms.linux-x64-musl"] +checksum = "sha256:2b07f09c218d473a26442bff5a90151f53f7b7c0a23bad244eda2c26303a2ba7" +url = "https://nodejs.org/dist/v26.5.1/node-v26.5.1-linux-x64.tar.gz" + +[tools.node."platforms.macos-arm64"] +checksum = "sha256:f4387df0b46556516d19abf2f2d6806481ac8368aa7f9d96bafed422a56a1d01" +url = "https://nodejs.org/dist/v26.5.1/node-v26.5.1-darwin-arm64.tar.gz" + +[tools.node."platforms.macos-x64"] +checksum = "sha256:077d5c936868dab19d21f77f1e71ce13697e80b3e86a399dcab238902a2ebf93" +url = "https://nodejs.org/dist/v26.5.1/node-v26.5.1-darwin-x64.tar.gz" + +[tools.node."platforms.windows-x64"] +checksum = "sha256:c432c996b95cbf7568f13a0fbb37526de84a27e3a5c520c3be15f05a9a168212" +url = "https://nodejs.org/dist/v26.5.1/node-v26.5.1-win-x64.zip" + +[[tools.pnpm]] +version = "11.10.0" +backend = "aqua:pnpm/pnpm" + +[tools.pnpm."platforms.linux-arm64"] +checksum = "sha256:7da014033800db506095d8d5eb15c4b1df7aa9cc6a4992634e4d59c3985e720b" +url = "https://github.com/pnpm/pnpm/releases/download/v11.10.0/pnpm-linux-arm64.tar.gz" +url_api = "https://api.github.com/repos/pnpm/pnpm/releases/assets/466571515" +provenance = "github-attestations" + +[tools.pnpm."platforms.linux-arm64-musl"] +checksum = "sha256:f3ff9b9041616c627d8b86b395d932fe703e6066e6e47c133fa525dfb5f39cc4" +url = "https://github.com/pnpm/pnpm/releases/download/v11.10.0/pnpm-linux-arm64-musl.tar.gz" +url_api = "https://api.github.com/repos/pnpm/pnpm/releases/assets/466571513" +provenance = "github-attestations" + +[tools.pnpm."platforms.linux-x64"] +checksum = "sha256:cf22c9f1ba90f67c9a5cfb1cbe9c2087cf4c3a5c409dad738c1f8a38b8137666" +url = "https://github.com/pnpm/pnpm/releases/download/v11.10.0/pnpm-linux-x64.tar.gz" +url_api = "https://api.github.com/repos/pnpm/pnpm/releases/assets/466571518" +provenance = "github-attestations" + +[tools.pnpm."platforms.linux-x64-musl"] +checksum = "sha256:ce68f57e8479d69aca120ab6dedf21a1560a885fcf3e9e5ef3333a08fd6ef6e9" +url = "https://github.com/pnpm/pnpm/releases/download/v11.10.0/pnpm-linux-x64-musl.tar.gz" +url_api = "https://api.github.com/repos/pnpm/pnpm/releases/assets/466571516" +provenance = "github-attestations" + +[tools.pnpm."platforms.macos-arm64"] +checksum = "sha256:d0d8a55b47dbe07a80d13fec7ee5af9bdca36187e61f9562d72d81dd637178c4" +url = "https://github.com/pnpm/pnpm/releases/download/v11.10.0/pnpm-darwin-arm64.tar.gz" +url_api = "https://api.github.com/repos/pnpm/pnpm/releases/assets/466571520" +provenance = "github-attestations" + +[tools.pnpm."platforms.windows-x64"] +checksum = "sha256:bb25e88285354cd2510a481859e5695b68f5def16f22e4ffb7aa76a87af4f700" +url = "https://github.com/pnpm/pnpm/releases/download/v11.10.0/pnpm-win32-x64.zip" +url_api = "https://api.github.com/repos/pnpm/pnpm/releases/assets/466571521" +provenance = "github-attestations" diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000000..2c291eb9fd5 --- /dev/null +++ b/mise.toml @@ -0,0 +1,5 @@ +[tools] +node = "26" + +[settings] +idiomatic_version_file_enable_tools = ["pnpm"]