@@ -1011,6 +1011,46 @@ Then run the locally generated `hookdeck-cli` binary:
10111011./hookdeck-cli
10121012```
10131013
1014+ ### Testing the npm package build
1015+
1016+ To test the npm package build process locally (including the wrapper script), you can use the automated test script:
1017+
1018+ ``` sh
1019+ # Run the automated test script (recommended)
1020+ ./test-scripts/test-npm-build.sh
1021+ ```
1022+
1023+ The test script will:
1024+ - Build all 6 platform binaries using GoReleaser
1025+ - Verify the binaries directory structure
1026+ - Test the wrapper script on your current platform
1027+ - Verify npm pack includes all required files
1028+
1029+ ** Manual testing (if you prefer step-by-step):**
1030+
1031+ ``` sh
1032+ # Install GoReleaser (if not already installed)
1033+ # Option 1: Using Homebrew (recommended on macOS)
1034+ brew install goreleaser
1035+
1036+ # Option 2: Download binary from GitHub releases
1037+ # Visit https://github.com/goreleaser/goreleaser/releases/latest
1038+
1039+ # Build all platform binaries for npm
1040+ goreleaser build -f .goreleaser/npm.yml --snapshot --clean
1041+
1042+ # Verify binaries directory structure
1043+ ls -R binaries/
1044+
1045+ # Test the wrapper script on your platform
1046+ node bin/hookdeck.js --version
1047+
1048+ # Test npm package creation (dry-run)
1049+ npm pack --dry-run
1050+ ```
1051+
1052+ This will create the ` binaries/ ` directory with all 6 platform binaries, allowing you to test the wrapper script locally before publishing.
1053+
10141054## Testing
10151055
10161056### Running Acceptance Tests
@@ -1045,6 +1085,36 @@ In CI environments, set the `HOOKDECK_CLI_TESTING_API_KEY` environment variable
10451085
10461086For detailed testing documentation and troubleshooting, see [ ` test/acceptance/README.md ` ] ( test/acceptance/README.md ) .
10471087
1088+ ### Testing npm package and wrapper script
1089+
1090+ The npm package includes a wrapper script (` bin/hookdeck.js ` ) that detects the platform and executes the correct binary.
1091+
1092+ ** Quick test (using automated script):**
1093+
1094+ ``` sh
1095+ ./test-scripts/test-npm-build.sh
1096+ ```
1097+
1098+ ** Manual testing:**
1099+
1100+ ``` sh
1101+ # Ensure GoReleaser is installed (see "Testing the npm package build" section above)
1102+
1103+ # Build all platform binaries
1104+ goreleaser build -f .goreleaser/npm.yml --snapshot --clean
1105+
1106+ # Test wrapper script on current platform
1107+ node bin/hookdeck.js version
1108+
1109+ # Verify wrapper script can find binary
1110+ node bin/hookdeck.js --help
1111+
1112+ # Test npm pack includes all files
1113+ npm pack --dry-run | grep -E " (bin/hookdeck.js|binaries/)"
1114+ ```
1115+
1116+ ** Note:** The wrapper script expects binaries in ` binaries/{platform}-{arch}/hookdeck[.exe] ` . When building locally, ensure all platforms are built or the wrapper will fail for missing platforms.
1117+
10481118### Testing against a local API
10491119
10501120When testing against a non-production Hookdeck API, you can use the
0 commit comments