Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove cli-spinners package and hence remove warning #68

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@clack/prompts": "^0.8.2",
"ai": "^4.0.13",
"chalk": "^5.3.0",
"cli-spinners": "^3.2.0",
"date-fns": "^4.1.0",
"dotenv": "^16.4.7",
"tiktoken": "^1.0.17",
Expand Down
10 changes: 5 additions & 5 deletions src/commands/chat/streaming.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import cliSpinners from 'cli-spinners';
import { colorAssistant } from '../../colors.js';

const spinner = cliSpinners.dots;
const frames = spinner.frames.map((f) => colorAssistant(f));
// Spinner params
const SPINNER_INTERVAL = 80; //ms
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'].map((f) => colorAssistant(f));

// State
let currentLine = '';
let outputtedLines: string[] = [];

let intervalRef: NodeJS.Timeout | undefined;
let frameIndex = 0;

Expand Down Expand Up @@ -54,7 +54,7 @@ export function startSpinner() {
clearInterval(intervalRef);
}

intervalRef = setInterval(renderFrame, spinner.interval).unref();
intervalRef = setInterval(renderFrame, SPINNER_INTERVAL).unref();
}

function renderFrame() {
Expand Down
8 changes: 0 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ __metadata:
"@vitest/coverage-v8": "npm:^2.1.8"
ai: "npm:^4.0.13"
chalk: "npm:^5.3.0"
cli-spinners: "npm:^3.2.0"
date-fns: "npm:^4.1.0"
del-cli: "npm:^6.0.0"
dotenv: "npm:^16.4.7"
Expand Down Expand Up @@ -3159,13 +3158,6 @@ __metadata:
languageName: node
linkType: hard

"cli-spinners@npm:^3.2.0":
version: 3.2.0
resolution: "cli-spinners@npm:3.2.0"
checksum: 10/6612d3880c87ad1749556ff463c41499ebeab4024ee4afc41a8731d0bcd1679b18bb67a98df7e647cfa49adcff1ce86c049e141a4da028bb12831d7f13111d89
languageName: node
linkType: hard

"cli-width@npm:^4.1.0":
version: 4.1.0
resolution: "cli-width@npm:4.1.0"
Expand Down
Loading