From d55952e3f28a8cc8e3854e71ab901384833c063f Mon Sep 17 00:00:00 2001 From: Cody Taylor Date: Mon, 3 Nov 2025 23:07:41 -0500 Subject: [PATCH 1/4] devcontainer: Use node v24 on debian bookworm Note: debian trixie does not support moby. --- .devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer.json b/.devcontainer.json index c05fa42..d37a2bb 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,5 +1,5 @@ { - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm", + "image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-bookworm", "customizations": { "vscode": { "settings": { From 0601e8af57a6b12a9da4be697a63a8a6e191dd14 Mon Sep 17 00:00:00 2001 From: Cody Taylor Date: Wed, 5 Nov 2025 23:11:04 -0500 Subject: [PATCH 2/4] Add feature: elm-lang --- src/elm-lang/NOTES.md | 9 ++++ src/elm-lang/devcontainer-feature.json | 44 ++++++++++++++++ src/elm-lang/install.sh | 50 +++++++++++++++++++ test/elm-lang/elm__debian__with_npm_tools.sh | 13 +++++ .../elm__javascript-node__with_npm_tools.sh | 13 +++++ test/elm-lang/elm__ubuntu__with_npm_tools.sh | 13 +++++ test/elm-lang/scenarios.json | 33 ++++++++++++ test/elm-lang/test.sh | 10 ++++ 8 files changed, 185 insertions(+) create mode 100644 src/elm-lang/NOTES.md create mode 100644 src/elm-lang/devcontainer-feature.json create mode 100644 src/elm-lang/install.sh create mode 100644 test/elm-lang/elm__debian__with_npm_tools.sh create mode 100644 test/elm-lang/elm__javascript-node__with_npm_tools.sh create mode 100644 test/elm-lang/elm__ubuntu__with_npm_tools.sh create mode 100644 test/elm-lang/scenarios.json create mode 100644 test/elm-lang/test.sh diff --git a/src/elm-lang/NOTES.md b/src/elm-lang/NOTES.md new file mode 100644 index 0000000..54faac4 --- /dev/null +++ b/src/elm-lang/NOTES.md @@ -0,0 +1,9 @@ +# Elm-lang + +Installs the [Elm](https://elm-lang.org) compiler following the [linux install](https://github.com/elm/compiler/blob/master/installers/linux/README.md) documentation. + +```shell +elm --help +``` + +See the [language guide](https://guide.elm-lang.org), [examples](https://elm-lang.org/examples), and [documentation](https://elm-lang.org/docs) for more information on the language. diff --git a/src/elm-lang/devcontainer-feature.json b/src/elm-lang/devcontainer-feature.json new file mode 100644 index 0000000..e75c234 --- /dev/null +++ b/src/elm-lang/devcontainer-feature.json @@ -0,0 +1,44 @@ +{ + "id": "elm-lang", + "name": "Elm Language Compiler (via Github Releases)", + "version": "0.1.0", + "documentationURL": "https://github.com/CodeMan99/features/tree/main/src/elm-lang", + "description": "Install the elm language compiler and related tools", + "options": { + "version": { + "default": "0.19.1", + "description": "Specify the compiler version", + "type": "string" + }, + "elmPrefix": { + "default": "/usr/local/bin", + "description": "Where the \"elm\" binary will be installed", + "type": "string" + }, + "installFormat": { + "default": true, + "description": "Install the \"elm-format\" command (via npm if installed)", + "type": "boolean" + }, + "installReview": { + "default": true, + "description": "Install the \"elm-review\" command (via npm if installed)", + "type": "boolean" + }, + "installTest": { + "default": true, + "description": "Install the \"elm-test\" command (via npm if installed)", + "type": "boolean" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "Elmtooling.elm-ls-vscode" + ] + } + }, + "installsAfter": [ + "ghcr.io/devcontainers/features/node" + ] +} diff --git a/src/elm-lang/install.sh b/src/elm-lang/install.sh new file mode 100644 index 0000000..bbbccfb --- /dev/null +++ b/src/elm-lang/install.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +set -e + +VERSION="${VERSION:-0.19.1}" +ELM_PREFIX="${ELMPREFIX:-/usr/local/bin}" +INSTALL_FORMAT="${INSTALLFORMAT:-true}" +INSTALL_REVIEW="${INSTALLREVIEW:-true}" +INSTALL_TEST="${INSTALLTEST:-true}" + +apt_get_update() +{ + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} + +# Checks if packages are installed and installs them if not +check_packages() { + if ! dpkg -s "$@" > /dev/null 2>&1; then + apt_get_update + apt-get -y install --no-install-recommends "$@" + fi +} + +export DEBIAN_FRONTEND=noninteractive +check_packages curl ca-certificates + +curl --location --output elm.gz "https://github.com/elm/compiler/releases/download/${VERSION}/binary-for-linux-64-bit.gz" +gunzip elm.gz +install elm "${ELM_PREFIX}" + +declare -a PACKAGES + +if [[ "${INSTALL_FORMAT}" == "true" ]]; then + PACKAGES+=("elm-format") +fi + +if [[ "${INSTALL_REVIEW}" == "true" ]]; then + PACKAGES+=("elm-review") +fi + +if [[ "${INSTALL_TEST}" == "true" ]]; then + PACKAGES+=("elm-test") +fi + +if command -v npm &> /dev/null && [[ ${#PACKAGES[@]} -gt 0 ]]; then + npm install -g "${PACKAGES[@]}" +fi diff --git a/test/elm-lang/elm__debian__with_npm_tools.sh b/test/elm-lang/elm__debian__with_npm_tools.sh new file mode 100644 index 0000000..f642457 --- /dev/null +++ b/test/elm-lang/elm__debian__with_npm_tools.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "Elm-lang compiler binary is executable" test -x /usr/local/bin/elm +check "elm --version" elm --version +check "npm tool: elm-format" test -x "$(npm prefix -g)/bin/elm-format" +check "npm tool: elm-review" test -x "$(npm prefix -g)/bin/elm-review" +check "npm tool: elm-test" test -x "$(npm prefix -g)/bin/elm-test" + +reportResults diff --git a/test/elm-lang/elm__javascript-node__with_npm_tools.sh b/test/elm-lang/elm__javascript-node__with_npm_tools.sh new file mode 100644 index 0000000..f642457 --- /dev/null +++ b/test/elm-lang/elm__javascript-node__with_npm_tools.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "Elm-lang compiler binary is executable" test -x /usr/local/bin/elm +check "elm --version" elm --version +check "npm tool: elm-format" test -x "$(npm prefix -g)/bin/elm-format" +check "npm tool: elm-review" test -x "$(npm prefix -g)/bin/elm-review" +check "npm tool: elm-test" test -x "$(npm prefix -g)/bin/elm-test" + +reportResults diff --git a/test/elm-lang/elm__ubuntu__with_npm_tools.sh b/test/elm-lang/elm__ubuntu__with_npm_tools.sh new file mode 100644 index 0000000..f743023 --- /dev/null +++ b/test/elm-lang/elm__ubuntu__with_npm_tools.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "Elm-lang compiler binary is executable" test -x /usr/local/bin/elm +check "elm --version" elm --version +check "npm tool not installed: elm-format" test ! -e "$(npm prefix -g)/bin/elm-format" +check "npm tool not installed: elm-review" test ! -e "$(npm prefix -g)/bin/elm-review" +check "npm tool: elm-test" test -x "$(npm prefix -g)/bin/elm-test" + +reportResults diff --git a/test/elm-lang/scenarios.json b/test/elm-lang/scenarios.json new file mode 100644 index 0000000..7269731 --- /dev/null +++ b/test/elm-lang/scenarios.json @@ -0,0 +1,33 @@ +{ + "elm__debian__with_npm_tools": { + "image": "debian:trixie", + "features": { + "elm-lang": {}, + "ghcr.io/devcontainers/features/node:1": { + "version": "lts", + "nodeGypDependencies": false + } + } + }, + "elm__ubuntu__with_npm_tools": { + "image": "ubuntu:noble", + "features": { + "elm-lang": { + "installFormat": false, + "installReview": false, + "installTest": true + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "lts", + "nodeGypDependencies": false + } + } + }, + "elm__javascript-node__with_npm_tools": { + "image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-bookworm", + "remoteUser": "node", + "features": { + "elm-lang": {} + } + } +} diff --git a/test/elm-lang/test.sh b/test/elm-lang/test.sh new file mode 100644 index 0000000..9270baa --- /dev/null +++ b/test/elm-lang/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "Elm-lang compiler binary is executable" test -x /usr/local/bin/elm +check "elm --version" elm --version + +reportResults From 39102016167af9f04c6a38f7ed8ae6ac3f200123 Mon Sep 17 00:00:00 2001 From: Cody Taylor Date: Wed, 5 Nov 2025 23:22:04 -0500 Subject: [PATCH 3/4] Automated documentation update [skip ci] --- src/circleci-cli/README.md | 2 +- src/deno-cache/README.md | 2 +- src/elm-lang/README.md | 43 ++++++++++++++++++++++++++++++++++++++ src/exercism-cli/README.md | 2 +- 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 src/elm-lang/README.md diff --git a/src/circleci-cli/README.md b/src/circleci-cli/README.md index 2ea6b0e..5eec0d0 100644 --- a/src/circleci-cli/README.md +++ b/src/circleci-cli/README.md @@ -7,7 +7,7 @@ Install the CircleCI CLI. Also installs the CircleCI extension for vscode. ```json "features": { - "ghcr.io/CodeMan99/features/circleci-cli:1": {} + "ghcr.io/codeman99/features/circleci-cli:1": {} } ``` diff --git a/src/deno-cache/README.md b/src/deno-cache/README.md index 6a9c772..aba7380 100644 --- a/src/deno-cache/README.md +++ b/src/deno-cache/README.md @@ -7,7 +7,7 @@ Create a docker named volume at /deno-dir ```json "features": { - "ghcr.io/CodeMan99/features/deno-cache:0": {} + "ghcr.io/codeman99/features/deno-cache:0": {} } ``` diff --git a/src/elm-lang/README.md b/src/elm-lang/README.md new file mode 100644 index 0000000..a9796ef --- /dev/null +++ b/src/elm-lang/README.md @@ -0,0 +1,43 @@ + +# Elm Language Compiler (via Github Releases) (elm-lang) + +Install the elm language compiler and related tools + +## Example Usage + +```json +"features": { + "ghcr.io/codeman99/features/elm-lang:0": {} +} +``` + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| version | Specify the compiler version | string | 0.19.1 | +| elmPrefix | Where the "elm" binary will be installed | string | /usr/local/bin | +| installFormat | Install the "elm-format" command (via npm if installed) | boolean | true | +| installReview | Install the "elm-review" command (via npm if installed) | boolean | true | +| installTest | Install the "elm-test" command (via npm if installed) | boolean | true | + +## Customizations + +### VS Code Extensions + +- `Elmtooling.elm-ls-vscode` + +# Elm-lang + +Installs the [Elm](https://elm-lang.org) compiler following the [linux install](https://github.com/elm/compiler/blob/master/installers/linux/README.md) documentation. + +```shell +elm --help +``` + +See the [language guide](https://guide.elm-lang.org), [examples](https://elm-lang.org/examples), and [documentation](https://elm-lang.org/docs) for more information on the language. + + +--- + +_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/CodeMan99/features/blob/main/src/elm-lang/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ diff --git a/src/exercism-cli/README.md b/src/exercism-cli/README.md index 588401e..6ddff5c 100644 --- a/src/exercism-cli/README.md +++ b/src/exercism-cli/README.md @@ -7,7 +7,7 @@ Install the exercism-cli. ```json "features": { - "ghcr.io/CodeMan99/features/exercism-cli:1": {} + "ghcr.io/codeman99/features/exercism-cli:1": {} } ``` From 581d474cbc2e150f625a21dc1ac89455f895155d Mon Sep 17 00:00:00 2001 From: Cody Taylor Date: Wed, 5 Nov 2025 23:28:51 -0500 Subject: [PATCH 4/4] ci: run tests