Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute paths not working in Typegen config #7620

Open
okj579 opened this issue Oct 15, 2024 · 2 comments
Open

Absolute paths not working in Typegen config #7620

okj579 opened this issue Oct 15, 2024 · 2 comments

Comments

@okj579
Copy link
Contributor

okj579 commented Oct 15, 2024

Describe the bug

Typegen doesn't accept absolute path for generates.

To Reproduce

Steps to reproduce the behavior:

  1. Create a sanity-typegen.json with an absolute path in generates
  2. Extract schema: sanity schema extract
  3. Run Typegen: sanity typegen generate

Typegen returns success, saying it has created a file at the given path, however it doesn't exist.
The path is interpreted as relative and created in the sanity directory, not the one actually defined.

Expected behavior

Types are written to the configured file.

Which versions of Sanity are you using?

3.60.0

@sanity/cli (global)             3.60.0 (up to date)
@sanity/asset-utils               2.0.6 (up to date)
@sanity/eslint-config-studio      4.0.0 (up to date)
@sanity/icons                     3.4.0 (up to date)
@sanity/language-filter           4.0.2 (up to date)
@sanity/locale-de-de             1.1.11 (up to date)
@sanity/orderable-document-list   1.2.2 (up to date)
@sanity/ui                        2.8.9 (up to date)
@sanity/util                     3.60.0 (up to date)
@sanity/vision                   3.60.0 (up to date)
sanity                           3.60.0 (up to date)

What operating system are you using?

Linux Mint 21.3 Virginia, Kernel 5.15.0-118

Which versions of Node.js / npm are you running?

node 20.18.0
pnpm 9.12.1
(npm 10.9.0 installed)

@sgulseth
Copy link
Member

sgulseth commented Nov 1, 2024

Thanks for reporting - this is indeed a bug, and it should work as you outline. I don't have a timeline on a fix atm, but we will keep this issue updated.

@sgulseth sgulseth added bug KTLO labels Nov 1, 2024 — with Linear
@aweissman11
Copy link

Having this same issue.

I'm working in a monorepo and want to write top level commands to generate types for each of the tenants, but cannot because the only way to get this to work is in the sanity-typegen.json file, which cannot handle multiple tenants.

Hope this can be worked on soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants