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

refactor: make project public in CodeTransformer #74

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

Julien-R44
Copy link
Member

PR is targetting #73 branch

i've made the project property public. this corresponds to the tsmorph instance.

the aim is that someone using this class will be able to apply and develop their own codemods

const transformer = new CodeTransformer(appRoot)
transformer.project // I can now apply all the modifications I want via ts-morph

I'm thinking in particular of codemods that could be applied from configure.ts but also too specific to have higher-level APIs in the CodeTransformer

@thetutlage
Copy link
Member

But do we want to create codemods outside of this package?

Base automatically changed from feat/add-vite-plugin to develop February 20, 2024 07:20
@Julien-R44
Copy link
Member Author

Yeah
in my case, with @adonisjs/inertia we have the option of generating a complete example setup when configuring the package. and that means, we gonna add a new route to the routes.ts file automatically

and I believe this use case is too specific to be added in the Codemods API.

Just a simple example but other package authors might have specific needs like this

@thetutlage
Copy link
Member

Cool, makes sense!

@thetutlage thetutlage merged commit 51a58cf into develop Feb 21, 2024
12 checks passed
@thetutlage thetutlage deleted the refactor/project-public branch February 21, 2024 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants