|
| 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 | +- **Single package** (not a monorepo, no `packages/` directory) |
| 29 | +- Has both `dependencies` and `devDependencies` (published package) |
| 30 | +- Runtime deps: `@socketregistry/packageurl-js`, `@socketsecurity/lib`, `form-data` |
| 31 | +- Dependencies pinned to exact versions in `package.json` |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Files Changed After Update |
| 36 | + |
| 37 | +- `package.json` - Dependency version pins (both deps and devDeps) |
| 38 | +- `pnpm-lock.yaml` - Lock file |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## Validation Commands |
| 43 | + |
| 44 | +```bash |
| 45 | +# Fix lint issues |
| 46 | +pnpm run fix --all |
| 47 | + |
| 48 | +# Run all checks (lint + type check) |
| 49 | +pnpm run check --all |
| 50 | + |
| 51 | +# Run tests |
| 52 | +pnpm test |
| 53 | +``` |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## Troubleshooting |
| 58 | + |
| 59 | +### taze Fails to Detect Updates |
| 60 | + |
| 61 | +**Cause:** taze has a maturity period for new releases. |
| 62 | +**Solution:** Socket packages are force-updated separately via `pnpm update --latest`. |
| 63 | + |
| 64 | +### Lock File Conflicts |
| 65 | + |
| 66 | +**Solution:** |
| 67 | +```bash |
| 68 | +rm pnpm-lock.yaml |
| 69 | +pnpm install |
| 70 | +``` |
| 71 | + |
| 72 | +### SDK Regeneration |
| 73 | + |
| 74 | +If `@socketsecurity/lib` is updated, the generated SDK types may need |
| 75 | +regeneration via `pnpm run generate-sdk`. Check if API types in `types/` |
| 76 | +are still valid after updating. |
0 commit comments