-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix napi double .d.ts formatting (#9238)
- Loading branch information
1 parent
e8ffdb8
commit a72f7d5
Showing
3 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
flags="\ | ||
--platform \ | ||
-p turborepo-napi \ | ||
--cargo-cwd ../../ \ | ||
--cargo-name turborepo_napi \ | ||
native \ | ||
--js false \ | ||
" | ||
|
||
if [ "$1" == "release" ]; then | ||
flags+=" --release" | ||
else | ||
flags+=" --dts ../js/index.d.ts" | ||
fi | ||
|
||
node_modules/.bin/napi build $flags | ||
|
||
# Unfortunately, when napi generates a .d.ts file, it doesn't match our formatting rules (it doesn't have semicolons). | ||
# Since there's now way to configure this from napi itself, so we need to run prettier on it after generating it. | ||
node_modules/.bin/prettier --write js/index.d.ts | ||
|
||
mkdir -p js/dist | ||
cp js/index.{js,d.ts} js/dist/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.