File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ # Iterate through all *.d.ts files in the dist directory
5+ find dist -type f -name " *.d.ts" | while read -r file; do
6+ # Log file name and line number for matches
7+ grep -n " ^import .* from '@stream-io/openai-realtime-api';" " $file " | while IFS=: read -r linenum _; do
8+ echo " Adding ts-ignore to declaration: $file :$linenum "
9+ done || true
10+
11+ # Use sed to prepend the comment to matching import statements
12+ sed -i ' ' ' /^import .* from ' \' ' @stream-io\/openai-realtime-api' \' ' ;/i\
13+ // @ts-ignore Optional dependency
14+ ' " $file " || true
15+ done
16+
Original file line number Diff line number Diff line change 2424 "test" : " vitest" ,
2525 "test:bun" : " bun run vitest" ,
2626 "start" : " rollup -w -c" ,
27- "build" : " rm -rf dist && rollup -c" ,
27+ "build" : " rm -rf dist && rollup -c && ./fix-optional-dep-types.sh " ,
2828 "generate:open-api" : " ./generate-openapi.sh" ,
2929 "lint" : " eslint **/*.ts" ,
3030 "lint:fix" : " eslint --fix **/*.ts" ,
You can’t perform that action at this time.
0 commit comments