pi-powerline 0.6.3 → 0.7.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/CHANGELOG.md +19 -0
- package/extensions/header.ts +9 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [0.7.1](https://github.com/jwu/pi-powerline/compare/v0.7.0...v0.7.1) (2026-05-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **header:** resolve user-scoped npm package dir with npm/ prefix ([5e5bb18](https://github.com/jwu/pi-powerline/commit/5e5bb189602e68488d57cc211a806f6c5a6d6a1b))
|
|
7
|
+
|
|
8
|
+
# [0.7.0](https://github.com/jwu/pi-powerline/compare/v0.6.3...v0.7.0) (2026-05-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **auto-format:** update pi import package ([3d67f66](https://github.com/jwu/pi-powerline/commit/3d67f6650be48de18b90f8c4582609f691e60cd3))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **header:** tag path packages distinctly ([471c409](https://github.com/jwu/pi-powerline/commit/471c409457de296ff94a96812e9706938981e5aa))
|
|
19
|
+
|
|
1
20
|
## [0.6.3](https://github.com/jwu/pi-powerline/compare/v0.6.2...v0.6.3) (2026-05-24)
|
|
2
21
|
|
|
3
22
|
|
package/extensions/header.ts
CHANGED
|
@@ -432,8 +432,8 @@ function resolvePackageDir(source: string, cwd: string, home = getHomeDir()): st
|
|
|
432
432
|
// project-scoped install (.pi/npm/node_modules/<name>)
|
|
433
433
|
const projectDir = join(cwd, '.pi', 'npm', 'node_modules', name);
|
|
434
434
|
if (existsSync(projectDir)) return projectDir;
|
|
435
|
-
// user-scoped install (~/.pi/agent/node_modules/<name>)
|
|
436
|
-
const userDir = join(home, '.pi', 'agent', 'node_modules', name);
|
|
435
|
+
// user-scoped install (~/.pi/agent/npm/node_modules/<name>)
|
|
436
|
+
const userDir = join(home, '.pi', 'agent', 'npm', 'node_modules', name);
|
|
437
437
|
if (existsSync(userDir)) return userDir;
|
|
438
438
|
// global npm root
|
|
439
439
|
if (npmRoot) {
|
|
@@ -450,13 +450,19 @@ function resolvePackageDir(source: string, cwd: string, home = getHomeDir()): st
|
|
|
450
450
|
|
|
451
451
|
// ── getPackages: name+version from each configured package ──
|
|
452
452
|
|
|
453
|
+
function getPackageScopeTag(source: string, scope: PackageSource['scope']): string {
|
|
454
|
+
const isPathSource = !source.startsWith('npm:');
|
|
455
|
+
if (scope === 'project') return isPathSource ? ' [lp]' : ' [l]';
|
|
456
|
+
return isPathSource ? ' [gp]' : ' [g]';
|
|
457
|
+
}
|
|
458
|
+
|
|
453
459
|
function getPackages(cwd: string, home = getHomeDir()): string[] {
|
|
454
460
|
const sources = readPackageSources(cwd, home);
|
|
455
461
|
const results: string[] = [];
|
|
456
462
|
|
|
457
463
|
for (const { source, scope } of sources) {
|
|
458
464
|
const pkgDir = resolvePackageDir(source, cwd, home);
|
|
459
|
-
const scopeTag = scope
|
|
465
|
+
const scopeTag = getPackageScopeTag(source, scope);
|
|
460
466
|
if (!pkgDir) {
|
|
461
467
|
// fallback: show npm package name or raw source
|
|
462
468
|
const name = source.startsWith('npm:') ? source.slice(4) : source;
|
package/package.json
CHANGED