From bc167f7fe68c22fb64849d3f50c98824237ba5eb Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 21 Oct 2025 15:40:42 -0700 Subject: [PATCH 1/3] Move files around in repo-toolbox. --- .../repo-toolbox/src/{ => cli}/ToolboxCommandLine.ts | 8 ++++---- .../actions/BumpDecoupledLocalDependencies.ts} | 6 +++--- .../repo-toolbox/src/{ => cli/actions}/ReadmeAction.ts | 0 .../src/{ => cli/actions}/RecordVersionsAction.ts | 0 repo-scripts/repo-toolbox/src/start.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename repo-scripts/repo-toolbox/src/{ => cli}/ToolboxCommandLine.ts (65%) rename repo-scripts/repo-toolbox/src/{BumpCyclicsAction.ts => cli/actions/BumpDecoupledLocalDependencies.ts} (95%) rename repo-scripts/repo-toolbox/src/{ => cli/actions}/ReadmeAction.ts (100%) rename repo-scripts/repo-toolbox/src/{ => cli/actions}/RecordVersionsAction.ts (100%) diff --git a/repo-scripts/repo-toolbox/src/ToolboxCommandLine.ts b/repo-scripts/repo-toolbox/src/cli/ToolboxCommandLine.ts similarity index 65% rename from repo-scripts/repo-toolbox/src/ToolboxCommandLine.ts rename to repo-scripts/repo-toolbox/src/cli/ToolboxCommandLine.ts index 475a4b48aa9..eb384cdb761 100644 --- a/repo-scripts/repo-toolbox/src/ToolboxCommandLine.ts +++ b/repo-scripts/repo-toolbox/src/cli/ToolboxCommandLine.ts @@ -3,9 +3,9 @@ import { CommandLineParser } from '@rushstack/ts-command-line'; -import { ReadmeAction } from './ReadmeAction'; -import { RecordVersionsAction } from './RecordVersionsAction'; -import { BumpCyclicsAction } from './BumpCyclicsAction'; +import { ReadmeAction } from './actions/ReadmeAction'; +import { RecordVersionsAction } from './actions/RecordVersionsAction'; +import { BumpDecoupledLocalDependencies } from './actions/BumpDecoupledLocalDependencies'; export class ToolboxCommandLine extends CommandLineParser { public constructor() { @@ -16,6 +16,6 @@ export class ToolboxCommandLine extends CommandLineParser { this.addAction(new ReadmeAction()); this.addAction(new RecordVersionsAction()); - this.addAction(new BumpCyclicsAction()); + this.addAction(new BumpDecoupledLocalDependencies()); } } diff --git a/repo-scripts/repo-toolbox/src/BumpCyclicsAction.ts b/repo-scripts/repo-toolbox/src/cli/actions/BumpDecoupledLocalDependencies.ts similarity index 95% rename from repo-scripts/repo-toolbox/src/BumpCyclicsAction.ts rename to repo-scripts/repo-toolbox/src/cli/actions/BumpDecoupledLocalDependencies.ts index 2c43ef5874f..5041b8920be 100644 --- a/repo-scripts/repo-toolbox/src/BumpCyclicsAction.ts +++ b/repo-scripts/repo-toolbox/src/cli/actions/BumpDecoupledLocalDependencies.ts @@ -8,11 +8,11 @@ import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; import { DependencyType, RushConfiguration } from '@microsoft/rush-lib'; import { CommandLineAction } from '@rushstack/ts-command-line'; -export class BumpCyclicsAction extends CommandLineAction { +export class BumpDecoupledLocalDependencies extends CommandLineAction { public constructor() { super({ - actionName: 'bump-cyclic-dependencies', - summary: 'Updates cyclic dependencies inside the repo.', + actionName: 'bump-decoupled-local-dependencies', + summary: 'Updates decoupled local dependencies inside the repo.', documentation: '' }); } diff --git a/repo-scripts/repo-toolbox/src/ReadmeAction.ts b/repo-scripts/repo-toolbox/src/cli/actions/ReadmeAction.ts similarity index 100% rename from repo-scripts/repo-toolbox/src/ReadmeAction.ts rename to repo-scripts/repo-toolbox/src/cli/actions/ReadmeAction.ts diff --git a/repo-scripts/repo-toolbox/src/RecordVersionsAction.ts b/repo-scripts/repo-toolbox/src/cli/actions/RecordVersionsAction.ts similarity index 100% rename from repo-scripts/repo-toolbox/src/RecordVersionsAction.ts rename to repo-scripts/repo-toolbox/src/cli/actions/RecordVersionsAction.ts diff --git a/repo-scripts/repo-toolbox/src/start.ts b/repo-scripts/repo-toolbox/src/start.ts index aaab695092f..11b0e4064c4 100644 --- a/repo-scripts/repo-toolbox/src/start.ts +++ b/repo-scripts/repo-toolbox/src/start.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { ToolboxCommandLine } from './ToolboxCommandLine'; +import { ToolboxCommandLine } from './cli/ToolboxCommandLine'; // eslint-disable-next-line no-console console.log('repo-toolbox\n'); From 2680a3bf1b2f1a0bc11e93cd25052b557d15db59 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 21 Oct 2025 15:50:15 -0700 Subject: [PATCH 2/3] Don't bump allowed alternative dependencies. --- .../actions/BumpDecoupledLocalDependencies.ts | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/repo-scripts/repo-toolbox/src/cli/actions/BumpDecoupledLocalDependencies.ts b/repo-scripts/repo-toolbox/src/cli/actions/BumpDecoupledLocalDependencies.ts index 5041b8920be..b2f10b83de8 100644 --- a/repo-scripts/repo-toolbox/src/cli/actions/BumpDecoupledLocalDependencies.ts +++ b/repo-scripts/repo-toolbox/src/cli/actions/BumpDecoupledLocalDependencies.ts @@ -5,7 +5,7 @@ import type { ChildProcess } from 'node:child_process'; import { Async, Executable, JsonFile } from '@rushstack/node-core-library'; import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; -import { DependencyType, RushConfiguration } from '@microsoft/rush-lib'; +import { DependencyType, RushConfiguration, type CommonVersionsConfiguration } from '@microsoft/rush-lib'; import { CommandLineAction } from '@rushstack/ts-command-line'; export class BumpDecoupledLocalDependencies extends CommandLineAction { @@ -46,12 +46,25 @@ export class BumpDecoupledLocalDependencies extends CommandLineAction { terminal.writeLine(); for (const project of rushConfiguration.projects) { + const commonVersions: CommonVersionsConfiguration = project.subspace.getCommonVersions(); + for (const cyclicDependencyProject of project.decoupledLocalDependencies) { - const version: string = cyclicDependencyVersions.get(cyclicDependencyProject)!; + const existingVersion: string | undefined = + project.packageJson.dependencies?.[cyclicDependencyProject] ?? + project.packageJson.devDependencies?.[cyclicDependencyProject]; + if ( + existingVersion && + commonVersions.allowedAlternativeVersions.get(cyclicDependencyProject)?.includes(existingVersion) + ) { + // Skip if the existing version is allowed by common-versions.json + continue; + } + + const newVersion: string = cyclicDependencyVersions.get(cyclicDependencyProject)!; if (project.packageJsonEditor.tryGetDependency(cyclicDependencyProject)) { project.packageJsonEditor.addOrUpdateDependency( cyclicDependencyProject, - version, + newVersion, DependencyType.Regular ); } @@ -59,7 +72,7 @@ export class BumpDecoupledLocalDependencies extends CommandLineAction { if (project.packageJsonEditor.tryGetDevDependency(cyclicDependencyProject)) { project.packageJsonEditor.addOrUpdateDependency( cyclicDependencyProject, - version, + newVersion, DependencyType.Dev ); } From ac0e3dab99b1436314cd0d814010f4f25a8ac08e Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 21 Oct 2025 15:52:25 -0700 Subject: [PATCH 3/3] Include @rushstack/set-webpack-public-path-plugin@^4.1.16 in common-versions.json. --- common/config/subspaces/default/common-versions.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/config/subspaces/default/common-versions.json b/common/config/subspaces/default/common-versions.json index 67948f39642..bcaa4198eb5 100644 --- a/common/config/subspaces/default/common-versions.json +++ b/common/config/subspaces/default/common-versions.json @@ -143,6 +143,10 @@ "@rushstack/eslint-config": [ // This is used by the ESLint 7 build tests "3.7.1" + ], + "@rushstack/set-webpack-public-path-plugin": [ + // This is used by the webpack 4 localization plugin tests + "^4.1.16" ] } }