|
| 1 | +# updating Reference Documentation |
| 2 | + |
| 3 | +## Table of Contents |
| 4 | + |
| 5 | +1. [How the Update Script Works](#how-the-update-script-works) |
| 6 | +2. [Files Changed After Update](#files-changed-after-update) |
| 7 | +3. [Validation Commands](#validation-commands) |
| 8 | +4. [Troubleshooting](#troubleshooting) |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## How the Update Script Works |
| 13 | + |
| 14 | +`pnpm run update` runs `scripts/update.mjs` which performs: |
| 15 | + |
| 16 | +```bash |
| 17 | +# 1. Run taze recursively with write mode |
| 18 | +pnpm exec taze -r -w |
| 19 | + |
| 20 | +# 2. Force-update Socket scoped packages (bypasses taze maturity period) |
| 21 | +pnpm update @socketsecurity/* @socketregistry/* @socketbin/* --latest -r |
| 22 | + |
| 23 | +# 3. pnpm install runs automatically to reconcile lockfile |
| 24 | +``` |
| 25 | + |
| 26 | +### Repo Structure |
| 27 | + |
| 28 | +- **Monorepo** with pnpm workspaces: `packages/npm/*`, `perf/*`, `registry`, `scripts` |
| 29 | +- Uses `pnpm-workspace.yaml` catalog for centralized version management |
| 30 | +- Dependencies use `catalog:` references in package.json files |
| 31 | +- Has `pnpm.overrides` mapping many packages to `@socketregistry/*` replacements |
| 32 | +- Has `pnpm.patchedDependencies` for brace-expansion, iconv-lite, minimatch |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Files Changed After Update |
| 37 | + |
| 38 | +- `package.json` - Root dependency version pins |
| 39 | +- `pnpm-workspace.yaml` - Catalog version entries |
| 40 | +- `packages/npm/*/package.json` - Workspace package dependencies |
| 41 | +- `pnpm-lock.yaml` - Lock file |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Validation Commands |
| 46 | + |
| 47 | +```bash |
| 48 | +# Fix lint issues |
| 49 | +pnpm run fix --all |
| 50 | + |
| 51 | +# Run all checks (lint + type check) |
| 52 | +pnpm run check --all |
| 53 | + |
| 54 | +# Run tests |
| 55 | +pnpm test |
| 56 | +``` |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Troubleshooting |
| 61 | + |
| 62 | +### taze Fails to Detect Updates |
| 63 | + |
| 64 | +**Cause:** taze has a maturity period for new releases. |
| 65 | +**Solution:** Socket packages are force-updated separately via `pnpm update --latest`. |
| 66 | + |
| 67 | +### Catalog Version Mismatches |
| 68 | + |
| 69 | +**Symptom:** Workspace packages reference `catalog:` but version differs from |
| 70 | +what taze wrote to root `package.json`. |
| 71 | +**Solution:** Ensure `pnpm-workspace.yaml` catalog entries match. taze updates |
| 72 | +catalog entries directly when using `-r -w`. |
| 73 | + |
| 74 | +### Lock File Conflicts |
| 75 | + |
| 76 | +**Solution:** |
| 77 | +```bash |
| 78 | +rm pnpm-lock.yaml |
| 79 | +pnpm install |
| 80 | +``` |
0 commit comments