-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump cli's cargo-messages to latest and attach src hygiene lint to dist
- Loading branch information
Showing
7 changed files
with
124 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,30 @@ | ||
#!/bin/bash | ||
|
||
# This script implements a lint that ensures that the src/ subtree | ||
# maintains the build invariant that there are no binary builds of | ||
# @cargo-messages packages in any node_modules subtree, which is a | ||
# requirement for ncc to codegen its require() calls correctly. | ||
|
||
mydir=$(dirname $0) | ||
cd $mydir/../.. | ||
|
||
dirty_subtrees=() | ||
|
||
for subtree in ./src ./src/cli ; do | ||
if [ -d $subtree/node_modules/@cargo-messages ]; then | ||
read -a binaries <<< $(ls -1 $subtree/node_modules/@cargo-messages) | ||
if [[ ${#binaries[@]} -gt 0 ]]; then | ||
echo "❌ $subtree installation contains binary @cargo-messages packages" | ||
dirty_subtrees+=($subtree) | ||
fi | ||
fi | ||
done | ||
|
||
if [[ ${#dirty_subtrees[@]} -gt 0 ]]; then | ||
echo | ||
echo 'The src/ tree installation contains binary @cargo-messages packages.' | ||
echo 'This will lead to invalid code generation when running `npm run dist`.' | ||
echo 'Delete the node_modules trees in the detected subtrees and rerun the' | ||
echo 'installation.' | ||
exit 1 | ||
fi |