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

Typescript types generation enhancement #970

Open
madiyetov opened this issue May 10, 2023 · 2 comments
Open

Typescript types generation enhancement #970

madiyetov opened this issue May 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@madiyetov
Copy link

Thanks for the typescript types generation feature. It's awesome.

Is your feature request related to a problem? Please describe.

We have slices separated in two directories. One in a project level directory, another one in a package.
So our config looks something like this:

// slicemachine.config.json
{
  "adapter": "@slicemachine/adapter-nuxt2",
  "libraries": ["./node_modules/common-slices/src/slices", "./slices"],
}

But all typescript types are generated and merged into one file in a project level. Which makes impossible to use generated types in common slices.

Describe the solution you'd like

I would suggest the simple thing. To generate 2 separate files. We can rely on the slicemachine.config.json's libraries to determine the directory to put these files. So in the end we will have 2 files which makes sense to me:
./node_modules/common-slices/src/slices/prismicio-types.d.ts
./slices/prismicio-types.d.ts

As a bonus, we can consider to generate custom types' types into customtypes folder.

Describe alternatives you've considered

It's not possible to use the file from a project level in a package.

Additional context

Our project is a monorepo structured where our common slices are located in a package and we can have multiple applications using them.

@madiyetov madiyetov added the enhancement New feature or request label May 10, 2023
@comeprismic
Copy link

Hi @madiyetov, I'm coming back to this issue. I'm curious what is your use case with these "common-slices"?

@denysbespalenko
Copy link

@comeprismic hi, is it any update/etas here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants