patchcord 0.5.55 → 0.5.56
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/bin/patchcord.mjs +26 -8
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -725,18 +725,32 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
725
725
|
globalCliInstalled = true;
|
|
726
726
|
} catch {
|
|
727
727
|
try {
|
|
728
|
-
const
|
|
729
|
-
mkdirSync(
|
|
730
|
-
cpSync(pluginRoot,
|
|
728
|
+
const fbStableDir = join(HOME, ".local", "share", "patchcord");
|
|
729
|
+
mkdirSync(fbStableDir, { recursive: true });
|
|
730
|
+
cpSync(pluginRoot, fbStableDir, { recursive: true, force: true });
|
|
731
731
|
const localBin = join(HOME, ".local", "bin");
|
|
732
732
|
mkdirSync(localBin, { recursive: true });
|
|
733
733
|
const wrapper = join(localBin, "patchcord");
|
|
734
|
-
writeFileSync(wrapper, `#!/bin/sh\nexec node "${join(
|
|
734
|
+
writeFileSync(wrapper, `#!/bin/sh\nexec node "${join(fbStableDir, "bin", "patchcord.mjs")}" "$@"\n`);
|
|
735
735
|
chmodSync(wrapper, 0o755);
|
|
736
736
|
globalCliInstalled = true;
|
|
737
737
|
} catch {}
|
|
738
738
|
}
|
|
739
739
|
|
|
740
|
+
// ── Stable copy for Claude Code plugin marketplace ──────────
|
|
741
|
+
// Claude Code's `plugin marketplace add` stores the literal directory
|
|
742
|
+
// path in its plugin manifest. If we point it at `pluginRoot` (the
|
|
743
|
+
// npx ephemeral cache), that directory gets wiped on the next `npx`
|
|
744
|
+
// invocation of any other package, and every Claude Code session
|
|
745
|
+
// afterward errors: "Plugin directory does not exist: ...".
|
|
746
|
+
// Maintain a stable mirror at ~/.local/share/patchcord/ and point
|
|
747
|
+
// the marketplace there instead.
|
|
748
|
+
const stablePluginDir = join(HOME, ".local", "share", "patchcord");
|
|
749
|
+
try {
|
|
750
|
+
mkdirSync(stablePluginDir, { recursive: true });
|
|
751
|
+
cpSync(pluginRoot, stablePluginDir, { recursive: true, force: true });
|
|
752
|
+
} catch {}
|
|
753
|
+
|
|
740
754
|
// ── Global setup (silent if nothing changed) ──
|
|
741
755
|
let globalChanges = [];
|
|
742
756
|
if (globalCliInstalled) globalChanges.push("Patchcord CLI installed globally");
|
|
@@ -750,10 +764,14 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
750
764
|
try { rmSync(npmCachePatchcord, { recursive: true, force: true }); } catch {}
|
|
751
765
|
}
|
|
752
766
|
|
|
753
|
-
// Always re-add marketplace (
|
|
754
|
-
//
|
|
755
|
-
//
|
|
756
|
-
|
|
767
|
+
// Always re-add marketplace (point at the STABLE mirror, not pluginRoot
|
|
768
|
+
// which is the npx ephemeral cache). Claude Code stores the literal
|
|
769
|
+
// path in its plugin manifest — pointing at npx cache breaks every
|
|
770
|
+
// future session as soon as that cache dir is swept.
|
|
771
|
+
// Remove any prior marketplace registration first so the path actually
|
|
772
|
+
// updates for users who got the buggy npx-cache path on an earlier install.
|
|
773
|
+
run(`claude plugin marketplace remove patchcord-marketplace`);
|
|
774
|
+
run(`claude plugin marketplace add "${stablePluginDir}"`);
|
|
757
775
|
const installed = run(`claude plugin list`)?.includes("patchcord");
|
|
758
776
|
wasPluginInstalled = !!installed;
|
|
759
777
|
if (installed) {
|