project-compass 3.4.0 → 3.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 (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/src/cli.js +8 -0
package/README.md CHANGED
@@ -25,7 +25,7 @@ npm install -g project-compass
25
25
  ## Usage
26
26
 
27
27
  ```bash
28
- project-compass [--dir /path/to/workspace] [--studio]
28
+ project-compass [--dir /path/to/workspace] [--studio] [--version]
29
29
  ```
30
30
 
31
31
  ### Keyboard Guide
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-compass",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
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": "^19.0.0"
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';
@@ -580,6 +581,7 @@ function parseArgs() {
580
581
  if ((token === '--dir' || token === '--path') && tokens[i + 1]) { args.root = tokens[i + 1]; i += 1; }
581
582
  else if (token === '--mode' && tokens[i + 1]) { args.mode = tokens[i + 1]; i += 1; }
582
583
  else if (token === '--help' || token === '-h') args.help = true;
584
+ else if (token === '--version' || token === '-v') args.version = true;
583
585
  else if (token === '--studio') args.view = 'studio';
584
586
  }
585
587
  return args;
@@ -587,6 +589,12 @@ function parseArgs() {
587
589
 
588
590
  async function main() {
589
591
  const args = parseArgs();
592
+ if (args.version) {
593
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
594
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8'));
595
+ console.log(`v${pkg.version}`);
596
+ return;
597
+ }
590
598
  if (args.help) {
591
599
  console.log(kleur.cyan('Project Compass · Ink project navigator/runner'));
592
600
  console.log('');