Skip to content

Commit

Permalink
fix(schema-utils): typescript + typebox package resolution issue
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan committed Oct 18, 2024
1 parent 24931a9 commit cc22068
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion packages/schema-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ export function AssertWeak<T extends TSchema>(

export const Type = new CustomTypeBuilder();
export { Optional, CloneType };
export type { Static, TObject, TSchema };
export type * from '@sinclair/typebox';
11 changes: 0 additions & 11 deletions scripts/replace-imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,3 @@ if grep -Rl "$SEARCH_PATTERN" "$1"; then
else
echo "All occurrences of '@trezor/*/src' have been successfully replaced."
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 cc22068

Please sign in to comment.