mirror of
https://github.com/galacean/engine.git
synced 2026-06-04 17:57:13 +08:00
feat: add github action to generate typedoc json automatically
This commit is contained in:
@@ -4,20 +4,19 @@ set -euo pipefail
|
||||
# generate declaration files via typedoc
|
||||
|
||||
ENGINE_PATH="$(pwd)"
|
||||
TYPEDOC="typedoc@0.23.28"
|
||||
|
||||
# Set default output directory if not provided
|
||||
OUTPUT_DIR=${1:-./api}
|
||||
|
||||
# Validate required environment variable
|
||||
if [ -z "${TYPEDOC:-}" ]; then
|
||||
echo "Error: TYPEDOC environment variable is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
for directory in ${ENGINE_PATH}/packages/*
|
||||
do
|
||||
if [ -d $directory ]; then
|
||||
bn=`basename $directory`;
|
||||
echo "typedoc compiling $directory"
|
||||
npx $TYPEDOC --version
|
||||
npx $TYPEDOC --json api/$bn.json --tsconfig $directory/tsconfig.json $directory/src/index.ts;
|
||||
SUCCESS+=("api/$bn.json")
|
||||
npx $TYPEDOC --json ${OUTPUT_DIR}/$bn.json --tsconfig $directory/tsconfig.json $directory/src/index.ts;
|
||||
SUCCESS+=("${OUTPUT_DIR}/$bn.json")
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user