Skip to content

Commit 9aa24cf

Browse files
authored
fix(app): publish only dist in npm tarball (#85)
1 parent 6d71842 commit 9aa24cf

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/app/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"bin": {
77
"docker-git": "dist/src/docker-git/main.js"
88
},
9+
"files": [
10+
"dist"
11+
],
912
"directories": {
1013
"doc": "doc"
1114
},

scripts/e2e/local-package-cli.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ KEEP="${KEEP:-0}"
1111

1212
PACK_LOG="$ROOT/npm-pack.log"
1313
HELP_LOG="$ROOT/docker-git-help.log"
14+
TAR_LIST="$ROOT/tar-list.txt"
1415
PACKED_TARBALL=""
1516

1617
fail() {
@@ -53,6 +54,20 @@ tarball_name="$(tail -n 1 "$PACK_LOG" | tr -d '\r')"
5354
PACKED_TARBALL="$REPO_ROOT/packages/app/$tarball_name"
5455
[[ -f "$PACKED_TARBALL" ]] || fail "packed tarball not found: $PACKED_TARBALL"
5556

57+
tar -tf "$PACKED_TARBALL" >"$TAR_LIST"
58+
while IFS= read -r entry; do
59+
case "$entry" in
60+
package/package.json|package/README*|package/LICENSE*|package/CHANGELOG*|package/dist/*)
61+
;;
62+
*)
63+
fail "unexpected file in packed tarball: $entry"
64+
;;
65+
esac
66+
done <"$TAR_LIST"
67+
68+
grep -Fxq "package/dist/src/docker-git/main.js" "$TAR_LIST" \
69+
|| fail "packed tarball does not include dist/src/docker-git/main.js"
70+
5671
dep_keys="$(tar -xOf "$PACKED_TARBALL" package/package.json | node -e 'let s="";process.stdin.on("data",(c)=>{s+=c});process.stdin.on("end",()=>{const pkg=JSON.parse(s);const deps=Object.keys(pkg.dependencies ?? {});if (deps.includes("@effect-template/lib")) {console.error("@effect-template/lib must not be a runtime dependency in packed package");process.exit(1)}process.stdout.write(deps.join(","));});')"
5772
[[ "$dep_keys" == *"effect"* ]] || fail "packed dependency set looks invalid: $dep_keys"
5873

0 commit comments

Comments
 (0)