diff --git a/yarn-project/cli/src/update/npm.ts b/yarn-project/cli/src/update/npm.ts index 41dadbf518e..6d73c1ca7d6 100644 --- a/yarn-project/cli/src/update/npm.ts +++ b/yarn-project/cli/src/update/npm.ts @@ -17,6 +17,8 @@ import { DependencyChanges } from './common.js'; export async function readPackageJson(projectPath: string): Promise<{ /** dependencies */ dependencies?: Record; + /** devDependencies */ + devDependencies?: Record; }> { const configFilepath = resolve(join(projectPath, 'package.json')); const pkg = JSON.parse(await readFile(configFilepath, 'utf-8')); @@ -63,31 +65,34 @@ export async function updateAztecDeps( dependencies: [], }; - if (!pkg.dependencies) { - return changes; - } - log(`Updating @aztec packages to ${aztecVersion} in ${relative(process.cwd(), changes.file)}`); const version = aztecVersion.version; - for (const name of Object.keys(pkg.dependencies)) { - if (!name.startsWith('@aztec/')) { - continue; - } - - // different release schedule - if (name === '@aztec/aztec-ui') { + for (const depType of ['dependencies', 'devDependencies'] as const) { + const dependencies = pkg[depType]; + if (!dependencies) { continue; } - if (pkg.dependencies[name] !== version) { - changes.dependencies.push({ - name, - from: pkg.dependencies[name], - to: version, - }); - - pkg.dependencies[name] = version; + for (const name of Object.keys(dependencies)) { + if (!name.startsWith('@aztec/')) { + continue; + } + + // different release schedule + if (name === '@aztec/aztec-ui') { + continue; + } + + if (dependencies[name] !== version) { + changes.dependencies.push({ + name, + from: dependencies[name], + to: version, + }); + + dependencies[name] = version; + } } } diff --git a/yarn-project/cli/src/update/update.ts b/yarn-project/cli/src/update/update.ts index bd819605d0d..977cb699c4e 100644 --- a/yarn-project/cli/src/update/update.ts +++ b/yarn-project/cli/src/update/update.ts @@ -98,7 +98,13 @@ async function getNpmSandboxVersion(projectPath: string, log: LogFn): Promise