Skip to content

Commit

Permalink
bump cli's cargo-messages to latest and attach src hygiene lint to dist
Browse files Browse the repository at this point in the history
  • Loading branch information
dherman committed Mar 24, 2024
1 parent 5df42e2 commit 3255ae3
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 106 deletions.
12 changes: 0 additions & 12 deletions check-src-pollution.sh

This file was deleted.

14 changes: 7 additions & 7 deletions dist/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
},
"homepage": "https://github.com/dherman/neon-rs#readme",
"optionalDependencies": {
"@cargo-messages/android-arm-eabi": "0.1.27",
"@cargo-messages/darwin-arm64": "0.1.27",
"@cargo-messages/darwin-x64": "0.1.27",
"@cargo-messages/linux-arm-gnueabihf": "0.1.27",
"@cargo-messages/linux-x64-gnu": "0.1.27",
"@cargo-messages/win32-arm64-msvc": "0.1.27",
"@cargo-messages/win32-x64-msvc": "0.1.27"
"@cargo-messages/android-arm-eabi": "0.1.48",
"@cargo-messages/darwin-arm64": "0.1.48",
"@cargo-messages/darwin-x64": "0.1.48",
"@cargo-messages/linux-arm-gnueabihf": "0.1.48",
"@cargo-messages/linux-x64-gnu": "0.1.48",
"@cargo-messages/win32-arm64-msvc": "0.1.48",
"@cargo-messages/win32-x64-msvc": "0.1.48"
}
}
76 changes: 38 additions & 38 deletions dist/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"workspaces": [],
"scripts": {
"postinstall": "node dist/install src --workspaces --omit=optional && node dist/install pkgs --workspaces && node dist/install dist --workspaces",
"dist": "cd src && npm run dist",
"dist": "bash ./test/lint/check-src.sh && cd src && npm run dist",
"version": "npm run version:src && npm run version:pkgs && npm run version:dist && npm run dist && git add .",
"version:src": "node dist/cli bump -d src",
"version:pkgs": "node dist/cli bump -d pkgs",
Expand Down
16 changes: 8 additions & 8 deletions src/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"dependencies": {
"@neon-rs/load": "^0.0.181",
"@neon-rs/manifest": "^0.0.5",
"cargo-messages": "0.1.27",
"cargo-messages": "^0.1.48",
"chalk": "^5.2.0",
"command-line-args": "^5.2.1",
"command-line-commands": "^3.0.2",
Expand All @@ -65,12 +65,12 @@
"temp": "^0.9.4"
},
"optionalDependencies": {
"@cargo-messages/android-arm-eabi": "0.1.27",
"@cargo-messages/darwin-arm64": "0.1.27",
"@cargo-messages/darwin-x64": "0.1.27",
"@cargo-messages/linux-arm-gnueabihf": "0.1.27",
"@cargo-messages/linux-x64-gnu": "0.1.27",
"@cargo-messages/win32-arm64-msvc": "0.1.27",
"@cargo-messages/win32-x64-msvc": "0.1.27"
"@cargo-messages/android-arm-eabi": "0.1.48",
"@cargo-messages/darwin-arm64": "0.1.48",
"@cargo-messages/darwin-x64": "0.1.48",
"@cargo-messages/linux-arm-gnueabihf": "0.1.48",
"@cargo-messages/linux-x64-gnu": "0.1.48",
"@cargo-messages/win32-arm64-msvc": "0.1.48",
"@cargo-messages/win32-x64-msvc": "0.1.48"
}
}
80 changes: 40 additions & 40 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions test/lint/check-src.sh
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

0 comments on commit 3255ae3

Please sign in to comment.