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

Add new types.path property #8381

Merged
merged 6 commits into from
Mar 15, 2023
Merged

Add new types.path property #8381

merged 6 commits into from
Mar 15, 2023

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented Mar 8, 2023

This pull request adds a new .types.path configuration option that will enable developers to specify where their Keystone types are built.

Previously you imported your types with .keystone/types, which are automatically built in node_modules/.keystone/types.d.ts. This is suitable for many usecases, but if you're using a monorepo, you might want to import these types in your other workspaces. Using node_modules/.keystone/... prevented that.

You can now specify a .types.path that works for you.
If you were relying on .keystone/types, that will break only if you use this feature.
Thereby, this is not a breaking change.

We thought about opting to try and keep .keystone/types resolving, even with a custom types.path, but that actually ended up in a number of weird edge-cases that aren't easy to debug.

@dcousens dcousens requested a review from jlarmstrongiv March 8, 2023 06:27
@dcousens dcousens self-assigned this Mar 8, 2023
@changeset-bot

This comment was marked as resolved.

@dcousens dcousens changed the title Add a new types.listTypesPath property Add new types.listTypesPath property Mar 8, 2023
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 8, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 23b987f:

Sandbox Source
@keystone-6/sandbox Configuration

Copy link

@jlarmstrongiv jlarmstrongiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 😄 can’t wait to give keystone with monorepos another try. Between this PR and #8307, it should be more doable now

examples/custom-output-paths/keystone.ts Outdated Show resolved Hide resolved
examples/extend-graphql-schema-nexus/schema.ts Outdated Show resolved Hide resolved
packages/core/src/types/config/index.ts Outdated Show resolved Hide resolved
@dcousens dcousens force-pushed the types-where branch 4 times, most recently from 9fc5ff4 to e34301d Compare March 14, 2023 04:48
@dcousens dcousens marked this pull request as ready for review March 14, 2023 04:54
@dcousens dcousens changed the title Add new types.listTypesPath property Add new types.path property Mar 15, 2023
@dcousens dcousens force-pushed the types-where branch 6 times, most recently from 842ff98 to a3185f6 Compare March 15, 2023 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants