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.
- package/bin/team-context.js +19 -11
- package/package.json +1 -1
package/bin/team-context.js
CHANGED
|
@@ -4550,8 +4550,15 @@ const COMMANDS = {
|
|
|
4550
4550
|
}
|
|
4551
4551
|
let newVersion = '';
|
|
4552
4552
|
try {
|
|
4553
|
-
|
|
4554
|
-
|
|
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
|
-
|
|
4678
|
+
// Primary: read from package.json (always accurate after npm install)
|
|
4672
4679
|
try {
|
|
4673
|
-
const
|
|
4674
|
-
console.log(`Wayfind v${version}`);
|
|
4675
|
-
} catch (
|
|
4676
|
-
//
|
|
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
|
|
4679
|
-
console.log(`Wayfind v${
|
|
4680
|
-
} catch (
|
|
4681
|
-
console.error('Version unknown
|
|
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