Skip to content

Commit 320de49

Browse files
Merge pull request #33 from script-development/armorer/m1-moderate-remediation
fs-packages M1 moderate remediation (Armorer)
2 parents 9c32733 + 1b21f18 commit 320de49

11 files changed

Lines changed: 42 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,36 @@ jobs:
4343
name: build-output
4444
path: packages
4545
- run: npm ci --ignore-scripts
46+
- name: Validate dist artifacts
47+
shell: bash
48+
run: |
49+
set -euo pipefail
50+
REQUIRED=("dist/index.mjs" "dist/index.cjs" "dist/index.d.mts" "dist/index.d.cts")
51+
FAILED=0
52+
for pkg_dir in packages/*/; do
53+
pkg_name=$(node -p "require('./${pkg_dir}package.json').name")
54+
pack_json=$(cd "$pkg_dir" && npm pack --dry-run --json 2>/dev/null)
55+
for required in "${REQUIRED[@]}"; do
56+
size=$(node -e "
57+
const files = JSON.parse(process.argv[1])[0].files;
58+
const f = files.find(e => e.path === process.argv[2]);
59+
if (!f) { console.log('MISSING'); process.exit(0); }
60+
console.log(f.size);
61+
" "$pack_json" "$required")
62+
if [ "$size" = "MISSING" ]; then
63+
echo "::error::${pkg_name} is missing ${required} in published tarball"
64+
FAILED=1
65+
elif [ "$size" = "0" ]; then
66+
echo "::error::${pkg_name} ${required} is 0 bytes"
67+
FAILED=1
68+
fi
69+
done
70+
done
71+
if [ "$FAILED" = "1" ]; then
72+
echo "Pre-publish dist validation failed. Refusing to publish empty or incomplete tarballs."
73+
exit 1
74+
fi
75+
echo "All packages validated: required dist/ artifacts present and non-empty."
4676
- run: npx changeset publish
4777
env:
4878
NPM_CONFIG_PROVENANCE: "true"

packages/adapter-store/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/adapter-store"
1111
},
1212
"files": [

packages/dialog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/dialog"
1111
},
1212
"files": [

packages/helpers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/helpers"
1111
},
1212
"files": [

packages/http/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/http"
1111
},
1212
"files": [

packages/loading/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/loading"
1111
},
1212
"files": [

packages/router/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/router"
1111
},
1212
"files": [
@@ -43,11 +43,11 @@
4343
"devDependencies": {
4444
"@vue/test-utils": "^2.4.6",
4545
"happy-dom": "^20.9.0",
46-
"vue": "^3.5.0",
46+
"vue": "^3.5.32",
4747
"vue-router": "^5.0.4"
4848
},
4949
"peerDependencies": {
50-
"vue": "^3.5.0",
50+
"vue": "^3.5.32",
5151
"vue-router": "^5.0.4"
5252
}
5353
}

packages/storage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/storage"
1111
},
1212
"files": [

packages/theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/theme"
1111
},
1212
"files": [

packages/toast/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/script-development/fs-packages.git",
9+
"url": "git+https://github.com/script-development/fs-packages.git",
1010
"directory": "packages/toast"
1111
},
1212
"files": [

0 commit comments

Comments
 (0)