[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
29
backend/scripts/bundle-openapi.ps1
Normal file
29
backend/scripts/bundle-openapi.ps1
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Bundle OpenAPI schema files into a single file
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Ensure we're in the project root
|
||||
$projectRoot = Split-Path -Parent $PSScriptRoot
|
||||
Set-Location $projectRoot
|
||||
|
||||
# Create dist directory if it doesn't exist
|
||||
if (-not (Test-Path "api\dist")) {
|
||||
New-Item -ItemType Directory -Force -Path "api\dist"
|
||||
}
|
||||
|
||||
# Bundle the OpenAPI files
|
||||
swagger-cli bundle api/schemas/openapi.yaml --outfile api/dist/openapi.yaml --type yaml
|
||||
|
||||
# Check if bundling was successful
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
} else {
|
||||
Write-Error "Failed to bundle OpenAPI schema"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Also create a JSON version for tools that prefer JSON
|
||||
swagger-cli bundle api/schemas/openapi.yaml --outfile api/dist/openapi.json --type json
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
} else {
|
||||
exit 1
|
||||
}
|
22
backend/scripts/bundle-openapi.sh
Normal file
22
backend/scripts/bundle-openapi.sh
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Get the directory where the script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
# Change to project root
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Create dist directory if it doesn't exist
|
||||
mkdir -p api/dist
|
||||
|
||||
# Bundle the OpenAPI files
|
||||
echo "Bundling OpenAPI schema to YAML..."
|
||||
swagger-cli bundle api/schemas/openapi.yaml --outfile api/dist/openapi.yaml --type yaml
|
||||
|
||||
# Create JSON version
|
||||
echo "Creating JSON version..."
|
||||
swagger-cli bundle api/schemas/openapi.yaml --outfile api/dist/openapi.json --type json
|
||||
|
||||
echo "OpenAPI schema bundling complete!"
|
Loading…
Add table
Add a link
Reference in a new issue