Skip to content

Commit 2c1f883

Browse files
author
Ben Keen
committed
Add bridge-cache plugin to populate cache without running action
1 parent 78ff506 commit 2c1f883

21 files changed

Lines changed: 322 additions & 9 deletions

File tree

apps/rush/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@rushstack/rush-amazon-s3-build-cache-plugin": "workspace:*",
4848
"@rushstack/rush-azure-storage-build-cache-plugin": "workspace:*",
4949
"@rushstack/rush-http-build-cache-plugin": "workspace:*",
50+
"@rushstack/rush-bridge-cache-plugin": "workspace:*",
5051
"@types/heft-jest": "1.0.1",
5152
"@types/semver": "7.5.0"
5253
}

apps/rush/src/start-dev-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ import { Colorize, ConsoleTerminalProvider, Terminal } from '@rushstack/terminal
66
const terminal: Terminal = new Terminal(new ConsoleTerminalProvider());
77

88
terminal.writeLine('For instructions on debugging Rush, please see this documentation:');
9-
terminal.writeLine(Colorize.bold('https://rushjs.io/pages/contributing/debugging/'));
9+
terminal.writeLine(Colorize.bold('https://rushjs.io/pages/contributing/#debugging-rush'));

apps/rush/src/start-dev.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ includePlugin('rush-azure-storage-build-cache-plugin');
3131
includePlugin('rush-http-build-cache-plugin');
3232
// Including this here so that developers can reuse it without installing the plugin a second time
3333
includePlugin('rush-azure-interactive-auth-plugin', '@rushstack/rush-azure-storage-build-cache-plugin');
34+
includePlugin('rush-bridge-cache-plugin');
3435

3536
const currentPackageVersion: string = PackageJsonLookup.loadOwnPackageJson(__dirname).version;
3637
RushCommandSelector.execute(currentPackageVersion, rushLib, {

common/config/rush/browser-approved-packages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
"name": "@reduxjs/toolkit",
3939
"allowedCategories": [ "libraries", "vscode-extensions" ]
4040
},
41+
{
42+
"name": "@rushstack/rush-bridge-cache-plugin",
43+
"allowedCategories": [ "libraries" ]
44+
},
4145
{
4246
"name": "@rushstack/rush-themed-ui",
4347
"allowedCategories": [ "libraries" ]

common/config/subspaces/default/pnpm-lock.yaml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AsyncParallelHook } from 'tapable';
1010
import { AsyncSeriesBailHook } from 'tapable';
1111
import { AsyncSeriesHook } from 'tapable';
1212
import { AsyncSeriesWaterfallHook } from 'tapable';
13-
import type { CollatedWriter } from '@rushstack/stream-collator';
13+
import { CollatedWriter } from '@rushstack/stream-collator';
1414
import type { CommandLineParameter } from '@rushstack/ts-command-line';
1515
import { CommandLineParameterKind } from '@rushstack/ts-command-line';
1616
import { HookMap } from 'tapable';
@@ -23,7 +23,8 @@ import { JsonNull } from '@rushstack/node-core-library';
2323
import { JsonObject } from '@rushstack/node-core-library';
2424
import { LookupByPath } from '@rushstack/lookup-by-path';
2525
import { PackageNameParser } from '@rushstack/node-core-library';
26-
import type { StdioSummarizer } from '@rushstack/terminal';
26+
import { StdioSummarizer } from '@rushstack/terminal';
27+
import { StreamCollator } from '@rushstack/stream-collator';
2728
import { SyncHook } from 'tapable';
2829
import { SyncWaterfallHook } from 'tapable';
2930
import { Terminal } from '@rushstack/terminal';
@@ -1127,6 +1128,27 @@ export type PnpmStoreLocation = 'local' | 'global';
11271128
// @public @deprecated (undocumented)
11281129
export type PnpmStoreOptions = PnpmStoreLocation;
11291130

1131+
// Warning: (ae-internal-missing-underscore) The name "ProjectBuildCache" should be prefixed with an underscore because the declaration is marked as @internal
1132+
//
1133+
// @internal (undocumented)
1134+
export class ProjectBuildCache {
1135+
// (undocumented)
1136+
get cacheId(): string | undefined;
1137+
// Warning: (ae-forgotten-export) The symbol "OperationExecutionRecord" needs to be exported by the entry point index.d.ts
1138+
// Warning: (ae-forgotten-export) The symbol "IOperationBuildCacheOptions" needs to be exported by the entry point index.d.ts
1139+
//
1140+
// (undocumented)
1141+
static forOperation(operation: OperationExecutionRecord, options: IOperationBuildCacheOptions): ProjectBuildCache;
1142+
// Warning: (ae-forgotten-export) The symbol "IProjectBuildCacheOptions" needs to be exported by the entry point index.d.ts
1143+
//
1144+
// (undocumented)
1145+
static getProjectBuildCache(options: IProjectBuildCacheOptions): ProjectBuildCache;
1146+
// (undocumented)
1147+
tryRestoreFromCacheAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
1148+
// (undocumented)
1149+
trySetCacheEntryAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
1150+
}
1151+
11301152
// @beta (undocumented)
11311153
export class ProjectChangeAnalyzer {
11321154
constructor(rushConfiguration: RushConfiguration);

libraries/rush-lib/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,5 @@ export {
197197
type IRushCommandLineParameter,
198198
type IRushCommandLineAction
199199
} from './api/RushCommandLine';
200+
201+
export { ProjectBuildCache } from './logic/buildCache/ProjectBuildCache';

libraries/rush-lib/src/logic/buildCache/ProjectBuildCache.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ interface IPathsToCache {
5050
outputFilePaths: string[];
5151
}
5252

53+
/**
54+
* @internal
55+
*/
5356
export class ProjectBuildCache {
5457
private static _tarUtilityPromise: Promise<TarExecutable | undefined> | undefined;
5558

libraries/rush-lib/src/pluginFramework/PluginManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export class PluginManager {
8181
tryAddBuiltInPlugin('rush-amazon-s3-build-cache-plugin');
8282
tryAddBuiltInPlugin('rush-azure-storage-build-cache-plugin');
8383
tryAddBuiltInPlugin('rush-http-build-cache-plugin');
84+
tryAddBuiltInPlugin('rush-bridge-cache-plugin');
8485
// This is a secondary plugin inside the `@rushstack/rush-azure-storage-build-cache-plugin`
8586
// package. Because that package comes with Rush (for now), it needs to get registered here.
8687
// If the necessary config file doesn't exist, this plugin doesn't do anything.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
3+
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
4+
require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');
5+
6+
module.exports = {
7+
extends: [
8+
'local-node-rig/profiles/default/includes/eslint/profile/node',
9+
'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals',
10+
'local-node-rig/profiles/default/includes/eslint/mixins/tsdoc'
11+
],
12+
parserOptions: { tsconfigRootDir: __dirname }
13+
};

0 commit comments

Comments
 (0)