Skip to content

@endo/module-source@1.5.0

Choose a tag to compare

@kriskowal kriskowal released this 13 Aug 22:51
· 12 commits to master since this release
2982078

Minor Changes

  • #3220 8906393 Thanks @boneskull! - Exposes AST-based parser for CJS, as well as an analyzeCjs function from the analyzer.js subpath export.

  • #3218 dfdfa08 Thanks @boneskull! - Fixes the type of SourceMapHook and introduces proper .ts type sources checked by tsc. Types that were previously inlined as JSDoc typedefs (SourceMapHook, SourceMapHookDetails, SourceMapObject, ModuleSourceOptions, TransformSourceParams) are now defined in src/types/module-source.ts and re-exported from the package root via a new src/external.types.d.ts entry.

    Adds a ./analyzer.js subpath export with analyzeModule(options?). The returned context object exposes analyzePass and transformPass (plain { visitor } objects) and a buildRecord() function. This is the primitive that @endo/parser-pipeline uses to drive module analysis; it is also used internally by the ModuleSource constructor, so the exported API is not specific to the pipeline.

    Removes the PluginFactory abstraction and visitorFromPlugin helper: Babel plugins now return plain { visitor } objects directly, with @babel/types imported at module scope.

Patch Changes