diff options
| author | adamdotdevin <[email protected]> | 2025-08-05 11:46:12 -0500 |
|---|---|---|
| committer | adamdotdevin <[email protected]> | 2025-08-05 11:46:12 -0500 |
| commit | 5e825a4b6a47999e18295ad64f99d59d282c6966 (patch) | |
| tree | 81a0dc7572da8d181d108149a7ae5503b9c01bd1 /packages/tui/sdk/scripts | |
| parent | 3db8e7c2b66bd6efea1457d9a2fcd6c9bbc782a8 (diff) | |
| download | opencode-5e825a4b6a47999e18295ad64f99d59d282c6966.tar.gz opencode-5e825a4b6a47999e18295ad64f99d59d282c6966.zip | |
chore: cleanup old sdk
Diffstat (limited to 'packages/tui/sdk/scripts')
| -rwxr-xr-x | packages/tui/sdk/scripts/bootstrap | 16 | ||||
| -rwxr-xr-x | packages/tui/sdk/scripts/format | 8 | ||||
| -rwxr-xr-x | packages/tui/sdk/scripts/lint | 11 | ||||
| -rwxr-xr-x | packages/tui/sdk/scripts/mock | 41 | ||||
| -rwxr-xr-x | packages/tui/sdk/scripts/test | 56 |
5 files changed, 0 insertions, 132 deletions
diff --git a/packages/tui/sdk/scripts/bootstrap b/packages/tui/sdk/scripts/bootstrap deleted file mode 100755 index d6ac16540..000000000 --- a/packages/tui/sdk/scripts/bootstrap +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then - brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle - } -fi - -echo "==> Installing Go dependencies…" - -go mod tidy -e diff --git a/packages/tui/sdk/scripts/format b/packages/tui/sdk/scripts/format deleted file mode 100755 index db2a3fa29..000000000 --- a/packages/tui/sdk/scripts/format +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -echo "==> Running gofmt -s -w" -gofmt -s -w . diff --git a/packages/tui/sdk/scripts/lint b/packages/tui/sdk/scripts/lint deleted file mode 100755 index 7e03a7beb..000000000 --- a/packages/tui/sdk/scripts/lint +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -echo "==> Running Go build" -go build ./... - -echo "==> Checking tests compile" -go test -run=^$ ./... diff --git a/packages/tui/sdk/scripts/mock b/packages/tui/sdk/scripts/mock deleted file mode 100755 index d2814ae6a..000000000 --- a/packages/tui/sdk/scripts/mock +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [[ -n "$1" && "$1" != '--'* ]]; then - URL="$1" - shift -else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 -fi - -echo "==> Starting mock server with URL ${URL}" - -# Run prism mock on the given spec -if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/[email protected] -- prism mock "$URL" &> .prism.log & - - # Wait for server to come online - echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do - echo -n "." - sleep 0.1 - done - - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - - echo -else - npm exec --package=@stainless-api/[email protected] -- prism mock "$URL" -fi diff --git a/packages/tui/sdk/scripts/test b/packages/tui/sdk/scripts/test deleted file mode 100755 index efebceaee..000000000 --- a/packages/tui/sdk/scripts/test +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color - -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -kill_server_on_port() { - pids=$(lsof -t -i tcp:"$1" || echo "") - if [ "$pids" != "" ]; then - kill "$pids" - echo "Stopped $pids." - fi -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if ! is_overriding_api_base_url && ! prism_is_running ; then - # When we exit this script, make sure to kill the background mock server process - trap 'kill_server_on_port 4010' EXIT - - # Start the dev server - ./scripts/mock --daemon -fi - -if is_overriding_api_base_url ; then - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" - echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo -fi - -echo "==> Running tests" -go test ./... "$@" |
