Closed ashley-evans closed 1 year ago
Waiting for Jest (or more accurately node experimental vm modules to be non-experimental) to fully support ESM before doing this. May be possible to achieve desired affect of having latest version by using dynamic import, however, would need to figure out a way of stopping TSC from compiling dynamic import into require
Value Added
Enables future work to update retext to the latest version
Description
Currently, the find keyphrase lambda uses the retext library to find keywords and phrases in text. Unfortunately, the most recent versions of the retext libraries are pure ES modules, meaning that they cannot be required and most be imported by another ES module or via dynamic imports.
To get around this, the lambda currently uses an older version of the libraries that were written prior to their transition away from CommonJS.
Transitioning this lambda from CommonJS to ESM will allow the latest versions of these libraries to be used and also provide a basis for any future development that uses ESM.
Acceptance Criteria
AC01
AC02