mirror of
https://github.com/morluto/rea
synced 2026-10-28 23:11:11 -04:00
fix(plugins): separate source and package launcher modules
This commit is contained in:
@@ -63,8 +63,6 @@
|
||||
"bridge/mitmproxy/capture.py",
|
||||
"scripts/rea.mjs",
|
||||
"scripts/plugin-mcp-launcher.mjs",
|
||||
"src/application/PackageRunnerCommand.mjs",
|
||||
"src/application/PackageRunnerCommand.d.mts",
|
||||
"scripts/rea-android-workspace-guardian.mjs",
|
||||
"scripts/electron-active-hook.cjs",
|
||||
"scripts/electron-active-hook-boundaries.cjs",
|
||||
|
||||
@@ -7,8 +7,6 @@ import { constants, tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import { packageRunnerCommand } from "../src/application/PackageRunnerCommand.mjs";
|
||||
|
||||
// Keep the package name at the launcher boundary so release automation updates
|
||||
// only a scalar version in plugin JSON, never a compound package specifier.
|
||||
// No build, dependency installation or ambient latest-version lookup is needed
|
||||
@@ -53,6 +51,12 @@ async function launch(packageSpecifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
const runnerModule = await import(
|
||||
(await isGitSourceCheckout())
|
||||
? "../src/application/PackageRunnerCommand.mjs"
|
||||
: "../dist/application/PackageRunnerCommand.mjs",
|
||||
);
|
||||
const { packageRunnerCommand } = runnerModule;
|
||||
const [command, ...args] = packageRunnerCommand(
|
||||
"npx",
|
||||
packageSpecifier,
|
||||
@@ -137,6 +141,16 @@ async function launch(packageSpecifier) {
|
||||
});
|
||||
}
|
||||
|
||||
async function isGitSourceCheckout() {
|
||||
try {
|
||||
await access(new URL("../.git", import.meta.url));
|
||||
return true;
|
||||
} catch (cause) {
|
||||
if (isMissing(cause)) return false;
|
||||
throw cause;
|
||||
}
|
||||
}
|
||||
|
||||
async function launchWindowsFallback(command, args, workingDirectory) {
|
||||
let spawnOwnedProviderProcess;
|
||||
try {
|
||||
|
||||
@@ -100,8 +100,6 @@ export async function verifyPackagePack({ root, workspace }) {
|
||||
throw new Error("Packaged Codex MCP server declaration is missing");
|
||||
for (const path of [
|
||||
"scripts/plugin-mcp-launcher.mjs",
|
||||
"src/application/PackageRunnerCommand.mjs",
|
||||
"src/application/PackageRunnerCommand.d.mts",
|
||||
"dist/application/PackageRunnerCommand.mjs",
|
||||
])
|
||||
if (!packedFiles.includes(`package/${path}`))
|
||||
|
||||
Reference in New Issue
Block a user