Skip to content

Commit

Permalink
improvement(fluid-build): Add a spinner with additional info for incr…
Browse files Browse the repository at this point in the history
…emental 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.
  • Loading branch information
tylerbutler authored Jan 15, 2025
1 parent 08aef9c commit 03c3491
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions build-tools/packages/build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"multimatch": "^5.0.0",
"picocolors": "^1.1.1",
"picomatch": "^2.3.1",
"picospinner": "^2.0.0",
"rimraf": "^4.4.1",
"semver": "^7.6.3",
"sort-package-json": "1.57.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { AsyncPriorityQueue } from "async";
import chalk from "picocolors";
import { Spinner } from "picospinner";
import * as semver from "semver";

import * as assert from "assert";
Expand Down Expand Up @@ -535,8 +536,13 @@ export class BuildGraph {
public async build(timer?: Timer): Promise<BuildResult> {
// This function must only be called once here at the beginning of the build.
// It checks the up-to-date state at this moment and will not be changed for the duration of the build.
const spinner = new Spinner("Checking incremental build task status...");
spinner.start();

const isUpToDate = await this.isUpToDate();
if (timer) timer.time(`Check up to date completed`);

timer?.time(`Check up to date completed`);
spinner.succeed("Tasks loaded.");

log(
`Start tasks '${chalk.cyanBright(this.buildTaskNames.join("', '"))}' in ${
Expand Down
4 changes: 4 additions & 0 deletions build-tools/packages/build-tools/src/fluidBuild/fluidBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import chalk from "picocolors";
import { Spinner } from "picospinner";

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

// build the graph
let buildGraph: BuildGraph;
const spinner = new Spinner("Creating build graph...");
try {
spinner.start();
buildGraph = repo.createBuildGraph(options, options.buildTaskNames);
} catch (e: unknown) {
error((e as Error).message);
process.exit(-11);
}
spinner.succeed("Build graph created.");
timer.time("Build graph creation completed");

// Check install
Expand Down
8 changes: 8 additions & 0 deletions build-tools/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 03c3491

Please sign in to comment.