@companion-ai/feynman 0.2.1 → 0.2.2
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
CHANGED
|
@@ -27,53 +27,7 @@ const settingsPath = resolve(appRoot, ".feynman", "settings.json");
|
|
|
27
27
|
const workspaceDir = resolve(appRoot, ".feynman", "npm");
|
|
28
28
|
const workspacePackageJsonPath = resolve(workspaceDir, "package.json");
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
if (!existsSync(settingsPath)) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const settings = JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
36
|
-
const packageSpecs = Array.isArray(settings.packages)
|
|
37
|
-
? settings.packages
|
|
38
|
-
.filter((value) => typeof value === "string" && value.startsWith("npm:"))
|
|
39
|
-
.map((value) => value.slice(4))
|
|
40
|
-
: [];
|
|
41
|
-
|
|
42
|
-
if (packageSpecs.length === 0) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
mkdirSync(workspaceDir, { recursive: true });
|
|
47
|
-
|
|
48
|
-
writeFileSync(
|
|
49
|
-
workspacePackageJsonPath,
|
|
50
|
-
JSON.stringify(
|
|
51
|
-
{
|
|
52
|
-
name: "pi-extensions",
|
|
53
|
-
private: true,
|
|
54
|
-
dependencies: Object.fromEntries(packageSpecs.map((spec) => [spec, "latest"])),
|
|
55
|
-
},
|
|
56
|
-
null,
|
|
57
|
-
2,
|
|
58
|
-
) + "\n",
|
|
59
|
-
"utf8",
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const npmExec = process.env.npm_execpath;
|
|
63
|
-
const install = npmExec
|
|
64
|
-
? spawnSync(process.execPath, [npmExec, "install", "--prefix", workspaceDir, ...packageSpecs], {
|
|
65
|
-
stdio: "inherit",
|
|
66
|
-
})
|
|
67
|
-
: spawnSync("npm", ["install", "--prefix", workspaceDir, ...packageSpecs], {
|
|
68
|
-
stdio: "inherit",
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
if (install.status !== 0) {
|
|
72
|
-
console.warn("[feynman] warning: failed to preinstall default Pi packages into .feynman/npm");
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
ensurePackageWorkspace();
|
|
30
|
+
// Pi handles package installation from .feynman/settings.json at runtime — no manual install needed
|
|
77
31
|
|
|
78
32
|
if (existsSync(packageJsonPath)) {
|
|
79
33
|
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|