Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

1.2 KB
Raw Blame
#!/bin/bash

echo "\n\n---\nRenamed tag files to index.ts...\n"
# Rename tag files to index.ts in services directories
# tags-split creates: services/tagName/tagName.ts -> rename to services/tagName/index.ts
find src/api/generated/services -mindepth 1 -maxdepth 1 -type d | while read -r dir; do
  dirname=$(basename "$dir")
  tagfile="$dir/$dirname.ts"
  if [ -f "$tagfile" ]; then
    mv "$tagfile" "$dir/index.ts"
    echo "Renamed $tagfile -> $dir/index.ts"
  fi
done

echo "\n✅ Tag files renamed to index.ts"

# Fix linting issues
echo "\n\n---\nRunning lint...\n"
if ! pnpm lint:generated; then
  echo "Lint check failed! Please fix linting errors before proceeding."
  exit 1
fi
echo "\n✅ Lint check successful"


# Format generated files (must run after lint: oxlint --fix writes unformatted autofixes)
echo "\n\n---\nRunning prettier...\n"
if ! pnpm prettify src/api/generated; then
  echo "Formatting failed!"
  exit 1
fi
echo "\n✅ Formatting successful"


# Check for type errors
echo "\n\n---\nChecking for type errors...\n"
if ! tsc --noEmit; then
  echo "Type check failed! Please fix type errors before proceeding."
  exit 1
fi
echo "\n✅ Type check successful"


echo "\n\n---\n ✅✅✅ API generation complete!"