From 605065eec7184d8bb1ee9aef0b333b4b01f2325c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 2 Mar 2025 13:43:31 -0500 Subject: [PATCH] feat(update): add ability to pin npm packages for all package-locks --- apps/update-sources/src/node-modules.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/update-sources/src/node-modules.ts b/apps/update-sources/src/node-modules.ts index 9101c5ea..e676b6f3 100644 --- a/apps/update-sources/src/node-modules.ts +++ b/apps/update-sources/src/node-modules.ts @@ -8,6 +8,8 @@ import { replaceInFile, npmRun } from './lib'; /* Constants */ const FLAKE = process.env.FLAKE as string; +const PINS = new Map([]); + const updatePackageJson = async(workspaceDir: string, updates: object) => { const currentPackageJson = await readPackageJSON(`${workspaceDir}/package.json`); @@ -16,6 +18,12 @@ const updatePackageJson = async(workspaceDir: string, updates: object) => { const updateDeps = (deps: string) => { Object.keys(currentPackageJson[deps]).forEach((dep) => { + if (PINS.has(dep)) { + currentPackageJson[deps][dep] = PINS.get(dep); + + return; + } + const versions = outdated[dep]; const current = versions?.wanted || versions?.current;