Open zernonia opened 1 week ago
@sadeghbarati there was some problem back then when I'm implementing the tw prefix, but I just had a look today and seems like the snapshot and everything looks good. Can you help review and check if it's all good? ๐
Just switch to your branch build the CLI and upload it to Stackblitz, seems not working yet, which is why I don't like test files ๐
Can you check again @sadeghbarati ? ๐
@zernonia fix: cater for cn function did fixed the cn prefix
I see prefix applied to all imports
in all ui .ts
files
https://stackblitz.com/edit/vitejs-vite-dzqk4g
Ahh nice catch @sadeghbarati ! Fixing!!!!
I think we should setup pkg.pr.new
for shadcn-vue cli
and module
packages too,
Stackblitz upload limit will prevent me to test future PRs
Yeah we can do that.. that would really help to test out the PR ๐
Name | Result |
---|---|
Last commit: | b88fe615 |
Status: | โ Deploy successful! |
Preview URL: | https://473d1d70.shadcn-vue.pages.dev |
Branch Preview URL: | https://refs-pull-619-merge.shadcn-vue.pages.dev |
Yup not as easy as I thought hahaha.. usingStringLiteral
is not powerful enough.. will convert to draft for now
@sadeghbarati I found this goldmind! https://vue-metamorph.dev/
It simplified the transformation soooooo much!!! I've refactor the transformer entirely to use vue-metamorph
! Do help test it out ya!
I hit the upload limit ๐ญ
I think vue-metamorph
should be in dependencies
index.ts
All UI ts
files import are still prefixed
defaultVariants
has issue with prefixes (this is not just in the button, the component that is using CVA is having this issue)withDefaults
also has the same issueButton.vue
auto-form
, chart-area|bar|donut|line
Now I understand why Codemod Team is having hard time working on Vue Codemods
Tested JavaScript projects too, seems like detypes
is not working well with vue-metamorph
index.js
@sadeghbarati Do you mind checking again? This time the transformation for prefix is much stricter to paritcular attributes and function only.
Also made a patch for vue-eslint-parser
that vue-metamorph
is using underneath. The undefined
issue should be gone now
@zernonia Everything is fine just
/* METAMORPH_START */
comment is in the some of components after parsing
sonner toast-options
classes in not having the prefixes (ignore defineProps error I just add the components for test)
v-calendar
style section is not having the prefix which we could ignore duo to legacy package and new calendar implementation
in JavaScript projects, found a strange thing, happening in AccordionTrigger
and SelectItem
and maybe other components as well
cn
placement is not formatted and also an additional ]
is added to the end of the cn function
in JavaScript projects, found a strange thing, happening in
AccordionTrigger
andSelectItem
and maybe other components as well
cn
placement is not formatted and also an additional]
is added to the end of the cn function
Looks like this is detypes
bug not vue-metamorph
Related Discussion https://github.com/radix-vue/shadcn-vue/discussions/632
๐ Linked issue
โ Type of change
๐ Description
๐ธ Screenshots (if appropriate)
๐ Checklist