const { code, rootRefs } = transform(`
import { ref, shallowRef } from 'vue'
let foo = $(ref())
- let a = $(ref(1))
+ export let a = $(ref(1))
let b = $(shallowRef({
count: 0
}))
expect(code).not.toMatch(`$(ref(1))`)
expect(code).not.toMatch(`$(shallowRef({`)
expect(code).toMatch(`let foo = (ref())`)
- expect(code).toMatch(`let a = (ref(1))`)
+ expect(code).toMatch(`export let a = (ref(1))`)
expect(code).toMatch(`
let b = (shallowRef({
count: 0
stmt.left.type === 'VariableDeclaration'
) {
walkVariableDeclaration(stmt.left)
+ } else if (
+ stmt.type === 'ExportNamedDeclaration' &&
+ stmt.declaration &&
+ stmt.declaration.type === 'VariableDeclaration'
+ ) {
+ walkVariableDeclaration(stmt.declaration, isRoot)
}
}
}
return
}
+ // skip type nodes
if (
parent &&
parent.type.startsWith('TS') &&