jfl 0.9.3 → 0.9.4
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
|
@@ -85,9 +85,24 @@ function getCurrentBranch(root: string): string {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// ─── Dedup guard ─────────────────────────────────────────────────────────────
|
|
89
|
+
// When developing jfl-cli locally, Pi discovers the extension from BOTH the
|
|
90
|
+
// local packages/pi/ AND the global npm-installed jfl package. Both run as
|
|
91
|
+
// separate factory calls in the same process. This guard ensures only the
|
|
92
|
+
// first one initializes — which is the local dev version (Pi loads project-
|
|
93
|
+
// local extensions before global packages).
|
|
94
|
+
|
|
95
|
+
const JFL_LOADED = Symbol.for("jfl-pi-extension-loaded")
|
|
96
|
+
|
|
88
97
|
// ─── Pi extension factory function ───────────────────────────────────────────
|
|
89
98
|
|
|
90
99
|
export default async function jflExtension(pi: any): Promise<void> {
|
|
100
|
+
// Skip if already loaded from another source (dedup)
|
|
101
|
+
if ((globalThis as any)[JFL_LOADED]) {
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
(globalThis as any)[JFL_LOADED] = true
|
|
105
|
+
|
|
91
106
|
let projectCwd = process.cwd()
|
|
92
107
|
let latestPiCtx: any = null
|
|
93
108
|
|