fix(plugins): enhance plugin installation and script handling
- Updated the `pnpm install` command in `plugin-install.js` to include the `--ignore-workspace` flag, ensuring proper installation of plugins within the app tree. - Improved the `instantiateScriptSource` function in `script-sandbox.js` to resolve `pluginDir` more effectively, allowing for better package management. - Added a new smoke test in `plugins-smoke.js` to validate the ability to require additional packages from plugin directories, enhancing testing coverage for plugin functionality. - Updated documentation in `AGENTS.md` to reflect changes in the installation command.
This commit is contained in:
@@ -51,9 +51,18 @@ export async function pnpmInstallPlugin(dir) {
|
||||
}
|
||||
if (!hasDeps) return { skipped: true };
|
||||
|
||||
// --ignore-workspace: plugins live under the app tree but are not workspace
|
||||
// packages; without this, pnpm install --dir can no-op against the root monorepo.
|
||||
await execFileAsync(
|
||||
"pnpm",
|
||||
["install", "--dir", dir, "--ignore-scripts", "--prefer-offline"],
|
||||
[
|
||||
"install",
|
||||
"--dir",
|
||||
dir,
|
||||
"--ignore-scripts",
|
||||
"--prefer-offline",
|
||||
"--ignore-workspace",
|
||||
],
|
||||
{
|
||||
cwd: dir,
|
||||
env: { ...process.env, CI: "1" },
|
||||
|
||||
Reference in New Issue
Block a user