Fix the Dependabot alerts whose numbers are passed as arguments. If no numbers are given or the user asks for "all new" alerts, fetch all open ones:
gh api 'repos/zauberzeug/nicegui/dependabot/alerts?state=open'
Steps
Fetch each alert to identify the package, manifest path, and first patched version:
gh api repos/zauberzeug/nicegui/dependabot/alerts/<number>Try the minimal fix first —
npm update <pkg>inside the manifest's directory. If the existing semver range in the parent'spackage.jsonalready allows the patched version, this is enough andpackage.jsonstays untouched.Escalate to an npm override if the patched version is outside the declared range (common for transitive deps). Add the package to the
overridessection of the manifest'spackage.jsonwith a range that includes the patched version, then runnpm install.Rebuild if the element has a
dist/— runnpm run buildin the manifest's directory. Don't hand-revert thedist/changes; let pre-commit hooks normalize any whitespace-only noise (the end-of-file-fixer will handle source-map trailing newlines).Rebuild vendored core libraries if the root manifest changed — run
npm run buildin the repository root; it runsextract_core_libraries.pyto refreshnicegui/static/. Whitespace-only churn in unrelated static files is normalized away by the pre-commit hooks.Scan other lockfiles in the repo for the same vulnerable package — sometimes Dependabot is slow to raise the next alert:
find . -name 'package-lock.json' -not -path '*/node_modules/*' -not -path '*/.venv/*'Check each one for the package and apply the same fix if needed.
Check for other open alerts that might as well be bundled into the same commit:
gh api 'repos/zauberzeug/nicegui/dependabot/alerts?state=open'Regenerate
DEPENDENCIES.md— runpython3 summarize_dependencies.py; it rewrites the file from the resolved lockfile versions and belongs in the same commit.Confirm with the user before committing. Then commit with a message following the established style:
- Single alert:
fix Dependabot alert 252 - Multiple:
fix Dependabot alerts 250 and 251orfix Dependabot alerts 246, 247, 248 and 249
Reference alert numbers as plain integers, never as
#252— GitHub auto-links#Nto issues/PRs, which points to the wrong ticket.- Single alert:
Do not push unless the user explicitly asks.