Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST editing #478

Merged
merged 8 commits into from
Jan 10, 2022
Merged

AST editing #478

merged 8 commits into from
Jan 10, 2022

Conversation

TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Jan 7, 2022

Adds ability to edit AST during beforeFileTranspile, and then the changes are reverted after the afterFileTranspile event.

  • Adds new AstEditor class that applies edits and tracks how to undo them.
  • Adds editor property to the beforeFileTranspile and afterFileTranspile lifecycle events.
  • Once the afterFileTranspile event has fired for all plugins, the editor.undoAll() method is called which will revert all of the AST changes made during the transpile flow.
  • Update docs with example
  • any files that were edited using editor will have the needsTranspiled property set to true automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants