project-compass 2.8.0 → 2.8.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.
- package/package.json +1 -1
- package/src/cli.js +3 -10
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import fs from 'fs';
|
|
|
6
6
|
import kleur from 'kleur';
|
|
7
7
|
import {execa} from 'execa';
|
|
8
8
|
import {discoverProjects, SCHEMA_GUIDE, checkBinary} from './projectDetection.js';
|
|
9
|
-
import {CONFIG_PATH,
|
|
9
|
+
import {CONFIG_PATH, ensureConfigDir} from './configPaths.js';
|
|
10
10
|
|
|
11
11
|
const create = React.createElement;
|
|
12
12
|
const DEFAULT_CONFIG = {customCommands: {}};
|
|
@@ -17,7 +17,6 @@ const OUTPUT_WINDOW_HEIGHT = OUTPUT_WINDOW_SIZE + 2;
|
|
|
17
17
|
const PROJECTS_MIN_WIDTH = 32;
|
|
18
18
|
const DETAILS_MIN_WIDTH = 44;
|
|
19
19
|
const HELP_CARD_MIN_WIDTH = 28;
|
|
20
|
-
const RECENT_RUN_LIMIT = 5;
|
|
21
20
|
const ACTION_MAP = {
|
|
22
21
|
b: 'build',
|
|
23
22
|
t: 'test',
|
|
@@ -175,7 +174,6 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
175
174
|
const [tasks, setTasks] = useState([]);
|
|
176
175
|
const [activeTaskId, setActiveTaskId] = useState(null);
|
|
177
176
|
const [logOffset, setLogOffset] = useState(0);
|
|
178
|
-
const [lastAction, setLastAction] = useState(null);
|
|
179
177
|
const [customMode, setCustomMode] = useState(false);
|
|
180
178
|
const [customInput, setCustomInput] = useState('');
|
|
181
179
|
const [customCursor, setCustomCursor] = useState(0);
|
|
@@ -185,7 +183,6 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
185
183
|
const [stdinBuffer, setStdinBuffer] = useState('');
|
|
186
184
|
const [stdinCursor, setStdinCursor] = useState(0);
|
|
187
185
|
const [showHelp, setShowHelp] = useState(false);
|
|
188
|
-
const [recentRuns, setRecentRuns] = useState([]);
|
|
189
186
|
const selectedProject = projects[selectedIndex] || null;
|
|
190
187
|
const runningProcessMap = useRef(new Map());
|
|
191
188
|
const lastCommandRef = useRef(null);
|
|
@@ -232,12 +229,6 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
232
229
|
setTasks(prev => [...prev, newTask]);
|
|
233
230
|
setActiveTaskId(taskId);
|
|
234
231
|
lastCommandRef.current = {project, commandMeta};
|
|
235
|
-
setLastAction(newTask.name);
|
|
236
|
-
|
|
237
|
-
setRecentRuns((prev) => {
|
|
238
|
-
const entry = {project: project.name, command: commandLabel, time: new Date().toLocaleTimeString()};
|
|
239
|
-
return [entry, ...prev].slice(0, RECENT_RUN_LIMIT);
|
|
240
|
-
});
|
|
241
232
|
|
|
242
233
|
try {
|
|
243
234
|
const subprocess = execa(commandMeta.command[0], commandMeta.command.slice(1), {
|
|
@@ -405,6 +396,8 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
405
396
|
}
|
|
406
397
|
});
|
|
407
398
|
|
|
399
|
+
const projectCountLabel = `${projects.length} project${projects.length === 1 ? '' : 's'}`;
|
|
400
|
+
|
|
408
401
|
if (mainView === 'studio') return create(Studio);
|
|
409
402
|
|
|
410
403
|
if (mainView === 'tasks') {
|