Skip to content

Commit ede6655

Browse files
authored
feat: update color usage, telemetry activation logic, and command/util dependencies (#3646)
* deps: update @heroku-cli/command and @heroku/heroku-cli-util - Update @heroku-cli/command from ^12.2.2 to ^12.3.1 - Update @heroku/heroku-cli-util from ^10.7.0 to ^10.8.0 - Replace deprecated color.dim() calls with color.gray() and color.inactive() - Update telemetry initialization to use isTelemetryEnabled() helper - Standardize color method usage across all command files * force colors to be true for now * fix tests and force color in unit tests * set force_colors in init.mjs * Fix pg:copy tests to pass locally * enables telemetry for windows in testing * test: fix failing tests after dependency updates - Fix telemetry tests to enable telemetry in test environment - Set ENABLE_WINDOWS_TELEMETRY for Windows CI compatibility - Add test to verify telemetry is disabled by default on Windows - Properly save/restore environment variables - Fix spaces/format test for updated color.gray() ANSI code - Fix pg:copy test to handle line wrapping differences between CI and local - Normalize whitespace in warning message assertions - Handle oclif's warning prefix (›) in wrapped output - Set FORCE_COLOR=3 in test init to ensure consistent color output All tests now pass in local, Linux CI, and Windows CI environments. * style: add blank line for import grouping in telemetry-manager * fix linting * test: handle Windows warning prefix (») in pg:copy test The oclif warning prefix differs between platforms: - Unix/Linux/macOS: › (single angle quote) - Windows: » (double angle quote) Updated the regex to handle both characters when normalizing output. * fix: prevent telemetry worker from keeping parent process alive The telemetry worker was spawned with stderr set to 'inherit', which created a persistent file descriptor reference preventing the parent CLI process from exiting until the worker completed. This caused the CLI to hang for users. Changes: - Only inherit stderr when DEBUG is set (for development) - Worker explicitly closes stderr before exiting (in DEBUG mode) - Uses setImmediate to allow stderr to flush before closing * fix linting
1 parent b9b8fed commit ede6655

Some content is hidden

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

44 files changed

+671
-490
lines changed

bin/run.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env -S node --no-deprecation
22

3-
/* eslint-disable n/no-unpublished-bin */
4-
53
import {execute, settings} from '@oclif/core'
64

75
// Enable performance tracking when oclif:perf is specified in DEBUG
@@ -14,10 +12,9 @@ process.env.HEROKU_UPDATE_INSTRUCTIONS = process.env.HEROKU_UPDATE_INSTRUCTIONS
1412
const now = new Date()
1513
const cliStartTime = now.getTime()
1614

17-
// Skip telemetry entirely on Windows for performance (unless explicitly enabled)
18-
const enableTelemetry = process.platform !== 'win32' || process.env.ENABLE_WINDOWS_TELEMETRY === 'true'
15+
const {isTelemetryEnabled} = await import('../dist/lib/analytics-telemetry/telemetry-utils.js')
1916

20-
if (enableTelemetry) {
17+
if (isTelemetryEnabled()) {
2118
// Dynamically import telemetry modules
2219
const {setupTelemetryHandlers} = await import('../dist/lib/analytics-telemetry/worker-client.js')
2320
const {computeDuration} = await import('../dist/lib/analytics-telemetry/telemetry-utils.js')
@@ -26,7 +23,7 @@ if (enableTelemetry) {
2623
setupTelemetryHandlers({
2724
cliStartTime,
2825
computeDuration,
29-
enableTelemetry,
26+
enableTelemetry: isTelemetryEnabled(),
3027
})
3128
}
3229

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"bin": "./bin/run.js",
77
"bugs": "https://github.com/heroku/cli/issues",
88
"dependencies": {
9-
"@heroku-cli/command": "^12.2.2",
9+
"@heroku-cli/command": "^12.3.1",
1010
"@heroku-cli/notifications": "^1.2.6",
1111
"@heroku-cli/schema": "^1.0.25",
1212
"@heroku/buildpack-registry": "^1.0.1",
13-
"@heroku/heroku-cli-util": "^10.7.0",
13+
"@heroku/heroku-cli-util": "^10.8.0",
1414
"@heroku/http-call": "^5.5.1",
1515
"@heroku/mcp-server": "^1.2.0",
1616
"@heroku/socksv5": "^0.0.9",

0 commit comments

Comments
 (0)