prismicio / prismic-ts-codegen

A Prismic model-to-TypeScript-type generator.
Apache License 2.0
18 stars 6 forks source link

fix(cli): prevent `"Named export 'createClient' not found"` error #58

Closed lihbr closed 1 year ago

lihbr commented 1 year ago

Types of changes

Description

CLI is broken due to the way @prismicio/client is treated since 0.1.12. This can be reproduced anywhere by simply running: npx prismic-ts-codegen@0.1.16.

This PR solves it by using the CJS export of the CLI which has proved more stable in the case of Slice Machine (init, start). This forces us however to inline ESM-only dependencies (see Vite config)

Resolves: #56

Checklist:

ComputerCatGIF

angeloashmore commented 1 year ago

LGTM! Thanks for fixing that issue. ESM strikes again!