@endo/module-source@1.5.0
Minor Changes
-
#3220
8906393Thanks @boneskull! - Exposes AST-based parser for CJS, as well as ananalyzeCjsfunction from theanalyzer.jssubpath export. -
#3218
dfdfa08Thanks @boneskull! - Fixes the type ofSourceMapHookand introduces proper.tstype sources checked bytsc. Types that were previously inlined as JSDoc typedefs (SourceMapHook,SourceMapHookDetails,SourceMapObject,ModuleSourceOptions,TransformSourceParams) are now defined insrc/types/module-source.tsand re-exported from the package root via a newsrc/external.types.d.tsentry.Adds a
./analyzer.jssubpath export withanalyzeModule(options?). The returned context object exposesanalyzePassandtransformPass(plain{ visitor }objects) and abuildRecord()function. This is the primitive that@endo/parser-pipelineuses to drive module analysis; it is also used internally by theModuleSourceconstructor, so the exported API is not specific to the pipeline.Removes the
PluginFactoryabstraction andvisitorFromPluginhelper: Babel plugins now return plain{ visitor }objects directly, with@babel/typesimported at module scope.