feat: add syntax replacements using web-features-codemods#207
feat: add syntax replacements using web-features-codemods#207
web-features-codemods#207Conversation
|
once #182 lands, we have a new sources option to let the user specify where their sources live. there's also a default glob in there (which we should move to a shared file). im not sure we need any code generation here as everything we need is already available from the package itself as far as i can tell. in that all exported codemods of web-features-codemods are applicable, so we can just put them into a usable shape at runtime. it looks like the fixable replacements script may be wrong and/or broken right now too outside of this as it writes to i think keeping this separate from module replacements makes sense as long as it happens as part of the analyze command |
|
Got it, shall I close this PR for now then? I will be happy to approach this once again once #182 is merged. |
|
feel free to leave it open and we can catch up from main once the other PR lands (should be soon). you could also rebase onto that branch for now so you can resolve the other things meanwhile |
Looking to help close #128 eventually.
For now, this PR adds a
fixable-syntax-replacement.tsfile and a generator script, similar to how module replacements are handled in the existing project.I've also added a simple plugin that checks the source files for possible syntax replacements when the analyze command is run, to see if this aligns with what you have planned.
I'll continue working on this PR but I have a couple of things to clarify:
.jsand.tsin the cwd, but should we only check in the src directory? Are there plans to let the user choose this when running the command?Any other feedback is appreciated since I'm new to this codebase.