From 3255ae3cb146baf04465a273a755ba9a5024588a Mon Sep 17 00:00:00 2001 From: David Herman Date: Sun, 24 Mar 2024 09:57:35 -0700 Subject: [PATCH] bump cli's cargo-messages to latest and attach src hygiene lint to dist --- check-src-pollution.sh | 12 ------- dist/cli/package.json | 14 ++++---- dist/package-lock.json | 76 +++++++++++++++++++-------------------- package.json | 2 +- src/cli/package.json | 16 ++++----- src/package-lock.json | 80 +++++++++++++++++++++--------------------- test/lint/check-src.sh | 30 ++++++++++++++++ 7 files changed, 124 insertions(+), 106 deletions(-) delete mode 100755 check-src-pollution.sh create mode 100755 test/lint/check-src.sh diff --git a/check-src-pollution.sh b/check-src-pollution.sh deleted file mode 100755 index eb73d3f7..00000000 --- a/check-src-pollution.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -mydir=$(dirname $0) -cd $mydir - -if [ -d ./src/node_modules/@cargo-messages ]; then - read -a pollution <<< `ls -1 ./src/node_modules/@cargo-messages` - - if [[ ${#pollution[@]} -gt 0 ]] ; then - echo "❌ ./src/node_modules/@cargo-messages is polluted" 1>&2 - fi -fi diff --git a/dist/cli/package.json b/dist/cli/package.json index 53767987..269feb49 100644 --- a/dist/cli/package.json +++ b/dist/cli/package.json @@ -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" } } diff --git a/dist/package-lock.json b/dist/package-lock.json index 2a344c64..05e9ad11 100644 --- a/dist/package-lock.json +++ b/dist/package-lock.json @@ -20,19 +20,22 @@ "neon": "index.js" }, "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" } }, - "cli/node_modules/@cargo-messages/android-arm-eabi": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/android-arm-eabi/-/android-arm-eabi-0.1.27.tgz", - "integrity": "sha512-/1eV/HutrsL42JcIwr1gGBFGqEKF6vWysTky/+bJ3jZj4loPOx+mee4nC2stbKqg2o5DvaTa52SdQ5GGKY/puw==", + "install": { + "version": "0.1.48" + }, + "node_modules/@cargo-messages/android-arm-eabi": { + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/android-arm-eabi/-/android-arm-eabi-0.1.48.tgz", + "integrity": "sha512-JYzb46KlcQZGI95EzmFCQNbMkpU5LlVmspQqtP1hve/ZCsWl4fl7MCgf3Drlejnd62LwqnlugplVplBLTWcq8A==", "cpu": [ "arm" ], @@ -41,10 +44,10 @@ "android" ] }, - "cli/node_modules/@cargo-messages/darwin-arm64": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-arm64/-/darwin-arm64-0.1.27.tgz", - "integrity": "sha512-fIaxPxB3AquFhFm69jY8kNE5a4wdfa9AczC9JqfIwJlWWXklyHi67GxRzWegj5IIBUtXVQV9fY5XkXDPVKiayw==", + "node_modules/@cargo-messages/darwin-arm64": { + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-arm64/-/darwin-arm64-0.1.48.tgz", + "integrity": "sha512-lI7gcvq5wdzNyJqwPGUKPkkIUSmQjJjOmLeIHbMBNvtsF84kVGZeC6H6CqfIskZy/FG7GZvP0jc1yhfmny/UtQ==", "cpu": [ "arm64" ], @@ -53,10 +56,10 @@ "darwin" ] }, - "cli/node_modules/@cargo-messages/darwin-x64": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-x64/-/darwin-x64-0.1.27.tgz", - "integrity": "sha512-tgw96Y9d48Xgw8jzZpQw6+2lqZao19B6bgDgf6EOt5RncgqpWWagW8Xb/vaDmspId1B13Kklpvf1Be7m9ekbDA==", + "node_modules/@cargo-messages/darwin-x64": { + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-x64/-/darwin-x64-0.1.48.tgz", + "integrity": "sha512-HpGDsFwCjnjnK0o7piShrohNDvWQQT9uQ20RKkxa9+HbDVXOB19u67DhjTpPJyNgBH/a20ntoTi8tPtoJTKoFQ==", "cpu": [ "x64" ], @@ -65,10 +68,10 @@ "darwin" ] }, - "cli/node_modules/@cargo-messages/linux-arm-gnueabihf": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm-gnueabihf/-/linux-arm-gnueabihf-0.1.27.tgz", - "integrity": "sha512-tEO40PJzcmGnSZoPjALocdm1HNtVk5hmp/U+7AEPtkhsYshdG2ke/x7acpUBSBjUr2WoL9sQSutV4pCVOQhVMw==", + "node_modules/@cargo-messages/linux-arm-gnueabihf": { + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm-gnueabihf/-/linux-arm-gnueabihf-0.1.48.tgz", + "integrity": "sha512-5h4iAxPDHujDEqVMKz04ypsLodXjWBXqnxBzaFqIHzZ8JhF5V3LlRlq2g01teFbcP7hB+kf+b96yWY3UGBYX8Q==", "cpu": [ "arm" ], @@ -77,10 +80,10 @@ "linux" ] }, - "cli/node_modules/@cargo-messages/linux-x64-gnu": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-gnu/-/linux-x64-gnu-0.1.27.tgz", - "integrity": "sha512-jkfoHvaHQIXAUPZe5F9jL+Kg0grJ7AHKZK24al2PipfsE5EzaozjQINV25HvB096s+F+2k9ny3VOehn7rXiVeg==", + "node_modules/@cargo-messages/linux-x64-gnu": { + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-gnu/-/linux-x64-gnu-0.1.48.tgz", + "integrity": "sha512-r+q11WLOFgJf7Ck/aBjPSmCUPwjMk/acQ2k5KCCiFpBEHoqMkqH0vWfEFRQygzV9mZqNm+DL/feHBlrRfVtbHQ==", "cpu": [ "x64" ], @@ -89,10 +92,10 @@ "linux" ] }, - "cli/node_modules/@cargo-messages/win32-arm64-msvc": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/win32-arm64-msvc/-/win32-arm64-msvc-0.1.27.tgz", - "integrity": "sha512-1AZ+GR1iWa50Pt6D2JTmzcZ5LHFf5X2tXl+fOq7ASpBKIB4qg070nEtON2YxyYAyH7Rv+/QRBQmE6yeBfIlpWA==", + "node_modules/@cargo-messages/win32-arm64-msvc": { + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-arm64-msvc/-/win32-arm64-msvc-0.1.48.tgz", + "integrity": "sha512-qbdvkfBd85cEwsz91bqQunMdq1BlMzPwTh68gSot1VOxA9KhuB4/ZW4V8l4oxC+N84VO1iX/Us+2OEvvv5y0oQ==", "cpu": [ "arm64" ], @@ -101,10 +104,10 @@ "win32" ] }, - "cli/node_modules/@cargo-messages/win32-x64-msvc": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/win32-x64-msvc/-/win32-x64-msvc-0.1.27.tgz", - "integrity": "sha512-V1qnHu5cRV8VjRZIoudIiZEBHJKyVKshJRk76ys3EUhfJnNCZyL72B1SIkmBS/mZkkMFgu/qz27B/9zJkzHgvw==", + "node_modules/@cargo-messages/win32-x64-msvc": { + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-x64-msvc/-/win32-x64-msvc-0.1.48.tgz", + "integrity": "sha512-diw0rOYjWFq2MSusgzRDTBvsg8LBonEDfjNs1jl07mS434PYYVyLxmYKVhp4u41ii9LVoF4KAor1f2ON7WkZkA==", "cpu": [ "x64" ], @@ -113,9 +116,6 @@ "win32" ] }, - "install": { - "version": "0.1.48" - }, "node_modules/@neon-rs/cli": { "resolved": "cli", "link": true diff --git a/package.json b/package.json index bbbb23b9..4020b939 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/cli/package.json b/src/cli/package.json index c74ba6cf..4e694939 100644 --- a/src/cli/package.json +++ b/src/cli/package.json @@ -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", @@ -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" } } diff --git a/src/package-lock.json b/src/package-lock.json index ce492200..55a15551 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -31,7 +31,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", @@ -57,19 +57,19 @@ "typescript": "^5.0.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" } }, "cli/node_modules/@cargo-messages/android-arm-eabi": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/android-arm-eabi/-/android-arm-eabi-0.1.27.tgz", - "integrity": "sha512-/1eV/HutrsL42JcIwr1gGBFGqEKF6vWysTky/+bJ3jZj4loPOx+mee4nC2stbKqg2o5DvaTa52SdQ5GGKY/puw==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/android-arm-eabi/-/android-arm-eabi-0.1.48.tgz", + "integrity": "sha512-JYzb46KlcQZGI95EzmFCQNbMkpU5LlVmspQqtP1hve/ZCsWl4fl7MCgf3Drlejnd62LwqnlugplVplBLTWcq8A==", "cpu": [ "arm" ], @@ -79,9 +79,9 @@ ] }, "cli/node_modules/@cargo-messages/darwin-arm64": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-arm64/-/darwin-arm64-0.1.27.tgz", - "integrity": "sha512-fIaxPxB3AquFhFm69jY8kNE5a4wdfa9AczC9JqfIwJlWWXklyHi67GxRzWegj5IIBUtXVQV9fY5XkXDPVKiayw==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-arm64/-/darwin-arm64-0.1.48.tgz", + "integrity": "sha512-lI7gcvq5wdzNyJqwPGUKPkkIUSmQjJjOmLeIHbMBNvtsF84kVGZeC6H6CqfIskZy/FG7GZvP0jc1yhfmny/UtQ==", "cpu": [ "arm64" ], @@ -91,9 +91,9 @@ ] }, "cli/node_modules/@cargo-messages/darwin-x64": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-x64/-/darwin-x64-0.1.27.tgz", - "integrity": "sha512-tgw96Y9d48Xgw8jzZpQw6+2lqZao19B6bgDgf6EOt5RncgqpWWagW8Xb/vaDmspId1B13Kklpvf1Be7m9ekbDA==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-x64/-/darwin-x64-0.1.48.tgz", + "integrity": "sha512-HpGDsFwCjnjnK0o7piShrohNDvWQQT9uQ20RKkxa9+HbDVXOB19u67DhjTpPJyNgBH/a20ntoTi8tPtoJTKoFQ==", "cpu": [ "x64" ], @@ -103,9 +103,9 @@ ] }, "cli/node_modules/@cargo-messages/linux-arm-gnueabihf": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm-gnueabihf/-/linux-arm-gnueabihf-0.1.27.tgz", - "integrity": "sha512-tEO40PJzcmGnSZoPjALocdm1HNtVk5hmp/U+7AEPtkhsYshdG2ke/x7acpUBSBjUr2WoL9sQSutV4pCVOQhVMw==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm-gnueabihf/-/linux-arm-gnueabihf-0.1.48.tgz", + "integrity": "sha512-5h4iAxPDHujDEqVMKz04ypsLodXjWBXqnxBzaFqIHzZ8JhF5V3LlRlq2g01teFbcP7hB+kf+b96yWY3UGBYX8Q==", "cpu": [ "arm" ], @@ -115,9 +115,9 @@ ] }, "cli/node_modules/@cargo-messages/linux-x64-gnu": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-gnu/-/linux-x64-gnu-0.1.27.tgz", - "integrity": "sha512-jkfoHvaHQIXAUPZe5F9jL+Kg0grJ7AHKZK24al2PipfsE5EzaozjQINV25HvB096s+F+2k9ny3VOehn7rXiVeg==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-gnu/-/linux-x64-gnu-0.1.48.tgz", + "integrity": "sha512-r+q11WLOFgJf7Ck/aBjPSmCUPwjMk/acQ2k5KCCiFpBEHoqMkqH0vWfEFRQygzV9mZqNm+DL/feHBlrRfVtbHQ==", "cpu": [ "x64" ], @@ -127,9 +127,9 @@ ] }, "cli/node_modules/@cargo-messages/win32-arm64-msvc": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/win32-arm64-msvc/-/win32-arm64-msvc-0.1.27.tgz", - "integrity": "sha512-1AZ+GR1iWa50Pt6D2JTmzcZ5LHFf5X2tXl+fOq7ASpBKIB4qg070nEtON2YxyYAyH7Rv+/QRBQmE6yeBfIlpWA==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-arm64-msvc/-/win32-arm64-msvc-0.1.48.tgz", + "integrity": "sha512-qbdvkfBd85cEwsz91bqQunMdq1BlMzPwTh68gSot1VOxA9KhuB4/ZW4V8l4oxC+N84VO1iX/Us+2OEvvv5y0oQ==", "cpu": [ "arm64" ], @@ -139,9 +139,9 @@ ] }, "cli/node_modules/@cargo-messages/win32-x64-msvc": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/@cargo-messages/win32-x64-msvc/-/win32-x64-msvc-0.1.27.tgz", - "integrity": "sha512-V1qnHu5cRV8VjRZIoudIiZEBHJKyVKshJRk76ys3EUhfJnNCZyL72B1SIkmBS/mZkkMFgu/qz27B/9zJkzHgvw==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-x64-msvc/-/win32-x64-msvc-0.1.48.tgz", + "integrity": "sha512-diw0rOYjWFq2MSusgzRDTBvsg8LBonEDfjNs1jl07mS434PYYVyLxmYKVhp4u41ii9LVoF4KAor1f2ON7WkZkA==", "cpu": [ "x64" ], @@ -156,20 +156,20 @@ "integrity": "sha512-teRPDgstiKQE91WsvnW4mAdTSEPUdi9a8b98IPVhm2R5MT1elzxeTFidP56JfqtzocZFYDetCwEcPB3xCIR4pg==" }, "cli/node_modules/cargo-messages": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/cargo-messages/-/cargo-messages-0.1.27.tgz", - "integrity": "sha512-5OewDrBZim9+fEjx1qRAXPT0SjDo7X3/4stdSEfNcjzcvRA+Mq0HjVNxYg9XV1FYwtMdkk2xrst/HaEGSjlbFA==", + "version": "0.1.48", + "resolved": "https://registry.npmjs.org/cargo-messages/-/cargo-messages-0.1.48.tgz", + "integrity": "sha512-ewYwq9rXfZAZKs6bqQCAzW1Fmb2KrQX/nHcj7TziqPCC7I5xCTV8nZtQNT37YCw2l2pu1u8xf1mlP75UM9GPzg==", "dependencies": { - "@neon-rs/load": "^0.1.17" + "@neon-rs/load": "0.1.17" }, "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" } }, "cli/node_modules/cargo-messages/node_modules/@neon-rs/load": { diff --git a/test/lint/check-src.sh b/test/lint/check-src.sh new file mode 100755 index 00000000..c90d8413 --- /dev/null +++ b/test/lint/check-src.sh @@ -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