From 612594022245533811adab8af3b8631bfaccb4e3 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 2 Sep 2023 11:57:53 +0200 Subject: [PATCH] create-app: warn if yarn install is taking a long time Signed-off-by: Patrik Oldsberg --- .changeset/grumpy-ties-know.md | 5 +++++ packages/create-app/src/lib/tasks.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/grumpy-ties-know.md diff --git a/.changeset/grumpy-ties-know.md b/.changeset/grumpy-ties-know.md new file mode 100644 index 0000000000..86e3b0ec7d --- /dev/null +++ b/.changeset/grumpy-ties-know.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Add a notification when `yarn install` is taking a long time. diff --git a/packages/create-app/src/lib/tasks.ts b/packages/create-app/src/lib/tasks.ts index f158a2d1f1..1943b0c3cc 100644 --- a/packages/create-app/src/lib/tasks.ts +++ b/packages/create-app/src/lib/tasks.ts @@ -31,6 +31,7 @@ import { promisify } from 'util'; import os from 'os'; const TASK_NAME_MAX_LENGTH = 14; +const TEN_MINUTES_MS = 1000 * 60 * 10; const exec = promisify(execCb); export type GitConfig = { @@ -222,7 +223,13 @@ export async function buildAppTask(appDir: string) { }); }; - await runCmd('yarn install'); + const installTimeout = setTimeout(() => { + Task.error( + "\n⏱️ It's taking a long time to install dependencies, you may want to exit (Ctrl-C) and run 'yarn install' and 'yarn tsc' manually", + ); + }, TEN_MINUTES_MS); + + await runCmd('yarn install').finally(() => clearTimeout(installTimeout)); await runCmd('yarn tsc'); }