artistudioxyz / aspri

💃 a Collection of scripts and libraries to speed up sotware development process
https://pkg.go.dev/github.com/artistudioxyz/aspri
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Incorect Replace #1

Open khairu-aqsara opened 1 year ago

khairu-aqsara commented 1 year ago

When I tried to use this tool, it's replace all the string contains dot- to {pluginnema}, it will trhow a bunch of error while trying to run npm install becase some of the packages are using a dot- string prefix like dotenv dot-case if I tried to run the command aspri --wp-refactor --from Dot --to {example} --type plugin it will change all the dot string into example

dotenv-cli -> exampleenv-cli
dot-case -> example-case
@babel/plugin-transform-dotall-regex -> @babel/plugin-transform-exampleall-regex
....

btw it's a greate tool :)

agung2001 commented 1 year ago

Hi @khairu-aqsara , thx for reporting the issue, really appreciate it 😁👍

yes the actual code for refactoring is here :

yes you're correct, unfortunately the search and replace function still pretty basic it'll find and replace the provided string whatever the case (Upper, Lower or Mixed) e.g @babel/plugin-transform-dotall-regex to @babel/plugin-transform-exampleall-regex

the correct refactoring process should be :

for now the Dot Framework can be refactored with no problem, even though it's not following the right process but yeah refactoring is actually a complex process, m still working on that if you got any suggestion or wants to contribute I'm very much appreciate it 😁👍