Files
poli0981-dev/package.json
T
poli0981andClaude Opus 5 32f1272377 chore(ci): pin actions to SHAs, add weekly OSV scan, enforce install-script allowlist
Three supply-chain gaps, two of which the repo already claimed to have closed.

1. Actions were pinned to floating tags (`actions/checkout@v7`). A tag is mutable,
   so CI executed whatever that tag pointed at on the day it ran. Now pinned to
   commit SHAs with the version in a trailing comment; the existing
   github-actions Dependabot ecosystem keeps both in sync.

2. Weekly OSV scan (.github/workflows/osv-scanner.yml). docs 06 §6 and 08 §2 both
   require one and none existed. It complements the per-PR audit gate: `npm audit
   --omit=dev --audit-level=high` only sees the production tree and only fails on
   high+, while OSV covers the whole lockfile against the full database. Also runs
   on PRs that touch package-lock.json so a bad bump is caught on the PR instead of
   up to a week later.

   It runs the scanner directly rather than the reusable SARIF workflow, because
   SARIF upload needs `security-events: write` plus code scanning, which this plan
   does not have. A non-zero exit failing the run is the alert. Switch to the
   reusable workflow once the repo is public and code scanning is free.

   osv-scanner.toml carries one suppression: gray-matter -> js-yaml@3.15.0
   (GHSA-5p4m-2wfm-xmqj), which has no patched 3.x and only ever parses our own
   committed frontmatter at build time. It has an `untilDate` so it expires and
   gets re-argued rather than becoming permanent.

3. Install-script hardening. `.npmrc` asserted "ignore-scripts is applied in CI"
   and that sharp needed scripts. Both were false: ci.yml never set it, and
   sharp@0.35 ships prebuilt @img/sharp-* binaries with no install script at all.
   Replaced with npm 11's allowlist model, which is what docs 06 §6 actually asks
   for: package.json#allowScripts names the four packages that legitimately have
   install scripts (esbuild, workerd, lefthook, fsevents) and .npmrc sets
   strict-allow-scripts so anything unreviewed is a hard failure.

   Verified in a clean directory: with strict on and esbuild NOT allow-listed,
   `npm install` exits 1 with ESTRICTALLOWSCRIPTS; with it allow-listed, it
   succeeds. A dependency that suddenly grows a postinstall now stops the build
   instead of executing it.

Also: job-level `permissions:` on the build job, and dependabot.yml's stale note
about /workers/widgets corrected — the worker exists now; it is skipped because it
is deliberately dependency-free and has no manifest to read.

Verified: prettier, eslint, astro check (0 errors), knip, build + CSP guard, audit
gate all green; `npm ci --dry-run` confirms lockfile and package.json stay in sync.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 00:41:04 +07:00

76 lines
2.1 KiB
JSON

{
"name": "poli0981-dev",
"type": "module",
"version": "0.0.0",
"private": true,
"license": "SEE LICENSE IN LICENSE",
"engines": {
"node": ">=24"
},
"allowScripts": {
"esbuild": true,
"workerd": true,
"lefthook": true,
"fsevents": true
},
"scripts": {
"dev": "astro dev",
"build": "astro build && node scripts/gen-og.mjs && pagefind --site dist/client && node scripts/check-csp-hashes.mjs",
"check-csp": "node scripts/check-csp-hashes.mjs",
"gen-og": "node scripts/gen-og.mjs",
"preview": "astro preview",
"astro": "astro",
"check": "astro check",
"lint": "eslint .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"knip": "knip",
"deploy": "wrangler deploy --config ./dist/server/wrangler.json",
"gen-demo-gallery": "node scripts/gen-demo-gallery.mjs",
"strip-exif": "node scripts/strip-exif.mjs",
"check-exif": "node scripts/check-exif.mjs"
},
"overrides": {
"undici": "^7.29.0",
"fast-uri": "^3.1.5",
"postcss": "^8.5.26",
"nanoid": "^3.3.18",
"js-yaml@^4": "^4.3.1"
},
"dependencies": {
"@astrojs/cloudflare": "^14.1.3",
"@astrojs/mdx": "^7.0.3",
"@astrojs/rss": "^4.0.19",
"@astrojs/sitemap": "^3.7.3",
"@astrojs/svelte": "^9.0.1",
"@tailwindcss/vite": "^4.3.3",
"astro": "^7.1.1",
"sharp": "^0.35.3",
"svelte": "^5.56.6",
"tailwindcss": "^4.3.3",
"zod": "^4.4.3"
},
"devDependencies": {
"@astrojs/check": "^0.9.9",
"@resvg/resvg-js": "^2.6.2",
"@types/node": "^26.1.1",
"eslint": "^10.7.0",
"eslint-plugin-astro": "^3.0.1",
"eslint-plugin-svelte": "^3.21.0",
"exifr": "^7.1.3",
"gray-matter": "^4.0.3",
"knip": "^6.27.0",
"lefthook": "^2.1.10",
"pagefind": "^1.5.2",
"prettier": "^3.9.5",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-svelte": "^4.1.1",
"prettier-plugin-tailwindcss": "^0.8.1",
"satori": "^0.28.0",
"satori-html": "^0.3.2",
"typescript": "~6.0.3",
"typescript-eslint": "^8.64.0",
"wrangler": "^4.120.0"
}
}