Commit Graph
5 Commits
Author SHA1 Message Date
supabase-vercel-tedd[bot] 4ea48d0e2a fix(scripts): keep fix-audit-vulnerability --json stdout parseable (#52987)
## Problem

`scripts/fix-audit-vulnerability.ts --json` is meant to print a single
JSON object to stdout. In practice, after any failed fix attempt, the
next run printed pnpm install output (`Scope: all 31 workspace
projects`, `Lockfile is up to date...`, `Done in ...`) before the JSON,
so `JSON.parse(stdout)` failed.

The script itself already routes its logs to stderr and pipes every
`execSync`. The extra output comes from pnpm: when a failed attempt is
reverted, the script restores `pnpm-lock.yaml` / `pnpm-workspace.yaml`
from a snapshot but leaves `node_modules` on the bumped versions. On the
next `pnpm tsx ...` call, pnpm sees `node_modules` out of sync with the
lockfile, runs an install before starting the script, and prints it to
stdout.

## Solution

- Add `syncNodeModules()` to `scripts/bump-package.ts`. It runs `pnpm
install --frozen-lockfile --silent` with piped output, and only logs a
warning to stderr if it fails.
- Call it after every revert: in `bumpPackage`'s `revert()` and in the
three lockfile-restore paths of `fixModule` in
`scripts/fix-audit-vulnerability.ts`. `node_modules` now matches the
restored lockfile after a failed attempt.
- Recommend `pnpm --silent tsx ...` in the usage text. Even when
`node_modules` is out of sync for another reason (a fresh pull, for
example), `--silent` keeps pnpm's own output off stdout.

## Review instructions

No UI. Verify from the repo root:

1. Run `pnpm tsx scripts/fix-audit-vulnerability.ts --json 2>/dev/null |
node -e 'JSON.parse(require("fs").readFileSync(0,"utf8"))'` and confirm
it exits 0.
2. Pick a dependency from that list that the script cannot fix (it
returns `still_vulnerable`), and run `pnpm tsx
scripts/fix-audit-vulnerability.ts <dep> --json 2>/dev/null` twice. Both
runs print only a JSON object to stdout.
3. After the failed attempt, `git status` shows no change to
`pnpm-lock.yaml` or `pnpm-workspace.yaml`, and `pnpm install
--frozen-lockfile` reports `Already up to date`.
4. `touch pnpm-lock.yaml && pnpm --silent tsx
scripts/fix-audit-vulnerability.ts --json 2>/dev/null` still parses as
JSON.
5. Progress logs still appear on stderr.

Checks run: the steps above, end to end; Prettier on both files; `tsc
--noEmit` on both files shows only an existing error at the final
`result.status` access in `main()`, which master also has. `turbo
typecheck`/`lint` pass but cover no package, because root `scripts/` is
not a workspace package.

## Checklist

Check all before review:

- [ ] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)


[FE-4918](https://linear.app/supabase/issue/FE-4918/bump-a-single-vulnerable-dependency)

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-11-05 17:25:28 +01:00
Ivan VasilovandClaude Sonnet 5.5 075c611463 chore: bump vulnerable dependencies (#51381)
## Summary

- Bumps vulnerable transitive dependencies flagged by `pnpm audit`, one
commit per dependency (lockfile only, no permanent overrides):
proxy-addr, shell-quote, @fastify/busboy,
@graphql-tools/executor-legacy-ws, @modelcontextprotocol/sdk,
compression, http-cache-semantics, source-map-js, smol-toml, dompurify.
- Updates `scripts/fix-audit-vulnerability.ts` to be agent-friendly:
accepts a dependency name argument, adds `--json` (single JSON object on
stdout, logs on stderr, never prompts) and `--help`.

## Not fixed

The remaining audit findings could not be resolved by this script. Some
are blocked by `minimumReleaseAge` (braces, node-forge, sprintf-js);
others stay vulnerable even with an override and need a parent
dependency update or scoped override.

## Test plan

- [ ] CI passes (typecheck, lint, prettier)
- [ ] `pnpm audit` shows fewer findings than on master

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 16:23:43 +02:00
Ivan Vasilov 83edf14a23 chore: Bump vulnerable dependencies (#44428)
This PR bumps various dependencies to fix vulnerabilities. 

The logic for bumping packages has been taken out of
`fix-audit-vulnerability` into a `bump-package` script.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Chores**
  * Removed unused development dependency from generator package
* Updated package version overrides and vulnerability management
configuration to address security concerns
* Enhanced internal package dependency maintenance tooling for improved
operational efficiency

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-01 13:10:37 +02:00
Ivan Vasilov e671676696 chore: Bump vulnerable dependencies (#44180)
Each dependency was bumped in its commit.
2026-03-25 14:02:11 +01:00
Ivan Vasilov b03866f023 chore: Bump vulnerable dependencies (#43148)
This pull request primarily updates dependencies across the project to
their latest versions, improving compatibility, security, and
performance. It also modifies configuration files to align with the
current package management setup.

Dependency upgrades (core libraries and tools):
Bumps dependencies to solve the following issues:
- https://github.com/supabase/supabase/security/dependabot/2855
- https://github.com/supabase/supabase/security/dependabot/2844
- https://github.com/supabase/supabase/security/dependabot/2860
- https://github.com/supabase/supabase/security/dependabot/2815
- https://github.com/supabase/supabase/security/dependabot/2774
- https://github.com/supabase/supabase/security/dependabot/2836
- https://github.com/supabase/supabase/security/dependabot/2816
- https://github.com/supabase/supabase/security/dependabot/2778
- https://github.com/supabase/supabase/security/dependabot/2790
- https://github.com/supabase/supabase/security/dependabot/2793

Configuration and lock file updates:

* Changed `.prettierignore` to ignore `pnpm-lock.yaml` instead of
`package-lock.json`, reflecting the switch to pnpm as the package
manager.
* Updated dependency overrides in `pnpm-lock.yaml` for `tar` and
`fast-xml-parser` to ensure consistent versions across the workspace.

These updates collectively ensure the project stays current with its
dependencies, reduces potential vulnerabilities, and improves overall
stability and maintainability.
2026-03-02 17:07:55 +01:00