Skip to content

Commit

Permalink
fix(connect): replace imports for @sinclair/typebox due to TS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan authored and mroz22 committed Sep 27, 2024
1 parent d77a28c commit 91123a2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/replace-imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,15 @@ if grep -Rl "$SEARCH_PATTERN" "$1"; then
exit 1
else
echo "All occurrences of '@trezor/*/src' have been successfully replaced."
fi
fi

# Patch for Typebox import issue, where TS uses an ESM import path, but our package is CommonJS
# @sinclair/typebox/build/esm/index.mjs -> @sinclair/typebox

REGEX="s/@sinclair\/typebox\/build\/esm\/index.mjs/@sinclair\/typebox/g"

if [[ "$OS" == "Darwin" ]]; then
find "$1" -type f -exec sed -i '' -E "$REGEX" {} +
else
find "$1" -type f -exec sed -i -E "$REGEX" {} +
fi

0 comments on commit 91123a2

Please sign in to comment.