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
1 change: 1 addition & 0 deletions .github/filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ talosctl: ./**/talosctl/**
terraform: ./**/terraform/**
terraform-mcp-server: ./**/terraform-mcp-server/**
tflint: ./**/tflint/**
typescript: ./**/typescript/**
zensical: ./**/zensical/**
17 changes: 17 additions & 0 deletions src/typescript/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

## OS Support

This feature is tested against the following OS versions:

- ubuntu:noble
- debian:12
- mcr.microsoft.com/devcontainers/base:ubuntu24.04
- mcr.microsoft.com/devcontainers/base:debian12

Versions older than what are listed above are untested and therefore may not support this feature without additional packages.

## Changelog

| Version | Notes |
| --- | --- |
| 1.0.0 | Initial release |
21 changes: 21 additions & 0 deletions src/typescript/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "TypeScript",
"id": "typescript",
"version": "1.0.0",
"description": "TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.",
"documentationURL": "https://www.typescriptlang.org/docs",
"options": {
"version": {
"default": "latest",
"description": "Select the version to install. Anything that is not 'latest' must be in '#.#.#' format.",
"proposals": [
"latest",
"6.0.3"
],
"type": "string"
}
},
"dependsOn": {
"ghcr.io/devcontainers/features/node": {}
}
}
16 changes: 16 additions & 0 deletions src/typescript/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -e

if ! command -v node > /dev/null 2>&1; then
echo "ERROR: node not found. This feature requires the 'node' devcontainer feature." >&2
echo "See: https://github.com/devcontainers/features/tree/main/src/node" >&2
exit 1
fi

VERSION="${VERSION:-latest}"
package_name="typescript"

npm install -g ${package_name}@${VERSION}

echo "${package_name} feature installation complete!"
10 changes: 10 additions & 0 deletions test/typescript/scenarios.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"typescript_version": {
"image": "mcr.microsoft.com/devcontainers/base:debian12",
"features": {
"typescript": {
"version": "5.9.3"
}
}
}
}
19 changes: 19 additions & 0 deletions test/typescript/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

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.
echo ""
echo "Running as $(whoami)"
check "typescript location" which tsc
check "typescript version" tsc -v

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

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.
echo ""
echo "Running as $(whoami)"
check "typescript location" which tsc
check "typescript version" tsc -v

# Report result
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults
Loading