Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ jobs:
- name: Clean and Build
run: npm run build

- name: Verify package contents
run: |
if [ ! -f lib/index.js ]; then
echo "Error: lib/index.js missing after build. Refusing to publish."
exit 1
fi

# Ensure the tarball includes the compiled entrypoint and excludes TypeScript sources
PACK_LIST=$(npm pack --dry-run 2>&1)
echo "$PACK_LIST"
echo "$PACK_LIST" | grep -q 'lib/index.js' || { echo "Error: lib/index.js not in package tarball."; exit 1; }
echo "$PACK_LIST" | grep -q 'src/' && { echo "Error: TypeScript src/ must not be published."; exit 1; } || true
echo "$PACK_LIST" | grep -q 'contracts/' || { echo "Error: contracts/ missing from package tarball."; exit 1; }
echo "Package contents look correct ✅"

- name: Publish Package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@
"bin": {
"wire-cli": "lib/index.js"
},
"files": [
"lib",
"contracts",
"blockproducer",
"chain-api",
"bp-relay"
],
"scripts": {
"test": "jest",
"start": "tsc && node bin/index.js",
"start": "tsc && node lib/index.js",
"build": "tsc",
"watch": "tsc -w"
"watch": "tsc -w",
"prepublishOnly": "npm run build"
},
"keywords": [],
"author": "Svetla Syrimis",
Expand Down