Skip to content

Commit fc22316

Browse files
committed
Rename disablePerProjectDependencyManifest to incrementalBuildDependencyGranularity.
1 parent 2a56595 commit fc22316

7 files changed

Lines changed: 46 additions & 15 deletions

File tree

‎apps/rush-lib/assets/rush-init/rush.json‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,18 @@
6464
/*[LINE "HYPOTHETICAL"]*/ "resolutionStrategy": "fast",
6565

6666
/**
67-
* If set to `true`, don't attempt to generate a file that records the dependencies of each project to
68-
* be used for incremental builds.
67+
* This is the mode for tracking external dependencies to detect if a project needs to be rebuilt
68+
* during an incremental build.
69+
*
70+
* If set to "project," track individual projects' dependencies when detecting if a project needs
71+
* to be rebuilt during an incremental build.
72+
*
73+
* If set to "repository," rebuild all projects when any dependencies across the repository are changed
74+
* during an incremental build.
75+
*
76+
* If unset, defaults to "project."
6977
*/
70-
/*[LINE "DEMO"]*/ "disablePerProjectDependencyManifest": false
78+
/*[LINE "DEMO"]*/ "incrementalBuildDependencyGranularity": "project"
7179
},
7280

7381
/**

‎apps/rush-lib/src/api/RushConfiguration.ts‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ export interface IRushRepositoryJson {
8787
export interface IPnpmOptionsJson {
8888
strictPeerDependencies?: boolean;
8989
resolutionStrategy?: ResolutionStrategy;
90-
disablePerProjectDependencyManifest?: boolean;
90+
/** @beta */
91+
incrementalBuildDependencyGranularity?: IncrementalBuildDependencyGranularity;
9192
}
9293

9394
/**
@@ -188,16 +189,26 @@ export class PnpmOptionsConfiguration {
188189
public readonly resolutionStrategy: ResolutionStrategy;
189190

190191
/**
191-
* If set to `true`, don't attempt to generate a file that records the dependencies of each project to be used for
192-
* incremental builds.
192+
* This is the mode for tracking external dependencies to detect if a project needs to be rebuilt
193+
* during an incremental build.
194+
*
195+
* If set to "project," track individual projects' dependencies when detecting if a project needs
196+
* to be rebuilt during an incremental build.
197+
*
198+
* If set to "repository," rebuild all projects when any dependencies across the repository are changed
199+
* during an incremental build.
200+
*
201+
* If unset, defaults to "project."
202+
*
203+
* @beta
193204
*/
194-
public readonly disablePerProjectDependencyManifest: boolean;
205+
public readonly incrementalBuildDependencyGranularity: IncrementalBuildDependencyGranularity;
195206

196207
/** @internal */
197208
public constructor(json: IPnpmOptionsJson) {
198209
this.strictPeerDependencies = !!json.strictPeerDependencies;
199210
this.resolutionStrategy = json.resolutionStrategy || 'fewer-dependencies';
200-
this.disablePerProjectDependencyManifest = !!json.disablePerProjectDependencyManifest;
211+
this.incrementalBuildDependencyGranularity = json.incrementalBuildDependencyGranularity || 'project';
201212
}
202213
}
203214

@@ -248,6 +259,12 @@ export interface ITryFindRushJsonLocationOptions {
248259
*/
249260
export type ResolutionStrategy = 'fewer-dependencies' | 'fast';
250261

262+
/**
263+
* This represents the available dependency-tracking granularities during incremental builds.
264+
* @beta
265+
*/
266+
export type IncrementalBuildDependencyGranularity = 'project' | 'repository';
267+
251268
/**
252269
* This represents the Rush configuration for a repository, based on the "rush.json"
253270
* configuration file.

‎apps/rush-lib/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export {
1414
RushConfiguration,
1515
ITryFindRushJsonLocationOptions,
1616
ResolutionStrategy,
17+
IncrementalBuildDependencyGranularity,
1718
PnpmOptionsConfiguration,
1819
YarnOptionsConfiguration
1920
} from './api/RushConfiguration';

‎apps/rush-lib/src/logic/PackageChangeAnalyzer.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class PackageChangeAnalyzer {
136136

137137
if (
138138
this._rushConfiguration.packageManager === 'pnpm' &&
139-
!this._rushConfiguration.pnpmOptions.disablePerProjectDependencyManifest
139+
this._rushConfiguration.pnpmOptions.incrementalBuildDependencyGranularity === 'project'
140140
) {
141141
const projects: RushConfigurationProject[] = [];
142142
const projectDependencyManifestPaths: string[] = [];

‎apps/rush-lib/src/logic/pnpm/PnpmLinkManager.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export class PnpmLinkManager extends BaseLinkManager {
270270
newLocalFolderPath
271271
);
272272

273-
if (!this._rushConfiguration.pnpmOptions.disablePerProjectDependencyManifest) {
273+
if (this._rushConfiguration.pnpmOptions.incrementalBuildDependencyGranularity === 'project') {
274274
pnpmProjectDependencyManifest.addDependency(newLocalPackage);
275275
}
276276

@@ -284,7 +284,7 @@ export class PnpmLinkManager extends BaseLinkManager {
284284

285285
PnpmLinkManager._createSymlinksForTopLevelProject(localPackage);
286286

287-
if (!this._rushConfiguration.pnpmOptions.disablePerProjectDependencyManifest) {
287+
if (this._rushConfiguration.pnpmOptions.incrementalBuildDependencyGranularity === 'project') {
288288
pnpmProjectDependencyManifest.save();
289289
} else {
290290
pnpmProjectDependencyManifest.deleteIfExists();

‎apps/rush-lib/src/schemas/rush.schema.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@
6666
"type": "string",
6767
"enum": ["fewer-dependencies", "fast"]
6868
},
69-
"disablePerProjectDependencyManifest": {
70-
"description": "If set to `true`, don't attempt to generate a file that records the dependencies of each project to be used for incremental builds.",
71-
"type": "boolean"
69+
"incrementalBuildDependencyGranularity": {
70+
"description": "This is the mode for tracking external dependencies to detect if a project needs to be rebuilt during an incremental build.",
71+
"type": "string",
72+
"enum": ["project", "repository"]
7273
}
7374
},
7475
"additionalProperties": false

‎common/reviews/api/rush-lib.api.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ export interface ILaunchOptions {
116116
isManaged: boolean;
117117
}
118118

119+
// @beta
120+
export type IncrementalBuildDependencyGranularity = 'project' | 'repository';
121+
119122
// @beta
120123
export class IndividualVersionPolicy extends VersionPolicy {
121124
// Warning: (ae-forgotten-export) The symbol "IIndividualVersionJson" needs to be exported by the entry point index.d.ts
@@ -219,7 +222,8 @@ export class PnpmOptionsConfiguration {
219222
//
220223
// @internal
221224
constructor(json: IPnpmOptionsJson);
222-
readonly disablePerProjectDependencyManifest: boolean;
225+
// @beta
226+
readonly incrementalBuildDependencyGranularity: IncrementalBuildDependencyGranularity;
223227
readonly resolutionStrategy: ResolutionStrategy;
224228
readonly strictPeerDependencies: boolean;
225229
}

0 commit comments

Comments
 (0)