Skip to content

Commit

Permalink
fix: remove json import warning (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjastrzebski authored Dec 8, 2024
1 parent 9327f99 commit d5c5de5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
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

0 comments on commit d5c5de5

Please sign in to comment.