diff --git a/README.md b/README.md index 7f6cf9d..26a937a 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ | [delta](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/delta) | `delta` — syntax-highlighting pager for git diffs | gh release | 1.0.0 | | [deno.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/deno.com) | `deno` — secure TypeScript/JavaScript runtime | curl | 1.0.0 | | [devenv.sh](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/devenv.sh) | `devenv` — reproducible developer environments via Nix | nix | 1.0.0 | +| [diffity.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/diffity.com) | `diffity` — agent-agnostic GitHub-style diff viewer and code review tool | npm | 1.0.0 | | [dozzle.dev](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/dozzle.dev) | `dozzle` — real-time Docker container log viewer | curl | 1.0.0 | | [fd](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/fd) | `fd` — fast and user-friendly file finder | gh release | 1.0.0 | | [feature-installer](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/feature-installer) | `feature-installer` — install devcontainer features at runtime | curl | 0.0.4 | diff --git a/src/diffity.com/NOTES.md b/src/diffity.com/NOTES.md new file mode 100644 index 0000000..a2b055f --- /dev/null +++ b/src/diffity.com/NOTES.md @@ -0,0 +1,17 @@ +# diffity.com + +## Project + +- [diffity](https://diffity.com) + +## Description + +An agent-agnostic, GitHub-style diff viewer and code review tool. `diffity` works with Claude Code, Cursor, Codex, and any AI coding agent — run it inside any git repo to open a syntax-highlighted diff in the browser. + +## Installation Method + +Installed as a global npm package via `npm install -g diffity`. Node.js and npm are installed as prerequisites via APT. + +## Other Notes + +_No additional notes._ diff --git a/src/diffity.com/devcontainer-feature.json b/src/diffity.com/devcontainer-feature.json new file mode 100644 index 0000000..ce2de0b --- /dev/null +++ b/src/diffity.com/devcontainer-feature.json @@ -0,0 +1,15 @@ +{ + "name": "diffity.com", + "id": "diffity.com", + "version": "1.0.0", + "description": "Install \"diffity\" CLI", + "documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/diffity.com", + "options": { + "version": { + "type": "string", + "default": "latest", + "proposals": ["latest"], + "description": "Version of \"diffity\" to install." + } + } +} diff --git a/src/diffity.com/install.sh b/src/diffity.com/install.sh new file mode 100755 index 0000000..9b19e21 --- /dev/null +++ b/src/diffity.com/install.sh @@ -0,0 +1,49 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o noclobber +set -o nounset +set -o allexport +readonly name='diffity' +apt_get_update() { + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} +apt_get_checkinstall() { + if ! dpkg -s "$@" >/dev/null 2>&1; then + apt_get_update + DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@" + fi +} +apt_get_cleanup() { + apt-get clean + rm -rf /var/lib/apt/lists/* +} +echo_banner() { + local text="$1" + echo -e "\e[1m\e[97m\e[41m$text\e[0m" +} +utils_check_version() { + local version=$1 + if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + printf >&2 '=== [ERROR] Option "version" (value: "%s") is not "latest" or valid semantic version format "X.Y.Z" !\n' \ + "$version" + exit 1 + fi +} +install() { + utils_check_version "$VERSION" + apt_get_checkinstall nodejs npm ca-certificates build-essential python3 + if [ "$VERSION" = 'latest' ]; then + npm install -g diffity + else + npm install -g "diffity@${VERSION}" + fi + apt_get_cleanup +} +echo_banner "devcontainer.community" +echo "Installing $name..." +install "$@" +echo "(*) Done!" diff --git a/test/diffity.com/test.sh b/test/diffity.com/test.sh new file mode 100644 index 0000000..0f28c60 --- /dev/null +++ b/test/diffity.com/test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +source dev-container-features-test-lib + +check "execute command" bash -c "diffity --version" + +reportResults