@taj-special/dravix-code 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli/index.js +26 -12
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -34,25 +34,39 @@ function markProjectVisited(hash) {
34
34
  }
35
35
  async function showFirstTimeDialog(projectName) {
36
36
  const cols = process.stdout.columns ?? 80;
37
- const W = Math.min(cols - 4, 58);
37
+ const W = Math.min(cols - 4, 56);
38
+ const inner = W + 2;
38
39
  const BC = chalk.hex('#6366f1');
39
40
  const Wt = chalk.hex('#e2e8f0');
40
41
  const Dim = chalk.hex('#6b7280');
41
42
  const G = chalk.hex('#34d399');
42
43
  const R = chalk.hex('#f87171');
44
+ const head = chalk.hex('#a78bfa').bold('Dravix Code') + Dim(' - first time in this project');
45
+ const projText = chalk.hex('#c4b5fd').bold(' ' + projectName);
46
+ function row(text) {
47
+ const visible = text.replace(/\x1b\[[0-9;]*m/g, '').length;
48
+ const pad = Math.max(inner - visible, 0);
49
+ return ' ' + BC('│') + ' ' + text + ' '.repeat(pad) + BC('│');
50
+ }
51
+ function padLine(fullWidth, left, right) {
52
+ const lVisible = left.replace(/\x1b\[[0-9;]*m/g, '').length;
53
+ const rVisible = right.replace(/\x1b\[[0-9;]*m/g, '').length;
54
+ const pad = Math.max(fullWidth - lVisible - rVisible, 0);
55
+ return left + right + ' '.repeat(pad);
56
+ }
43
57
  console.clear();
44
58
  console.log('');
45
- console.log(' ' + BC('╭' + '─'.repeat(W) + '╮'));
46
- console.log(' ' + BC('│') + ' ' + chalk.hex('#a78bfa').bold('Dravix Code') + Dim(' — first time in this project') + ' '.repeat(Math.max(W - 44, 0)) + BC('│'));
47
- console.log(' ' + BC('├' + '─'.repeat(W) + '┤'));
48
- console.log(' ' + BC('│') + ' ' + Wt('Open Dravix Code in:') + ' '.repeat(Math.max(W - 22, 0)) + BC('│'));
49
- console.log(' ' + BC('│') + ' ' + chalk.hex('#c4b5fd').bold(` ${projectName}`) + ' '.repeat(Math.max(W - projectName.length - 8, 0)) + BC('│'));
50
- console.log(' ' + BC('├' + '─'.repeat(W) + '┤'));
51
- console.log(' ' + BC('') + ' ' + ' '.repeat(Math.max(W - 28, 0)) + BC('│'));
52
- console.log(' ' + BC('│') + ' ' + G.bold(' [ Enter ] ') + Wt(' Yes, open here') + ' '.repeat(Math.max(W - 40, 0)) + BC('│'));
53
- console.log(' ' + BC('│') + ' ' + R.bold(' [ Esc ] ') + Wt(' No, exit') + ' '.repeat(Math.max(W - 39, 0)) + BC('│'));
54
- console.log(' ' + BC('') + ' ' + ' '.repeat(Math.max(W - 28, 0)) + BC('│'));
55
- console.log(' ' + BC('╰' + '─'.repeat(W) + '╯'));
59
+ console.log(' ' + BC('╭' + '─'.repeat(inner) + '╮'));
60
+ console.log(row(head));
61
+ console.log(' ' + BC('├' + '─'.repeat(inner) + '┤'));
62
+ console.log(row(Wt('Open Dravix Code in:')));
63
+ console.log(row(projText));
64
+ console.log(' ' + BC('├' + '─'.repeat(inner) + '┤'));
65
+ console.log(row(''));
66
+ console.log(row(padLine(inner - 2, G.bold(' [ Enter ] '), Wt(' Yes, open here'))));
67
+ console.log(row(padLine(inner - 2, R.bold(' [ Esc ] '), Wt(' No, exit'))));
68
+ console.log(row(''));
69
+ console.log(' ' + BC('╰' + '─'.repeat(inner) + '╯'));
56
70
  console.log('');
57
71
  return new Promise((resolve) => {
58
72
  process.stdin.setRawMode(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taj-special/dravix-code",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "AI-powered coding assistant CLI — Dravix Code",
5
5
  "type": "module",
6
6
  "bin": {