pi-ext
bugabingas pi extensions
owned by bugabinga
fix: scope Pi package migration floor
bb9416fb027d237a46dd87e8c475111de8285754
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (2)
.pi/skills/modernize/scripts/audit.mjs
Modified121 121 export function collectPackageVersions(lock) {
123 123 lock
&& typeof lock
=== "object" && lock.packages
? lock.packages
: {};
124 - return Object.
entries(packages)
125 - .flatMap(([location, value])
=> {
126 - const marker
= "node_modules/@earendil-works/";
127 - const index
= location.lastIndexOf(marker);
128 - if (index
=== -1 || !value
|| typeof value
!== "object")
return [];
129 - const name
= location.slice(index
+ "node_modules/".length);
130 - return typeof value.version
=== "string" 131 - ? [{ name, version: value.version }]
134 - .sort((a, b)
=> a.name.localeCompare(b.name));
124 + const found
= new Map();
125 + for (
const [location, value]
of Object.
entries(packages)) {
126 + const match
= /(?:^|\/)node_modules\/(@earendil-works\/pi-[^/]+)$/.exec(
129 + if (
!match
|| !value
|| typeof value
!== "object")
continue;
130 + if (
typeof value.version
!== "string")
continue;
131 + const item
= { name: match[
1], version: value.version };
132 + found.set(
`${item.name}
@${item.version}
`, item);
134 + return [
...found.values()].sort(
136 + a.name.localeCompare(b.name)
|| compareVersions(a.version, b.version),
137 140 export function parseGitFiles(raw) {
.pi/skills/modernize/scripts/audit.test.mjs
Modified79 79 collectPackageVersions({
81 81 "node_modules/@earendil-works/pi-ai": { version: "0.80.4" },
82 + "extensions/x/node_modules/@earendil-works/pi-ai": {
82 85 "node_modules/@earendil-works/pi-coding-agent": {
88 + "node_modules/@earendil-works/pi-coding-agent/node_modules/partial-json":
85 92 "node_modules/vitest": { version: "4.1.9" },