project-compass 3.4.0 → 3.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.
- package/README.md +1 -1
- package/package.json +2 -2
- package/src/cli.js +13 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-compass",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Futuristic project navigator and runner for Node, Python, Rust, and Go",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"fast-glob": "^3.3.3",
|
|
27
27
|
"ink": "^5.1.0",
|
|
28
28
|
"kleur": "^4.1.5",
|
|
29
|
-
"react": "^
|
|
29
|
+
"react": "^18.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"eslint": "^9.19.0",
|
package/src/cli.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React, {useCallback, useEffect, useMemo, useRef, useState, memo} from 'react';
|
|
3
3
|
import {render, Box, Text, useApp, useInput} from 'ink';
|
|
4
4
|
import path from 'path';
|
|
5
|
+
import {fileURLToPath} from 'url';
|
|
5
6
|
import fs from 'fs';
|
|
6
7
|
import kleur from 'kleur';
|
|
7
8
|
import {execa} from 'execa';
|
|
@@ -441,6 +442,10 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
441
442
|
if (hasRunningTasks) setQuitConfirm(true); else exit();
|
|
442
443
|
return;
|
|
443
444
|
}
|
|
445
|
+
if (isCtrlC) {
|
|
446
|
+
if (hasRunningTasks) setQuitConfirm(true); else exit();
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
444
449
|
if (shiftCombo('c') && viewMode === 'detail' && selectedProject) { setCustomMode(true); setCustomInput(''); setCustomCursor(0); return; }
|
|
445
450
|
|
|
446
451
|
const actionKey = normalizedInput && ACTION_MAP[normalizedInput];
|
|
@@ -558,7 +563,7 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
558
563
|
create(Box, {marginTop: 1, flexDirection: 'column'},
|
|
559
564
|
create(Box, {flexDirection: 'row', justifyContent: 'space-between'}, create(Text, {bold: true, color: 'yellow'}, `Output: ${activeTask?.name || 'None'}`), create(Text, {dimColor: true}, logOffset ? `Scrolled ${logOffset} lines` : 'Live log view')),
|
|
560
565
|
create(OutputPanel, {activeTask, logOffset}),
|
|
561
|
-
create(Box, {marginTop: 1, flexDirection: 'row', justifyContent: 'space-between'}, create(Text, {dimColor: true}, running ? 'Type to feed stdin; Enter: submit
|
|
566
|
+
create(Box, {marginTop: 1, flexDirection: 'row', justifyContent: 'space-between'}, create(Text, {dimColor: true}, running ? 'Type to feed stdin; Enter: submit.' : 'Run a command or press Shift+T to switch tasks.'), create(Text, {dimColor: true}, `${toggleHint}, Shift+S: Structure Guide`)),
|
|
562
567
|
create(Box, {marginTop: 1, flexDirection: 'row', borderStyle: 'round', borderColor: running ? 'green' : 'gray', paddingX: 1}, create(Text, {bold: true, color: 'green'}, running ? ' Stdin buffer ' : ' Input ready '), create(Box, {marginLeft: 1}, create(CursorText, {value: stdinBuffer || (running ? '' : 'Start a command to feed stdin'), cursorIndex: stdinCursor, active: running})))
|
|
563
568
|
),
|
|
564
569
|
config.showHelpCards && create(Box, {marginTop: 1, flexDirection: 'row', justifyContent: 'space-between', flexWrap: 'wrap'}, [
|
|
@@ -580,6 +585,7 @@ function parseArgs() {
|
|
|
580
585
|
if ((token === '--dir' || token === '--path') && tokens[i + 1]) { args.root = tokens[i + 1]; i += 1; }
|
|
581
586
|
else if (token === '--mode' && tokens[i + 1]) { args.mode = tokens[i + 1]; i += 1; }
|
|
582
587
|
else if (token === '--help' || token === '-h') args.help = true;
|
|
588
|
+
else if (token === '--version' || token === '-v') args.version = true;
|
|
583
589
|
else if (token === '--studio') args.view = 'studio';
|
|
584
590
|
}
|
|
585
591
|
return args;
|
|
@@ -587,6 +593,12 @@ function parseArgs() {
|
|
|
587
593
|
|
|
588
594
|
async function main() {
|
|
589
595
|
const args = parseArgs();
|
|
596
|
+
if (args.version) {
|
|
597
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
598
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8'));
|
|
599
|
+
console.log(`v${pkg.version}`);
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
590
602
|
if (args.help) {
|
|
591
603
|
console.log(kleur.cyan('Project Compass · Ink project navigator/runner'));
|
|
592
604
|
console.log('');
|