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