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
7 changes: 6 additions & 1 deletion forge/sterling/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
This folder contains a build of the current version of Sterling for Forge. To update, build Sterling and recursively copy the contents of the `dist` folder in that repo to the `build` sub-folder here. Remember to build with `yarn run build:forge`; the Forge version is slightly different from the Alloy version.
This folder contains a build of the current version of Sterling for Forge. To update, you can either:

- Run `./update-sterling.sh vX.Y.Z` to download `sterling-forge.zip` from the corresponding GitHub release and replace `build/`.
- Or build Sterling locally and recursively copy the contents of the `dist` folder in that repo to the `build` sub-folder here.

Remember to build with `yarn run build:forge`; the Forge version is slightly different from the Alloy version.

Also, note well that the build has sub-folders. Don't neglect to `cp -r` and to delete the subfolders before copying.
2 changes: 1 addition & 1 deletion forge/sterling/build/assets/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.2",
"version": "2.1.3",
"name": "sterling-layout",
"description": "Spytial Sterling is a fork of the Sterling visualizer that encodes spatial layout.",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion forge/sterling/build/assets/yandex-browser-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.2",
"version": "2.1.3",
"api_version": 1,
"layout": {
"logo": "yandex-browser-50x50.png",
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions forge/sterling/build/version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Sterling Layout",
"version": "2.1.2",
"version": "2.1.3",
"build": "forge",
"timestamp": "2026-01-29T17:26:55Z",
"timestamp": "2026-01-31T20:31:29Z",
"tag": ""
}
125 changes: 125 additions & 0 deletions forge/sterling/update-sterling.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#!/usr/bin/env bash
set -euo pipefail

DEFAULT_REPO="sidprasad/sterling-ts"
DEFAULT_TAG="v2.1.3"
DEFAULT_ASSET="sterling-forge.zip"

usage() {
cat <<'USAGE'
Usage: ./update-sterling.sh [tag]
./update-sterling.sh --tag vX.Y.Z [--repo owner/name] [--asset sterling-forge.zip]
./update-sterling.sh --url https://github.com/owner/repo/releases/download/vX.Y.Z/sterling-forge.zip

Environment overrides:
STERLING_REPO, STERLING_TAG, STERLING_ASSET, STERLING_URL
USAGE
}

repo="${STERLING_REPO:-$DEFAULT_REPO}"
tag="${STERLING_TAG:-$DEFAULT_TAG}"
asset="${STERLING_ASSET:-$DEFAULT_ASSET}"
url="${STERLING_URL:-}"
tag_override_set=""

while [[ $# -gt 0 ]]; do
case "$1" in
-t|--tag)
tag="${2:-}"
shift 2
;;
-r|--repo)
repo="${2:-}"
shift 2
;;
-a|--asset)
asset="${2:-}"
shift 2
;;
-u|--url)
url="${2:-}"
shift 2
;;
-h|--help)
usage
exit 0
;;
-*)
echo "Unknown option: $1" >&2
usage
exit 1
;;
*)
if [[ -z "$tag_override_set" ]]; then
tag="$1"
tag_override_set="1"
shift
else
echo "Unexpected argument: $1" >&2
usage
exit 1
fi
;;
esac
done

if [[ -z "$url" ]]; then
if [[ -z "$tag" || -z "$repo" || -z "$asset" ]]; then
echo "Missing tag/repo/asset values." >&2
usage
exit 1
fi
url="https://github.com/${repo}/releases/download/${tag}/${asset}"
fi

if ! command -v unzip >/dev/null 2>&1; then
echo "Missing required tool: unzip" >&2
exit 1
fi

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGET_DIR="${SCRIPT_DIR}/build"

if [[ -z "$TARGET_DIR" || "$TARGET_DIR" == "/" ]]; then
echo "Refusing to operate on invalid target directory." >&2
exit 1
fi

tmp_dir="$(mktemp -d)"
trap 'rm -rf "$tmp_dir"' EXIT
zip_path="${tmp_dir}/sterling-forge.zip"
extract_dir="${tmp_dir}/extract"
mkdir -p "$extract_dir"

echo "Downloading: $url"
if command -v curl >/dev/null 2>&1; then
curl -fsSL -o "$zip_path" "$url"
elif command -v wget >/dev/null 2>&1; then
wget -O "$zip_path" "$url"
else
echo "Missing required tool: curl or wget" >&2
exit 1
fi

unzip -q "$zip_path" -d "$extract_dir"

source_dir=""
if [[ -d "${extract_dir}/dist" ]]; then
source_dir="${extract_dir}/dist"
elif [[ -d "${extract_dir}/build" ]]; then
source_dir="${extract_dir}/build"
else
candidate="$(find "$extract_dir" -maxdepth 2 -type d \( -name dist -o -name build \) | head -n 1)"
if [[ -n "$candidate" ]]; then
source_dir="$candidate"
else
source_dir="$extract_dir"
fi
fi

echo "Replacing ${TARGET_DIR} with contents from ${source_dir}"
rm -rf "$TARGET_DIR"
mkdir -p "$TARGET_DIR"
cp -R "${source_dir}/." "$TARGET_DIR/"

echo "Done."