@@ -26,6 +26,7 @@ import { PackageManagerName, PackageManager } from './packageManager/PackageMana
2626import { NpmPackageManager } from './packageManager/NpmPackageManager' ;
2727import { YarnPackageManager } from './packageManager/YarnPackageManager' ;
2828import { PnpmPackageManager } from './packageManager/PnpmPackageManager' ;
29+ import { ExperimentsConfiguration } from './ExperimentsConfiguration' ;
2930
3031const MINIMUM_SUPPORTED_RUSH_JSON_VERSION : string = '0.0.0' ;
3132
@@ -40,7 +41,8 @@ const knownRushConfigFilenames: string[] = [
4041 RushConstants . browserApprovedPackagesFilename ,
4142 RushConstants . nonbrowserApprovedPackagesFilename ,
4243 RushConstants . versionPoliciesFilename ,
43- RushConstants . commandLineFilename
44+ RushConstants . commandLineFilename ,
45+ RushConstants . experimentsFilename
4446] ;
4547
4648/**
@@ -327,6 +329,7 @@ export class RushConfiguration {
327329 private _projectsByName : Map < string , RushConfigurationProject > ;
328330
329331 private _versionPolicyConfiguration : VersionPolicyConfiguration ;
332+ private _experimentsConfiguration : ExperimentsConfiguration ;
330333
331334 /**
332335 * Loads the configuration data from an Rush.json configuration file and returns
@@ -1013,6 +1016,16 @@ export class RushConfiguration {
10131016 return this . _versionPolicyConfiguration ;
10141017 }
10151018
1019+ /**
1020+ * This configuration object contains settings repo maintainers have specified to enable
1021+ * and disable experimental Rush features.
1022+ *
1023+ * @beta
1024+ */
1025+ public get experimentsConfiguration ( ) : ExperimentsConfiguration {
1026+ return this . _experimentsConfiguration ;
1027+ }
1028+
10161029 /**
10171030 * Returns the project for which the specified path is underneath that project's folder.
10181031 * If the path is not under any project's folder, returns undefined.
@@ -1077,8 +1090,14 @@ export class RushConfiguration {
10771090
10781091 this . _ensureConsistentVersions = ! ! rushConfigurationJson . ensureConsistentVersions ;
10791092
1093+ const experimentsConfigFile : string = path . join (
1094+ this . _commonRushConfigFolder ,
1095+ RushConstants . experimentsFilename
1096+ ) ;
1097+ this . _experimentsConfiguration = new ExperimentsConfiguration ( experimentsConfigFile ) ;
1098+
10801099 this . _pnpmOptions = new PnpmOptionsConfiguration ( rushConfigurationJson . pnpmOptions || { } ) ;
1081- this . _yarnOptions = new YarnOptionsConfiguration ( rushConfigurationJson . yarnOptions || { } ) ;
1100+ this . _yarnOptions = new YarnOptionsConfiguration ( rushConfigurationJson . yarnOptions || { } ) ;
10821101
10831102 // TODO: Add an actual "packageManager" field in rush.json
10841103 const packageManagerFields : string [ ] = [ ] ;
@@ -1185,8 +1204,10 @@ export class RushConfiguration {
11851204 this . _eventHooks = new EventHooks ( rushConfigurationJson . eventHooks ) ;
11861205 }
11871206
1188- const versionPolicyConfigFile : string =
1189- path . join ( this . _commonRushConfigFolder , RushConstants . versionPoliciesFilename ) ;
1207+ const versionPolicyConfigFile : string = path . join (
1208+ this . _commonRushConfigFolder ,
1209+ RushConstants . versionPoliciesFilename
1210+ ) ;
11901211 this . _versionPolicyConfiguration = new VersionPolicyConfiguration ( versionPolicyConfigFile ) ;
11911212
11921213 this . _projects = [ ] ;
0 commit comments