ricokahler / sanity-codegen

Generate TypeScript types from your Sanity.io schemas
sanity-codegen-dev.vercel.app
MIT License
270 stars 19 forks source link

The plugin doesn't work at all, missing binaries. #327

Open scerelli opened 9 months ago

scerelli commented 9 months ago

I have a mono repo based on turborepo and pnpm workspaces. I tried to follow the instruction how you specified.

pnpm add sanity-codegen@alpha --filter="my-workspace" then cd into my sanity workspace and run: npx sanity-codegen codegen i also tried pnpm dlx sanity-codegen@alpha codegen or pnpm sanity-codegen codegen.

No luck, pnpm throws this error:

 ERR_PNPM_DLX_NO_BIN  No binaries found in sanity-codegen

npx instead:

npx sanity-codegen codegen

 ›   Error: command codegen not found

I guess there is something wrong in the docs.

I saw in node_modules folder that sanity-codegen doesn't contain much, just a package json with a bunch of sanity-codegen packages. To make it work i think you should export at least some commands that can be run from the outside.