In #1512 I exported Recommend methods in addition to the existing default function export, to allow algoliasearch to import them in CJS.
This causes an issue as now there are multiple exports, which means recommend() cannot be accessed directly and is instead available from require('@algolia/recommend').default.
To prevent this, the Recommend methods are now augmenting the default function export.
[!NOTE]
The existing version of api-extractor does not correctly resolve type imports, resulting in import('../xyz').Type statements with relative paths that are incorrect. I updated to the fixed version and went through all 22 type declaration files. There are no meaningful changes (in some cases type imports are aliased with a suffix to prevent conflicts, ie: import { Type as Type_2 } from '...', but all exports have the appropriate name, and now imports are properly resolved.
In #1512 I exported Recommend methods in addition to the existing default function export, to allow
algoliasearch
to import them in CJS.This causes an issue as now there are multiple exports, which means
recommend()
cannot be accessed directly and is instead available fromrequire('@algolia/recommend').default
.To prevent this, the Recommend methods are now augmenting the default function export.
Tests on the built bundles are also added to catch this in CI.
Fixes #1515