Files
Coolify-TypeScript-SDK/.devcontainer/setup.sh
2024-11-19 21:24:42 -06:00

30 lines
713 B
Bash

#!/bin/bash
# Install the speakeasy CLI
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
# Setup samples directory
rmdir samples || true
mkdir samples
npm install
npm install -g ts-node
npm link
npm link coolify
TS_CONFIG_CONTENT=$(cat <<EOL
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"openapi": ["../src/index"],
"openapi/*": ["../src/*"]
}
},
"include": ["./**/*.ts"]
}
EOL
)
echo "$TS_CONFIG_CONTENT" > samples/tsconfig.json
# Generate starter usage sample with speakeasy
speakeasy generate usage -s https://raw.githubusercontent.com/coollabsio/documentation-coolify/refs/heads/main/openapi.yaml -l typescript -o samples/root.ts