Replies: 3 comments 1 reply
-
It's worth mentioning that if we just wanted utilities specific to Canvas Kit, we could simplify the syntax even further. I would prefer to make it a general purpose tool that works for other projects though. |
Beta Was this translation helpful? Give feedback.
-
Love the look of this approach. I like the idea of keeping it generic as well. IMO it's important to think about how we could make these functions as flexible as possible, rather than catering too much to our most common use cases. First question at a glance: How would I perform multiple transformations in Some additional functionality/common use cases I'd like to propose:
|
Beta Was this translation helpful? Give feedback.
-
Worth a look: https://www.codeshiftcommunity.com/ |
Beta Was this translation helpful? Give feedback.
-
I think we could turn this: https://github.com/Workday/canvas-kit/blob/master/modules/codemod/lib/v6/deprecateCookieBanner.ts
Into this:
I found that our usage of jscodeshift was extremely repetitive and verbose. We have a few very common transforms, like updating imports, type identifiers, and JSX components & props. I'd like to create a helper library to write those transforms more declaratively. I think it's worth abstracting away some of the AST details too, which is part of what makes our current code mods verbose.
I could really use some input on what we'd like the syntax to look like for an abstraction over jscodeshift, as well as how we'd like to manage the package, because I'd like to publish it on NPM.
Beta Was this translation helpful? Give feedback.
All reactions