* chore: enable tw prefix * chore: enable tw prefix during init * fix: cater for cn function * fix: prevent transforming importDeclaration * chore: update registry to make sure tailwind prefix parse correctly * chore: fix wrong import * chore: checkpoint * refactor: goodbye ts-morph * chore: remove ts-morpg * chore: update test * chore: cleanup * chore: fix test * fix: move vue-metamorph to dep * refactor: transform tw prefix by specific case * fix: transform-sfc not parsing .ts file * fix: prefix double quote * chore: patch vue-eslint-parser * refactor: transform to cater only for class in sfc * refactor: replace detypes with @unovue/detypes * chore: update test snapshot * chore: update pnpm-lock, fix import * chore: bump detypes version * chore: update deps
111 lines
2.5 KiB
Plaintext
111 lines
2.5 KiB
Plaintext
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
|
|
exports[`transformSFC > basic 1`] = `
|
|
"<script setup>
|
|
const array = [1, 2, 3];
|
|
</script>
|
|
|
|
<template>
|
|
<div v-bind="{ array }">template</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineEmits 1`] = `
|
|
"<script setup>
|
|
const emit = defineEmits(['foo']);
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: true },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps with external props 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: false, default: 'bar' },
|
|
a: { type: String, required: true },
|
|
b: { type: Number, required: true },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps with package props 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: false, default: 'bar' },
|
|
for: { type: String, required: false },
|
|
asChild: { type: Boolean, required: false },
|
|
as: { type: null, required: false },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > defineProps with withDefaults 1`] = `
|
|
"<script setup>
|
|
const props = defineProps({
|
|
foo: { type: String, required: true, default: 'bar' },
|
|
});
|
|
</script>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > remove all type reference 1`] = `
|
|
"<script setup>
|
|
const array = [1, 2, 3];
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
v-bind="{ array }"
|
|
:prop="(a) => a"
|
|
:prop2="
|
|
(a) => {
|
|
let b = a;
|
|
return b;
|
|
}
|
|
"
|
|
>
|
|
{{ true ? 123 : 0 }}
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|
|
"
|
|
`;
|
|
|
|
exports[`transformSFC > remove all type reference, keeping similar template 1`] = `
|
|
"<script setup>
|
|
const array = [1, 2, 3];
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
:class="
|
|
cn(
|
|
'relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
position === 'popper' &&
|
|
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
props.class,
|
|
)
|
|
"
|
|
>
|
|
{{ true ? 123 : 0 }}
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|
|
"
|
|
`;
|