This repository was archived by the owner on May 6, 2023. It is now read-only.
This repository was archived by the owner on May 6, 2023. It is now read-only.
How to publish types? #155
Open
Description
Is there a way to publish the types from the generated schemas? I tried to compile, I get a variation of the following error:
The inferred type of 'headlines' cannot be named without a reference to 'sanity-typed-schema-builder/node_modules/@sanity/types'. This is likely not portable. A type annotation is necessary.
5 export const headlines = s.document({
I found some suggestions like setting "preserveSymlinks": true
, but that causes the emitted types files to be any
s...
The issue appears to have been added to the Typescript 4.8 milestone... but 4.8 has already been published.
Hoping perhaps that I am missing something silly? I really like this library's pattern, so if we can't get this to work, then I think i'll make a monorepo so I'll have access to the types in our frontend 🤷
tsconfig.json
as suggested by sanity docs
tsconfig.schema.json
used for actually building
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"skipLibCheck": true,
"outDir": "./dist_schema/",
"rootDir": "./app/schema/",
"moduleResolution": "node",
"declaration": true,
"declarationMap": true,
"declarationDir": "./dist_schema/"
}
}
Metadata
Metadata
Assignees
Labels
No labels