@mintlify/common 1.0.1236 → 1.0.1237

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.
@@ -100,7 +100,16 @@ export const resolveAllImports = (params) => __awaiter(void 0, void 0, void 0, f
100
100
  }
101
101
  }
102
102
  try {
103
- const contentWithResolvedImport = yield resolveImport(specifier, ast, importedSnippet.tree, exportMap, onWarning !== null && onWarning !== void 0 ? onWarning : ((warning) => console.log(warning.message)));
103
+ const contentWithResolvedImport = yield resolveImport(specifier, ast, importedSnippet.tree, exportMap, (warning) => {
104
+ // the collision itself doesn't know which page it happened in, so add it here
105
+ const located = Object.assign(Object.assign({}, warning), { message: `${warning.message} (in ${fileWithImports.filename}, importing ${resolvedPath})` });
106
+ if (onWarning) {
107
+ onWarning(located);
108
+ }
109
+ else {
110
+ console.log(located.message);
111
+ }
112
+ });
104
113
  if (contentWithResolvedImport == undefined) {
105
114
  throw new Error('Import failed to resolve');
106
115
  }
@@ -74,7 +74,9 @@ const replaceVariablesWithProps = (node, treeToInject, exportMap, snippetExportM
74
74
  return existing;
75
75
  let id = 0;
76
76
  let uniqueName = createUniqueVariableName(name, id);
77
- while (exportMap[uniqueName]) {
77
+ // Also skip the snippet's own exports: a nested snippet it already inlined declared `prop_0`,
78
+ // and reusing that name would let this tag's value overwrite the nested one
79
+ while (exportMap[uniqueName] || snippetExportMap[uniqueName]) {
78
80
  id += 1;
79
81
  uniqueName = createUniqueVariableName(name, id);
80
82
  }