@taj-special/dravix-code 1.4.0 → 1.4.2

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 +22 -13
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -34,25 +34,34 @@ 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 - 6, 56);
38
38
  const BC = chalk.hex('#6366f1');
39
39
  const Wt = chalk.hex('#e2e8f0');
40
40
  const Dim = chalk.hex('#6b7280');
41
41
  const G = chalk.hex('#34d399');
42
42
  const R = chalk.hex('#f87171');
43
+ function row(text) {
44
+ const visible = text.replace(/\x1b\[[0-9;]*m/g, '').length;
45
+ const pad = Math.max(W - visible, 0);
46
+ return ' ' + BC('│ ') + text + ' '.repeat(pad) + BC(' │');
47
+ }
48
+ function btnRow(leftBtn, rightText) {
49
+ const lv = leftBtn.replace(/\x1b\[[0-9;]*m/g, '').length;
50
+ const rv = rightText.replace(/\x1b\[[0-9;]*m/g, '').length;
51
+ return ' ' + BC('│ ') + leftBtn + rightText + ' '.repeat(Math.max(W - lv - rv, 0)) + BC(' │');
52
+ }
43
53
  console.clear();
44
- 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) + '╯'));
54
+ console.log(' ' + BC('╭' + '─'.repeat(W + 2) + '╮'));
55
+ console.log(row(chalk.hex('#a78bfa').bold('Dravix Code') + Dim(' - first time in this project')));
56
+ console.log(' ' + BC('' + ''.repeat(W + 2) + ''));
57
+ console.log(row(Wt('Open Dravix Code in:')));
58
+ console.log(row(' ' + chalk.hex('#c4b5fd').bold(projectName)));
59
+ console.log(' ' + BC('' + ''.repeat(W + 2) + ''));
60
+ console.log(row(''));
61
+ console.log(btnRow(G.bold(' [ Enter ] '), Wt(' Yes, open here')));
62
+ console.log(btnRow(R.bold(' [ Esc ] '), Wt(' No, exit')));
63
+ console.log(row(''));
64
+ console.log(' ' + BC('' + ''.repeat(W + 2) + ''));
56
65
  console.log('');
57
66
  return new Promise((resolve) => {
58
67
  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.2",
4
4
  "description": "AI-powered coding assistant CLI — Dravix Code",
5
5
  "type": "module",
6
6
  "bin": {