feat(update): add ability to pin npm packages for all package-locks
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
cd6303019d
commit
605065eec7
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue