From 4424b415ebd1105e8808ee855a88f778304175c9 Mon Sep 17 00:00:00 2001 From: Mads Hartmann Date: Mon, 8 Jun 2026 19:43:27 +0000 Subject: [PATCH] Add Ona devcontainer and automations setup Configure a Node 22 dev container with pnpm 10.12.1 (matching .tool-versions) plus shellcheck and shfmt, which the Jest test suite requires. Add automations for install, compile, test, and a watch service for incremental TypeScript builds. Co-authored-by: Ona --- .devcontainer/Dockerfile | 11 ++++++++++ .devcontainer/devcontainer.json | 12 +++++++++++ .ona/automations.yaml | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .ona/automations.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..8c04f6b1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +FROM mcr.microsoft.com/devcontainers/javascript-node:22 + +# shellcheck and shfmt are required by the test suite (see .github/workflows/verify.yml). +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends shellcheck shfmt \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Pin pnpm to the version in .tool-versions. The pnpm-10 lockfile is incompatible +# with the pnpm 11 that the base image (or corepack's latest default) provides, so +# install the exact version globally. The repo enforces pnpm via package.json preinstall. +RUN npm install -g pnpm@10.12.1 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..b40e3f69 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +// The Dev Container format allows you to configure your environment. At the heart of it +// is a Docker image or Dockerfile which controls the tools available in your environment. +// +// See https://aka.ms/devcontainer.json for more information. +{ + "name": "Bash Language Server", + // Node 22 base image (matches .tool-versions) extended with shellcheck, shfmt and pnpm. + "build": { + "context": ".", + "dockerfile": "Dockerfile" + } +} diff --git a/.ona/automations.yaml b/.ona/automations.yaml new file mode 100644 index 00000000..11538204 --- /dev/null +++ b/.ona/automations.yaml @@ -0,0 +1,36 @@ +tasks: + install: + name: Install dependencies + description: Install workspace dependencies with pnpm (also installs the vscode-client deps via postinstall). + command: | + pnpm install --frozen-lockfile + triggeredBy: + - postDevcontainerStart + + compile: + name: Compile + description: Build the TypeScript projects. + command: | + pnpm compile + triggeredBy: + - manual + dependsOn: + - install + + test: + name: Test + description: Run the Jest test suite (requires shellcheck and shfmt, provided by the dev container). + command: | + pnpm test + triggeredBy: + - manual + dependsOn: + - install + +services: + watch: + name: Watch + description: Rebuild the TypeScript projects on change. + commands: + start: | + pnpm watch