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

Change view module resolution #7805

Merged
merged 4 commits into from
Aug 25, 2022
Merged

Change view module resolution #7805

merged 4 commits into from
Aug 25, 2022

Conversation

emmatown
Copy link
Member

@emmatown emmatown commented Aug 17, 2022

This pull request changes field type .views resolution from being path based to a module path.
This means instead of using require.resolve(...) to resolve your custom views, you will now use a path as though it was resolving from where keystone dev is run.

This additionally means you can use typical modules or packages without needing relative or absolute pathing workarounds.

For example, if you wanted to use the @keystone-6 text field views for your custom field type, you can now do that through canonical module resolution:

  fieldType({ ... })({
    input: { ... },
    output: graphql.field({ ... }),
    views: '@keystone-6/core/fields/types/text/views',
  })

@changeset-bot

This comment was marked as resolved.

@vercel
Copy link

vercel bot commented Aug 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
keystone-next-docs ✅ Ready (Inspect) Visit Preview Aug 25, 2022 at 2:18AM (UTC)

@vercel vercel bot temporarily deployed to Preview August 17, 2022 06:28 Inactive
@emmatown emmatown force-pushed the change-view-resolution branch from ffc7032 to 3164eb9 Compare August 17, 2022 06:30
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 17, 2022

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 d358281:

Sandbox Source
@keystone-6/sandbox Configuration

@vercel vercel bot temporarily deployed to Preview August 17, 2022 06:37 Inactive
@dcousens dcousens force-pushed the change-view-resolution branch from 3164eb9 to 86460ce Compare August 25, 2022 01:28
@dcousens dcousens marked this pull request as ready for review August 25, 2022 01:28
@dcousens dcousens marked this pull request as draft August 25, 2022 01:29
@vercel vercel bot temporarily deployed to Preview August 25, 2022 01:34 Inactive
@dcousens dcousens marked this pull request as ready for review August 25, 2022 01:37
@vercel vercel bot temporarily deployed to Preview August 25, 2022 01:39 Inactive
@vercel vercel bot temporarily deployed to Preview August 25, 2022 01:45 Inactive
@dcousens dcousens force-pushed the change-view-resolution branch from 5f07b9b to 368583b Compare August 25, 2022 01:47
@vercel vercel bot temporarily deployed to Preview August 25, 2022 01:51 Inactive
@dcousens dcousens enabled auto-merge (squash) August 25, 2022 02:11
@vercel vercel bot temporarily deployed to Preview August 25, 2022 02:13 Inactive
@dcousens dcousens force-pushed the change-view-resolution branch from 0563ef4 to d358281 Compare August 25, 2022 02:16
@vercel vercel bot temporarily deployed to Preview August 25, 2022 02:18 Inactive
@dcousens dcousens merged commit c227562 into main Aug 25, 2022
@dcousens dcousens deleted the change-view-resolution branch August 25, 2022 02:50
dcousens added a commit that referenced this pull request Sep 14, 2022
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
Co-authored-by: Daniel Cousens <413395+dcousens@users.noreply.github.com>
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.

2 participants