diff --git a/.agent/docs/dependency-updates.md b/.agent/docs/dependency-updates.md new file mode 100644 index 0000000..d14c3ad --- /dev/null +++ b/.agent/docs/dependency-updates.md @@ -0,0 +1,19 @@ +# Dependency Updates Checklist + +Whenever any `package.json` (root, `client/`, or `sas/`) or lockfile is modified, run the same checks CI runs before pushing: + +1. **npm audit** (must be clean for prod deps): + ```bash + npm audit --omit=dev # in repo root + cd sas && npm audit --omit=dev + cd ../client && npm audit --omit=dev + ``` + Fix with `npm audit fix`, targeted `overrides` in `package.json`, or version bumps — never `npm audit fix --force` blindly, as it can introduce breaking changes. + +2. **License checker** (client only): + ```bash + cd client && npm run license-checker + ``` + If a new dependency fails, either add its SPDX id to the `onlyAllow` list in `client/licenseChecker.js` (if the license is acceptable, e.g. permissive ones like `BlueOak-1.0.0`) or add the specific package to `excludePackages` with justification. Data Controller ships on-prem, so only OSI-approved permissive licenses are acceptable for production dependencies. + +Both checks run in `.gitea/workflows/build.yaml` (`Check audit` and `Licence checker` steps) and will fail the build if skipped locally. diff --git a/client/licenseChecker.js b/client/licenseChecker.js index f0dd03f..294fab7 100644 --- a/client/licenseChecker.js +++ b/client/licenseChecker.js @@ -8,7 +8,7 @@ const check = (cwd) => { start: cwd, excludePrivatePackages: true, onlyAllow: - 'AFLv2.1;Apache 2.0;Apache-2.0;Apache*;Artistic-2.0;0BSD;BSD*;BSD-2-Clause;BSD-3-Clause;CC0-1.0;CC-BY-3.0;CC-BY-4.0;ISC;MIT;MPL-2.0;ODC-By-1.0;Python-2.0;Unlicense;', + 'AFLv2.1;Apache 2.0;Apache-2.0;Apache*;Artistic-2.0;BlueOak-1.0.0;0BSD;BSD*;BSD-2-Clause;BSD-3-Clause;CC0-1.0;CC-BY-3.0;CC-BY-4.0;ISC;MIT;MPL-2.0;ODC-By-1.0;Python-2.0;Unlicense;', excludePackages: '@cds/city@1.1.0;@handsontable/angular-wrapper@16.0.1;@handsontable/angular-wrapper@17.1.0;@handsontable/angular-wrapper@18.0.0;handsontable@^16.0.1;handsontable@16.2.0;handsontable@17.1.0;handsontable@18.0.0;hyperformula@2.7.1;hyperformula@3.0.0;hyperformula@3.1.0;hyperformula@3.2.0;hyperformula@3.3.0;jackspeak@3.4.3;path-scurry@1.11.1;package-json-from-dist@1.0.1;buffers@0.1.1' },