wayfind 2.0.27 → 2.0.28

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/bin/team-context.js +19 -11
  2. package/package.json +1 -1
@@ -4550,8 +4550,15 @@ const COMMANDS = {
4550
4550
  }
4551
4551
  let newVersion = '';
4552
4552
  try {
4553
- const pkg = require(path.join(ROOT, 'package.json'));
4554
- newVersion = pkg.version;
4553
+ // After npm install, ROOT still points to the old code in memory.
4554
+ // Resolve the freshly installed package path from npm global root.
4555
+ const globalRoot = spawnSync('npm', ['root', '-g'], { stdio: 'pipe' });
4556
+ const freshPkgPath = path.join((globalRoot.stdout || '').toString().trim(), 'wayfind', 'package.json');
4557
+ if (fs.existsSync(freshPkgPath)) {
4558
+ newVersion = JSON.parse(fs.readFileSync(freshPkgPath, 'utf8')).version;
4559
+ } else {
4560
+ newVersion = require(path.join(ROOT, 'package.json')).version;
4561
+ }
4555
4562
  } catch (e) {
4556
4563
  // Can't read package.json
4557
4564
  }
@@ -4668,17 +4675,18 @@ const COMMANDS = {
4668
4675
  version: {
4669
4676
  desc: 'Print installed Wayfind version',
4670
4677
  run: () => {
4671
- const versionFile = path.join(HOME, '.claude', 'team-context', '.wayfind-version');
4678
+ // Primary: read from package.json (always accurate after npm install)
4672
4679
  try {
4673
- const version = fs.readFileSync(versionFile, 'utf8').trim();
4674
- console.log(`Wayfind v${version}`);
4675
- } catch (err) {
4676
- // Fall back to package.json version if no installed version file
4680
+ const pkg = require(path.join(ROOT, 'package.json'));
4681
+ console.log(`Wayfind v${pkg.version}`);
4682
+ } catch (e) {
4683
+ // Fallback: cached version file (may be stale after update)
4684
+ const versionFile = path.join(HOME, '.claude', 'team-context', '.wayfind-version');
4677
4685
  try {
4678
- const pkg = require(path.join(ROOT, 'package.json'));
4679
- console.log(`Wayfind v${pkg.version} (from package.json)`);
4680
- } catch (e) {
4681
- console.error('Version unknown (no .wayfind-version file found)');
4686
+ const version = fs.readFileSync(versionFile, 'utf8').trim();
4687
+ console.log(`Wayfind v${version}`);
4688
+ } catch (err) {
4689
+ console.error('Version unknown');
4682
4690
  process.exit(1);
4683
4691
  }
4684
4692
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wayfind",
3
- "version": "2.0.27",
3
+ "version": "2.0.28",
4
4
  "description": "Team decision trail for AI-assisted development. The connective tissue between product, engineering, and strategy.",
5
5
  "bin": {
6
6
  "wayfind": "./bin/team-context.js"