Skip to content

Replace elegant-spinner with ora (default settings)#109

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/use-ora-default-settings
Closed

Replace elegant-spinner with ora (default settings)#109
Copilot wants to merge 2 commits intomainfrom
copilot/use-ora-default-settings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Replaces the elegant-spinner dependency with ora@9.3.0 (latest) using its default settings.

Changes

  • package.json: Swapped elegant-spinner: 2.0.0 for ora: 9.3.0 in dependencies
  • tsconfig.json: Changed "module" to "node16" and added "moduleResolution": "node16" so TypeScript emits a true dynamic import() expression (rather than compiling it to require()), enabling the CJS extension host to load the ESM-only ora package
  • src/extension.ts: Replaced the static require-style import with a dynamic import('ora') call in the constructor; the resolved Ora instance's frame() method is stored as a spinnerFrame function reference and used in place of the previous statusBarSpinner.frame() calls

Since ora v5+, the package is ESM-only. The frame() method returns the next spinner frame string and remains a drop-in replacement for the previous elegant-spinner behaviour.

@rzhao271
Copy link
Copy Markdown

rzhao271 commented Apr 1, 2026

@copilot Use the latest version of ora instead.

@rzhao271 rzhao271 marked this pull request as ready for review April 1, 2026 23:58
Agent-Logs-Url: https://github.com/microsoft/vscode-azurecli/sessions/c358cc1a-22e5-4573-b408-c1f9e67a4c73

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

@copilot Use the latest version of ora instead.

Updated to ora 9.3.0 in commit 6749877. Since v5+ is ESM-only, I switched tsconfig.json to "module": "node16" so TypeScript emits a true dynamic import() (rather than compiling it to require()), and replaced the static import with a dynamic import('ora') in the constructor that stores a spinnerFrame function reference used in the status bar interval.

@rzhao271
Copy link
Copy Markdown

rzhao271 commented Apr 2, 2026

Closing as wontfix.

@rzhao271 rzhao271 closed this Apr 2, 2026
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