Skip to content

Commit 03c3491

Browse files
authored
improvement(fluid-build): Add a spinner with additional info for incremental task checks (#23282)
Adds a CLI spinner to display a little more feedback when loading the build graph and checking incremental tasks. Currently fluid-build just sits there for awhile and looks like it's hung. There is more that we could do, but this is a step in the right direction.
1 parent 08aef9c commit 03c3491

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

build-tools/packages/build-tools/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"multimatch": "^5.0.0",
5858
"picocolors": "^1.1.1",
5959
"picomatch": "^2.3.1",
60+
"picospinner": "^2.0.0",
6061
"rimraf": "^4.4.1",
6162
"semver": "^7.6.3",
6263
"sort-package-json": "1.57.0",

build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { AsyncPriorityQueue } from "async";
77
import chalk from "picocolors";
8+
import { Spinner } from "picospinner";
89
import * as semver from "semver";
910

1011
import * as assert from "assert";
@@ -535,8 +536,13 @@ export class BuildGraph {
535536
public async build(timer?: Timer): Promise<BuildResult> {
536537
// This function must only be called once here at the beginning of the build.
537538
// It checks the up-to-date state at this moment and will not be changed for the duration of the build.
539+
const spinner = new Spinner("Checking incremental build task status...");
540+
spinner.start();
541+
538542
const isUpToDate = await this.isUpToDate();
539-
if (timer) timer.time(`Check up to date completed`);
543+
544+
timer?.time(`Check up to date completed`);
545+
spinner.succeed("Tasks loaded.");
540546

541547
log(
542548
`Start tasks '${chalk.cyanBright(this.buildTaskNames.join("', '"))}' in ${

build-tools/packages/build-tools/src/fluidBuild/fluidBuild.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import chalk from "picocolors";
7+
import { Spinner } from "picospinner";
78

89
import { GitRepo } from "../common/gitRepo";
910
import { defaultLogger } from "../common/logging";
@@ -99,12 +100,15 @@ async function main() {
99100

100101
// build the graph
101102
let buildGraph: BuildGraph;
103+
const spinner = new Spinner("Creating build graph...");
102104
try {
105+
spinner.start();
103106
buildGraph = repo.createBuildGraph(options, options.buildTaskNames);
104107
} catch (e: unknown) {
105108
error((e as Error).message);
106109
process.exit(-11);
107110
}
111+
spinner.succeed("Build graph created.");
108112
timer.time("Build graph creation completed");
109113

110114
// Check install

build-tools/pnpm-lock.yaml

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

0 commit comments

Comments
 (0)