Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/circleci-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
```

Expand Down
2 changes: 1 addition & 1 deletion src/deno-cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
```

Expand Down
9 changes: 9 additions & 0 deletions src/elm-lang/NOTES.md
Original file line number Diff line number Diff line change
@@ -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.
43 changes: 43 additions & 0 deletions src/elm-lang/README.md
Original file line number Diff line number Diff line change
@@ -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`._
44 changes: 44 additions & 0 deletions src/elm-lang/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
50 changes: 50 additions & 0 deletions src/elm-lang/install.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/exercism-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Install the exercism-cli.

```json
"features": {
"ghcr.io/CodeMan99/features/exercism-cli:1": {}
"ghcr.io/codeman99/features/exercism-cli:1": {}
}
```

Expand Down
13 changes: 13 additions & 0 deletions test/elm-lang/elm__debian__with_npm_tools.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions test/elm-lang/elm__javascript-node__with_npm_tools.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions test/elm-lang/elm__ubuntu__with_npm_tools.sh
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions test/elm-lang/scenarios.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
}
10 changes: 10 additions & 0 deletions test/elm-lang/test.sh
Original file line number Diff line number Diff line change
@@ -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