Skip to content

Adopt latest stdin-discarder version#251

Merged
sindresorhus merged 1 commit intosindresorhus:mainfrom
agusayerza:ora/update-stdin-discarder
Feb 4, 2026
Merged

Adopt latest stdin-discarder version#251
sindresorhus merged 1 commit intosindresorhus:mainfrom
agusayerza:ora/update-stdin-discarder

Conversation

@agusayerza
Copy link
Contributor

To fix ora process hanging when stdin stays open, sindresorhus/stdin-discarder@f917ce9 was implemented. This solves #248 , but the stdin-discarder version that has the fix was never adopted here.

Adopting the fixed version

@sindresorhus sindresorhus merged commit 020eaba into sindresorhus:main Feb 4, 2026
2 checks passed
@agusayerza agusayerza deleted the ora/update-stdin-discarder branch February 4, 2026 11:29
github-merge-queue bot pushed a commit to NangoHQ/nango that referenced this pull request Feb 4, 2026
## Issue
`nango compile` hangs indefinitely when run via pre-commit hooks due to
an upstream bug in ora's `stdin-discarder` dependency (#5207). This is
blocking a customer's CI/CD workflow.

## Root cause
The bug was fixed in `stdin-discarder@0.3.1`, but `ora@9.1.0` (latest)
still depends on `stdin-discarder@^0.2.2` and hasn't released a patched
version yet.

## Fix
Added a `createSpinner()` wrapper that returns a no-op spinner when
running in non-interactive environments (CI, pre-commit hooks, piped
output, or when `--no-interactive` flag is passed). The real ora spinner
is only used when both `interactive=true` AND `process.stdout.isTTY` is
true.

This workaround should be removed once `ora` releases a patched version

I have opened a PR to actually bump the `stdin-discarder` version on the
`ora` repo (sindresorhus/ora#251)

Closes #5207

<!-- Summary by @propel-code-bot -->

---

**Add resilient spinner wrapper and propagate non-interactive handling
across CLI**

Introduces a centralized `Spinner` utility that wraps `ora`, falls back
to text-based logging when either stdin/stdout is non-TTY, and is wired
through compile, dev, deploy, migrations, init, clone, and test
generation flows. Global CLI options now auto-disable interactivity in
CI environments (`isCI` or `--no-interactive`), ensuring commands
invoked from hooks or piped executions no longer hang, while also
updating `ora` to `9.2.0` and related dependencies (e.g.,
`stdin-discarder@0.3.1`).

<details>
<summary><strong>Key Changes</strong></summary>

• Created `packages/cli/lib/utils/spinner.ts` implementing a Proxy-based
`Spinner` class that mirrors the `Ora` interface and prints textual
status when `process.stdin` or `stdout` is non-TTY.
• Replaced direct `ora` usage across CLI commands (`compile`, `dev`,
`deploy`, zero-yaml migrations, init, clone, tests, etc.) with the new
`Spinner`, adding `interactive` parameters where needed.
• Updated `packages/cli/lib/index.ts` global option handling to default
to interactive mode, automatically disable it under CI, and pass the
flag through to all commands.
• Bumped `ora` to `9.2.0` in `packages/cli/package.json` and lockfile,
pulling in the fixed `stdin-discarder@0.3.1` plus new transitive
dependencies.

</details>

<details>
<summary><strong>Affected Areas</strong></summary>

• packages/cli/lib/utils/spinner.ts
• packages/cli/lib/zeroYaml/* (compile, dev, deploy, migrations, init,
check)
• packages/cli/lib/services/{clone,test}.service.ts
• packages/cli/lib/index.ts
• packages/cli/package.json & package-lock.json

</details>

---
*This summary was automatically generated by @propel-code-bot*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants