Closed morgante closed 1 month ago
You can always copy the output to our playground to see if the transformed code is valid.
If I run grit apply valibot_v03
I get the following error: Error: Permission denied (os error 13)
Once I can confirm that the codemod works, I will add instructions on how to run it to our migration guide. Do people need to manually add the .grit/patterns/valibot_v03.md
file to their repo to run the command? Does it only works on Linux and MacOS?
If I run
grit apply valibot_v03
I get the following error:Error: Permission denied (os error 13)
Hmm, what steps did you take to install it / can you provide reproduction instructions? This isn't expected.
Do people need to manually add the .grit/patterns/valibot_v03.md file to their repo to run the command?
Yes, currently they will need to download it. I'm planning to add a feature for applying remote patterns directly too.
Does it only works on Linux and MacOS?
We also have Windows releases available.
Hmm, what steps did you take to install it / can you provide reproduction instructions? This isn't expected.
I followed the Quickstart guide and executed: npm install --location=global @getgrit/launcher
. I can run grit
. So the installation was successful.
I got it to work with sudo
but it should work without it. I will test the codemod in the next few days and get back to you. Thanks again!
Yes, currently they will need to download it. I'm planning to add a https://github.com/getgrit/gritql/issues/356 for applying remote patterns directly too. We also have Windows releases available.
👍
I got it to work with sudo but it should work without it.
Agreed, sudo definitely shouldn't be required. Maybe you can try running grit doctor
without sudo to figure out why. I'm also happy to help debug on Discord.
I get the same error when I type grit doctor
. With sudo
it prints out environment and configuration info. Seems like a permission problem. I will get back to you on Discord tonight or in the next few days. In the meantime, if you have time, you can try to get the following codemod to work.
Hint:
transform
andbrand
can be deeply nested and should now be placed next to each other in the pipeline of the wrapped schema.
// Before
const Schema = v.transform(
v.brand(v.string(), "Name"),
(input) => input.length
);
// After
const Schema = v.pipe(
v.string(),
v.brand('Name'),
v.transform((input) => input.length)
);
This now handles brand
and transform
.
You can try this out by running
Grit also includes built-in testing for the markdown file. Just run
grit patterns test
in this repo.