* refactor: rename @open-pencil/codegen to @open-pencil/emit In design tools codegen means design-to-code, which is dom-css's job and Core's codegen tools'. The package builds and prints the syntax trees exporters emit, so name it for that. It has not been released yet. * fix: alias @open-pencil/emit to its source in Vite The rename missed the escaped regex, so Vite resolved the package through its built dist output.
12 lines
429 B
TypeScript
12 lines
429 B
TypeScript
export {}
|
|
|
|
const { es, jsx } = await import('../dist/index.js')
|
|
|
|
const card = jsx.printJSX(
|
|
jsx.element('Card', [jsx.attribute('title', jsx.stringValue('a "quoted" title'))], [], 0)
|
|
)
|
|
const module = es.printModule(es.parseModule('export const answer = 42'))
|
|
if (card !== '<Card title={"a \\"quoted\\" title"} />' || !module.includes('answer = 42')) {
|
|
throw new Error('Expected built emit package to print JSX and modules')
|
|
}
|