44import * as path from 'node:path' ;
55import * as child_process from 'node:child_process' ;
66
7-
87import type {
98 CommandLineFlagParameter ,
109 CommandLineStringParameter ,
@@ -30,6 +29,7 @@ import {
3029import { ProjectChangeAnalyzer } from '../../logic/ProjectChangeAnalyzer' ;
3130import { Git } from '../../logic/Git' ;
3231import { RushConstants } from '../../logic/RushConstants' ;
32+ import * as PolicyValidator from '../../logic/policy/PolicyValidator' ;
3333
3434const BULK_LONG_NAME : string = '--bulk' ;
3535const BULK_MESSAGE_LONG_NAME : string = '--message' ;
@@ -171,6 +171,15 @@ export class ChangeAction extends BaseRushAction {
171171 }
172172
173173 public async runAsync ( ) : Promise < void > {
174+ await PolicyValidator . validatePolicyAsync (
175+ this . rushConfiguration ,
176+ this . rushConfiguration . defaultSubspace ,
177+ undefined ,
178+ {
179+ allowShrinkwrapUpdates : true
180+ }
181+ ) ;
182+
174183 if ( this . _verifyAllParameter . value ) {
175184 const incompatibleParameters : (
176185 | CommandLineFlagParameter
@@ -319,10 +328,7 @@ export class ChangeAction extends BaseRushAction {
319328 this . terminal ,
320329 await this . _getChangeFilesSinceBaseBranchAsync ( )
321330 ) ;
322- changeFileData = await this . _promptForChangeFileDataAsync (
323- sortedProjectList ,
324- existingChangeComments
325- ) ;
331+ changeFileData = await this . _promptForChangeFileDataAsync ( sortedProjectList , existingChangeComments ) ;
326332
327333 if ( this . _isEmailRequired ( changeFileData ) ) {
328334 const email : string = this . _changeEmailParameter . value
@@ -592,9 +598,7 @@ export class ChangeAction extends BaseRushAction {
592598 }
593599 }
594600
595- private async _promptForCommentsAsync (
596- packageName : string
597- ) : Promise < IChangeInfo | undefined > {
601+ private async _promptForCommentsAsync ( packageName : string ) : Promise < IChangeInfo | undefined > {
598602 const bumpOptions : { [ type : string ] : string } = this . _getBumpOptions ( packageName ) ;
599603 const { default : input } = await import ( '@inquirer/input' ) ;
600604 const comment : string = await input ( { message : `Describe changes, or ENTER if no changes:` } ) ;
@@ -680,10 +684,7 @@ export class ChangeAction extends BaseRushAction {
680684 * or will ask for it if it is not found or the Git config is wrong.
681685 */
682686 private async _detectOrAskForEmailAsync ( ) : Promise < string > {
683- return (
684- ( await this . _detectAndConfirmEmailAsync ( ) ) ||
685- ( await this . _promptForEmailAsync ( ) )
686- ) ;
687+ return ( await this . _detectAndConfirmEmailAsync ( ) ) || ( await this . _promptForEmailAsync ( ) ) ;
687688 }
688689
689690 private _detectEmail ( ) : string | undefined {
@@ -780,9 +781,7 @@ export class ChangeAction extends BaseRushAction {
780781
781782 const fileExists : boolean = FileSystem . exists ( filePath ) ;
782783 const shouldWrite : boolean =
783- ! fileExists ||
784- overwrite ||
785- ( interactiveMode ? await this . _promptForOverwriteAsync ( filePath ) : false ) ;
784+ ! fileExists || overwrite || ( interactiveMode ? await this . _promptForOverwriteAsync ( filePath ) : false ) ;
786785
787786 if ( ! interactiveMode && fileExists && ! overwrite ) {
788787 throw new Error ( `Changefile ${ filePath } already exists` ) ;
@@ -794,9 +793,7 @@ export class ChangeAction extends BaseRushAction {
794793 }
795794 }
796795
797- private async _promptForOverwriteAsync (
798- filePath : string
799- ) : Promise < boolean > {
796+ private async _promptForOverwriteAsync ( filePath : string ) : Promise < boolean > {
800797 const { default : confirm } = await import ( '@inquirer/confirm' ) ;
801798 const overwrite : boolean = await confirm ( {
802799 message : `Overwrite ${ filePath } ?`
0 commit comments