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
17 changes: 0 additions & 17 deletions .claude/settings.local.json

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- hello
- imagemagick
- mc
- typst
- yek
- yq
baseImage:
Expand Down Expand Up @@ -48,6 +49,7 @@ jobs:
- imagemagick
- mc
- mcp-language-server
- typst
- yek
- yq
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.claude/settings.local.json
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This is Tobias Maier's Dev Container Features collection - a repository for crea
- `imagemagick` - ImageMagick image processing tools
- `mc` - MinIO Client for object storage
- `mcp-language-server` - MCP Language Server for semantic code navigation
- `typst` - Typst markup-based typesetting system
- `yek` - Repository serialization tool for LLMs
- `yq` - YAML processing tool

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A collection of custom [Dev Container Features](https://containers.dev/implement
| [imagemagick](https://github.com/tmaier/devcontainer-features/tree/main/src/imagemagick) | ImageMagick image processing library with PDF support | `ghcr.io/tmaier/devcontainer-features/imagemagick` |
| [mc](https://github.com/tmaier/devcontainer-features/tree/main/src/mc) | MinIO Client for object storage operations | `ghcr.io/tmaier/devcontainer-features/mc` |
| [mcp-language-server](https://github.com/tmaier/devcontainer-features/tree/main/src/mcp-language-server) | MCP Language Server for semantic code navigation | `ghcr.io/tmaier/devcontainer-features/mcp-language-server` |
| [typst](https://github.com/tmaier/devcontainer-features/tree/main/src/typst) | Typst markup-based typesetting system | `ghcr.io/tmaier/devcontainer-features/typst` |
| [yek](https://github.com/tmaier/devcontainer-features/tree/main/src/yek) | Repository file serialization tool for LLM consumption | `ghcr.io/tmaier/devcontainer-features/yek` |
| [yq](https://github.com/tmaier/devcontainer-features/tree/main/src/yq) | YAML, JSON, XML, and CSV processor | `ghcr.io/tmaier/devcontainer-features/yq` |

Expand Down
7 changes: 7 additions & 0 deletions src/typst/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## What This Feature Installs

This feature installs [Typst](https://github.com/typst/typst), a new markup-based typesetting system that is powerful and easy to learn. Typst is designed to be an alternative to LaTeX, with a focus on simplicity and modern features.

## Documentation

For complete usage instructions and documentation, visit the official Typst website: https://typst.app/docs
14 changes: 14 additions & 0 deletions src/typst/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "typst",
"version": "1.0.0",
"name": "Typst",
"description": "Installs Typst - a markup-based typesetting system that is powerful and easy to learn",
"options": {
"version": {
"type": "string",
"default": "latest",
"description": "Version of Typst to install. Use 'latest' for the latest version, or specify a version like '0.13.1'."
}
},
"installsAfter": []
}
49 changes: 49 additions & 0 deletions src/typst/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh
set -e

echo "Installing Typst..."

# Get version from options (capitalized by devcontainer spec)
TYPST_VERSION="${VERSION:-latest}"

# Update package list and install dependencies if not available
if ! command -v curl >/dev/null 2>&1; then
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates
fi

if ! command -v tar >/dev/null 2>&1 || ! command -v xz >/dev/null 2>&1; then
apt-get update
apt-get install -y --no-install-recommends tar xz-utils
fi

# Construct download URL based on version
if [ "$TYPST_VERSION" = "latest" ]; then
echo "Installing latest version of Typst..."
DOWNLOAD_URL="https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz"
else
echo "Installing Typst version: $TYPST_VERSION"
DOWNLOAD_URL="https://github.com/typst/typst/releases/download/v${TYPST_VERSION}/typst-x86_64-unknown-linux-musl.tar.xz"
fi

# Download and extract Typst
echo "Downloading from: $DOWNLOAD_URL"
curl -fsSL -o /tmp/typst.tar.xz "$DOWNLOAD_URL"
cd /tmp
tar -xf typst.tar.xz

# Move binary to /usr/bin
mv typst-x86_64-unknown-linux-musl/typst /usr/bin/typst
chmod +x /usr/bin/typst

# Clean up
rm -rf /tmp/typst.tar.xz /tmp/typst-x86_64-unknown-linux-musl

# Verify installation
if ! command -v typst >/dev/null 2>&1; then
echo "Error: Typst installation failed"
exit 1
fi

INSTALLED_VERSION=$(typst --version)
echo "Typst installed successfully: $INSTALLED_VERSION"
16 changes: 16 additions & 0 deletions test/typst/scenarios.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"typst_default": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"typst": {}
}
},
"typst_specific_version": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"typst": {
"version": "0.13.1"
}
}
}
}
36 changes: 36 additions & 0 deletions test/typst/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# This test file will be executed against auto-generated devcontainer.json files
# that include the 'typst' Feature with various options.
#
# For more information, see: https://github.com/devcontainers/cli/blob/main/docs/features/test.md
#
# These scripts are run as 'root' by default. Although that can be changed
# with the '--remote-user' flag.
#
# This test can be run with the following command:
#
# devcontainer features test \
# --features typst \
# --remote-user root \
# --skip-scenarios \
# --base-image mcr.microsoft.com/devcontainers/base:ubuntu \
# /path/to/this/repo

set -e

# Optional: Import test library bundled with the devcontainer CLI
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
# Provides the 'check' and 'reportResults' commands.
source dev-container-features-test-lib

# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
# check <LABEL> <cmd> [args...]
check "typst command available" which typst
check "typst shows version" bash -c "typst --version"
check "typst version output format" bash -c "typst --version | grep -i 'typst'"

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults
17 changes: 17 additions & 0 deletions test/typst/typst_default.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# This test file will be executed against the 'typst_default' scenario
# defined in scenarios.json

set -e

# Import test library bundled with the devcontainer CLI
source dev-container-features-test-lib

# Feature-specific tests
check "typst command available" which typst
check "typst shows version" bash -c "typst --version"
check "typst version output format" bash -c "typst --version | grep -i 'typst'"

# Report results
reportResults
17 changes: 17 additions & 0 deletions test/typst/typst_specific_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# This test file will be executed against the 'typst_specific_version' scenario
# defined in scenarios.json, which installs version 0.13.1

set -e

# Import test library bundled with the devcontainer CLI
source dev-container-features-test-lib

# Feature-specific tests
check "typst command available" which typst
check "typst shows version" bash -c "typst --version"
check "typst version is 0.13.1" bash -c "typst --version | grep '0.13.1'"

# Report results
reportResults
Loading