portable-agent-layer 0.85.11 → 0.85.12
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/package.json +1 -1
- package/src/cli/doctor/state.ts +35 -5
package/package.json
CHANGED
package/src/cli/doctor/state.ts
CHANGED
|
@@ -209,13 +209,43 @@ function bindingFindings(): Finding[] {
|
|
|
209
209
|
: issues.map(bindingFinding);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
function resolves(name: string, from: string): boolean {
|
|
213
|
+
try {
|
|
214
|
+
Bun.resolveSync(`${name}/package.json`, from);
|
|
215
|
+
return true;
|
|
216
|
+
} catch {
|
|
217
|
+
try {
|
|
218
|
+
Bun.resolveSync(name, from);
|
|
219
|
+
return true;
|
|
220
|
+
} catch {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export function unresolvedDependencies(pkg: string): string[] {
|
|
227
|
+
try {
|
|
228
|
+
const { dependencies = {} } = JSON.parse(
|
|
229
|
+
readFileSync(resolve(pkg, "package.json"), "utf-8")
|
|
230
|
+
);
|
|
231
|
+
return Object.keys(dependencies).filter((name) => !resolves(name, pkg));
|
|
232
|
+
} catch {
|
|
233
|
+
return [];
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
212
237
|
function dependencyFinding(): Finding {
|
|
213
|
-
|
|
238
|
+
const missing = unresolvedDependencies(palPkg());
|
|
239
|
+
return missing.length === 0
|
|
214
240
|
? passed("dependencies", "Dependencies installed")
|
|
215
|
-
: failing(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
241
|
+
: failing(
|
|
242
|
+
"dependencies",
|
|
243
|
+
`PAL's dependencies do not resolve: ${missing.join(", ")}`,
|
|
244
|
+
{
|
|
245
|
+
say: "Install them",
|
|
246
|
+
command: "pal cli install",
|
|
247
|
+
}
|
|
248
|
+
);
|
|
219
249
|
}
|
|
220
250
|
|
|
221
251
|
export function stateFindings(): Finding[] {
|