adsmarch-ads-mcp 0.1.6 → 0.1.7
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 +1 -1
- package/src/index.mjs +10 -3
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -86,11 +86,18 @@ if (selected.includes('google') && !existsSync(googleBinary) && process.env.ADS_
|
|
|
86
86
|
// Meta adapter ships as a compiled npm dependency. Resolve it through the
|
|
87
87
|
// Node module resolver so it works both when deps are installed inside the
|
|
88
88
|
// package (dev) and when npm hoists them to a parent node_modules (npx/global).
|
|
89
|
-
|
|
89
|
+
// The upstream package only exposes an "import" condition in its exports map,
|
|
90
|
+
// so ESM import.meta.resolve is the primary strategy (require.resolve would
|
|
91
|
+
// throw ERR_PACKAGE_PATH_NOT_EXPORTED).
|
|
90
92
|
let metaEntry;
|
|
91
93
|
try {
|
|
92
|
-
metaEntry =
|
|
93
|
-
} catch { /*
|
|
94
|
+
metaEntry = fileURLToPath(import.meta.resolve('@mikusnuz/meta-ads-mcp'));
|
|
95
|
+
} catch { /* ESM resolution failure: try CJS resolution, then local path */ }
|
|
96
|
+
if (!metaEntry || !existsSync(metaEntry)) {
|
|
97
|
+
try {
|
|
98
|
+
metaEntry = createRequire(import.meta.url).resolve('@mikusnuz/meta-ads-mcp');
|
|
99
|
+
} catch { /* exports map blocks the require condition: fall back */ }
|
|
100
|
+
}
|
|
94
101
|
if (!metaEntry || !existsSync(metaEntry)) {
|
|
95
102
|
metaEntry = resolve(root, 'node_modules', '@mikusnuz', 'meta-ads-mcp', 'dist', 'index.js');
|
|
96
103
|
}
|