Skip to content

Commit 3c419dc

Browse files
committed
Update names of async functions to end with 'Async.'
1 parent d291fd8 commit 3c419dc

File tree

113 files changed

+927
-544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+927
-544
lines changed

apps/api-documenter/src/start.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ console.log(
1919

2020
const parser: ApiDocumenterCommandLine = new ApiDocumenterCommandLine();
2121

22-
parser.execute().catch(console.error); // CommandLineParser.execute() should never reject the promise
22+
parser.executeAsync().catch(console.error); // CommandLineParser.executeAsync() should never reject the promise

apps/api-extractor/src/start.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ console.log(
1616

1717
const parser: ApiExtractorCommandLine = new ApiExtractorCommandLine();
1818

19-
parser.execute().catch((error) => {
19+
parser.executeAsync().catch((error) => {
2020
console.error(Colorize.red(`An unexpected error occurred: ${error}`));
2121
process.exit(1);
2222
});

apps/heft/src/cli/HeftCommandLineParser.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class HeftCommandLineParser extends CommandLineParser {
9595
this._metricsCollector = new MetricsCollector();
9696
}
9797

98-
public async execute(args?: string[]): Promise<boolean> {
98+
public async executeAsync(args?: string[]): Promise<boolean> {
9999
// Defensively set the exit code to 1 so if the tool crashes for whatever reason,
100100
// we'll have a nonzero exit code.
101101
process.exitCode = 1;
@@ -166,9 +166,9 @@ export class HeftCommandLineParser extends CommandLineParser {
166166
this.addAction(aliasAction);
167167
}
168168

169-
return await super.execute(args);
169+
return await super.executeAsync(args);
170170
} catch (e) {
171-
await this._reportErrorAndSetExitCode(e as Error);
171+
await this._reportErrorAndSetExitCodeAsync(e as Error);
172172
return false;
173173
}
174174
}
@@ -195,7 +195,7 @@ export class HeftCommandLineParser extends CommandLineParser {
195195
};
196196
await super.onExecute();
197197
} catch (e) {
198-
await this._reportErrorAndSetExitCode(e as Error);
198+
await this._reportErrorAndSetExitCodeAsync(e as Error);
199199
}
200200

201201
// If we make it here, things are fine and reset the exit code back to 0
@@ -235,7 +235,7 @@ export class HeftCommandLineParser extends CommandLineParser {
235235
};
236236
}
237237

238-
private async _reportErrorAndSetExitCode(error: Error): Promise<void> {
238+
private async _reportErrorAndSetExitCodeAsync(error: Error): Promise<void> {
239239
if (!(error instanceof AlreadyReportedError)) {
240240
this.globalTerminal.writeErrorLine(error.toString());
241241
}

apps/heft/src/plugins/NodeServicePlugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class NodeServicePlugin implements IHeftTaskPlugin {
120120
);
121121
}
122122

123-
private async _loadStageConfiguration(
123+
private async _loadStageConfigurationAsync(
124124
taskSession: IHeftTaskSession,
125125
heftConfiguration: HeftConfiguration
126126
): Promise<void> {
@@ -187,7 +187,7 @@ export default class NodeServicePlugin implements IHeftTaskPlugin {
187187
taskSession: IHeftTaskSession,
188188
heftConfiguration: HeftConfiguration
189189
): Promise<void> {
190-
await this._loadStageConfiguration(taskSession, heftConfiguration);
190+
await this._loadStageConfigurationAsync(taskSession, heftConfiguration);
191191
if (!this._pluginEnabled) {
192192
return;
193193
}

apps/heft/src/start.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { HeftCommandLineParser } from './cli/HeftCommandLineParser';
88
const parser: HeftCommandLineParser = new HeftCommandLineParser();
99

1010
parser
11-
.execute()
11+
.executeAsync()
1212
.then(() => {
1313
// This should be removed when the issue with aria not tearing down
1414
process.exit(process.exitCode === undefined ? 0 : process.exitCode);

apps/rundown/src/start.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ console.log(`Rundown ${toolVersion} - https://rushstack.io`);
1212
console.log();
1313

1414
const commandLine: RundownCommandLine = new RundownCommandLine();
15-
commandLine.execute().catch((error) => {
15+
commandLine.executeAsync().catch((error) => {
1616
console.error(error);
1717
});

apps/trace-import/src/start.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ console.log(Colorize.bold(`trace-import ${toolVersion}`) + ' - ' + Colorize.cyan
1313
console.log();
1414

1515
const commandLine: TraceImportCommandLineParser = new TraceImportCommandLineParser();
16-
commandLine.execute().catch((error) => {
16+
commandLine.executeAsync().catch((error) => {
1717
console.error(error);
1818
});

build-tests/rush-redis-cobuild-plugin-integration-test/src/runRush.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ async function rushRush(args: string[]): Promise<void> {
3636
// eslint-disable-next-line no-console
3737
console.log(`Executing: rush ${args.join(' ')}`);
3838
await parser
39-
.execute(args)
39+
.executeAsync(args)
4040
// eslint-disable-next-line no-console
41-
.catch(console.error); // CommandLineParser.execute() should never reject the promise
41+
.catch(console.error); // CommandLineParser.executeAsync() should never reject the promise
4242
}
4343

4444
// eslint-disable-next-line no-console

build-tests/ts-command-line-test/src/BusinessLogic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See LICENSE in the project root for license information.
33

44
export class BusinessLogic {
5-
public static async doTheWork(force: boolean, protocol: string): Promise<void> {
5+
public static async doTheWorkAsync(force: boolean, protocol: string): Promise<void> {
66
console.log(`Received parameters: force=${force}, protocol="${protocol}"`);
77
console.log(`Business logic did the work.`);
88
}

build-tests/ts-command-line-test/src/PushAction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class PushAction extends CommandLineAction {
2424

2525
protected onExecute(): Promise<void> {
2626
// abstract
27-
return BusinessLogic.doTheWork(this._force.value, this._protocol.value);
27+
return BusinessLogic.doTheWorkAsync(this._force.value, this._protocol.value);
2828
}
2929

3030
protected onDefineParameters(): void {

build-tests/ts-command-line-test/src/start.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
import { WidgetCommandLine } from './WidgetCommandLine';
55

66
const commandLine: WidgetCommandLine = new WidgetCommandLine();
7-
commandLine.execute();
7+
commandLine.executeAsync();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-documenter",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/api-documenter"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-extractor",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-config",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-config"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-jest-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-jest-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-sass-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-sass-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-typescript-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-typescript-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/module-minifier",
5+
"comment": "Rename `IMinifierConnection.disconnect` to `IMinifierConnection.disconnectAsync` and `IModuleMinifier.connect` to `IModuleMinifier.connectAsync`. The old functions are marked as `@deprecated`.",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/module-minifier"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/node-core-library",
5+
"comment": "Rename `Async.sleep` to `Async.sleepAsync`. The old function is marked as `@deprecated`.",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/node-core-library"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/operation-graph",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/operation-graph"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rundown",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/rundown"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/trace-import",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/trace-import"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/ts-command-line",
5+
"comment": "Rename `CommandLineParser.execute` to `CommandLineParser.executeAsync` and `CommandLineParser.executeWithoutErrorHandling` to `CommandLineParser.executeWithoutErrorHandlingAsync`. The old functions are marked as `@deprecated`.",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/ts-command-line"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/typings-generator",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/typings-generator"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/webpack4-module-minifier-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/webpack4-module-minifier-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/webpack5-module-minifier-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/webpack5-module-minifier-plugin"
10+
}

common/reviews/api/module-minifier.api.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export interface ILocalMinifierOptions {
2222
// @public
2323
export interface IMinifierConnection {
2424
configHash: string;
25+
// @deprecated (undocumented)
2526
disconnect(): Promise<void>;
27+
disconnectAsync(): Promise<void>;
2628
}
2729

2830
// @public
@@ -60,7 +62,9 @@ export interface IModuleMinificationSuccessResult {
6062

6163
// @public
6264
export interface IModuleMinifier {
65+
// @deprecated (undocumented)
6366
connect(): Promise<IMinifierConnection>;
67+
connectAsync(): Promise<IMinifierConnection>;
6468
minify: IModuleMinifierFunction;
6569
}
6670

@@ -80,16 +84,18 @@ export interface IWorkerPoolMinifierOptions {
8084
// @public
8185
export class LocalMinifier implements IModuleMinifier {
8286
constructor(options: ILocalMinifierOptions);
83-
// (undocumented)
87+
// @deprecated (undocumented)
8488
connect(): Promise<IMinifierConnection>;
89+
connectAsync(): Promise<IMinifierConnection>;
8590
minify(request: IModuleMinificationRequest, callback: IModuleMinificationCallback): void;
8691
}
8792

8893
// @public
8994
export class MessagePortMinifier implements IModuleMinifier {
9095
constructor(port: MessagePort_2);
91-
// (undocumented)
96+
// @deprecated (undocumented)
9297
connect(): Promise<IMinifierConnection>;
98+
connectAsync(): Promise<IMinifierConnection>;
9399
minify(request: IModuleMinificationRequest, callback: IModuleMinificationCallback): void;
94100
// (undocumented)
95101
readonly port: MessagePort_2;
@@ -102,16 +108,18 @@ export function _minifySingleFileAsync(request: IModuleMinificationRequest, ters
102108

103109
// @public
104110
export class NoopMinifier implements IModuleMinifier {
105-
// (undocumented)
111+
// @deprecated (undocumented)
106112
connect(): Promise<IMinifierConnection>;
113+
connectAsync(): Promise<IMinifierConnection>;
107114
minify(request: IModuleMinificationRequest, callback: IModuleMinificationCallback): void;
108115
}
109116

110117
// @public
111118
export class WorkerPoolMinifier implements IModuleMinifier {
112119
constructor(options: IWorkerPoolMinifierOptions);
113-
// (undocumented)
120+
// @deprecated (undocumented)
114121
connect(): Promise<IMinifierConnection>;
122+
connectAsync(): Promise<IMinifierConnection>;
115123
// (undocumented)
116124
get maxThreads(): number;
117125
set maxThreads(threads: number);

0 commit comments

Comments
 (0)