You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## TLDR
Simplified PostHog enricher initialization and improved API ergonomics by removing manual setup requirements and adding file parsing capabilities.
## Changes
- **Removed manual initialization**: Grammar files are now bundled and auto-located at runtime, eliminating the need to call `initialize()` or specify WASM directory paths
- **Added file parsing**: New `parseFile()` method automatically detects language from file extensions and reads files directly
- **Improved property naming**: Renamed `enrichedFlags` and `enrichedEvents` to `flags` and `events` for cleaner API
- **Enhanced comment formatting**: Removed restriction that limited one comment per source line
- **Updated documentation**: Revised README examples to reflect the simplified API and new capabilities
- **Added language detection**: Exported `EXT_TO_LANG_ID` mapping for file extension to language ID conversion
The package requires pre-built tree-sitter WASM grammar files. Run `pnpm fetch-grammars` to build them, or place pre-built `.wasm` files in the `grammars/` directory.
205
+
Grammar files are bundled with the package and auto-located at runtime — no manual setup needed.
206
+
207
+
For development, run `pnpm fetch-grammars` to rebuild the WASM grammar files in the `grammars/` directory.
0 commit comments