Here's an attempt to further improve #85. I'm not super happy with the implementation, since it feels like transform errors and template errors should be handled seperately. I didn't want to start refactoring everything so I tried to make these edits as reviewable as possible and keep the discussion going.
My reasoning for adding an annotated message logging the line of the compiled template function was to explain the errors that meriyah might throw and make it clear that the error is happening on a compiled function, not a user-authored one. To deal with these errors originating from the Eleventy integration, I also plan to add a message to my plugin reminding users to check for undeclared shortcodes and filters since those will cause errors when meriyah goes to parse/transform.
Happy to edit/revise further if there's a cleaner way of tracking these errors!
Also included in this pull:
871cb1bf04e6d429f7ed1a3ce3471774425084f1 adds type annotation for ESTree nodes so Typescript can pick those up.
5279c7db25ca71cbd01cc9fdcdc0ebee5b7386c6 patches a build error I was getting with dnt and JSR, for whatever reason, dnt was complaining that @std/path@1.0.8 wasn't able to be resolved. Reverting to the deno.land url fixes this for now.
Here's an attempt to further improve #85. I'm not super happy with the implementation, since it feels like transform errors and template errors should be handled seperately. I didn't want to start refactoring everything so I tried to make these edits as reviewable as possible and keep the discussion going.
My reasoning for adding an annotated message logging the line of the compiled template function was to explain the errors that
meriyah
might throw and make it clear that the error is happening on a compiled function, not a user-authored one. To deal with these errors originating from the Eleventy integration, I also plan to add a message to my plugin reminding users to check for undeclared shortcodes and filters since those will cause errors whenmeriyah
goes to parse/transform.Happy to edit/revise further if there's a cleaner way of tracking these errors!
Also included in this pull:
dnt
and JSR, for whatever reason,dnt
was complaining that@std/path@1.0.8
wasn't able to be resolved. Reverting to thedeno.land
url fixes this for now.