From 44f2ef60e29912f3c85b91fc704e09a7d5a15b22 Mon Sep 17 00:00:00 2001 From: Mitchell Hamilton Date: Thu, 19 Aug 2021 15:41:25 +1000 Subject: [PATCH] Move types package into main package (#6371) --- .changeset/brave-paws-sneeze.md | 1 - .changeset/cold-turkeys-lie.md | 10 ++++++++++ docs/pages/docs/apis/config.mdx | 16 ++++++++-------- docs/pages/docs/apis/context.mdx | 2 +- docs/pages/docs/apis/fields.mdx | 2 +- .../docs/guides/custom-admin-ui-navigation.mdx | 4 ++-- docs/pages/docs/guides/custom-admin-ui-pages.mdx | 2 +- docs/pages/docs/guides/custom-fields.mdx | 8 ++++---- docs/pages/docs/guides/testing.mdx | 2 +- docs/pages/docs/guides/virtual-fields.mdx | 4 ++-- examples-staging/basic/admin/config.tsx | 2 +- examples-staging/basic/admin/fieldViews/Test.tsx | 2 +- examples-staging/basic/package.json | 1 - examples-staging/basic/schema.ts | 2 +- .../ecommerce/mutations/addToCart.ts | 2 +- examples-staging/ecommerce/mutations/checkout.ts | 2 +- examples-staging/ecommerce/package.json | 1 - examples-staging/ecommerce/schemas/Order.ts | 2 +- examples-staging/ecommerce/seed-data/index.ts | 2 +- .../ecommerce/tests/mutations.test.ts | 2 +- examples-staging/ecommerce/types.ts | 2 +- examples-staging/roles/package.json | 1 - examples/custom-admin-ui-logo/admin/config.tsx | 2 +- examples/custom-admin-ui-logo/package.json | 1 - examples/custom-admin-ui-navigation/README.md | 2 +- .../custom-admin-ui-navigation/admin/config.ts | 2 +- examples/custom-admin-ui-navigation/package.json | 1 - examples/custom-admin-ui-pages/admin/config.ts | 2 +- examples/custom-admin-ui-pages/package.json | 1 - .../fields/related-links/components.tsx | 2 +- examples/custom-field-view/package.json | 1 - examples/custom-field/package.json | 1 - examples/custom-field/stars-field/index.ts | 2 +- examples/custom-field/stars-field/views.tsx | 2 +- examples/testing/README.md | 2 +- examples/testing/example.test.ts | 2 +- examples/testing/package.json | 3 +-- examples/virtual-field/README.md | 2 +- examples/virtual-field/package.json | 3 +-- examples/virtual-field/schema.ts | 2 +- packages/auth/package.json | 1 - packages/auth/src/gql/getBaseAuthSchema.ts | 2 +- packages/auth/src/gql/getInitFirstItemSchema.ts | 2 +- packages/auth/src/gql/getMagicAuthLinkSchema.ts | 2 +- packages/auth/src/gql/getPasswordResetSchema.ts | 2 +- packages/auth/src/index.ts | 2 +- packages/auth/src/lib/createAuthToken.ts | 2 +- packages/auth/src/lib/findMatchingIdentity.ts | 2 +- packages/auth/src/lib/getErrorMessage.ts | 2 +- packages/auth/src/lib/validateAuthToken.ts | 2 +- packages/auth/src/lib/validateSecret.ts | 2 +- packages/auth/src/pages/InitPage.tsx | 2 +- packages/auth/src/schema.ts | 2 +- packages/auth/src/templates/init.ts | 2 +- packages/auth/src/types.ts | 2 +- packages/cloudinary/package.json | 4 +++- packages/cloudinary/src/index.ts | 2 +- packages/cloudinary/src/test-fixtures.skip.ts | 2 +- packages/cloudinary/src/views/Field.tsx | 2 +- packages/cloudinary/src/views/index.tsx | 2 +- packages/fields-document/package.json | 1 - packages/fields-document/src/index.ts | 2 +- .../fields-document/src/relationship-data.tsx | 6 +++++- packages/fields-document/src/views.tsx | 2 +- packages/keystone/package.json | 9 ++++++--- .../admin-ui/id-field-view.tsx | 2 +- .../admin-ui/pages/App/index.tsx | 2 +- .../admin-ui/pages/ItemPage/index.tsx | 2 +- .../admin-ui/pages/ListPage/FieldSelection.tsx | 2 +- .../admin-ui/pages/ListPage/FilterAdd.tsx | 2 +- .../admin-ui/pages/ListPage/FilterList.tsx | 2 +- .../admin-ui/pages/ListPage/SortSelection.tsx | 2 +- .../admin-ui/pages/ListPage/index.tsx | 2 +- .../admin-ui/pages/ListPage/useFilters.tsx | 2 +- .../pages/ListPage/useSelectedFields.tsx | 2 +- .../admin-ui/pages/ListPage/useSort.tsx | 2 +- .../next-graphql.ts | 2 +- .../node-api.ts | 2 +- .../keystone/src/admin-ui/admin-meta-graphql.ts | 2 +- .../src/admin-ui/components/Navigation.tsx | 2 +- .../keystone/src/admin-ui/components/index.ts | 2 +- packages/keystone/src/admin-ui/context.tsx | 2 +- .../src/admin-ui/system/createAdminMeta.ts | 2 +- .../src/admin-ui/system/createAdminUIServer.ts | 2 +- .../src/admin-ui/system/generateAdminUI.ts | 3 +-- .../src/admin-ui/system/getAdminMetaSchema.ts | 8 +++++--- packages/keystone/src/admin-ui/templates/app.ts | 2 +- .../keystone/src/admin-ui/templates/index.ts | 3 +-- .../keystone/src/admin-ui/templates/no-access.ts | 2 +- packages/keystone/src/admin-ui/utils/Fields.tsx | 2 +- .../keystone/src/admin-ui/utils/dataGetter.ts | 2 +- .../getRootGraphQLFieldsFromFieldController.ts | 2 +- .../keystone/src/admin-ui/utils/item-form.ts | 2 +- .../src/admin-ui/utils/serialization.tsx | 2 +- .../keystone/src/admin-ui/utils/useAdminMeta.tsx | 2 +- .../src/admin-ui/utils/useInvalidFields.ts | 2 +- .../src/admin-ui/utils/useLazyMetadata.tsx | 4 ++-- packages/keystone/src/artifacts.ts | 4 ++-- .../keystone/src/fields/tests/test-fixtures.ts | 2 +- .../src/fields/types/autoIncrement/index.ts | 2 +- .../types/autoIncrement/tests/test-fixtures.ts | 2 +- .../keystone/src/fields/types/checkbox/index.ts | 2 +- .../src/fields/types/checkbox/views/index.tsx | 6 +++--- .../keystone/src/fields/types/decimal/index.ts | 2 +- .../fields/types/decimal/tests/test-fixtures.ts | 2 +- .../src/fields/types/decimal/views/index.tsx | 2 +- packages/keystone/src/fields/types/file/index.ts | 4 ++-- packages/keystone/src/fields/types/file/utils.ts | 2 +- .../src/fields/types/file/views/Field.tsx | 2 +- .../src/fields/types/file/views/index.tsx | 4 ++-- .../keystone/src/fields/types/float/index.ts | 2 +- .../src/fields/types/float/views/index.tsx | 2 +- .../keystone/src/fields/types/image/index.ts | 4 ++-- .../fields/types/image/tests/test-fixtures.ts | 2 +- .../keystone/src/fields/types/image/utils.ts | 2 +- .../src/fields/types/image/views/Field.tsx | 2 +- .../src/fields/types/image/views/index.tsx | 4 ++-- .../keystone/src/fields/types/integer/index.ts | 2 +- .../src/fields/types/integer/views/index.tsx | 2 +- packages/keystone/src/fields/types/json/index.ts | 2 +- .../src/fields/types/json/views/index.tsx | 6 +++--- .../keystone/src/fields/types/password/index.ts | 8 ++++---- .../src/fields/types/password/views/index.tsx | 14 +++++++------- .../src/fields/types/relationship/index.ts | 2 +- .../relationship/views/RelationshipSelect.tsx | 2 +- .../relationship/views/cards/InlineCreate.tsx | 2 +- .../relationship/views/cards/InlineEdit.tsx | 2 +- .../types/relationship/views/cards/index.tsx | 2 +- .../relationship/views/cards/useItemState.tsx | 2 +- .../fields/types/relationship/views/index.tsx | 10 +++++----- .../keystone/src/fields/types/select/index.ts | 4 ++-- .../src/fields/types/select/views/index.tsx | 8 ++++---- packages/keystone/src/fields/types/text/index.ts | 2 +- .../src/fields/types/text/tests/test-fixtures.ts | 2 +- .../src/fields/types/text/views/index.tsx | 6 +++--- .../keystone/src/fields/types/timestamp/index.ts | 2 +- .../types/timestamp/tests/test-fixtures.ts | 2 +- .../src/fields/types/timestamp/views/index.tsx | 8 ++++---- .../keystone/src/fields/types/virtual/index.ts | 2 +- .../src/fields/types/virtual/views/index.tsx | 6 +++--- .../src/lib/config/applyIdFieldDefaults.ts | 2 +- packages/keystone/src/lib/config/initConfig.ts | 2 +- .../keystone/src/lib/context/createContext.ts | 2 +- .../src/lib/context/createFilesContext.ts | 2 +- .../src/lib/context/createImagesContext.ts | 2 +- .../lib/context/executeGraphQLFieldToRootVal.ts | 2 +- .../context/executeGraphQLFieldWithSelection.ts | 2 +- packages/keystone/src/lib/context/itemAPI.ts | 2 +- packages/keystone/src/lib/core/access-control.ts | 4 ++-- .../keystone/src/lib/core/field-assertions.ts | 2 +- packages/keystone/src/lib/core/graphql-schema.ts | 2 +- .../src/lib/core/mutations/access-control.ts | 2 +- .../src/lib/core/mutations/create-update.ts | 2 +- .../keystone/src/lib/core/mutations/delete.ts | 2 +- .../keystone/src/lib/core/mutations/index.ts | 2 +- .../nested-mutation-many-input-resolvers.ts | 2 +- .../nested-mutation-one-input-resolvers.ts | 2 +- packages/keystone/src/lib/core/prisma-schema.ts | 2 +- packages/keystone/src/lib/core/queries/index.ts | 2 +- .../src/lib/core/queries/output-field.ts | 4 ++-- .../keystone/src/lib/core/queries/resolvers.ts | 7 +------ .../src/lib/core/resolve-relationships.ts | 2 +- .../keystone/src/lib/core/types-for-lists.ts | 4 ++-- packages/keystone/src/lib/core/utils.ts | 2 +- packages/keystone/src/lib/core/where-inputs.ts | 2 +- packages/keystone/src/lib/createGraphQLSchema.ts | 2 +- packages/keystone/src/lib/createSystem.ts | 2 +- packages/keystone/src/lib/id-field.ts | 6 +++--- .../keystone/src/lib/keystone-cloud/assets.ts | 2 +- .../keystone/src/lib/schema-type-printer.tsx | 8 ++++---- .../keystone/src/lib/server/addHealthCheck.ts | 2 +- .../src/lib/server/createApolloServer.ts | 2 +- .../src/lib/server/createExpressServer.ts | 7 +------ packages/keystone/src/schema/index.ts | 7 +------ packages/keystone/src/schema/schema.ts | 2 +- packages/keystone/src/scripts/build/build.ts | 2 +- .../tests/__snapshots__/artifacts.test.ts.snap | 4 ++-- .../keystone/src/scripts/tests/artifacts.test.ts | 2 +- .../src/scripts/tests/migrations.test.ts | 2 +- packages/keystone/src/scripts/tests/utils.tsx | 3 +-- packages/keystone/src/session/index.ts | 4 ++-- packages/keystone/src/testing.ts | 2 +- .../src => keystone/src/types}/admin-meta.ts | 0 .../{types/src => keystone/src/types}/base.ts | 0 .../src/types}/config/access-control.ts | 0 .../src => keystone/src/types}/config/fields.ts | 0 .../src => keystone/src/types}/config/hooks.ts | 0 .../src => keystone/src/types}/config/index.ts | 0 .../src => keystone/src/types}/config/lists.ts | 0 .../{types/src => keystone/src/types}/context.ts | 0 .../{types/src => keystone/src/types}/core.ts | 0 .../src/types}/filters/enum-filter.ts | 0 .../src => keystone/src/types}/filters/index.ts | 0 .../src/types}/filters/providers/postgresql.ts | 2 +- .../src/types}/filters/providers/sqlite.ts | 0 packages/keystone/src/types/index.ts | 11 +++++++++++ .../json-field-type-polyfill-for-sqlite.ts | 0 .../src => keystone/src/types}/next-fields.ts | 0 .../src/types}/schema/graphql-ts-schema.ts | 0 .../src => keystone/src/types}/schema/index.ts | 0 .../types}/schema/schema-api-with-context.d.ts | 0 .../src/types}/schema/schema-api-with-context.js | 0 .../{types/src => keystone/src/types}/session.ts | 0 .../{types/src => keystone/src/types}/utils.ts | 0 packages/keystone/types/package.json | 4 ++++ packages/session-store-redis/package.json | 4 ++++ packages/session-store-redis/src/index.ts | 2 +- packages/types/README.md | 2 ++ packages/types/package.json | 10 ---------- packages/types/src/index.ts | 16 +++++----------- packages/utils/package.json | 4 ---- prisma-utils/src/index.ts | 4 ++-- tests/admin-ui-tests/package.json | 1 - tests/api-tests/access-control/authed.test.ts | 2 +- .../api-tests/access-control/not-authed.test.ts | 2 +- tests/api-tests/access-control/schema.test.ts | 2 +- tests/api-tests/auth-header.test.ts | 2 +- tests/api-tests/default-value/defaults.test.ts | 2 +- tests/api-tests/fields/crud.test.ts | 2 +- tests/api-tests/fields/filter.test.ts | 2 +- tests/api-tests/fields/types/Virtual.test.ts | 2 +- tests/api-tests/fields/types/document.test.ts | 2 +- tests/api-tests/hooks/hook-errors.test.ts | 2 +- tests/api-tests/package.json | 1 - tests/api-tests/queries/cache-hints.test.ts | 2 +- tests/api-tests/queries/orderBy.test.ts | 2 +- .../crud-self-ref/many-to-many-one-sided.test.ts | 2 +- .../crud-self-ref/many-to-many.test.ts | 2 +- .../crud-self-ref/one-to-many-one-sided.test.ts | 2 +- .../crud-self-ref/one-to-many.test.ts | 2 +- .../crud-self-ref/one-to-one.test.ts | 2 +- .../crud/many-to-many-one-sided.test.ts | 2 +- .../relationships/crud/many-to-many.test.ts | 2 +- .../crud/one-to-many-one-sided.test.ts | 2 +- .../relationships/crud/one-to-many.test.ts | 2 +- .../relationships/crud/one-to-one.test.ts | 2 +- .../relationships/many-to-one-to-one.test.ts | 2 +- .../two-way-backreference/to-many.test.ts | 2 +- .../api-tests/relationships/shared-names.test.ts | 2 +- tests/api-tests/utils.ts | 2 +- yarn.lock | 5 +++++ 241 files changed, 312 insertions(+), 318 deletions(-) create mode 100644 .changeset/cold-turkeys-lie.md rename packages/{types/src => keystone/src/types}/admin-meta.ts (100%) rename packages/{types/src => keystone/src/types}/base.ts (100%) rename packages/{types/src => keystone/src/types}/config/access-control.ts (100%) rename packages/{types/src => keystone/src/types}/config/fields.ts (100%) rename packages/{types/src => keystone/src/types}/config/hooks.ts (100%) rename packages/{types/src => keystone/src/types}/config/index.ts (100%) rename packages/{types/src => keystone/src/types}/config/lists.ts (100%) rename packages/{types/src => keystone/src/types}/context.ts (100%) rename packages/{types/src => keystone/src/types}/core.ts (100%) rename packages/{types/src => keystone/src/types}/filters/enum-filter.ts (100%) rename packages/{types/src => keystone/src/types}/filters/index.ts (100%) rename packages/{types/src => keystone/src/types}/filters/providers/postgresql.ts (99%) rename packages/{types/src => keystone/src/types}/filters/providers/sqlite.ts (100%) create mode 100644 packages/keystone/src/types/index.ts rename packages/{types/src => keystone/src/types}/json-field-type-polyfill-for-sqlite.ts (100%) rename packages/{types/src => keystone/src/types}/next-fields.ts (100%) rename packages/{types/src => keystone/src/types}/schema/graphql-ts-schema.ts (100%) rename packages/{types/src => keystone/src/types}/schema/index.ts (100%) rename packages/{types/src => keystone/src/types}/schema/schema-api-with-context.d.ts (100%) rename packages/{types/src => keystone/src/types}/schema/schema-api-with-context.js (100%) rename packages/{types/src => keystone/src/types}/session.ts (100%) rename packages/{types/src => keystone/src/types}/utils.ts (100%) create mode 100644 packages/keystone/types/package.json diff --git a/.changeset/brave-paws-sneeze.md b/.changeset/brave-paws-sneeze.md index bb937a64b46..c3dc42a3f8f 100644 --- a/.changeset/brave-paws-sneeze.md +++ b/.changeset/brave-paws-sneeze.md @@ -1,7 +1,6 @@ --- "@keystone-next/cloudinary": major "@keystone-next/keystone": major -"@keystone-next/types": major --- Removed unused legacy filter code diff --git a/.changeset/cold-turkeys-lie.md b/.changeset/cold-turkeys-lie.md new file mode 100644 index 00000000000..8849832c855 --- /dev/null +++ b/.changeset/cold-turkeys-lie.md @@ -0,0 +1,10 @@ +--- +'@keystone-next/auth': major +'@keystone-next/cloudinary': major +'@keystone-next/fields-document': major +'@keystone-next/session-store-redis': major +'@keystone-next/types': major +'@keystone-next/keystone': minor +--- + +Moved `@keystone-next/types` to `@keystone-next/keystone/types` diff --git a/docs/pages/docs/apis/config.mdx b/docs/pages/docs/apis/config.mdx index 3b6e7618400..4f850ab0314 100644 --- a/docs/pages/docs/apis/config.mdx +++ b/docs/pages/docs/apis/config.mdx @@ -28,7 +28,7 @@ export default config({ We will cover each of these options below. -The configuration object has a TypeScript type of `KeystoneConfig`, which can be imported from `@keystone-next/types`. +The configuration object has a TypeScript type of `KeystoneConfig`, which can be imported from `@keystone-next/keystone/types`. This type definition should be considered the source of truth for the available configuration options. ## lists @@ -40,7 +40,7 @@ In general you will use the `createSchema()` function to create this configurati See the [Schema API](./schema) docs for details on how to use this function. ```typescript -import type { ListSchemaConfig } from '@keystone-next/types'; +import type { ListSchemaConfig } from '@keystone-next/keystone/types'; import { config, createSchema } from '@keystone-next/keystone/schema'; export default config({ @@ -52,7 +52,7 @@ export default config({ ## db ``` -import type { DatabaseConfig } from '@keystone-next/types'; +import type { DatabaseConfig } from '@keystone-next/keystone/types'; ``` The `db` config option configures the database used to store data in your Keystone system. @@ -128,7 +128,7 @@ The `sqlite` provider is not intended to be used in production systems, and has ## ui ```ts -import type { AdminUIConfig } from '@keystone-next/types'; +import type { AdminUIConfig } from '@keystone-next/keystone/types'; ``` The `ui` config option configures the Admin UI which is provided by Keystone. @@ -186,7 +186,7 @@ export default config({ ## server ``` -import type { ServerConfig } from '@keystone-next/types'; +import type { ServerConfig } from '@keystone-next/keystone/types'; ``` The `dev` and `start` commands from the Keystone [command line](../guides/cli) will start an Express web-server for you. @@ -249,7 +249,7 @@ config({ ## session ``` -import type { SessionStrategy } from '@keystone-next/types'; +import type { SessionStrategy } from '@keystone-next/keystone/types'; ``` The `session` config option allows you to configure session management of your Keystone system. @@ -271,7 +271,7 @@ See the [Session API](./session) for more details on how to configure session ma ## graphql ``` -import type { GraphQLConfig } from '@keystone-next/types'; +import type { GraphQLConfig } from '@keystone-next/keystone/types'; ``` The `graphql` config option allows you to configures certain aspects of your GraphQL API. @@ -305,7 +305,7 @@ export default config({ ## extendGraphqlSchema ``` -import type { ExtendGraphqlSchema } from '@keystone-next/types'; +import type { ExtendGraphqlSchema } from '@keystone-next/keystone/types'; ``` The `extendGraphqlSchema` config option allows you to extend the GraphQL API which is generated by Keystone based on your schema definition. diff --git a/docs/pages/docs/apis/context.mdx b/docs/pages/docs/apis/context.mdx index 665c62b2c5d..e075db84568 100644 --- a/docs/pages/docs/apis/context.mdx +++ b/docs/pages/docs/apis/context.mdx @@ -10,7 +10,7 @@ The APIs provided by the `KeystoneContext` object can be used to write the busin The `KeystoneContext` object has the following properties, which are documented below. ```typescript -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; context = { // HTTP request object diff --git a/docs/pages/docs/apis/fields.mdx b/docs/pages/docs/apis/fields.mdx index 1a4c773a213..b6a100d6589 100644 --- a/docs/pages/docs/apis/fields.mdx +++ b/docs/pages/docs/apis/fields.mdx @@ -564,7 +564,7 @@ Options: ```typescript import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { virtual } from '@keystone-next/keystone/fields'; -import { schema } from '@keystone-next/types'; +import { schema } from '@keystone-next/keystone/types'; export default config({ lists: createSchema({ diff --git a/docs/pages/docs/guides/custom-admin-ui-navigation.mdx b/docs/pages/docs/guides/custom-admin-ui-navigation.mdx index f37ab3e2da3..1ed9376ef94 100644 --- a/docs/pages/docs/guides/custom-admin-ui-navigation.mdx +++ b/docs/pages/docs/guides/custom-admin-ui-navigation.mdx @@ -15,7 +15,7 @@ Reference your custom Navigation component in the export as so. ```ts // /admin/config.ts -import type { AdminConfig } from '@keystone-next/types'; +import type { AdminConfig } from '@keystone-next/keystone/types'; import { CustomNavigation } from './components/CustomNavigation'; export const components: AdminConfig['components'] = { @@ -148,7 +148,7 @@ export function CustomNavigation({ authenticatedItem, lists }: NavigationProps) // admin/config.ts -import { AdminConfig } from '@keystone-next/types'; +import { AdminConfig } from '@keystone-next/keystone/types'; import { CustomNavigation } from './components/CustomNavigation'; export const components: AdminConfig['components'] = { Navigation: CustomNavigation diff --git a/docs/pages/docs/guides/custom-admin-ui-pages.mdx b/docs/pages/docs/guides/custom-admin-ui-pages.mdx index 30af0ff1f6f..b587f0c4f83 100644 --- a/docs/pages/docs/guides/custom-admin-ui-pages.mdx +++ b/docs/pages/docs/guides/custom-admin-ui-pages.mdx @@ -86,7 +86,7 @@ First add the following files to the `/admin` directory in the root of your Keys ```tsx // admin/config.ts -import type { AdminConfig } from '@keystone-next/types'; +import type { AdminConfig } from '@keystone-next/keystone/types'; import { CustomNavigation } from './components/CustomNavigation'; export const components: AdminConfig['components']= { Navigation: CustomNavigation diff --git a/docs/pages/docs/guides/custom-fields.mdx b/docs/pages/docs/guides/custom-fields.mdx index 8ae9e65d04f..9ae717a9994 100644 --- a/docs/pages/docs/guides/custom-fields.mdx +++ b/docs/pages/docs/guides/custom-fields.mdx @@ -31,7 +31,7 @@ import { orderDirectionEnum, filters, FieldDefaultValue, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; export type MyIntFieldConfig = CommonFieldConfig & { @@ -162,7 +162,7 @@ The `Field` export is a React component which is used in the **item view** and t // view.tsx import { FieldContainer, FieldLabel, TextInput } from '@keystone-ui/fields'; -import { FieldProps } from '@keystone-next/types'; +import { FieldProps } from '@keystone-next/keystone/types'; export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => ( @@ -193,7 +193,7 @@ Note it does not allow modifying the value. // view.tsx import { CellLink, CellContainer } from '@keystone-next/keystone/admin-ui/components'; -import { CellComponent } from '@keystone-next/types'; +import { CellComponent } from '@keystone-next/keystone/types'; export const Cell: CellComponent = ({ item, field, linkTo }) => { let value = item[field.path] + ''; @@ -211,7 +211,7 @@ Note it does not allow modifying the value. // view.tsx import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; -import { CardValueComponent } from '@keystone-next/types'; +import { CardValueComponent } from '@keystone-next/keystone/types'; export const CardValue: CardValueComponent = ({ item, field }) => { return ( diff --git a/docs/pages/docs/guides/testing.mdx b/docs/pages/docs/guides/testing.mdx index af81f4a0b18..1efad75ee7a 100644 --- a/docs/pages/docs/guides/testing.mdx +++ b/docs/pages/docs/guides/testing.mdx @@ -205,7 +205,7 @@ x> Be careful of sharing database state across tests. Avoid relying on changes o ``` import { setupTestEnv, TestEnv } from '@keystone-next/keystone/testing'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; describe('Example tests using test environment', () => { let testEnv: TestEnv; diff --git a/docs/pages/docs/guides/virtual-fields.mdx b/docs/pages/docs/guides/virtual-fields.mdx index 50da6dd262f..4acd2a5ea38 100644 --- a/docs/pages/docs/guides/virtual-fields.mdx +++ b/docs/pages/docs/guides/virtual-fields.mdx @@ -18,7 +18,7 @@ We'll start with a list called `Example` and create a virtual field called `hell ```typescript import { config, createSchema, list } from '@keystone-next/keystone/schema'; import { virtual } from '@keystone-next/keystone/fields'; -import { schema } from '@keystone-next/types'; +import { schema } from '@keystone-next/keystone/types'; export default config({ lists: createSchema({ @@ -59,7 +59,7 @@ The value of `hello` is generated from the `resolve` function, which returns the ## The schema API -The `virtual` field is configured using functions from the `schema` API in the `@keystone-next/types` package. +The `virtual` field is configured using functions from the `schema` API in the `@keystone-next/keystone/types` package. This API provides the interface required to create type-safe extensions to the Keystone GraphQL schema. The schema API is based on the [`@graphql-ts/schema`](https://github.com/Thinkmill/graphql-ts) package. diff --git a/examples-staging/basic/admin/config.tsx b/examples-staging/basic/admin/config.tsx index e060f6bb678..f41f2254a92 100644 --- a/examples-staging/basic/admin/config.tsx +++ b/examples-staging/basic/admin/config.tsx @@ -1,6 +1,6 @@ // import React from 'react'; -import { AdminConfig } from '@keystone-next/types'; +import { AdminConfig } from '@keystone-next/keystone/types'; // import { DarkTheme } from '@keystone-next/keystone/admin-ui/themes'; // export const theme = DarkTheme; diff --git a/examples-staging/basic/admin/fieldViews/Test.tsx b/examples-staging/basic/admin/fieldViews/Test.tsx index 7255b445855..dfe74a63998 100644 --- a/examples-staging/basic/admin/fieldViews/Test.tsx +++ b/examples-staging/basic/admin/fieldViews/Test.tsx @@ -1,6 +1,6 @@ /* @jsx jsx */ -import { FieldProps } from '@keystone-next/types'; +import { FieldProps } from '@keystone-next/keystone/types'; import { jsx } from '@keystone-ui/core'; import { FieldContainer, FieldLabel, TextArea, TextInput } from '@keystone-ui/fields'; import { controller } from '@keystone-next/keystone/fields/types/text/views'; diff --git a/examples-staging/basic/package.json b/examples-staging/basic/package.json index 152aec9e78f..aebf52d2a79 100644 --- a/examples-staging/basic/package.json +++ b/examples-staging/basic/package.json @@ -14,7 +14,6 @@ "@keystone-next/document-renderer": "^4.0.0", "@keystone-next/fields-document": "^8.0.0", "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "@keystone-ui/core": "^3.1.1", "@keystone-ui/fields": "^4.1.1", "@keystone-ui/icons": "^4.0.0", diff --git a/examples-staging/basic/schema.ts b/examples-staging/basic/schema.ts index af1f49402cf..42397836f64 100644 --- a/examples-staging/basic/schema.ts +++ b/examples-staging/basic/schema.ts @@ -12,7 +12,7 @@ import { } from '@keystone-next/keystone/fields'; import { document } from '@keystone-next/fields-document'; // import { cloudinaryImage } from '@keystone-next/cloudinary'; -import { KeystoneListsAPI, schema } from '@keystone-next/types'; +import { KeystoneListsAPI, schema } from '@keystone-next/keystone/types'; import { componentBlocks } from './admin/fieldViews/Content'; import { KeystoneListsTypeInfo } from '.keystone/types'; diff --git a/examples-staging/ecommerce/mutations/addToCart.ts b/examples-staging/ecommerce/mutations/addToCart.ts index e071e44cd0d..4a9692d93a8 100644 --- a/examples-staging/ecommerce/mutations/addToCart.ts +++ b/examples-staging/ecommerce/mutations/addToCart.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { Session } from '../types'; async function addToCart( diff --git a/examples-staging/ecommerce/mutations/checkout.ts b/examples-staging/ecommerce/mutations/checkout.ts index 78645966d40..2e9ce95e1a2 100644 --- a/examples-staging/ecommerce/mutations/checkout.ts +++ b/examples-staging/ecommerce/mutations/checkout.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; // import stripeConfig from '../lib/stripe'; diff --git a/examples-staging/ecommerce/package.json b/examples-staging/ecommerce/package.json index dd37b7faa29..e82df27223d 100644 --- a/examples-staging/ecommerce/package.json +++ b/examples-staging/ecommerce/package.json @@ -19,7 +19,6 @@ "@keystone-next/auth": "^31.0.0", "@keystone-next/cloudinary": "^6.0.6", "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "@types/nodemailer": "^6.4.4", "dotenv": "^10.0.0", "next": "^10.2.3", diff --git a/examples-staging/ecommerce/schemas/Order.ts b/examples-staging/ecommerce/schemas/Order.ts index 43519bb982b..3b466e96207 100644 --- a/examples-staging/ecommerce/schemas/Order.ts +++ b/examples-staging/ecommerce/schemas/Order.ts @@ -1,6 +1,6 @@ import { integer, text, relationship, virtual } from '@keystone-next/keystone/fields'; import { list } from '@keystone-next/keystone/schema'; -import { schema } from '@keystone-next/types'; +import { schema } from '@keystone-next/keystone/types'; import { isSignedIn, rules } from '../access'; import formatMoney from '../lib/formatMoney'; diff --git a/examples-staging/ecommerce/seed-data/index.ts b/examples-staging/ecommerce/seed-data/index.ts index 68ae3a09560..318d56bb162 100644 --- a/examples-staging/ecommerce/seed-data/index.ts +++ b/examples-staging/ecommerce/seed-data/index.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { products } from './data'; export async function insertSeedData({ prisma }: KeystoneContext) { diff --git a/examples-staging/ecommerce/tests/mutations.test.ts b/examples-staging/ecommerce/tests/mutations.test.ts index a2c73580c9f..f3f425b175d 100644 --- a/examples-staging/ecommerce/tests/mutations.test.ts +++ b/examples-staging/ecommerce/tests/mutations.test.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestRunner } from '@keystone-next/keystone/testing'; import config from '../keystone'; diff --git a/examples-staging/ecommerce/types.ts b/examples-staging/ecommerce/types.ts index ee1f06f44c2..20cf767d0d3 100644 --- a/examples-staging/ecommerce/types.ts +++ b/examples-staging/ecommerce/types.ts @@ -1,4 +1,4 @@ -import { KeystoneGraphQLAPI, KeystoneListsAPI } from '@keystone-next/types'; +import { KeystoneGraphQLAPI, KeystoneListsAPI } from '@keystone-next/keystone/types'; // NOTE -- these types are commented out in master because they aren't generated by the build (yet) // To get full List and GraphQL API type support, uncomment them here and use them below diff --git a/examples-staging/roles/package.json b/examples-staging/roles/package.json index a741c0c29dc..75a4c5c8502 100644 --- a/examples-staging/roles/package.json +++ b/examples-staging/roles/package.json @@ -11,7 +11,6 @@ "dependencies": { "@keystone-next/auth": "^31.0.0", "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "next": "^10.2.3", "react": "^17.0.2", "react-dom": "^17.0.2" diff --git a/examples/custom-admin-ui-logo/admin/config.tsx b/examples/custom-admin-ui-logo/admin/config.tsx index d5e845d1013..58dd45b55c6 100644 --- a/examples/custom-admin-ui-logo/admin/config.tsx +++ b/examples/custom-admin-ui-logo/admin/config.tsx @@ -1,4 +1,4 @@ -import { AdminConfig } from '@keystone-next/types'; +import { AdminConfig } from '@keystone-next/keystone/types'; import { CustomLogo } from './components/CustomLogo'; // Presently the Logo is the only Admin UI component that is customisable. diff --git a/examples/custom-admin-ui-logo/package.json b/examples/custom-admin-ui-logo/package.json index e13662d607d..178c05e1544 100644 --- a/examples/custom-admin-ui-logo/package.json +++ b/examples/custom-admin-ui-logo/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "@keystone-ui/core": "^3.1.0", "next": "^10.2.3", "react": "^17.0.2" diff --git a/examples/custom-admin-ui-navigation/README.md b/examples/custom-admin-ui-navigation/README.md index 486add508b1..8fc2df99a31 100644 --- a/examples/custom-admin-ui-navigation/README.md +++ b/examples/custom-admin-ui-navigation/README.md @@ -39,7 +39,7 @@ The exported components object is expected to have the following type signature: Keystone conveniently exports an AdminConfig type for DX. ```typescript -import { AdminConfig } from '@keystone-next/types'; +import { AdminConfig } from '@keystone-next/keystone/types'; export const components: AdminConfig['components'] = { Logo, Navigation, diff --git a/examples/custom-admin-ui-navigation/admin/config.ts b/examples/custom-admin-ui-navigation/admin/config.ts index 4e65a6cec7d..7902ad3ba41 100644 --- a/examples/custom-admin-ui-navigation/admin/config.ts +++ b/examples/custom-admin-ui-navigation/admin/config.ts @@ -1,4 +1,4 @@ -import { AdminConfig } from '@keystone-next/types'; +import { AdminConfig } from '@keystone-next/keystone/types'; import { CustomNavigation } from './components/CustomNavigation'; export const components: AdminConfig['components'] = { diff --git a/examples/custom-admin-ui-navigation/package.json b/examples/custom-admin-ui-navigation/package.json index ee9032c7dbf..2f8a596d8f9 100644 --- a/examples/custom-admin-ui-navigation/package.json +++ b/examples/custom-admin-ui-navigation/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "react": "^17.0.2" }, "devDependencies": { diff --git a/examples/custom-admin-ui-pages/admin/config.ts b/examples/custom-admin-ui-pages/admin/config.ts index 12e80c22bb2..ec880712dea 100644 --- a/examples/custom-admin-ui-pages/admin/config.ts +++ b/examples/custom-admin-ui-pages/admin/config.ts @@ -1,4 +1,4 @@ -import type { AdminConfig } from '@keystone-next/types'; +import type { AdminConfig } from '@keystone-next/keystone/types'; import { CustomNavigation } from './components/CustomNavigation'; export const components: AdminConfig['components'] = { Navigation: CustomNavigation, diff --git a/examples/custom-admin-ui-pages/package.json b/examples/custom-admin-ui-pages/package.json index 79a252b82d2..5fbeaaa9712 100644 --- a/examples/custom-admin-ui-pages/package.json +++ b/examples/custom-admin-ui-pages/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "@keystone-ui/core": "^3.1.0", "react": "^17.0.2" }, diff --git a/examples/custom-field-view/fields/related-links/components.tsx b/examples/custom-field-view/fields/related-links/components.tsx index 663c9a60d98..03d6bab221e 100644 --- a/examples/custom-field-view/fields/related-links/components.tsx +++ b/examples/custom-field-view/fields/related-links/components.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { FieldProps } from '@keystone-next/types'; +import { FieldProps } from '@keystone-next/keystone/types'; import { css } from '@emotion/css'; import { Button } from '@keystone-ui/button'; import { FieldContainer, FieldLabel, TextInput } from '@keystone-ui/fields'; diff --git a/examples/custom-field-view/package.json b/examples/custom-field-view/package.json index 0486438683e..3e69b26603a 100644 --- a/examples/custom-field-view/package.json +++ b/examples/custom-field-view/package.json @@ -11,7 +11,6 @@ "dependencies": { "@emotion/css": "^11.1.3", "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "@keystone-ui/button": "^5.0.0", "@keystone-ui/core": "^3.1.1", "@keystone-ui/fields": "^4.1.2", diff --git a/examples/custom-field/package.json b/examples/custom-field/package.json index 8e4da668f0b..06070cbb542 100644 --- a/examples/custom-field/package.json +++ b/examples/custom-field/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "@keystone-ui/fields": "^4.1.2", "react": "^17.0.2" }, diff --git a/examples/custom-field/stars-field/index.ts b/examples/custom-field/stars-field/index.ts index d3b39934666..2f8816753f6 100644 --- a/examples/custom-field/stars-field/index.ts +++ b/examples/custom-field/stars-field/index.ts @@ -7,7 +7,7 @@ import { orderDirectionEnum, schema, filters, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; // this field is based on the integer field // but with validation to ensure the value is within an expected range diff --git a/examples/custom-field/stars-field/views.tsx b/examples/custom-field/stars-field/views.tsx index c6672ed4183..13c28254668 100644 --- a/examples/custom-field/stars-field/views.tsx +++ b/examples/custom-field/stars-field/views.tsx @@ -8,7 +8,7 @@ import { FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; import { StarsInput } from './stars-input'; // this is the component shown in the create modal and item page diff --git a/examples/testing/README.md b/examples/testing/README.md index b64f5c36660..3550968aa0e 100644 --- a/examples/testing/README.md +++ b/examples/testing/README.md @@ -127,7 +127,7 @@ test( The function `setupTestEnv` is used to set up a test environment which can be used across multiple tests. ```typescript -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestEnv, TestEnv } from '@keystone-next/keystone/testing'; import config from './keystone'; diff --git a/examples/testing/example.test.ts b/examples/testing/example.test.ts index 065064a41cd..a8d152c9e90 100644 --- a/examples/testing/example.test.ts +++ b/examples/testing/example.test.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestEnv, setupTestRunner, TestEnv } from '@keystone-next/keystone/testing'; import config from './keystone'; diff --git a/examples/testing/package.json b/examples/testing/package.json index 0936a3324b5..afa7411a4fe 100644 --- a/examples/testing/package.json +++ b/examples/testing/package.json @@ -14,8 +14,7 @@ "@babel/preset-env": "^7.15.0", "@babel/preset-typescript": "^7.15.0", "@keystone-next/auth": "^31.0.0", - "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0" + "@keystone-next/keystone": "^24.0.0" }, "devDependencies": { "babel-jest": "^27.0.6", diff --git a/examples/virtual-field/README.md b/examples/virtual-field/README.md index fd452f6068f..31d4b7d6600 100644 --- a/examples/virtual-field/README.md +++ b/examples/virtual-field/README.md @@ -19,7 +19,7 @@ You can also access a GraphQL Playground at [localhost:3000/api/graphql](http:// ## Features This project demonstrates how to use virtual fields. -It uses the `schema` API from the `@keystone-next/types` package to define the GraphQL schema used by the virtual fields. +It uses the `schema` API from `@keystone-next/keystone/types` to define the GraphQL schema used by the virtual fields. ### `isPublished` diff --git a/examples/virtual-field/package.json b/examples/virtual-field/package.json index 82f2b9fd65e..bfc51fb4efc 100644 --- a/examples/virtual-field/package.json +++ b/examples/virtual-field/package.json @@ -9,8 +9,7 @@ "build": "keystone-next build" }, "dependencies": { - "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0" + "@keystone-next/keystone": "^24.0.0" }, "devDependencies": { "typescript": "^4.3.5" diff --git a/examples/virtual-field/schema.ts b/examples/virtual-field/schema.ts index 2bcb92c6c28..fdcb82bcae6 100644 --- a/examples/virtual-field/schema.ts +++ b/examples/virtual-field/schema.ts @@ -1,6 +1,6 @@ import { createSchema, list } from '@keystone-next/keystone/schema'; import { select, relationship, text, timestamp, virtual } from '@keystone-next/keystone/fields'; -import { schema } from '@keystone-next/types'; +import { schema } from '@keystone-next/keystone/types'; export const lists = createSchema({ Post: list({ diff --git a/packages/auth/package.json b/packages/auth/package.json index a59a20ccc09..41d1a446cda 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -10,7 +10,6 @@ "dependencies": { "@babel/runtime": "^7.15.3", "@graphql-tools/schema": "^8.1.1", - "@keystone-next/types": "^24.0.0", "@keystone-ui/button": "^5.0.0", "@keystone-ui/core": "^3.1.1", "@keystone-ui/fields": "^4.1.1", diff --git a/packages/auth/src/gql/getBaseAuthSchema.ts b/packages/auth/src/gql/getBaseAuthSchema.ts index c5b54da3310..324d6e7ef25 100644 --- a/packages/auth/src/gql/getBaseAuthSchema.ts +++ b/packages/auth/src/gql/getBaseAuthSchema.ts @@ -1,4 +1,4 @@ -import type { GraphQLSchemaExtension, KeystoneContext } from '@keystone-next/types'; +import type { GraphQLSchemaExtension, KeystoneContext } from '@keystone-next/keystone/types'; import { AuthGqlNames, SecretFieldImpl } from '../types'; diff --git a/packages/auth/src/gql/getInitFirstItemSchema.ts b/packages/auth/src/gql/getInitFirstItemSchema.ts index e5a6648c5d2..7b0af597577 100644 --- a/packages/auth/src/gql/getInitFirstItemSchema.ts +++ b/packages/auth/src/gql/getInitFirstItemSchema.ts @@ -1,4 +1,4 @@ -import type { GraphQLSchemaExtension } from '@keystone-next/types'; +import type { GraphQLSchemaExtension } from '@keystone-next/keystone/types'; import { assertInputObjectType, GraphQLInputObjectType, GraphQLSchema, printType } from 'graphql'; import { AuthGqlNames, InitFirstItemConfig } from '../types'; diff --git a/packages/auth/src/gql/getMagicAuthLinkSchema.ts b/packages/auth/src/gql/getMagicAuthLinkSchema.ts index a7505e275c3..938bcdd0fbf 100644 --- a/packages/auth/src/gql/getMagicAuthLinkSchema.ts +++ b/packages/auth/src/gql/getMagicAuthLinkSchema.ts @@ -1,4 +1,4 @@ -import type { GraphQLSchemaExtension } from '@keystone-next/types'; +import type { GraphQLSchemaExtension } from '@keystone-next/keystone/types'; import { AuthGqlNames, AuthTokenTypeConfig, SecretFieldImpl } from '../types'; diff --git a/packages/auth/src/gql/getPasswordResetSchema.ts b/packages/auth/src/gql/getPasswordResetSchema.ts index 50266e7d5ac..31ae9c15d34 100644 --- a/packages/auth/src/gql/getPasswordResetSchema.ts +++ b/packages/auth/src/gql/getPasswordResetSchema.ts @@ -1,4 +1,4 @@ -import type { GraphQLSchemaExtension } from '@keystone-next/types'; +import type { GraphQLSchemaExtension } from '@keystone-next/keystone/types'; import { AuthGqlNames, AuthTokenTypeConfig, SecretFieldImpl } from '../types'; diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts index 4d7c3cce2bb..89dd87a936b 100644 --- a/packages/auth/src/index.ts +++ b/packages/auth/src/index.ts @@ -6,7 +6,7 @@ import { KeystoneContext, AdminUIConfig, SessionStrategy, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; import { password, timestamp } from '@keystone-next/keystone/fields'; import { AuthConfig, AuthGqlNames } from './types'; diff --git a/packages/auth/src/lib/createAuthToken.ts b/packages/auth/src/lib/createAuthToken.ts index ad9f5aee0d5..e7f6c015753 100644 --- a/packages/auth/src/lib/createAuthToken.ts +++ b/packages/auth/src/lib/createAuthToken.ts @@ -1,5 +1,5 @@ import { randomBytes } from 'crypto'; -import type { KeystoneDbAPI } from '@keystone-next/types'; +import type { KeystoneDbAPI } from '@keystone-next/keystone/types'; import { AuthTokenRequestErrorCode } from '../types'; import { findMatchingIdentity } from './findMatchingIdentity'; diff --git a/packages/auth/src/lib/findMatchingIdentity.ts b/packages/auth/src/lib/findMatchingIdentity.ts index 3297aacf5a8..8ca2cfa71f2 100644 --- a/packages/auth/src/lib/findMatchingIdentity.ts +++ b/packages/auth/src/lib/findMatchingIdentity.ts @@ -1,4 +1,4 @@ -import type { KeystoneDbAPI } from '@keystone-next/types'; +import type { KeystoneDbAPI } from '@keystone-next/keystone/types'; import { AuthTokenRequestErrorCode } from '../types'; diff --git a/packages/auth/src/lib/getErrorMessage.ts b/packages/auth/src/lib/getErrorMessage.ts index 42fc18ab302..e7dd3a17fd1 100644 --- a/packages/auth/src/lib/getErrorMessage.ts +++ b/packages/auth/src/lib/getErrorMessage.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { AuthTokenRedemptionErrorCode, AuthTokenRequestErrorCode, diff --git a/packages/auth/src/lib/validateAuthToken.ts b/packages/auth/src/lib/validateAuthToken.ts index ae5de7b0645..72d0acc2095 100644 --- a/packages/auth/src/lib/validateAuthToken.ts +++ b/packages/auth/src/lib/validateAuthToken.ts @@ -1,4 +1,4 @@ -import type { KeystoneDbAPI } from '@keystone-next/types'; +import type { KeystoneDbAPI } from '@keystone-next/keystone/types'; import { AuthTokenRedemptionErrorCode, SecretFieldImpl } from '../types'; import { validateSecret } from './validateSecret'; diff --git a/packages/auth/src/lib/validateSecret.ts b/packages/auth/src/lib/validateSecret.ts index 63679b9c0f5..a09fa243e30 100644 --- a/packages/auth/src/lib/validateSecret.ts +++ b/packages/auth/src/lib/validateSecret.ts @@ -1,4 +1,4 @@ -import type { KeystoneDbAPI } from '@keystone-next/types'; +import type { KeystoneDbAPI } from '@keystone-next/keystone/types'; import { PasswordAuthErrorCode, SecretFieldImpl } from '../types'; import { findMatchingIdentity } from './findMatchingIdentity'; diff --git a/packages/auth/src/pages/InitPage.tsx b/packages/auth/src/pages/InitPage.tsx index fae7e9e9ffc..49c8508bca2 100644 --- a/packages/auth/src/pages/InitPage.tsx +++ b/packages/auth/src/pages/InitPage.tsx @@ -7,7 +7,7 @@ import { jsx, H1, Stack, Inline, VisuallyHidden } from '@keystone-ui/core'; import { Button } from '@keystone-ui/button'; import { Checkbox, TextInput } from '@keystone-ui/fields'; import { useRawKeystone } from '@keystone-next/keystone/admin-ui/context'; -import { FieldMeta } from '@keystone-next/types'; +import { FieldMeta } from '@keystone-next/keystone/types'; import isDeepEqual from 'fast-deep-equal'; import { gql, useMutation } from '@keystone-next/keystone/admin-ui/apollo'; diff --git a/packages/auth/src/schema.ts b/packages/auth/src/schema.ts index 64cbef1e917..18419ccecec 100644 --- a/packages/auth/src/schema.ts +++ b/packages/auth/src/schema.ts @@ -1,5 +1,5 @@ import { mergeSchemas } from '@graphql-tools/schema'; -import { ExtendGraphqlSchema } from '@keystone-next/types'; +import { ExtendGraphqlSchema } from '@keystone-next/keystone/types'; import { assertObjectType, diff --git a/packages/auth/src/templates/init.ts b/packages/auth/src/templates/init.ts index d9682236eec..0ee81c6974f 100644 --- a/packages/auth/src/templates/init.ts +++ b/packages/auth/src/templates/init.ts @@ -1,4 +1,4 @@ -import { BaseGeneratedListTypes } from '@keystone-next/types'; +import { BaseGeneratedListTypes } from '@keystone-next/keystone/types'; import { AuthConfig } from '../types'; type InitTemplateArgs = { diff --git a/packages/auth/src/types.ts b/packages/auth/src/types.ts index 91de2bd4081..b314ad1d7df 100644 --- a/packages/auth/src/types.ts +++ b/packages/auth/src/types.ts @@ -1,4 +1,4 @@ -import { BaseGeneratedListTypes, KeystoneContext } from '@keystone-next/types'; +import { BaseGeneratedListTypes, KeystoneContext } from '@keystone-next/keystone/types'; export type AuthGqlNames = { CreateInitialInput: string; diff --git a/packages/cloudinary/package.json b/packages/cloudinary/package.json index 4c5421f9624..285f5bdaee9 100644 --- a/packages/cloudinary/package.json +++ b/packages/cloudinary/package.json @@ -6,7 +6,6 @@ "module": "dist/cloudinary.esm.js", "dependencies": { "@babel/runtime": "^7.15.3", - "@keystone-next/types": "^24.0.0", "@keystone-ui/button": "^5.0.0", "@keystone-ui/core": "^3.1.1", "@keystone-ui/fields": "^4.1.2", @@ -17,6 +16,9 @@ "graphql-upload": "^12.0.0", "react": "^17.0.2" }, + "peerDependencies": { + "@keystone-next/keystone": "^24.0.0" + }, "devDependencies": { "@keystone-next/keystone": "^24.0.0", "mime": "^2.5.2" diff --git a/packages/cloudinary/src/index.ts b/packages/cloudinary/src/index.ts index 937f643548f..07fa053fca2 100644 --- a/packages/cloudinary/src/index.ts +++ b/packages/cloudinary/src/index.ts @@ -6,7 +6,7 @@ import { jsonFieldTypePolyfilledForSQLite, schema, FieldDefaultValue, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; import { FileUpload } from 'graphql-upload'; import cuid from 'cuid'; import cloudinary from 'cloudinary'; diff --git a/packages/cloudinary/src/test-fixtures.skip.ts b/packages/cloudinary/src/test-fixtures.skip.ts index 3e2172174f6..1be7d9adec9 100644 --- a/packages/cloudinary/src/test-fixtures.skip.ts +++ b/packages/cloudinary/src/test-fixtures.skip.ts @@ -3,7 +3,7 @@ import mime from 'mime'; import { FileUpload, Upload } from 'graphql-upload'; import cloudinary from 'cloudinary'; import { text } from '@keystone-next/keystone/fields'; -import { DatabaseProvider } from '@keystone-next/types'; +import { DatabaseProvider } from '@keystone-next/keystone/types'; import { cloudinaryImage } from './index'; const path = require('path'); diff --git a/packages/cloudinary/src/views/Field.tsx b/packages/cloudinary/src/views/Field.tsx index 4f6b5614631..85b95a4cd45 100644 --- a/packages/cloudinary/src/views/Field.tsx +++ b/packages/cloudinary/src/views/Field.tsx @@ -6,7 +6,7 @@ import { useEffect, useMemo, useRef, useState } from 'react'; import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { Pill } from '@keystone-ui/pill'; import { Button } from '@keystone-ui/button'; -import { FieldProps } from '@keystone-next/types'; +import { FieldProps } from '@keystone-next/keystone/types'; function useObjectURL(fileData: File | undefined) { let [objectURL, setObjectURL] = useState(undefined); diff --git a/packages/cloudinary/src/views/index.tsx b/packages/cloudinary/src/views/index.tsx index 0e12f549ae4..77f45dc3473 100644 --- a/packages/cloudinary/src/views/index.tsx +++ b/packages/cloudinary/src/views/index.tsx @@ -6,7 +6,7 @@ import { CellComponent, FieldController, FieldControllerConfig, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { validateImage } from './Field'; diff --git a/packages/fields-document/package.json b/packages/fields-document/package.json index 54cda35faec..3ecca6dddad 100644 --- a/packages/fields-document/package.json +++ b/packages/fields-document/package.json @@ -23,7 +23,6 @@ "@braintree/sanitize-url": "^5.0.2", "@emotion/weak-memoize": "^0.2.5", "@keystone-next/keystone": "^24.0.0", - "@keystone-next/types": "^24.0.0", "@keystone-ui/button": "^5.0.0", "@keystone-ui/core": "^3.1.1", "@keystone-ui/fields": "^4.1.1", diff --git a/packages/fields-document/src/index.ts b/packages/fields-document/src/index.ts index 9fbd1819af0..55ff4787db5 100644 --- a/packages/fields-document/src/index.ts +++ b/packages/fields-document/src/index.ts @@ -7,7 +7,7 @@ import { schema, JSONValue, FieldDefaultValue, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; import { Relationships } from './DocumentEditor/relationship'; import { ComponentBlock } from './component-blocks'; import { DocumentFeatures } from './views'; diff --git a/packages/fields-document/src/relationship-data.tsx b/packages/fields-document/src/relationship-data.tsx index ede96091c09..4668d7f4913 100644 --- a/packages/fields-document/src/relationship-data.tsx +++ b/packages/fields-document/src/relationship-data.tsx @@ -1,4 +1,8 @@ -import { BaseGeneratedListTypes, GqlNames, KeystoneGraphQLAPI } from '@keystone-next/types'; +import { + BaseGeneratedListTypes, + GqlNames, + KeystoneGraphQLAPI, +} from '@keystone-next/keystone/types'; import { Descendant } from 'slate'; import { GraphQLSchema, executeSync, parse } from 'graphql'; import weakMemoize from '@emotion/weak-memoize'; diff --git a/packages/fields-document/src/views.tsx b/packages/fields-document/src/views.tsx index 94cb55a74f4..0c16db654fb 100644 --- a/packages/fields-document/src/views.tsx +++ b/packages/fields-document/src/views.tsx @@ -10,7 +10,7 @@ import { FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; import weakMemoize from '@emotion/weak-memoize'; import { DocumentEditor } from './DocumentEditor'; import { ComponentBlock } from './component-blocks'; diff --git a/packages/keystone/package.json b/packages/keystone/package.json index 29701a15f41..6969e088f1b 100644 --- a/packages/keystone/package.json +++ b/packages/keystone/package.json @@ -18,7 +18,8 @@ "static", "admin-ui", "testing", - "fields" + "fields", + "types" ], "bin": { "keystone-next": "bin/cli.js" @@ -31,8 +32,8 @@ "@emotion/hash": "^0.8.0", "@emotion/weak-memoize": "^0.2.5", "@graphql-tools/schema": "^8.1.1", + "@graphql-ts/schema": "0.2.0", "@hapi/iron": "^6.0.0", - "@keystone-next/types": "^24.0.0", "@keystone-ui/button": "^5.0.0", "@keystone-ui/core": "^3.1.1", "@keystone-ui/fields": "^4.1.2", @@ -59,6 +60,7 @@ "@types/form-data": "2.5.0", "@types/fs-extra": "^9.0.12", "@types/graphql-upload": "^8.0.6", + "@types/inflection": "^1.5.28", "@types/node-fetch": "^2.5.12", "@types/pluralize": "^0.0.29", "@types/prettier": "^2.3.2", @@ -154,7 +156,8 @@ "fields/index.ts", "fields/types/*/views/index.tsx", "fields/types/relationship/views/RelationshipSelect.tsx", - "fields/types/{image,file}/utils.ts" + "fields/types/{image,file}/utils.ts", + "types/index.ts" ] }, "repository": "https://github.com/keystonejs/keystone/tree/master/packages/keystone" diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx index cba2c258087..54d55591fd6 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx @@ -8,7 +8,7 @@ import { FieldController, FieldControllerConfig, IdFieldConfig, -} from '@keystone-next/types'; +} from '../../types'; import { CellLink, CellContainer } from '../../admin-ui/components'; export const Field = () => null; diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.tsx index b15dc85f40b..89695d0b655 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Core } from '@keystone-ui/core'; import { AppProps } from 'next/app'; import { DocumentNode } from 'graphql'; -import { AdminConfig, FieldViews } from '@keystone-next/types'; +import { AdminConfig, FieldViews } from '../../../../types'; import { ErrorBoundary } from '../../../../admin-ui/components'; import { KeystoneProvider } from '../../../../admin-ui/context'; diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx index 27aad5541dc..ca55ef7b6f8 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx @@ -15,7 +15,6 @@ import { useState, } from 'react'; -import { ListMeta } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { Box, Center, Heading, Stack, Text, jsx, useTheme } from '@keystone-ui/core'; import { LoadingDots } from '@keystone-ui/loading'; @@ -26,6 +25,7 @@ import { Notice } from '@keystone-ui/notice'; import { useToasts } from '@keystone-ui/toast'; import { Tooltip } from '@keystone-ui/tooltip'; import { FieldLabel, TextInput } from '@keystone-ui/fields'; +import { ListMeta } from '../../../../types'; import { DataGetter, DeepNullable, diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx index 11e517ec534..f6bef6d06fd 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FieldSelection.tsx @@ -1,11 +1,11 @@ /** @jsx jsx */ -import { ListMeta } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { Box, jsx } from '@keystone-ui/core'; import { ChevronDownIcon } from '@keystone-ui/icons/icons/ChevronDownIcon'; import { Options, OptionPrimitive, CheckMark } from '@keystone-ui/options'; import { Popover } from '@keystone-ui/popover'; import { useRouter } from 'next/router'; +import { ListMeta } from '../../../../types'; import { useSelectedFields } from './useSelectedFields'; function isArrayEqual(arrA: string[], arrB: string[]) { diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx index fc237fe2b4e..18361d78f82 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx @@ -1,7 +1,6 @@ /** @jsx jsx */ import { ComponentProps, Fragment, FormEvent, useMemo, useState } from 'react'; -import { FieldMeta, JSONValue } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { Box, Divider, Heading, Stack, VisuallyHidden, jsx, useTheme } from '@keystone-ui/core'; import { Select } from '@keystone-ui/fields'; @@ -11,6 +10,7 @@ import { ChevronDownIcon } from '@keystone-ui/icons/icons/ChevronDownIcon'; import { OptionPrimitive, Options } from '@keystone-ui/options'; import { PopoverDialog, usePopover } from '@keystone-ui/popover'; +import { FieldMeta, JSONValue } from '../../../../types'; import { useList } from '../../../../admin-ui/context'; import { useRouter } from '../../../../admin-ui/router'; diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx index a0677922e21..7b487926842 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterList.tsx @@ -1,10 +1,10 @@ /** @jsx jsx */ import { Inline, jsx, Stack } from '@keystone-ui/core'; -import { FieldMeta, ListMeta } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { usePopover, PopoverDialog } from '@keystone-ui/popover'; import { FormEvent, Fragment, useState } from 'react'; import { Pill } from '@keystone-ui/pill'; +import { FieldMeta, ListMeta } from '../../../../types'; import { useRouter } from '../../../../admin-ui/router'; import { Filter } from './useFilters'; diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/SortSelection.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/SortSelection.tsx index fb5bfe01bee..5470704712b 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/SortSelection.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/SortSelection.tsx @@ -1,11 +1,11 @@ /** @jsx jsx */ -import { ListMeta } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { Divider, Heading, jsx, Stack } from '@keystone-ui/core'; import { ChevronDownIcon } from '@keystone-ui/icons/icons/ChevronDownIcon'; import { Options } from '@keystone-ui/options'; import { PopoverDialog, usePopover } from '@keystone-ui/popover'; import { Fragment } from 'react'; +import { ListMeta } from '../../../../types'; import { useRouter } from '../../../../admin-ui/router'; import { fieldSelectionOptionsComponents } from './FieldSelection'; import { useSort } from './useSort'; diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx index 4d1c517cd78..8f0cf02dc46 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx @@ -2,7 +2,6 @@ import { Fragment, HTMLAttributes, ReactNode, useEffect, useMemo, useState } from 'react'; -import { ListMeta } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { Box, Center, Heading, jsx, Stack, useTheme } from '@keystone-ui/core'; import { CheckboxControl } from '@keystone-ui/fields'; @@ -11,6 +10,7 @@ import { LoadingDots } from '@keystone-ui/loading'; import { AlertDialog, DrawerController } from '@keystone-ui/modals'; import { useToasts } from '@keystone-ui/toast'; +import { ListMeta } from '../../../../types'; import { getRootGraphQLFieldsFromFieldController, DataGetter, diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useFilters.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useFilters.tsx index e3655a35dd3..4b1860e1d08 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useFilters.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useFilters.tsx @@ -1,5 +1,5 @@ import { useMemo } from 'react'; -import { JSONValue, ListMeta } from '@keystone-next/types'; +import { JSONValue, ListMeta } from '../../../../types'; import { useRouter } from '../../../../admin-ui/router'; export type Filter = { field: string; type: string; value: JSONValue }; diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSelectedFields.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSelectedFields.tsx index 8786bdb1a3b..28b3567719f 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSelectedFields.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSelectedFields.tsx @@ -1,5 +1,5 @@ -import { ListMeta } from '@keystone-next/types'; import { useMemo } from 'react'; +import { ListMeta } from '../../../../types'; import { useRouter } from '../../../../admin-ui/router'; export function useSelectedFields( diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSort.tsx b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSort.tsx index 6e4b29bc748..5dd65026ec5 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSort.tsx +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/useSort.tsx @@ -1,5 +1,5 @@ -import { ListMeta } from '@keystone-next/types'; import { useMemo } from 'react'; +import { ListMeta } from '../../../../types'; import { useRouter } from '../../../../admin-ui/router'; export function useSort(list: ListMeta) { diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/next-graphql.ts b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/next-graphql.ts index 78ec432b4c4..91565438128 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/next-graphql.ts +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/next-graphql.ts @@ -1,4 +1,4 @@ -import { KeystoneConfig } from '@keystone-next/types'; +import { KeystoneConfig } from '../types'; import { initConfig } from '../lib/config/initConfig'; import { createSystem } from '../lib/createSystem'; import { createApolloServerMicro } from '../lib/server/createApolloServer'; diff --git a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/node-api.ts b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/node-api.ts index 0ff1335df88..4d8357a2dc4 100644 --- a/packages/keystone/src/___internal-do-not-use-will-break-in-patch/node-api.ts +++ b/packages/keystone/src/___internal-do-not-use-will-break-in-patch/node-api.ts @@ -1,4 +1,4 @@ -import { KeystoneConfig } from '@keystone-next/types'; +import { KeystoneConfig } from '../types'; import { createSystem } from '../lib/createSystem'; import { initConfig } from '../lib/config/initConfig'; diff --git a/packages/keystone/src/admin-ui/admin-meta-graphql.ts b/packages/keystone/src/admin-ui/admin-meta-graphql.ts index 9deaeb37531..7f218257052 100644 --- a/packages/keystone/src/admin-ui/admin-meta-graphql.ts +++ b/packages/keystone/src/admin-ui/admin-meta-graphql.ts @@ -1,4 +1,4 @@ -import { JSONValue } from '@keystone-next/types'; +import { JSONValue } from '../types'; import { gql } from './apollo'; export const staticAdminMetaQuery = gql` diff --git a/packages/keystone/src/admin-ui/components/Navigation.tsx b/packages/keystone/src/admin-ui/components/Navigation.tsx index 781855831ad..db7f8b19c28 100644 --- a/packages/keystone/src/admin-ui/components/Navigation.tsx +++ b/packages/keystone/src/admin-ui/components/Navigation.tsx @@ -2,12 +2,12 @@ import { AllHTMLAttributes, ReactNode, Fragment } from 'react'; import { useRouter } from 'next/router'; -import { NavigationProps, ListMeta } from '@keystone-next/types'; import { Stack, jsx, useTheme, Text } from '@keystone-ui/core'; import { Button } from '@keystone-ui/button'; import { Popover } from '@keystone-ui/popover'; import { MoreHorizontalIcon } from '@keystone-ui/icons/icons/MoreHorizontalIcon'; import { ChevronRightIcon } from '@keystone-ui/icons/icons/ChevronRightIcon'; +import { NavigationProps, ListMeta } from '../../types'; import { useKeystone } from '../context'; import { Link } from '../router'; diff --git a/packages/keystone/src/admin-ui/components/index.ts b/packages/keystone/src/admin-ui/components/index.ts index e66a23b2f5d..a016adf3cfe 100644 --- a/packages/keystone/src/admin-ui/components/index.ts +++ b/packages/keystone/src/admin-ui/components/index.ts @@ -10,7 +10,7 @@ export { Navigation, NavigationContainer, NavItem, ListNavItems, ListNavItem } f // co-locating the type with the admin-ui/component for a more a salient mental model. // importing this type from @keystone-next/keystone/admin-ui/components is probably intuitive for a user -export type { NavigationProps } from '@keystone-next/types'; +export type { NavigationProps } from '../../types'; // CUSTOM PAGE BUILDING UTILITIES export { PageContainer } from './PageContainer'; diff --git a/packages/keystone/src/admin-ui/context.tsx b/packages/keystone/src/admin-ui/context.tsx index 5d917f58c61..d5b1bfd86f7 100644 --- a/packages/keystone/src/admin-ui/context.tsx +++ b/packages/keystone/src/admin-ui/context.tsx @@ -1,10 +1,10 @@ import React, { ReactNode, createContext, useContext, useMemo } from 'react'; -import type { AdminConfig, AdminMeta, FieldViews } from '@keystone-next/types'; import { Center } from '@keystone-ui/core'; import { ToastProvider } from '@keystone-ui/toast'; import { LoadingDots } from '@keystone-ui/loading'; import { DrawerProvider } from '@keystone-ui/modals'; import { createUploadLink } from 'apollo-upload-client'; +import type { AdminConfig, AdminMeta, FieldViews } from '../types'; import { useAdminMeta } from './utils/useAdminMeta'; import { ApolloProvider, ApolloClient, InMemoryCache, ApolloError, DocumentNode } from './apollo'; import { diff --git a/packages/keystone/src/admin-ui/system/createAdminMeta.ts b/packages/keystone/src/admin-ui/system/createAdminMeta.ts index 20c64a9fc69..94c7d977aa9 100644 --- a/packages/keystone/src/admin-ui/system/createAdminMeta.ts +++ b/packages/keystone/src/admin-ui/system/createAdminMeta.ts @@ -1,5 +1,5 @@ -import type { KeystoneConfig, AdminMetaRootVal } from '@keystone-next/types'; import { GraphQLString } from 'graphql'; +import type { KeystoneConfig, AdminMetaRootVal } from '../../../types'; import { humanize } from '../../lib/utils'; import { InitialisedList } from '../../lib/core/types-for-lists'; diff --git a/packages/keystone/src/admin-ui/system/createAdminUIServer.ts b/packages/keystone/src/admin-ui/system/createAdminUIServer.ts index 9807ad2089f..a217ed48546 100644 --- a/packages/keystone/src/admin-ui/system/createAdminUIServer.ts +++ b/packages/keystone/src/admin-ui/system/createAdminUIServer.ts @@ -1,6 +1,6 @@ import url from 'url'; import express from 'express'; -import type { KeystoneConfig, SessionStrategy, CreateContext } from '@keystone-next/types'; +import type { KeystoneConfig, SessionStrategy, CreateContext } from '../../types'; import { createSessionContext } from '../../session'; export const createAdminUIServer = async ( diff --git a/packages/keystone/src/admin-ui/system/generateAdminUI.ts b/packages/keystone/src/admin-ui/system/generateAdminUI.ts index 5b2e259909b..75a30d11d48 100644 --- a/packages/keystone/src/admin-ui/system/generateAdminUI.ts +++ b/packages/keystone/src/admin-ui/system/generateAdminUI.ts @@ -5,8 +5,7 @@ import fastGlob from 'fast-glob'; import prettier from 'prettier'; import resolve from 'resolve'; import { GraphQLSchema } from 'graphql'; -import type { KeystoneConfig, AdminMetaRootVal } from '@keystone-next/types'; -import { AdminFileToWrite } from '@keystone-next/types'; +import type { KeystoneConfig, AdminMetaRootVal, AdminFileToWrite } from '../../types'; import { writeAdminFiles } from '../templates'; import { serializePathForImport } from '../utils/serializePathForImport'; diff --git a/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts b/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts index 29bf7753c32..de7c9ca24b9 100644 --- a/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts +++ b/packages/keystone/src/admin-ui/system/getAdminMetaSchema.ts @@ -1,12 +1,14 @@ -import { JSONValue, QueryMode, schema as schemaAPIFromTypesPkg } from '@keystone-next/types'; +import { GraphQLSchema, GraphQLObjectType, assertScalarType, assertEnumType } from 'graphql'; import { + JSONValue, + QueryMode, + schema as schemaAPIFromTypesPkg, KeystoneContext, KeystoneConfig, AdminMetaRootVal, ListMetaRootVal, FieldMetaRootVal, -} from '@keystone-next/types'; -import { GraphQLSchema, GraphQLObjectType, assertScalarType, assertEnumType } from 'graphql'; +} from '../../types'; import { InitialisedList } from '../../lib/core/types-for-lists'; const schema = { diff --git a/packages/keystone/src/admin-ui/templates/app.ts b/packages/keystone/src/admin-ui/templates/app.ts index 532242d1d0b..d6151f68936 100644 --- a/packages/keystone/src/admin-ui/templates/app.ts +++ b/packages/keystone/src/admin-ui/templates/app.ts @@ -10,7 +10,7 @@ import { FragmentDefinitionNode, SelectionNode, } from 'graphql'; -import { AdminMetaRootVal } from '@keystone-next/types'; +import { AdminMetaRootVal } from '../../types'; import { staticAdminMetaQuery, StaticAdminMetaQuery } from '../admin-meta-graphql'; import { serializePathForImport } from '../utils/serializePathForImport'; diff --git a/packages/keystone/src/admin-ui/templates/index.ts b/packages/keystone/src/admin-ui/templates/index.ts index 8115ce08475..d6e7c7f34e5 100644 --- a/packages/keystone/src/admin-ui/templates/index.ts +++ b/packages/keystone/src/admin-ui/templates/index.ts @@ -1,7 +1,6 @@ import * as Path from 'path'; -import type { AdminMetaRootVal, KeystoneConfig } from '@keystone-next/types'; -import { AdminFileToWrite } from '@keystone-next/types'; import { GraphQLSchema } from 'graphql'; +import type { AdminMetaRootVal, KeystoneConfig, AdminFileToWrite } from '../../../types'; import { appTemplate } from './app'; import { homeTemplate } from './home'; import { listTemplate } from './list'; diff --git a/packages/keystone/src/admin-ui/templates/no-access.ts b/packages/keystone/src/admin-ui/templates/no-access.ts index a146ca59be3..b656d442231 100644 --- a/packages/keystone/src/admin-ui/templates/no-access.ts +++ b/packages/keystone/src/admin-ui/templates/no-access.ts @@ -1,4 +1,4 @@ -import type { KeystoneConfig } from '@keystone-next/types'; +import type { KeystoneConfig } from '../../types'; export const noAccessTemplate = (session: KeystoneConfig['session']) => `import { getNoAccessPage } from '@keystone-next/keystone/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage'; diff --git a/packages/keystone/src/admin-ui/utils/Fields.tsx b/packages/keystone/src/admin-ui/utils/Fields.tsx index ee097432eea..4739c63a6a9 100644 --- a/packages/keystone/src/admin-ui/utils/Fields.tsx +++ b/packages/keystone/src/admin-ui/utils/Fields.tsx @@ -1,7 +1,7 @@ /** @jsx jsx */ import { jsx, Stack } from '@keystone-ui/core'; -import { FieldMeta } from '@keystone-next/types'; import { memo, useMemo } from 'react'; +import { FieldMeta } from '../../types'; import { Value } from '.'; type RenderFieldProps = { diff --git a/packages/keystone/src/admin-ui/utils/dataGetter.ts b/packages/keystone/src/admin-ui/utils/dataGetter.ts index cce804adea0..3b3e1095cda 100644 --- a/packages/keystone/src/admin-ui/utils/dataGetter.ts +++ b/packages/keystone/src/admin-ui/utils/dataGetter.ts @@ -1,5 +1,5 @@ -import { JSONValue } from '@keystone-next/types'; import { GraphQLError } from 'graphql'; +import { JSONValue } from '../../types'; type Path = (string | number)[]; diff --git a/packages/keystone/src/admin-ui/utils/getRootGraphQLFieldsFromFieldController.ts b/packages/keystone/src/admin-ui/utils/getRootGraphQLFieldsFromFieldController.ts index 0d52d96fc6e..a2619132486 100644 --- a/packages/keystone/src/admin-ui/utils/getRootGraphQLFieldsFromFieldController.ts +++ b/packages/keystone/src/admin-ui/utils/getRootGraphQLFieldsFromFieldController.ts @@ -1,6 +1,6 @@ -import { FieldController } from '@keystone-next/types'; import weakMemoize from '@emotion/weak-memoize'; import { FragmentDefinitionNode, parse, SelectionSetNode } from 'graphql'; +import { FieldController } from '../../../types'; function extractRootFields(selectedFields: Set, selectionSet: SelectionSetNode) { selectionSet.selections.forEach(selection => { diff --git a/packages/keystone/src/admin-ui/utils/item-form.ts b/packages/keystone/src/admin-ui/utils/item-form.ts index b18b749c19a..d7e043bf903 100644 --- a/packages/keystone/src/admin-ui/utils/item-form.ts +++ b/packages/keystone/src/admin-ui/utils/item-form.ts @@ -1,7 +1,7 @@ -import { FieldMeta } from '@keystone-next/types'; import { GraphQLError } from 'graphql'; import { useMemo } from 'react'; import isDeepEqual from 'fast-deep-equal'; +import { FieldMeta } from '../../types'; import { ItemData, deserializeValue, serializeValueToObjByFieldKey } from './serialization'; import { DataGetter } from './dataGetter'; diff --git a/packages/keystone/src/admin-ui/utils/serialization.tsx b/packages/keystone/src/admin-ui/utils/serialization.tsx index 060d88a96f0..0e37962d9e3 100644 --- a/packages/keystone/src/admin-ui/utils/serialization.tsx +++ b/packages/keystone/src/admin-ui/utils/serialization.tsx @@ -1,5 +1,5 @@ -import { JSONValue, FieldMeta } from '@keystone-next/types'; import { GraphQLError } from 'graphql'; +import { JSONValue, FieldMeta } from '../../types'; import { DataGetter } from './dataGetter'; import { getRootGraphQLFieldsFromFieldController } from './getRootGraphQLFieldsFromFieldController'; diff --git a/packages/keystone/src/admin-ui/utils/useAdminMeta.tsx b/packages/keystone/src/admin-ui/utils/useAdminMeta.tsx index aa3e4181b18..2765ff26567 100644 --- a/packages/keystone/src/admin-ui/utils/useAdminMeta.tsx +++ b/packages/keystone/src/admin-ui/utils/useAdminMeta.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from 'react'; import hashString from '@emotion/hash'; -import { AdminMeta, FieldViews, getGqlNames } from '@keystone-next/types'; +import { AdminMeta, FieldViews, getGqlNames } from '../../types'; import { useLazyQuery } from '../apollo'; import { StaticAdminMetaQuery, staticAdminMetaQuery } from '../admin-meta-graphql'; diff --git a/packages/keystone/src/admin-ui/utils/useInvalidFields.ts b/packages/keystone/src/admin-ui/utils/useInvalidFields.ts index b2739067b5b..b6a79da59b9 100644 --- a/packages/keystone/src/admin-ui/utils/useInvalidFields.ts +++ b/packages/keystone/src/admin-ui/utils/useInvalidFields.ts @@ -1,5 +1,5 @@ -import { FieldMeta } from '@keystone-next/types'; import { useMemo } from 'react'; +import { FieldMeta } from '../../types'; import { Value } from './item-form'; export function useInvalidFields( diff --git a/packages/keystone/src/admin-ui/utils/useLazyMetadata.tsx b/packages/keystone/src/admin-ui/utils/useLazyMetadata.tsx index 3e0c110a8af..a9dc1235a20 100644 --- a/packages/keystone/src/admin-ui/utils/useLazyMetadata.tsx +++ b/packages/keystone/src/admin-ui/utils/useLazyMetadata.tsx @@ -1,10 +1,10 @@ import { GraphQLError } from 'graphql'; -import type { AuthenticatedItem, VisibleLists, CreateViewFieldModes } from '@keystone-next/types'; import { useMemo } from 'react'; +import type { AuthenticatedItem, VisibleLists, CreateViewFieldModes } from '../../types'; import { DocumentNode, useQuery, QueryResult, ServerError, ServerParseError } from '../apollo'; import { DeepNullable, makeDataGetter } from './dataGetter'; -export type { AuthenticatedItem, VisibleLists, CreateViewFieldModes } from '@keystone-next/types'; +export type { AuthenticatedItem, VisibleLists, CreateViewFieldModes }; export function useLazyMetadata(query: DocumentNode): { authenticatedItem: AuthenticatedItem; diff --git a/packages/keystone/src/artifacts.ts b/packages/keystone/src/artifacts.ts index 5750545d5c8..92afcab18ab 100644 --- a/packages/keystone/src/artifacts.ts +++ b/packages/keystone/src/artifacts.ts @@ -1,9 +1,9 @@ import path from 'path'; import { printSchema, GraphQLSchema } from 'graphql'; import * as fs from 'fs-extra'; -import type { KeystoneConfig } from '@keystone-next/types'; import { getGenerator, formatSchema } from '@prisma/sdk'; import { format } from 'prettier'; +import type { KeystoneConfig } from './types'; import { confirmPrompt, shouldPrompt } from './lib/prompts'; import { printGeneratedTypes } from './lib/schema-type-printer'; import { ExitError } from './scripts/utils'; @@ -124,7 +124,7 @@ ${makeVercelIncludeTheSQLiteDB(cwd, path.join(cwd, 'node_modules/.keystone/next' export const lists = createListsAPI(keystoneConfig, PrismaClient); `; -const nodeAPIDTS = `import { KeystoneListsAPI } from '@keystone-next/types'; +const nodeAPIDTS = `import { KeystoneListsAPI } from '@keystone-next/keystone/types'; import { KeystoneListsTypeInfo } from './types'; export const lists: KeystoneListsAPI;`; diff --git a/packages/keystone/src/fields/tests/test-fixtures.ts b/packages/keystone/src/fields/tests/test-fixtures.ts index 0c72dadf71c..2db7c56a4cb 100644 --- a/packages/keystone/src/fields/tests/test-fixtures.ts +++ b/packages/keystone/src/fields/tests/test-fixtures.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '../../types'; import { text } from '../types/text'; export const name = 'ID'; diff --git a/packages/keystone/src/fields/types/autoIncrement/index.ts b/packages/keystone/src/fields/types/autoIncrement/index.ts index f64eb3294cc..593ae17b7bb 100644 --- a/packages/keystone/src/fields/types/autoIncrement/index.ts +++ b/packages/keystone/src/fields/types/autoIncrement/index.ts @@ -7,7 +7,7 @@ import { orderDirectionEnum, schema, filters, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getIndexType } from '../../get-index-type'; diff --git a/packages/keystone/src/fields/types/autoIncrement/tests/test-fixtures.ts b/packages/keystone/src/fields/types/autoIncrement/tests/test-fixtures.ts index c4659c1f360..0fdada0ae8b 100644 --- a/packages/keystone/src/fields/types/autoIncrement/tests/test-fixtures.ts +++ b/packages/keystone/src/fields/types/autoIncrement/tests/test-fixtures.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '../../../../types'; import { text } from '../../text'; import { autoIncrement } from '..'; diff --git a/packages/keystone/src/fields/types/checkbox/index.ts b/packages/keystone/src/fields/types/checkbox/index.ts index 2bf2be46125..bcb5726cd4a 100644 --- a/packages/keystone/src/fields/types/checkbox/index.ts +++ b/packages/keystone/src/fields/types/checkbox/index.ts @@ -7,7 +7,7 @@ import { orderDirectionEnum, schema, filters, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; export type CheckboxFieldConfig = diff --git a/packages/keystone/src/fields/types/checkbox/views/index.tsx b/packages/keystone/src/fields/types/checkbox/views/index.tsx index 383f9eb20ed..0bc9685cc83 100644 --- a/packages/keystone/src/fields/types/checkbox/views/index.tsx +++ b/packages/keystone/src/fields/types/checkbox/views/index.tsx @@ -1,14 +1,14 @@ /* @jsx jsx */ +import { jsx, useTheme } from '@keystone-ui/core'; +import { Checkbox, FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; -import { jsx, useTheme } from '@keystone-ui/core'; -import { Checkbox, FieldContainer, FieldLabel } from '@keystone-ui/fields'; +} from '../../../../types'; import { CellContainer } from '../../../../admin-ui/components'; export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => { diff --git a/packages/keystone/src/fields/types/decimal/index.ts b/packages/keystone/src/fields/types/decimal/index.ts index e293554659b..7b66b460d67 100644 --- a/packages/keystone/src/fields/types/decimal/index.ts +++ b/packages/keystone/src/fields/types/decimal/index.ts @@ -8,7 +8,7 @@ import { Decimal, FieldDefaultValue, filters, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getIndexType } from '../../get-index-type'; diff --git a/packages/keystone/src/fields/types/decimal/tests/test-fixtures.ts b/packages/keystone/src/fields/types/decimal/tests/test-fixtures.ts index 32159acab5c..0aa9812d341 100644 --- a/packages/keystone/src/fields/types/decimal/tests/test-fixtures.ts +++ b/packages/keystone/src/fields/types/decimal/tests/test-fixtures.ts @@ -1,4 +1,4 @@ -import { DatabaseProvider } from '@keystone-next/types'; +import { DatabaseProvider } from '../../../../types'; import { decimal } from '..'; import { text } from '../../text'; diff --git a/packages/keystone/src/fields/types/decimal/views/index.tsx b/packages/keystone/src/fields/types/decimal/views/index.tsx index 51bca6b17c5..a8559f264b8 100644 --- a/packages/keystone/src/fields/types/decimal/views/index.tsx +++ b/packages/keystone/src/fields/types/decimal/views/index.tsx @@ -8,7 +8,7 @@ import { FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; +} from '../../../../types'; import { CellLink, CellContainer } from '../../../../admin-ui/components'; export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => ( diff --git a/packages/keystone/src/fields/types/file/index.ts b/packages/keystone/src/fields/types/file/index.ts index f74645c28c5..98fe3452ec9 100644 --- a/packages/keystone/src/fields/types/file/index.ts +++ b/packages/keystone/src/fields/types/file/index.ts @@ -1,3 +1,4 @@ +import { FileUpload } from 'graphql-upload'; import { fieldType, schema, @@ -7,8 +8,7 @@ import { KeystoneContext, FileData, FieldDefaultValue, -} from '@keystone-next/types'; -import { FileUpload } from 'graphql-upload'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getFileRef } from './utils'; diff --git a/packages/keystone/src/fields/types/file/utils.ts b/packages/keystone/src/fields/types/file/utils.ts index b3ca4e9e23a..fd3e27b1df0 100644 --- a/packages/keystone/src/fields/types/file/utils.ts +++ b/packages/keystone/src/fields/types/file/utils.ts @@ -1,4 +1,4 @@ -import { AssetMode } from '@keystone-next/types'; +import { AssetMode } from '../../../types'; const FILEREGEX = /^(local|keystone-cloud):file:([^\\\/:\n]+)/; diff --git a/packages/keystone/src/fields/types/file/views/Field.tsx b/packages/keystone/src/fields/types/file/views/Field.tsx index 7429b5a14db..a9dc10132d6 100644 --- a/packages/keystone/src/fields/types/file/views/Field.tsx +++ b/packages/keystone/src/fields/types/file/views/Field.tsx @@ -10,7 +10,7 @@ import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { TextInput } from '@keystone-ui/fields'; import { Pill } from '@keystone-ui/pill'; import { Button } from '@keystone-ui/button'; -import { FieldProps } from '@keystone-next/types'; +import { FieldProps } from '../../../../types'; import { parseFileRef } from '../utils'; import { FileValue } from './index'; diff --git a/packages/keystone/src/fields/types/file/views/index.tsx b/packages/keystone/src/fields/types/file/views/index.tsx index 65e3c52c306..455642f05f1 100644 --- a/packages/keystone/src/fields/types/file/views/index.tsx +++ b/packages/keystone/src/fields/types/file/views/index.tsx @@ -1,14 +1,14 @@ /* @jsx jsx */ import { jsx } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, -} from '@keystone-next/types'; +} from '../../../../types'; -import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { validateFile, validateRef } from './Field'; export { Field } from './Field'; diff --git a/packages/keystone/src/fields/types/float/index.ts b/packages/keystone/src/fields/types/float/index.ts index c0cc4b6d04d..d759a21c8de 100644 --- a/packages/keystone/src/fields/types/float/index.ts +++ b/packages/keystone/src/fields/types/float/index.ts @@ -7,7 +7,7 @@ import { orderDirectionEnum, FieldDefaultValue, filters, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getIndexType } from '../../get-index-type'; diff --git a/packages/keystone/src/fields/types/float/views/index.tsx b/packages/keystone/src/fields/types/float/views/index.tsx index 96507819058..2a739dba20c 100644 --- a/packages/keystone/src/fields/types/float/views/index.tsx +++ b/packages/keystone/src/fields/types/float/views/index.tsx @@ -8,7 +8,7 @@ import { FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; +} from '../../../../types'; import { CellLink, CellContainer } from '../../../../admin-ui/components'; export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => ( diff --git a/packages/keystone/src/fields/types/image/index.ts b/packages/keystone/src/fields/types/image/index.ts index fdfd04bd0db..d7cfcdd3e13 100644 --- a/packages/keystone/src/fields/types/image/index.ts +++ b/packages/keystone/src/fields/types/image/index.ts @@ -1,3 +1,4 @@ +import { FileUpload } from 'graphql-upload'; import { BaseGeneratedListTypes, FieldDefaultValue, @@ -8,8 +9,7 @@ import { ImageExtension, KeystoneContext, schema, -} from '@keystone-next/types'; -import { FileUpload } from 'graphql-upload'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getImageRef, SUPPORTED_IMAGE_EXTENSIONS } from './utils'; diff --git a/packages/keystone/src/fields/types/image/tests/test-fixtures.ts b/packages/keystone/src/fields/types/image/tests/test-fixtures.ts index 5b37a58e692..dd8f3ac835f 100644 --- a/packages/keystone/src/fields/types/image/tests/test-fixtures.ts +++ b/packages/keystone/src/fields/types/image/tests/test-fixtures.ts @@ -2,7 +2,7 @@ import path from 'path'; import fs from 'fs-extra'; import { Upload } from 'graphql-upload'; import mime from 'mime'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '../../../../types'; import { text } from '../../text'; import { image } from '..'; diff --git a/packages/keystone/src/fields/types/image/utils.ts b/packages/keystone/src/fields/types/image/utils.ts index 35a72ca47ce..ca654398f71 100644 --- a/packages/keystone/src/fields/types/image/utils.ts +++ b/packages/keystone/src/fields/types/image/utils.ts @@ -1,4 +1,4 @@ -import { AssetMode, ImageExtension } from '@keystone-next/types'; +import { AssetMode, ImageExtension } from '../../../types'; const IMAGEREGEX = /^(local|keystone-cloud):image:([^\\\/:\n]+)\.(gif|jpg|png|webp)$/; diff --git a/packages/keystone/src/fields/types/image/views/Field.tsx b/packages/keystone/src/fields/types/image/views/Field.tsx index 0f72a3c45c7..130ce2de119 100644 --- a/packages/keystone/src/fields/types/image/views/Field.tsx +++ b/packages/keystone/src/fields/types/image/views/Field.tsx @@ -11,7 +11,7 @@ import { TextInput } from '@keystone-ui/fields'; import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { Pill } from '@keystone-ui/pill'; import { Button } from '@keystone-ui/button'; -import { FieldProps } from '@keystone-next/types'; +import { FieldProps } from '../../../../types'; import { parseImageRef } from '../utils'; import { ImageValue } from './index'; diff --git a/packages/keystone/src/fields/types/image/views/index.tsx b/packages/keystone/src/fields/types/image/views/index.tsx index fa3391102cd..d9ad2b68690 100644 --- a/packages/keystone/src/fields/types/image/views/index.tsx +++ b/packages/keystone/src/fields/types/image/views/index.tsx @@ -1,13 +1,13 @@ /* @jsx jsx */ import { jsx } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, -} from '@keystone-next/types'; -import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; +} from '../../../../types'; import { validateImage, validateRef, ImageWrapper } from './Field'; export { Field } from './Field'; diff --git a/packages/keystone/src/fields/types/integer/index.ts b/packages/keystone/src/fields/types/integer/index.ts index de466378153..6f646dd6f7d 100644 --- a/packages/keystone/src/fields/types/integer/index.ts +++ b/packages/keystone/src/fields/types/integer/index.ts @@ -7,7 +7,7 @@ import { orderDirectionEnum, schema, filters, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getIndexType } from '../../get-index-type'; diff --git a/packages/keystone/src/fields/types/integer/views/index.tsx b/packages/keystone/src/fields/types/integer/views/index.tsx index 0d8b4076e47..ce0f43422a0 100644 --- a/packages/keystone/src/fields/types/integer/views/index.tsx +++ b/packages/keystone/src/fields/types/integer/views/index.tsx @@ -8,7 +8,7 @@ import { FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; +} from '../../../../types'; import { CellLink, CellContainer } from '../../../../admin-ui/components'; export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => ( diff --git a/packages/keystone/src/fields/types/json/index.ts b/packages/keystone/src/fields/types/json/index.ts index 2e186367943..459e6e44ef1 100644 --- a/packages/keystone/src/fields/types/json/index.ts +++ b/packages/keystone/src/fields/types/json/index.ts @@ -6,7 +6,7 @@ import { CommonFieldConfig, jsonFieldTypePolyfilledForSQLite, schema, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; export type JsonFieldConfig = diff --git a/packages/keystone/src/fields/types/json/views/index.tsx b/packages/keystone/src/fields/types/json/views/index.tsx index b5db3ad13dc..92088fad3ef 100644 --- a/packages/keystone/src/fields/types/json/views/index.tsx +++ b/packages/keystone/src/fields/types/json/views/index.tsx @@ -1,14 +1,14 @@ /* @jsx jsx */ +import { jsx, Stack, Text } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel, TextArea } from '@keystone-ui/fields'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; -import { jsx, Stack, Text } from '@keystone-ui/core'; -import { FieldContainer, FieldLabel, TextArea } from '@keystone-ui/fields'; +} from '../../../../types'; import { CellContainer, CellLink } from '../../../../admin-ui/components'; export const Field = ({ diff --git a/packages/keystone/src/fields/types/password/index.ts b/packages/keystone/src/fields/types/password/index.ts index b52426c2998..70f6909ead3 100644 --- a/packages/keystone/src/fields/types/password/index.ts +++ b/packages/keystone/src/fields/types/password/index.ts @@ -1,3 +1,6 @@ +import bcryptjs from 'bcryptjs'; +// @ts-ignore +import dumbPasswords from 'dumb-passwords'; import { BaseGeneratedListTypes, FieldDefaultValue, @@ -5,10 +8,7 @@ import { FieldTypeFunc, CommonFieldConfig, schema, -} from '@keystone-next/types'; -import bcryptjs from 'bcryptjs'; -// @ts-ignore -import dumbPasswords from 'dumb-passwords'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; type PasswordFieldConfig = diff --git a/packages/keystone/src/fields/types/password/views/index.tsx b/packages/keystone/src/fields/types/password/views/index.tsx index a432a49156a..7a203ac34c4 100644 --- a/packages/keystone/src/fields/types/password/views/index.tsx +++ b/packages/keystone/src/fields/types/password/views/index.tsx @@ -2,13 +2,6 @@ import { useState } from 'react'; -import { - CardValueComponent, - CellComponent, - FieldController, - FieldControllerConfig, - FieldProps, -} from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { Stack, Text, VisuallyHidden, jsx, useTheme } from '@keystone-ui/core'; import { FieldContainer, FieldLabel, TextInput } from '@keystone-ui/fields'; @@ -16,6 +9,13 @@ import { EyeIcon } from '@keystone-ui/icons/icons/EyeIcon'; import { EyeOffIcon } from '@keystone-ui/icons/icons/EyeOffIcon'; import { XIcon } from '@keystone-ui/icons/icons/XIcon'; import { SegmentedControl } from '@keystone-ui/segmented-control'; +import { + CardValueComponent, + CellComponent, + FieldController, + FieldControllerConfig, + FieldProps, +} from '../../../../types'; import { CellContainer } from '../../../../admin-ui/components'; export const Field = ({ diff --git a/packages/keystone/src/fields/types/relationship/index.ts b/packages/keystone/src/fields/types/relationship/index.ts index 2cd4714dfce..8d6113e94d5 100644 --- a/packages/keystone/src/fields/types/relationship/index.ts +++ b/packages/keystone/src/fields/types/relationship/index.ts @@ -6,7 +6,7 @@ import { schema, AdminMetaRootVal, FieldDefaultValue, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; // This is the default display mode for Relationships diff --git a/packages/keystone/src/fields/types/relationship/views/RelationshipSelect.tsx b/packages/keystone/src/fields/types/relationship/views/RelationshipSelect.tsx index 1a2b47892d4..ab2965aa644 100644 --- a/packages/keystone/src/fields/types/relationship/views/RelationshipSelect.tsx +++ b/packages/keystone/src/fields/types/relationship/views/RelationshipSelect.tsx @@ -3,10 +3,10 @@ import 'intersection-observer'; import { RefObject, useEffect, useMemo, useState, createContext, useContext } from 'react'; -import { IdFieldConfig, ListMeta } from '@keystone-next/types'; import { jsx } from '@keystone-ui/core'; import { MultiSelect, Select, selectComponents } from '@keystone-ui/fields'; import { validate as validateUUID } from 'uuid'; +import { IdFieldConfig, ListMeta } from '../../../../types'; import { gql, TypedDocumentNode, useQuery } from '../../../../admin-ui/apollo'; function useIntersectionObserver(cb: IntersectionObserverCallback, ref: RefObject) { diff --git a/packages/keystone/src/fields/types/relationship/views/cards/InlineCreate.tsx b/packages/keystone/src/fields/types/relationship/views/cards/InlineCreate.tsx index 0f2afcc541e..e650186ba24 100644 --- a/packages/keystone/src/fields/types/relationship/views/cards/InlineCreate.tsx +++ b/packages/keystone/src/fields/types/relationship/views/cards/InlineCreate.tsx @@ -5,7 +5,7 @@ import { jsx, Stack } from '@keystone-ui/core'; import isDeepEqual from 'fast-deep-equal'; import { useToasts } from '@keystone-ui/toast'; import { Button } from '@keystone-ui/button'; -import { ListMeta } from '@keystone-next/types'; +import { ListMeta } from '../../../../../types'; import { ItemData, makeDataGetter, diff --git a/packages/keystone/src/fields/types/relationship/views/cards/InlineEdit.tsx b/packages/keystone/src/fields/types/relationship/views/cards/InlineEdit.tsx index ba14368b595..fb9b718e35f 100644 --- a/packages/keystone/src/fields/types/relationship/views/cards/InlineEdit.tsx +++ b/packages/keystone/src/fields/types/relationship/views/cards/InlineEdit.tsx @@ -1,11 +1,11 @@ /** @jsx jsx */ -import { ListMeta } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { jsx, Stack } from '@keystone-ui/core'; import { useToasts } from '@keystone-ui/toast'; import { useCallback, useState } from 'react'; import { Tooltip } from '@keystone-ui/tooltip'; +import { ListMeta } from '../../../../../types'; import { deserializeValue, ItemData, diff --git a/packages/keystone/src/fields/types/relationship/views/cards/index.tsx b/packages/keystone/src/fields/types/relationship/views/cards/index.tsx index 28456a8230f..52c10bd6861 100644 --- a/packages/keystone/src/fields/types/relationship/views/cards/index.tsx +++ b/packages/keystone/src/fields/types/relationship/views/cards/index.tsx @@ -13,11 +13,11 @@ import { } from '@keystone-ui/core'; import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; -import { FieldProps, ListMeta } from '@keystone-next/types'; import { Button } from '@keystone-ui/button'; import { Tooltip } from '@keystone-ui/tooltip'; import { LoadingDots } from '@keystone-ui/loading'; import { useEffect, useRef, useState } from 'react'; +import { FieldProps, ListMeta } from '../../../../../types'; import { getRootGraphQLFieldsFromFieldController, makeDataGetter, diff --git a/packages/keystone/src/fields/types/relationship/views/cards/useItemState.tsx b/packages/keystone/src/fields/types/relationship/views/cards/useItemState.tsx index 18031514e67..2f71a128192 100644 --- a/packages/keystone/src/fields/types/relationship/views/cards/useItemState.tsx +++ b/packages/keystone/src/fields/types/relationship/views/cards/useItemState.tsx @@ -1,5 +1,5 @@ -import { FieldMeta, ListMeta } from '@keystone-next/types'; import { useCallback, useMemo, useState } from 'react'; +import { FieldMeta, ListMeta } from '../../../../../types'; import { DataGetter, makeDataGetter } from '../../../../../admin-ui/utils'; import { gql, useQuery } from '../../../../../admin-ui/apollo'; import { controller } from '../index'; diff --git a/packages/keystone/src/fields/types/relationship/views/index.tsx b/packages/keystone/src/fields/types/relationship/views/index.tsx index f36db3f23b5..4578c705f07 100644 --- a/packages/keystone/src/fields/types/relationship/views/index.tsx +++ b/packages/keystone/src/fields/types/relationship/views/index.tsx @@ -2,6 +2,10 @@ import { Fragment, ReactNode, useState } from 'react'; +import { Button } from '@keystone-ui/button'; +import { Inline, jsx, Stack, useTheme } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel, FieldLegend } from '@keystone-ui/fields'; +import { DrawerController } from '@keystone-ui/modals'; import { CardValueComponent, CellComponent, @@ -9,11 +13,7 @@ import { FieldControllerConfig, FieldProps, ListMeta, -} from '@keystone-next/types'; -import { Button } from '@keystone-ui/button'; -import { Inline, jsx, Stack, useTheme } from '@keystone-ui/core'; -import { FieldContainer, FieldLabel, FieldLegend } from '@keystone-ui/fields'; -import { DrawerController } from '@keystone-ui/modals'; +} from '../../../../types'; import { Link } from '../../../../admin-ui/router'; import { useKeystone, useList } from '../../../../admin-ui/context'; import { CellContainer, CreateItemDrawer } from '../../../../admin-ui/components'; diff --git a/packages/keystone/src/fields/types/select/index.ts b/packages/keystone/src/fields/types/select/index.ts index 903b3b20116..f4572b361eb 100644 --- a/packages/keystone/src/fields/types/select/index.ts +++ b/packages/keystone/src/fields/types/select/index.ts @@ -1,3 +1,4 @@ +import inflection from 'inflection'; import { BaseGeneratedListTypes, FieldDefaultValue, @@ -7,9 +8,8 @@ import { orderDirectionEnum, schema, filters, -} from '@keystone-next/types'; +} from '../../../types'; // @ts-ignore -import inflection from 'inflection'; import { resolveView } from '../../resolve-view'; import { getIndexType } from '../../get-index-type'; diff --git a/packages/keystone/src/fields/types/select/views/index.tsx b/packages/keystone/src/fields/types/select/views/index.tsx index 6905bcc8ef7..54d25d5ea80 100644 --- a/packages/keystone/src/fields/types/select/views/index.tsx +++ b/packages/keystone/src/fields/types/select/views/index.tsx @@ -1,15 +1,15 @@ /* @jsx jsx */ import { Fragment } from 'react'; +import { jsx } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel, MultiSelect, Select } from '@keystone-ui/fields'; +import { SegmentedControl } from '@keystone-ui/segmented-control'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; -import { jsx } from '@keystone-ui/core'; -import { FieldContainer, FieldLabel, MultiSelect, Select } from '@keystone-ui/fields'; -import { SegmentedControl } from '@keystone-ui/segmented-control'; +} from '../../../../types'; import { CellContainer, CellLink } from '../../../../admin-ui/components'; export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => ( diff --git a/packages/keystone/src/fields/types/text/index.ts b/packages/keystone/src/fields/types/text/index.ts index 734fdee3d57..7133357fe79 100644 --- a/packages/keystone/src/fields/types/text/index.ts +++ b/packages/keystone/src/fields/types/text/index.ts @@ -7,7 +7,7 @@ import { orderDirectionEnum, FieldTypeFunc, filters, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getIndexType } from '../../get-index-type'; diff --git a/packages/keystone/src/fields/types/text/tests/test-fixtures.ts b/packages/keystone/src/fields/types/text/tests/test-fixtures.ts index 7b8d1f65eb1..6e394396ac0 100644 --- a/packages/keystone/src/fields/types/text/tests/test-fixtures.ts +++ b/packages/keystone/src/fields/types/text/tests/test-fixtures.ts @@ -1,4 +1,4 @@ -import { DatabaseProvider } from '@keystone-next/types'; +import { DatabaseProvider } from '../../../../types'; import { text } from '..'; export const name = 'Text'; diff --git a/packages/keystone/src/fields/types/text/views/index.tsx b/packages/keystone/src/fields/types/text/views/index.tsx index d2a25730845..a2a25cbbfda 100644 --- a/packages/keystone/src/fields/types/text/views/index.tsx +++ b/packages/keystone/src/fields/types/text/views/index.tsx @@ -1,13 +1,13 @@ /* @jsx jsx */ +import { jsx } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel, TextArea, TextInput } from '@keystone-ui/fields'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; -import { jsx } from '@keystone-ui/core'; -import { FieldContainer, FieldLabel, TextArea, TextInput } from '@keystone-ui/fields'; +} from '../../../../types'; import { CellContainer, CellLink } from '../../../../admin-ui/components'; export const Field = ({ field, value, onChange, autoFocus }: FieldProps) => ( diff --git a/packages/keystone/src/fields/types/timestamp/index.ts b/packages/keystone/src/fields/types/timestamp/index.ts index b62353f4f66..6d33962461e 100644 --- a/packages/keystone/src/fields/types/timestamp/index.ts +++ b/packages/keystone/src/fields/types/timestamp/index.ts @@ -7,7 +7,7 @@ import { orderDirectionEnum, FieldDefaultValue, filters, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; import { getIndexType } from '../../get-index-type'; diff --git a/packages/keystone/src/fields/types/timestamp/tests/test-fixtures.ts b/packages/keystone/src/fields/types/timestamp/tests/test-fixtures.ts index 0774623dde4..fda4f053201 100644 --- a/packages/keystone/src/fields/types/timestamp/tests/test-fixtures.ts +++ b/packages/keystone/src/fields/types/timestamp/tests/test-fixtures.ts @@ -1,4 +1,4 @@ -import { DatabaseProvider, KeystoneContext } from '@keystone-next/types'; +import { DatabaseProvider, KeystoneContext } from '../../../../types'; import { text } from '../../text'; import { timestamp } from '..'; diff --git a/packages/keystone/src/fields/types/timestamp/views/index.tsx b/packages/keystone/src/fields/types/timestamp/views/index.tsx index 22e12fa46c5..015a2428ae1 100644 --- a/packages/keystone/src/fields/types/timestamp/views/index.tsx +++ b/packages/keystone/src/fields/types/timestamp/views/index.tsx @@ -1,16 +1,16 @@ /* @jsx jsx */ import { useState } from 'react'; +import { jsx, Inline, Stack, VisuallyHidden } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel, TextInput, DatePicker, DateType } from '@keystone-ui/fields'; +import { TextInputProps } from '@keystone-ui/fields/src/TextInput'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; -import { jsx, Inline, Stack, VisuallyHidden } from '@keystone-ui/core'; -import { FieldContainer, FieldLabel, TextInput, DatePicker, DateType } from '@keystone-ui/fields'; -import { TextInputProps } from '@keystone-ui/fields/src/TextInput'; +} from '../../../../types'; import { CellContainer, CellLink } from '../../../../admin-ui/components'; import { isValidDate, diff --git a/packages/keystone/src/fields/types/virtual/index.ts b/packages/keystone/src/fields/types/virtual/index.ts index 534bf684ef4..e8be5473710 100644 --- a/packages/keystone/src/fields/types/virtual/index.ts +++ b/packages/keystone/src/fields/types/virtual/index.ts @@ -6,7 +6,7 @@ import { FieldTypeFunc, fieldType, ListInfo, -} from '@keystone-next/types'; +} from '../../../types'; import { resolveView } from '../../resolve-view'; type VirtualFieldGraphQLField = schema.Field; diff --git a/packages/keystone/src/fields/types/virtual/views/index.tsx b/packages/keystone/src/fields/types/virtual/views/index.tsx index 7a76c4c285c..ad923f4af0c 100644 --- a/packages/keystone/src/fields/types/virtual/views/index.tsx +++ b/packages/keystone/src/fields/types/virtual/views/index.tsx @@ -1,14 +1,14 @@ /* @jsx jsx */ +import { jsx } from '@keystone-ui/core'; +import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; import { CardValueComponent, CellComponent, FieldController, FieldControllerConfig, FieldProps, -} from '@keystone-next/types'; -import { jsx } from '@keystone-ui/core'; -import { FieldContainer, FieldLabel } from '@keystone-ui/fields'; +} from '../../../../types'; import { PrettyData } from './PrettyData'; diff --git a/packages/keystone/src/lib/config/applyIdFieldDefaults.ts b/packages/keystone/src/lib/config/applyIdFieldDefaults.ts index a1f7b8b81bc..a8bd695585e 100644 --- a/packages/keystone/src/lib/config/applyIdFieldDefaults.ts +++ b/packages/keystone/src/lib/config/applyIdFieldDefaults.ts @@ -1,4 +1,4 @@ -import type { KeystoneConfig } from '@keystone-next/types'; +import type { KeystoneConfig } from '../../types'; import { idFieldType } from '../id-field'; /* Validate lists config and default the id field */ diff --git a/packages/keystone/src/lib/config/initConfig.ts b/packages/keystone/src/lib/config/initConfig.ts index 2a285a61fb2..71d5e7542a0 100644 --- a/packages/keystone/src/lib/config/initConfig.ts +++ b/packages/keystone/src/lib/config/initConfig.ts @@ -1,4 +1,4 @@ -import { KeystoneConfig } from '@keystone-next/types'; +import { KeystoneConfig } from '../../types'; import { applyIdFieldDefaults } from './applyIdFieldDefaults'; diff --git a/packages/keystone/src/lib/context/createContext.ts b/packages/keystone/src/lib/context/createContext.ts index 39e28d6a3e5..d1fed55606b 100644 --- a/packages/keystone/src/lib/context/createContext.ts +++ b/packages/keystone/src/lib/context/createContext.ts @@ -6,7 +6,7 @@ import { KeystoneGraphQLAPI, GqlNames, KeystoneConfig, -} from '@keystone-next/types'; +} from '../../types'; import { PrismaClient } from '../core/utils'; import { getDbAPIFactory, itemAPIForList } from './itemAPI'; diff --git a/packages/keystone/src/lib/context/createFilesContext.ts b/packages/keystone/src/lib/context/createFilesContext.ts index 83f456ee852..d5f93c83f6a 100644 --- a/packages/keystone/src/lib/context/createFilesContext.ts +++ b/packages/keystone/src/lib/context/createFilesContext.ts @@ -2,10 +2,10 @@ import path from 'path'; import crypto from 'crypto'; import { pipeline } from 'stream'; import filenamify from 'filenamify'; -import { KeystoneConfig, FilesContext } from '@keystone-next/types'; import fs from 'fs-extra'; import slugify from '@sindresorhus/slugify'; +import { KeystoneConfig, FilesContext } from '../../types'; import { parseFileRef } from '../../fields/types/file/utils'; import { buildKeystoneCloudFileSrc, diff --git a/packages/keystone/src/lib/context/createImagesContext.ts b/packages/keystone/src/lib/context/createImagesContext.ts index 090da5ec2c7..d4d8db62ba0 100644 --- a/packages/keystone/src/lib/context/createImagesContext.ts +++ b/packages/keystone/src/lib/context/createImagesContext.ts @@ -1,9 +1,9 @@ import path from 'path'; -import { KeystoneConfig, ImagesContext, ImageMetadata } from '@keystone-next/types'; import { v4 as uuid } from 'uuid'; import fs from 'fs-extra'; import fromBuffer from 'image-type'; import imageSize from 'image-size'; +import { KeystoneConfig, ImagesContext, ImageMetadata } from '../../types'; import { parseImageRef } from '../../fields/types/image/utils'; import { buildKeystoneCloudImageSrc, diff --git a/packages/keystone/src/lib/context/executeGraphQLFieldToRootVal.ts b/packages/keystone/src/lib/context/executeGraphQLFieldToRootVal.ts index 8a8ac921cc3..5c35e6ac33f 100644 --- a/packages/keystone/src/lib/context/executeGraphQLFieldToRootVal.ts +++ b/packages/keystone/src/lib/context/executeGraphQLFieldToRootVal.ts @@ -1,4 +1,3 @@ -import { KeystoneContext } from '@keystone-next/types'; import { GraphQLScalarType, GraphQLObjectType, @@ -25,6 +24,7 @@ import { GraphQLOutputType, astFromValue, } from 'graphql'; +import { KeystoneContext } from '../../types'; function getNamedOrListTypeNodeForType( type: diff --git a/packages/keystone/src/lib/context/executeGraphQLFieldWithSelection.ts b/packages/keystone/src/lib/context/executeGraphQLFieldWithSelection.ts index 7fead9188fc..471fe80b8ca 100644 --- a/packages/keystone/src/lib/context/executeGraphQLFieldWithSelection.ts +++ b/packages/keystone/src/lib/context/executeGraphQLFieldWithSelection.ts @@ -8,7 +8,7 @@ import { parse, validate, } from 'graphql'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '../../types'; import { getVariablesForGraphQLField } from './executeGraphQLFieldToRootVal'; function getRootTypeName(type: GraphQLOutputType): string { diff --git a/packages/keystone/src/lib/context/itemAPI.ts b/packages/keystone/src/lib/context/itemAPI.ts index beadf98c452..b397e8f1f59 100644 --- a/packages/keystone/src/lib/context/itemAPI.ts +++ b/packages/keystone/src/lib/context/itemAPI.ts @@ -5,7 +5,7 @@ import { KeystoneListsAPI, KeystoneContext, GqlNames, -} from '@keystone-next/types'; +} from '../../types'; import { executeGraphQLFieldToRootVal } from './executeGraphQLFieldToRootVal'; import { executeGraphQLFieldWithSelection } from './executeGraphQLFieldWithSelection'; diff --git a/packages/keystone/src/lib/core/access-control.ts b/packages/keystone/src/lib/core/access-control.ts index dc1ae1d99c1..e5a899e5c21 100644 --- a/packages/keystone/src/lib/core/access-control.ts +++ b/packages/keystone/src/lib/core/access-control.ts @@ -1,3 +1,4 @@ +import { GraphQLInputObjectType } from 'graphql'; import { BaseGeneratedListTypes, CreateAccessControl, @@ -11,8 +12,7 @@ import { ListAccessControl, ReadListAccessControl, UpdateListAccessControl, -} from '@keystone-next/types'; -import { GraphQLInputObjectType } from 'graphql'; +} from '../../types'; import { coerceAndValidateForGraphQLInput } from '../coerceAndValidateForGraphQLInput'; import { InputFilter } from './where-inputs'; diff --git a/packages/keystone/src/lib/core/field-assertions.ts b/packages/keystone/src/lib/core/field-assertions.ts index db7d58e09b1..0490cbcc717 100644 --- a/packages/keystone/src/lib/core/field-assertions.ts +++ b/packages/keystone/src/lib/core/field-assertions.ts @@ -1,4 +1,4 @@ -import { schema } from '@keystone-next/types'; +import { schema } from '../../types'; import { InitialisedField } from './types-for-lists'; export type ListForValidation = { listKey: string; fields: Record }; diff --git a/packages/keystone/src/lib/core/graphql-schema.ts b/packages/keystone/src/lib/core/graphql-schema.ts index 9259400ad5c..4c6a7f9e712 100644 --- a/packages/keystone/src/lib/core/graphql-schema.ts +++ b/packages/keystone/src/lib/core/graphql-schema.ts @@ -1,5 +1,5 @@ import { GraphQLNamedType, GraphQLSchema } from 'graphql'; -import { DatabaseProvider, schema } from '@keystone-next/types'; +import { DatabaseProvider, schema } from '../../types'; import { InitialisedList } from './types-for-lists'; import { getMutationsForList } from './mutations'; diff --git a/packages/keystone/src/lib/core/mutations/access-control.ts b/packages/keystone/src/lib/core/mutations/access-control.ts index 0756a934f12..5a3907f588b 100644 --- a/packages/keystone/src/lib/core/mutations/access-control.ts +++ b/packages/keystone/src/lib/core/mutations/access-control.ts @@ -1,4 +1,4 @@ -import { ItemRootValue, KeystoneContext } from '@keystone-next/types'; +import { ItemRootValue, KeystoneContext } from '../../../types'; import { validateCreateListAccessControl, validateFieldAccessControl, diff --git a/packages/keystone/src/lib/core/mutations/create-update.ts b/packages/keystone/src/lib/core/mutations/create-update.ts index 289d34a9821..37a4c0b8cfd 100644 --- a/packages/keystone/src/lib/core/mutations/create-update.ts +++ b/packages/keystone/src/lib/core/mutations/create-update.ts @@ -1,5 +1,5 @@ -import { KeystoneContext, DatabaseProvider, ItemRootValue } from '@keystone-next/types'; import pLimit, { Limit } from 'p-limit'; +import { KeystoneContext, DatabaseProvider, ItemRootValue } from '../../../types'; import { ResolvedDBField } from '../resolve-relationships'; import { InitialisedList } from '../types-for-lists'; import { diff --git a/packages/keystone/src/lib/core/mutations/delete.ts b/packages/keystone/src/lib/core/mutations/delete.ts index 1d24a15aee9..c1a82e37aae 100644 --- a/packages/keystone/src/lib/core/mutations/delete.ts +++ b/packages/keystone/src/lib/core/mutations/delete.ts @@ -1,5 +1,5 @@ -import { KeystoneContext, DatabaseProvider } from '@keystone-next/types'; import pLimit, { Limit } from 'p-limit'; +import { KeystoneContext, DatabaseProvider } from '../../../types'; import { InitialisedList } from '../types-for-lists'; import { runWithPrisma } from '../utils'; import { resolveUniqueWhereInput, UniqueInputFilter } from '../where-inputs'; diff --git a/packages/keystone/src/lib/core/mutations/index.ts b/packages/keystone/src/lib/core/mutations/index.ts index da3d67b8860..337497d5b2f 100644 --- a/packages/keystone/src/lib/core/mutations/index.ts +++ b/packages/keystone/src/lib/core/mutations/index.ts @@ -1,4 +1,4 @@ -import { DatabaseProvider, getGqlNames, schema } from '@keystone-next/types'; +import { DatabaseProvider, getGqlNames, schema } from '../../../types'; import { InitialisedList } from '../types-for-lists'; import * as createAndUpdate from './create-update'; import * as deletes from './delete'; diff --git a/packages/keystone/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts b/packages/keystone/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts index fe79cd09e69..36d6d73096a 100644 --- a/packages/keystone/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts +++ b/packages/keystone/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts @@ -1,4 +1,4 @@ -import { KeystoneContext, TypesForList, schema } from '@keystone-next/types'; +import { KeystoneContext, TypesForList, schema } from '../../../types'; import { resolveUniqueWhereInput, UniqueInputFilter, UniquePrismaFilter } from '../where-inputs'; import { InitialisedList } from '../types-for-lists'; import { isRejected, isFulfilled } from '../utils'; diff --git a/packages/keystone/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts b/packages/keystone/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts index 9cdc5ec6775..67424cc3f61 100644 --- a/packages/keystone/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts +++ b/packages/keystone/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts @@ -1,4 +1,4 @@ -import { KeystoneContext, TypesForList, schema } from '@keystone-next/types'; +import { KeystoneContext, TypesForList, schema } from '../../../types'; import { resolveUniqueWhereInput } from '../where-inputs'; import { InitialisedList } from '../types-for-lists'; import { NestedMutationState } from './create-update'; diff --git a/packages/keystone/src/lib/core/prisma-schema.ts b/packages/keystone/src/lib/core/prisma-schema.ts index 21dd43c7810..23f9af4699a 100644 --- a/packages/keystone/src/lib/core/prisma-schema.ts +++ b/packages/keystone/src/lib/core/prisma-schema.ts @@ -1,4 +1,4 @@ -import { ScalarDBField, ScalarDBFieldDefault, DatabaseProvider } from '@keystone-next/types'; +import { ScalarDBField, ScalarDBFieldDefault, DatabaseProvider } from '../../types'; import { ResolvedDBField, ListsWithResolvedRelations } from './resolve-relationships'; import { getDBFieldKeyForFieldOnMultiField } from './utils'; diff --git a/packages/keystone/src/lib/core/queries/index.ts b/packages/keystone/src/lib/core/queries/index.ts index 4e335310f11..df413e363f0 100644 --- a/packages/keystone/src/lib/core/queries/index.ts +++ b/packages/keystone/src/lib/core/queries/index.ts @@ -1,4 +1,4 @@ -import { getGqlNames, schema } from '@keystone-next/types'; +import { getGqlNames, schema } from '../../../types'; import { InitialisedList } from '../types-for-lists'; import * as queries from './resolvers'; diff --git a/packages/keystone/src/lib/core/queries/output-field.ts b/packages/keystone/src/lib/core/queries/output-field.ts index c927730f07a..57978b9c258 100644 --- a/packages/keystone/src/lib/core/queries/output-field.ts +++ b/packages/keystone/src/lib/core/queries/output-field.ts @@ -1,3 +1,4 @@ +import { GraphQLResolveInfo } from 'graphql'; import { NextFieldType, CacheHint, @@ -9,8 +10,7 @@ import { FindManyArgsValue, KeystoneContext, TypesForList, -} from '@keystone-next/types'; -import { GraphQLResolveInfo } from 'graphql'; +} from '../../../types'; import { validateFieldAccessControl } from '../access-control'; import { accessDeniedError } from '../graphql-errors'; import { ResolvedDBField, ResolvedRelationDBField } from '../resolve-relationships'; diff --git a/packages/keystone/src/lib/core/queries/resolvers.ts b/packages/keystone/src/lib/core/queries/resolvers.ts index 21a9225146c..01089790d37 100644 --- a/packages/keystone/src/lib/core/queries/resolvers.ts +++ b/packages/keystone/src/lib/core/queries/resolvers.ts @@ -1,10 +1,5 @@ -import { - FindManyArgsValue, - ItemRootValue, - KeystoneContext, - OrderDirection, -} from '@keystone-next/types'; import { GraphQLResolveInfo } from 'graphql'; +import { FindManyArgsValue, ItemRootValue, KeystoneContext, OrderDirection } from '../../../types'; import { validateNonCreateListAccessControl } from '../access-control'; import { PrismaFilter, diff --git a/packages/keystone/src/lib/core/resolve-relationships.ts b/packages/keystone/src/lib/core/resolve-relationships.ts index bd8e01a5931..0ae1312420e 100644 --- a/packages/keystone/src/lib/core/resolve-relationships.ts +++ b/packages/keystone/src/lib/core/resolve-relationships.ts @@ -1,4 +1,4 @@ -import { DBField, MultiDBField, NoDBField, ScalarishDBField } from '@keystone-next/types'; +import { DBField, MultiDBField, NoDBField, ScalarishDBField } from '../../types'; type BaseResolvedRelationDBField = { kind: 'relation'; diff --git a/packages/keystone/src/lib/core/types-for-lists.ts b/packages/keystone/src/lib/core/types-for-lists.ts index d4408407ebc..cc3a15b828b 100644 --- a/packages/keystone/src/lib/core/types-for-lists.ts +++ b/packages/keystone/src/lib/core/types-for-lists.ts @@ -12,8 +12,8 @@ import { DatabaseProvider, FindManyArgs, CacheHintArgs, -} from '@keystone-next/types'; -import { FieldHooks } from '@keystone-next/types/src/config/hooks'; +} from '../../types'; +import { FieldHooks } from '../../types/config/hooks'; import { ResolvedFieldAccessControl, ResolvedListAccessControl, diff --git a/packages/keystone/src/lib/core/utils.ts b/packages/keystone/src/lib/core/utils.ts index d380eabb062..bafd31201bb 100644 --- a/packages/keystone/src/lib/core/utils.ts +++ b/packages/keystone/src/lib/core/utils.ts @@ -1,5 +1,5 @@ -import { ItemRootValue, KeystoneConfig, KeystoneContext } from '@keystone-next/types'; import pluralize from 'pluralize'; +import { ItemRootValue, KeystoneConfig, KeystoneContext } from '../../types'; import { humanize } from '../utils'; import { InitialisedList } from './types-for-lists'; import { PrismaFilter, UniquePrismaFilter } from './where-inputs'; diff --git a/packages/keystone/src/lib/core/where-inputs.ts b/packages/keystone/src/lib/core/where-inputs.ts index e6bfab810c6..5f36b42901c 100644 --- a/packages/keystone/src/lib/core/where-inputs.ts +++ b/packages/keystone/src/lib/core/where-inputs.ts @@ -1,4 +1,4 @@ -import { DBField, KeystoneContext } from '@keystone-next/types'; +import { DBField, KeystoneContext } from '../../types'; import { InitialisedList } from './types-for-lists'; import { getDBFieldKeyForFieldOnMultiField } from './utils'; diff --git a/packages/keystone/src/lib/createGraphQLSchema.ts b/packages/keystone/src/lib/createGraphQLSchema.ts index 0de192ec3d4..18b590c6bab 100644 --- a/packages/keystone/src/lib/createGraphQLSchema.ts +++ b/packages/keystone/src/lib/createGraphQLSchema.ts @@ -1,4 +1,4 @@ -import type { KeystoneConfig, AdminMetaRootVal } from '@keystone-next/types'; +import type { KeystoneConfig, AdminMetaRootVal } from '../types'; import { getAdminMetaSchema } from '../admin-ui/system'; import { sessionSchema } from '../session'; import { InitialisedList } from './core/types-for-lists'; diff --git a/packages/keystone/src/lib/createSystem.ts b/packages/keystone/src/lib/createSystem.ts index 1a0a6114dcf..118b40e3ade 100644 --- a/packages/keystone/src/lib/createSystem.ts +++ b/packages/keystone/src/lib/createSystem.ts @@ -1,4 +1,4 @@ -import { FieldData, KeystoneConfig, DatabaseProvider, getGqlNames } from '@keystone-next/types'; +import { FieldData, KeystoneConfig, DatabaseProvider, getGqlNames } from '../types'; import { createAdminMeta } from '../admin-ui/system/createAdminMeta'; import { createGraphQLSchema } from './createGraphQLSchema'; diff --git a/packages/keystone/src/lib/id-field.ts b/packages/keystone/src/lib/id-field.ts index 7269fa98029..729a163050c 100644 --- a/packages/keystone/src/lib/id-field.ts +++ b/packages/keystone/src/lib/id-field.ts @@ -1,4 +1,6 @@ import path from 'path'; +import { validate } from 'uuid'; +import { isCuid } from 'cuid'; import { fieldType, FieldTypeFunc, @@ -6,9 +8,7 @@ import { orderDirectionEnum, ScalarDBField, schema, -} from '@keystone-next/types'; -import { validate } from 'uuid'; -import { isCuid } from 'cuid'; +} from '../types'; const views = path.join( path.dirname(require.resolve('@keystone-next/keystone/package.json')), diff --git a/packages/keystone/src/lib/keystone-cloud/assets.ts b/packages/keystone/src/lib/keystone-cloud/assets.ts index b811b26876e..fa9e2f57daa 100644 --- a/packages/keystone/src/lib/keystone-cloud/assets.ts +++ b/packages/keystone/src/lib/keystone-cloud/assets.ts @@ -1,7 +1,7 @@ import { Readable } from 'stream'; import fetch from 'node-fetch'; import FormData from 'form-data'; -import { ImageMetadata } from '@keystone-next/types'; +import { ImageMetadata } from '../../types'; /** * This function and request to the cloud API will not be necessary if we can diff --git a/packages/keystone/src/lib/schema-type-printer.tsx b/packages/keystone/src/lib/schema-type-printer.tsx index 0b05d902119..b404c7ab561 100644 --- a/packages/keystone/src/lib/schema-type-printer.tsx +++ b/packages/keystone/src/lib/schema-type-printer.tsx @@ -1,4 +1,3 @@ -import { getGqlNames } from '@keystone-next/types'; import { GraphQLSchema, parse, @@ -13,6 +12,7 @@ import { InputValueDefinitionNode, } from 'graphql'; import prettier from 'prettier'; +import { getGqlNames } from '../types'; import { InitialisedList } from './core/types-for-lists'; let printEnumTypeDefinition = (node: EnumTypeDefinitionNode) => { @@ -83,14 +83,14 @@ export function printGeneratedTypes( String: 'string', Int: 'number', Float: 'number', - JSON: 'import("@keystone-next/types").JSONValue', + JSON: 'import("@keystone-next/keystone/types").JSONValue', }; let prelude = `import { KeystoneListsAPI as GenericKeystoneListsAPI, KeystoneDbAPI as GenericKeystoneDbAPI, KeystoneContext as GenericKeystoneContext, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; `; let { printedTypes, ast, printTypeNode } = printInputTypesFromSchema( @@ -151,7 +151,7 @@ export type ${listTypeInfoName} = { listQuery: ${ listQuery ? printArgs(listQuery.arguments!) - : 'import("@keystone-next/types").BaseGeneratedListTypes["args"]["listQuery"]' + : 'import("@keystone-next/keystone/types").BaseGeneratedListTypes["args"]["listQuery"]' } }; }; diff --git a/packages/keystone/src/lib/server/addHealthCheck.ts b/packages/keystone/src/lib/server/addHealthCheck.ts index dd0ec176e99..7f5dc892c07 100644 --- a/packages/keystone/src/lib/server/addHealthCheck.ts +++ b/packages/keystone/src/lib/server/addHealthCheck.ts @@ -1,5 +1,5 @@ -import type { KeystoneConfig } from '@keystone-next/types'; import { Application } from 'express'; +import type { KeystoneConfig } from '../../types'; import { defaults } from '../config/defaults'; diff --git a/packages/keystone/src/lib/server/createApolloServer.ts b/packages/keystone/src/lib/server/createApolloServer.ts index af4d51b3985..4e944dca0be 100644 --- a/packages/keystone/src/lib/server/createApolloServer.ts +++ b/packages/keystone/src/lib/server/createApolloServer.ts @@ -3,7 +3,7 @@ import { GraphQLError, GraphQLSchema } from 'graphql'; import { ApolloServer as ApolloServerMicro } from 'apollo-server-micro'; import { ApolloServer as ApolloServerExpress } from 'apollo-server-express'; import type { Config } from 'apollo-server-express'; -import type { CreateContext, GraphQLConfig, SessionStrategy } from '@keystone-next/types'; +import type { CreateContext, GraphQLConfig, SessionStrategy } from '../../types'; import { createSessionContext } from '../../session'; export const createApolloServerMicro = ({ diff --git a/packages/keystone/src/lib/server/createExpressServer.ts b/packages/keystone/src/lib/server/createExpressServer.ts index e94fe7c1297..922d4e92ec0 100644 --- a/packages/keystone/src/lib/server/createExpressServer.ts +++ b/packages/keystone/src/lib/server/createExpressServer.ts @@ -2,12 +2,7 @@ import cors, { CorsOptions } from 'cors'; import express from 'express'; import { GraphQLSchema } from 'graphql'; import { graphqlUploadExpress } from 'graphql-upload'; -import type { - KeystoneConfig, - CreateContext, - SessionStrategy, - GraphQLConfig, -} from '@keystone-next/types'; +import type { KeystoneConfig, CreateContext, SessionStrategy, GraphQLConfig } from '../../types'; import { createAdminUIServer } from '../../admin-ui/system'; import { createApolloServerExpress } from './createApolloServer'; import { addHealthCheck } from './addHealthCheck'; diff --git a/packages/keystone/src/schema/index.ts b/packages/keystone/src/schema/index.ts index aeb616d86a0..7140d8b7c40 100644 --- a/packages/keystone/src/schema/index.ts +++ b/packages/keystone/src/schema/index.ts @@ -1,7 +1,2 @@ export { createSchema, list, gql, graphQLSchemaExtension, config } from './schema'; -export type { - ListSchemaConfig, - ListConfig, - ExtendGraphqlSchema, - BaseFields, -} from '@keystone-next/types'; +export type { ListSchemaConfig, ListConfig, ExtendGraphqlSchema, BaseFields } from '../types'; diff --git a/packages/keystone/src/schema/schema.ts b/packages/keystone/src/schema/schema.ts index 1c84166a776..7b1ced29d33 100644 --- a/packages/keystone/src/schema/schema.ts +++ b/packages/keystone/src/schema/schema.ts @@ -9,7 +9,7 @@ import type { KeystoneConfig, ListConfig, ListSchemaConfig, -} from '@keystone-next/types'; +} from '../types'; export function createSchema(config: ListSchemaConfig) { return config; diff --git a/packages/keystone/src/scripts/build/build.ts b/packages/keystone/src/scripts/build/build.ts index 32ea33f7689..e570ea8b8de 100644 --- a/packages/keystone/src/scripts/build/build.ts +++ b/packages/keystone/src/scripts/build/build.ts @@ -1,7 +1,7 @@ import Path from 'path'; import prettier from 'prettier'; import fs from 'fs-extra'; -import { AdminFileToWrite } from '@keystone-next/types'; +import { AdminFileToWrite } from '../../types'; import { buildAdminUI, generateAdminUI } from '../../admin-ui/system'; import { createSystem } from '../../lib/createSystem'; import { initConfig } from '../../lib/config/initConfig'; diff --git a/packages/keystone/src/scripts/tests/__snapshots__/artifacts.test.ts.snap b/packages/keystone/src/scripts/tests/__snapshots__/artifacts.test.ts.snap index 40457901eb3..0d2cd4acba6 100644 --- a/packages/keystone/src/scripts/tests/__snapshots__/artifacts.test.ts.snap +++ b/packages/keystone/src/scripts/tests/__snapshots__/artifacts.test.ts.snap @@ -6,14 +6,14 @@ import { KeystoneListsAPI as GenericKeystoneListsAPI, KeystoneDbAPI as GenericKeystoneDbAPI, KeystoneContext as GenericKeystoneContext, -} from '@keystone-next/types'; +} from '@keystone-next/keystone/types'; type Scalars = { readonly ID: string; readonly Boolean: boolean; readonly String: string; readonly Int: number; readonly Float: number; - readonly JSON: import('@keystone-next/types').JSONValue; + readonly JSON: import('@keystone-next/keystone/types').JSONValue; }; export type TodoWhereInput = { diff --git a/packages/keystone/src/scripts/tests/artifacts.test.ts b/packages/keystone/src/scripts/tests/artifacts.test.ts index 6c9196ad896..436f978b5fb 100644 --- a/packages/keystone/src/scripts/tests/artifacts.test.ts +++ b/packages/keystone/src/scripts/tests/artifacts.test.ts @@ -111,7 +111,7 @@ describe('postinstall', () => { await runCommand(tmp, 'postinstall'); expect(await getFiles(tmp, ['node_modules/.keystone/api.{d.ts,js}'])).toMatchInlineSnapshot(` ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ node_modules/.keystone/api.d.ts ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ - import { KeystoneListsAPI } from '@keystone-next/types'; + import { KeystoneListsAPI } from '@keystone-next/keystone/types'; import { KeystoneListsTypeInfo } from './types'; export const lists: KeystoneListsAPI; diff --git a/packages/keystone/src/scripts/tests/migrations.test.ts b/packages/keystone/src/scripts/tests/migrations.test.ts index 574d157641c..775700b8c9e 100644 --- a/packages/keystone/src/scripts/tests/migrations.test.ts +++ b/packages/keystone/src/scripts/tests/migrations.test.ts @@ -1,5 +1,5 @@ -import { ListSchemaConfig } from '@keystone-next/types'; import fs from 'fs-extra'; +import { ListSchemaConfig } from '../../types'; import { checkbox, text } from '../../fields'; import { requirePrismaClient } from '../../artifacts'; import { config, list } from '../../schema'; diff --git a/packages/keystone/src/scripts/tests/utils.tsx b/packages/keystone/src/scripts/tests/utils.tsx index 4b8eaffba9a..eff6c71a660 100644 --- a/packages/keystone/src/scripts/tests/utils.tsx +++ b/packages/keystone/src/scripts/tests/utils.tsx @@ -7,9 +7,9 @@ import fastGlob from 'fast-glob'; // @ts-ignore import fixturez from 'fixturez'; import outdent from 'outdent'; -import { KeystoneConfig } from '@keystone-next/types'; import { parseArgsStringToArgv } from 'string-argv'; import { IntrospectionEngine, uriToCredentials } from '@prisma/sdk'; +import { KeystoneConfig } from '../../types'; import { cli } from '../cli'; import { mockPrompts } from '../../lib/prompts'; @@ -115,7 +115,6 @@ export const symlinkKeystoneDeps = Object.fromEntries( [ '@keystone-next/keystone', '@keystone-next/auth', - '@keystone-next/types', '@prisma/engines', '@prisma/client', 'typescript', diff --git a/packages/keystone/src/session/index.ts b/packages/keystone/src/session/index.ts index 9843ebe8c9b..e5954eabc55 100644 --- a/packages/keystone/src/session/index.ts +++ b/packages/keystone/src/session/index.ts @@ -2,6 +2,7 @@ import { IncomingMessage, ServerResponse } from 'http'; import { GraphQLObjectType, GraphQLSchema } from 'graphql'; import * as cookie from 'cookie'; import Iron from '@hapi/iron'; +import { sync as uid } from 'uid-safe'; import { SessionStrategy, JSONValue, @@ -9,9 +10,8 @@ import { SessionContext, CreateContext, schema, -} from '@keystone-next/types'; +} from '../types'; // uid-safe is what express-session uses so let's just use it -import { sync as uid } from 'uid-safe'; function generateSessionId() { return uid(24); diff --git a/packages/keystone/src/testing.ts b/packages/keystone/src/testing.ts index 02edf3f7f62..691df2eb622 100644 --- a/packages/keystone/src/testing.ts +++ b/packages/keystone/src/testing.ts @@ -4,7 +4,7 @@ import fs from 'fs'; import express from 'express'; import supertest, { Test } from 'supertest'; import memoizeOne from 'memoize-one'; -import type { KeystoneConfig, KeystoneContext } from '@keystone-next/types'; +import type { KeystoneConfig, KeystoneContext } from './types'; import { getCommittedArtifacts, writeCommittedArtifacts, diff --git a/packages/types/src/admin-meta.ts b/packages/keystone/src/types/admin-meta.ts similarity index 100% rename from packages/types/src/admin-meta.ts rename to packages/keystone/src/types/admin-meta.ts diff --git a/packages/types/src/base.ts b/packages/keystone/src/types/base.ts similarity index 100% rename from packages/types/src/base.ts rename to packages/keystone/src/types/base.ts diff --git a/packages/types/src/config/access-control.ts b/packages/keystone/src/types/config/access-control.ts similarity index 100% rename from packages/types/src/config/access-control.ts rename to packages/keystone/src/types/config/access-control.ts diff --git a/packages/types/src/config/fields.ts b/packages/keystone/src/types/config/fields.ts similarity index 100% rename from packages/types/src/config/fields.ts rename to packages/keystone/src/types/config/fields.ts diff --git a/packages/types/src/config/hooks.ts b/packages/keystone/src/types/config/hooks.ts similarity index 100% rename from packages/types/src/config/hooks.ts rename to packages/keystone/src/types/config/hooks.ts diff --git a/packages/types/src/config/index.ts b/packages/keystone/src/types/config/index.ts similarity index 100% rename from packages/types/src/config/index.ts rename to packages/keystone/src/types/config/index.ts diff --git a/packages/types/src/config/lists.ts b/packages/keystone/src/types/config/lists.ts similarity index 100% rename from packages/types/src/config/lists.ts rename to packages/keystone/src/types/config/lists.ts diff --git a/packages/types/src/context.ts b/packages/keystone/src/types/context.ts similarity index 100% rename from packages/types/src/context.ts rename to packages/keystone/src/types/context.ts diff --git a/packages/types/src/core.ts b/packages/keystone/src/types/core.ts similarity index 100% rename from packages/types/src/core.ts rename to packages/keystone/src/types/core.ts diff --git a/packages/types/src/filters/enum-filter.ts b/packages/keystone/src/types/filters/enum-filter.ts similarity index 100% rename from packages/types/src/filters/enum-filter.ts rename to packages/keystone/src/types/filters/enum-filter.ts diff --git a/packages/types/src/filters/index.ts b/packages/keystone/src/types/filters/index.ts similarity index 100% rename from packages/types/src/filters/index.ts rename to packages/keystone/src/types/filters/index.ts diff --git a/packages/types/src/filters/providers/postgresql.ts b/packages/keystone/src/types/filters/providers/postgresql.ts similarity index 99% rename from packages/types/src/filters/providers/postgresql.ts rename to packages/keystone/src/types/filters/providers/postgresql.ts index cac24d557da..81246aeddab 100644 --- a/packages/types/src/filters/providers/postgresql.ts +++ b/packages/keystone/src/types/filters/providers/postgresql.ts @@ -3,7 +3,7 @@ import { schema } from '../../schema'; -import { QueryMode } from '../..'; +import { QueryMode } from '../../next-fields'; type StringNullableFilterType = schema.InputObjectType<{ // can be null diff --git a/packages/types/src/filters/providers/sqlite.ts b/packages/keystone/src/types/filters/providers/sqlite.ts similarity index 100% rename from packages/types/src/filters/providers/sqlite.ts rename to packages/keystone/src/types/filters/providers/sqlite.ts diff --git a/packages/keystone/src/types/index.ts b/packages/keystone/src/types/index.ts new file mode 100644 index 00000000000..94b4e12f993 --- /dev/null +++ b/packages/keystone/src/types/index.ts @@ -0,0 +1,11 @@ +export * from './core'; +export * from './config'; +export * from './utils'; +export * from './session'; +export * from './admin-meta'; +export * from './base'; +export * from './context'; +export * from './next-fields'; +export * as filters from './filters'; +export * from './schema'; +export { jsonFieldTypePolyfilledForSQLite } from './json-field-type-polyfill-for-sqlite'; diff --git a/packages/types/src/json-field-type-polyfill-for-sqlite.ts b/packages/keystone/src/types/json-field-type-polyfill-for-sqlite.ts similarity index 100% rename from packages/types/src/json-field-type-polyfill-for-sqlite.ts rename to packages/keystone/src/types/json-field-type-polyfill-for-sqlite.ts diff --git a/packages/types/src/next-fields.ts b/packages/keystone/src/types/next-fields.ts similarity index 100% rename from packages/types/src/next-fields.ts rename to packages/keystone/src/types/next-fields.ts diff --git a/packages/types/src/schema/graphql-ts-schema.ts b/packages/keystone/src/types/schema/graphql-ts-schema.ts similarity index 100% rename from packages/types/src/schema/graphql-ts-schema.ts rename to packages/keystone/src/types/schema/graphql-ts-schema.ts diff --git a/packages/types/src/schema/index.ts b/packages/keystone/src/types/schema/index.ts similarity index 100% rename from packages/types/src/schema/index.ts rename to packages/keystone/src/types/schema/index.ts diff --git a/packages/types/src/schema/schema-api-with-context.d.ts b/packages/keystone/src/types/schema/schema-api-with-context.d.ts similarity index 100% rename from packages/types/src/schema/schema-api-with-context.d.ts rename to packages/keystone/src/types/schema/schema-api-with-context.d.ts diff --git a/packages/types/src/schema/schema-api-with-context.js b/packages/keystone/src/types/schema/schema-api-with-context.js similarity index 100% rename from packages/types/src/schema/schema-api-with-context.js rename to packages/keystone/src/types/schema/schema-api-with-context.js diff --git a/packages/types/src/session.ts b/packages/keystone/src/types/session.ts similarity index 100% rename from packages/types/src/session.ts rename to packages/keystone/src/types/session.ts diff --git a/packages/types/src/utils.ts b/packages/keystone/src/types/utils.ts similarity index 100% rename from packages/types/src/utils.ts rename to packages/keystone/src/types/utils.ts diff --git a/packages/keystone/types/package.json b/packages/keystone/types/package.json new file mode 100644 index 00000000000..6cbbe144d0c --- /dev/null +++ b/packages/keystone/types/package.json @@ -0,0 +1,4 @@ +{ + "main": "dist/keystone.cjs.js", + "module": "dist/keystone.esm.js" +} diff --git a/packages/session-store-redis/package.json b/packages/session-store-redis/package.json index 32396318b80..944b56ff7d0 100644 --- a/packages/session-store-redis/package.json +++ b/packages/session-store-redis/package.json @@ -11,7 +11,11 @@ "@babel/runtime": "^7.15.3", "@types/redis": "^2.8.31" }, + "peerDependencies": { + "@keystone-next/keystone": "^24.0.1" + }, "devDependencies": { + "@keystone-next/keystone": "^24.0.1", "redis": "^3.1.2" }, "repository": "https://github.com/keystonejs/keystone/tree/master/packages/session-store-redis" diff --git a/packages/session-store-redis/src/index.ts b/packages/session-store-redis/src/index.ts index e1fb2d2e4d7..1592f287e2d 100644 --- a/packages/session-store-redis/src/index.ts +++ b/packages/session-store-redis/src/index.ts @@ -1,6 +1,6 @@ import { promisify } from 'util'; import type { RedisClient } from 'redis'; -import type { SessionStoreFunction } from '@keystone-next/types'; +import type { SessionStoreFunction } from '@keystone-next/keystone/types'; type Options = { /** An initialised redis client from the `redis` npm package */ diff --git a/packages/types/README.md b/packages/types/README.md index f364057c069..f5381e29e9a 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -1,5 +1,7 @@ # @keystone-next/types +The exports of this package have been moved to `@keystone-next/keystone/types`. + Keystone-next is a preview release of the next version of Keystone. Please visit for full details. For updates, [follow @keystonejs on Twitter](https://twitter.com/keystonejs) and [join us in Slack](https://community.keystonejs.com/). diff --git a/packages/types/package.json b/packages/types/package.json index 74aaa2136ee..9561e720ce8 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -7,15 +7,5 @@ "engines": { "node": "^12.20 || >= 14.13" }, - "dependencies": { - "@babel/runtime": "^7.15.3", - "@graphql-ts/schema": "0.2.0", - "apollo-server-types": "^0.9.0", - "cors": "^2.8.5", - "decimal.js": "10.3.1", - "graphql": "^15.5.1", - "graphql-type-json": "^0.3.2", - "graphql-upload": "^12.0.0" - }, "repository": "https://github.com/keystonejs/keystone/tree/master/packages/types" } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 94b4e12f993..c9882a7f055 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,11 +1,5 @@ -export * from './core'; -export * from './config'; -export * from './utils'; -export * from './session'; -export * from './admin-meta'; -export * from './base'; -export * from './context'; -export * from './next-fields'; -export * as filters from './filters'; -export * from './schema'; -export { jsonFieldTypePolyfilledForSQLite } from './json-field-type-polyfill-for-sqlite'; +throw new Error( + '`@keystone-next/types` has been moved to `@keystone-next/keystone/types`, please import from there instead.' +); + +export {}; diff --git a/packages/utils/package.json b/packages/utils/package.json index 43197d74571..3a746abe756 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -10,9 +10,5 @@ "engines": { "node": "^12.20 || >= 14.13" }, - "dependencies": { - "@babel/runtime": "^7.15.3", - "@keystone-next/types": "^24.0.0" - }, "repository": "https://github.com/keystonejs/keystone/tree/master/packages/utils" } diff --git a/prisma-utils/src/index.ts b/prisma-utils/src/index.ts index c4570a8c39f..75b783689cb 100644 --- a/prisma-utils/src/index.ts +++ b/prisma-utils/src/index.ts @@ -109,7 +109,7 @@ ${ 2 ) ); - const filepath = `${__dirname}/../../packages/types/src/filters/providers/${provider}.ts`; + const filepath = `${__dirname}/../../packages/keystone/src/types/filters/providers/${provider}.ts`; const newContent = format( `// Do not manually modify this file, it is automatically generated by the package at /prisma-utils in this repo. // Update the script if you need this file to be different @@ -117,7 +117,7 @@ ${ import { schema } from '../../schema'; -${provider !== 'sqlite' ? `import { QueryMode } from '../..'` : ''} +${provider !== 'sqlite' ? `import { QueryMode } from '../../next-fields'` : ''} ${[...referencedTypes].map(typeName => printInputTypeForGraphQLTS(typeName, types)).join('\n\n')} diff --git a/tests/admin-ui-tests/package.json b/tests/admin-ui-tests/package.json index 92f98924f4d..04c346ad3ca 100644 --- a/tests/admin-ui-tests/package.json +++ b/tests/admin-ui-tests/package.json @@ -24,7 +24,6 @@ "build": "keystone-next build" }, "dependencies": { - "@keystone-next/types": "^24.0.0", "@manypkg/find-root": "^1.1.0", "dotenv": "^10.0.0", "tree-kill": "^1.2.2" diff --git a/tests/api-tests/access-control/authed.test.ts b/tests/api-tests/access-control/authed.test.ts index 814b0301948..e943e13d9dc 100644 --- a/tests/api-tests/access-control/authed.test.ts +++ b/tests/api-tests/access-control/authed.test.ts @@ -1,5 +1,5 @@ import { GraphQLError } from 'graphql'; -import { DatabaseProvider, KeystoneContext } from '@keystone-next/types'; +import { DatabaseProvider, KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestEnv, TestEnv } from '@keystone-next/keystone/testing'; import { expectAccessDenied } from '../utils'; import { diff --git a/tests/api-tests/access-control/not-authed.test.ts b/tests/api-tests/access-control/not-authed.test.ts index 0ae5df7807e..cfa16176fda 100644 --- a/tests/api-tests/access-control/not-authed.test.ts +++ b/tests/api-tests/access-control/not-authed.test.ts @@ -1,5 +1,5 @@ import { GraphQLError } from 'graphql'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { GraphQLRequest, setupTestEnv, TestEnv } from '@keystone-next/keystone/testing'; import { expectAccessDenied, expectGraphQLValidationError } from '../utils'; import { diff --git a/tests/api-tests/access-control/schema.test.ts b/tests/api-tests/access-control/schema.test.ts index 8325b6b3c7c..d5b823a753d 100644 --- a/tests/api-tests/access-control/schema.test.ts +++ b/tests/api-tests/access-control/schema.test.ts @@ -1,5 +1,5 @@ import { setupTestEnv, TestEnv } from '@keystone-next/keystone/testing'; -import { getGqlNames, KeystoneContext } from '@keystone-next/types'; +import { getGqlNames, KeystoneContext } from '@keystone-next/keystone/types'; import { getStaticListName, getImperativeListName, diff --git a/tests/api-tests/auth-header.test.ts b/tests/api-tests/auth-header.test.ts index 64d8d6434ce..a1fe0abfb82 100644 --- a/tests/api-tests/auth-header.test.ts +++ b/tests/api-tests/auth-header.test.ts @@ -2,7 +2,7 @@ import { text, timestamp, password } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { statelessSessions } from '@keystone-next/keystone/session'; import { createAuth } from '@keystone-next/auth'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestRunner, TestArgs, setupTestEnv } from '@keystone-next/keystone/testing'; import { apiTestConfig, expectAccessDenied } from './utils'; diff --git a/tests/api-tests/default-value/defaults.test.ts b/tests/api-tests/default-value/defaults.test.ts index 6811a790843..144554f2b2e 100644 --- a/tests/api-tests/default-value/defaults.test.ts +++ b/tests/api-tests/default-value/defaults.test.ts @@ -1,7 +1,7 @@ import { text } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { BaseFields } from '@keystone-next/types'; +import type { BaseFields } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../utils'; const setupList = (fields: BaseFields) => diff --git a/tests/api-tests/fields/crud.test.ts b/tests/api-tests/fields/crud.test.ts index 1955bcc9d5a..f9b4d4be870 100644 --- a/tests/api-tests/fields/crud.test.ts +++ b/tests/api-tests/fields/crud.test.ts @@ -1,6 +1,6 @@ import globby from 'globby'; import { createSchema, list } from '@keystone-next/keystone/schema'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestRunner } from '@keystone-next/keystone/testing'; import { apiTestConfig } from '../utils'; diff --git a/tests/api-tests/fields/filter.test.ts b/tests/api-tests/fields/filter.test.ts index 3b034fa1204..45f5e407494 100644 --- a/tests/api-tests/fields/filter.test.ts +++ b/tests/api-tests/fields/filter.test.ts @@ -1,6 +1,6 @@ import globby from 'globby'; import { createSchema, list } from '@keystone-next/keystone/schema'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestRunner } from '@keystone-next/keystone/testing'; import { apiTestConfig } from '../utils'; diff --git a/tests/api-tests/fields/types/Virtual.test.ts b/tests/api-tests/fields/types/Virtual.test.ts index f1309d9b88d..ca07e5419d5 100644 --- a/tests/api-tests/fields/types/Virtual.test.ts +++ b/tests/api-tests/fields/types/Virtual.test.ts @@ -1,7 +1,7 @@ import { integer, relationship, text, virtual } from '@keystone-next/keystone/fields'; import { BaseFields, createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import { schema } from '@keystone-next/types'; +import { schema } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; function makeRunner(fields: BaseFields) { diff --git a/tests/api-tests/fields/types/document.test.ts b/tests/api-tests/fields/types/document.test.ts index 61c98304ded..96bdbe2be93 100644 --- a/tests/api-tests/fields/types/document.test.ts +++ b/tests/api-tests/fields/types/document.test.ts @@ -2,7 +2,7 @@ import { text } from '@keystone-next/keystone/fields'; import { document } from '@keystone-next/fields-document'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import { KeystoneContext } from '../../../../packages/types/src'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig, expectInternalServerError } from '../../utils'; const runner = setupTestRunner({ diff --git a/tests/api-tests/hooks/hook-errors.test.ts b/tests/api-tests/hooks/hook-errors.test.ts index 7809eb022e7..57119dc7459 100644 --- a/tests/api-tests/hooks/hook-errors.test.ts +++ b/tests/api-tests/hooks/hook-errors.test.ts @@ -1,7 +1,7 @@ import { text } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { GraphQLRequest, setupTestRunner } from '@keystone-next/keystone/testing'; -import { KeystoneContext } from '../../../packages/types/src'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig, expectAccessDenied, expectExtensionError } from '../utils'; const runner = (debug: boolean | undefined) => diff --git a/tests/api-tests/package.json b/tests/api-tests/package.json index 44dc5ca6485..e5070316c02 100644 --- a/tests/api-tests/package.json +++ b/tests/api-tests/package.json @@ -26,7 +26,6 @@ "uuid": "^8.3.2" }, "dependencies": { - "@keystone-next/types": "^24.0.0", "apollo-cache-control": "^0.14.0", "express": "^4.17.1" } diff --git a/tests/api-tests/queries/cache-hints.test.ts b/tests/api-tests/queries/cache-hints.test.ts index 9341f9174d1..9e0a56f8edd 100644 --- a/tests/api-tests/queries/cache-hints.test.ts +++ b/tests/api-tests/queries/cache-hints.test.ts @@ -1,7 +1,7 @@ import { CacheScope } from 'apollo-cache-control'; import { text, relationship, integer } from '@keystone-next/keystone/fields'; import { list, createSchema, graphQLSchemaExtension } from '@keystone-next/keystone/schema'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestRunner } from '@keystone-next/keystone/testing'; import { apiTestConfig } from '../utils'; diff --git a/tests/api-tests/queries/orderBy.test.ts b/tests/api-tests/queries/orderBy.test.ts index 08dee5318ac..05cdc91d93a 100644 --- a/tests/api-tests/queries/orderBy.test.ts +++ b/tests/api-tests/queries/orderBy.test.ts @@ -1,7 +1,7 @@ import { integer } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig, expectBadUserInput } from '../utils'; const runner = setupTestRunner({ diff --git a/tests/api-tests/relationships/crud-self-ref/many-to-many-one-sided.test.ts b/tests/api-tests/relationships/crud-self-ref/many-to-many-one-sided.test.ts index c71b23cb60e..bffc020b685 100644 --- a/tests/api-tests/relationships/crud-self-ref/many-to-many-one-sided.test.ts +++ b/tests/api-tests/relationships/crud-self-ref/many-to-many-one-sided.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud-self-ref/many-to-many.test.ts b/tests/api-tests/relationships/crud-self-ref/many-to-many.test.ts index 0fdff611266..a2c0498a208 100644 --- a/tests/api-tests/relationships/crud-self-ref/many-to-many.test.ts +++ b/tests/api-tests/relationships/crud-self-ref/many-to-many.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud-self-ref/one-to-many-one-sided.test.ts b/tests/api-tests/relationships/crud-self-ref/one-to-many-one-sided.test.ts index 9abb0625bbe..f619c90fa0c 100644 --- a/tests/api-tests/relationships/crud-self-ref/one-to-many-one-sided.test.ts +++ b/tests/api-tests/relationships/crud-self-ref/one-to-many-one-sided.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud-self-ref/one-to-many.test.ts b/tests/api-tests/relationships/crud-self-ref/one-to-many.test.ts index fcd0e704ed5..26d4dd030b9 100644 --- a/tests/api-tests/relationships/crud-self-ref/one-to-many.test.ts +++ b/tests/api-tests/relationships/crud-self-ref/one-to-many.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud-self-ref/one-to-one.test.ts b/tests/api-tests/relationships/crud-self-ref/one-to-one.test.ts index 10001dd7d10..a00e5a33c18 100644 --- a/tests/api-tests/relationships/crud-self-ref/one-to-one.test.ts +++ b/tests/api-tests/relationships/crud-self-ref/one-to-one.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud/many-to-many-one-sided.test.ts b/tests/api-tests/relationships/crud/many-to-many-one-sided.test.ts index 8aabd9d84f3..e0d3709085f 100644 --- a/tests/api-tests/relationships/crud/many-to-many-one-sided.test.ts +++ b/tests/api-tests/relationships/crud/many-to-many-one-sided.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud/many-to-many.test.ts b/tests/api-tests/relationships/crud/many-to-many.test.ts index 7e0e9498eed..44e6890f489 100644 --- a/tests/api-tests/relationships/crud/many-to-many.test.ts +++ b/tests/api-tests/relationships/crud/many-to-many.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud/one-to-many-one-sided.test.ts b/tests/api-tests/relationships/crud/one-to-many-one-sided.test.ts index 13a132bf287..ced7f4b8626 100644 --- a/tests/api-tests/relationships/crud/one-to-many-one-sided.test.ts +++ b/tests/api-tests/relationships/crud/one-to-many-one-sided.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud/one-to-many.test.ts b/tests/api-tests/relationships/crud/one-to-many.test.ts index ad1c288ba16..c2790ed9c4d 100644 --- a/tests/api-tests/relationships/crud/one-to-many.test.ts +++ b/tests/api-tests/relationships/crud/one-to-many.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/crud/one-to-one.test.ts b/tests/api-tests/relationships/crud/one-to-one.test.ts index 2abdcd78d31..e5c9719ba42 100644 --- a/tests/api-tests/relationships/crud/one-to-one.test.ts +++ b/tests/api-tests/relationships/crud/one-to-one.test.ts @@ -2,7 +2,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import type { KeystoneContext } from '@keystone-next/types'; +import type { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../../utils'; type IdType = any; diff --git a/tests/api-tests/relationships/many-to-one-to-one.test.ts b/tests/api-tests/relationships/many-to-one-to-one.test.ts index 9726e38559b..e73b4897b0f 100644 --- a/tests/api-tests/relationships/many-to-one-to-one.test.ts +++ b/tests/api-tests/relationships/many-to-one-to-one.test.ts @@ -1,4 +1,4 @@ -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; diff --git a/tests/api-tests/relationships/nested-mutations/two-way-backreference/to-many.test.ts b/tests/api-tests/relationships/nested-mutations/two-way-backreference/to-many.test.ts index 7e6b082e372..a386a080009 100644 --- a/tests/api-tests/relationships/nested-mutations/two-way-backreference/to-many.test.ts +++ b/tests/api-tests/relationships/nested-mutations/two-way-backreference/to-many.test.ts @@ -1,7 +1,7 @@ import { gen, sampleOne } from 'testcheck'; import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { setupTestRunner } from '@keystone-next/keystone/testing'; import { apiTestConfig } from '../../../utils'; diff --git a/tests/api-tests/relationships/shared-names.test.ts b/tests/api-tests/relationships/shared-names.test.ts index 8cfd31806fa..953d5cdc129 100644 --- a/tests/api-tests/relationships/shared-names.test.ts +++ b/tests/api-tests/relationships/shared-names.test.ts @@ -1,7 +1,7 @@ import { text, relationship } from '@keystone-next/keystone/fields'; import { createSchema, list } from '@keystone-next/keystone/schema'; import { setupTestRunner } from '@keystone-next/keystone/testing'; -import { KeystoneContext } from '@keystone-next/types'; +import { KeystoneContext } from '@keystone-next/keystone/types'; import { apiTestConfig } from '../utils'; type IdType = any; diff --git a/tests/api-tests/utils.ts b/tests/api-tests/utils.ts index 391b70fdc15..dca929d866b 100644 --- a/tests/api-tests/utils.ts +++ b/tests/api-tests/utils.ts @@ -1,4 +1,4 @@ -import { KeystoneConfig, DatabaseProvider } from '@keystone-next/types'; +import { KeystoneConfig, DatabaseProvider } from '@keystone-next/keystone/types'; // This function injects the db configuration that we use for testing in CI. // This functionality is a keystone repo specific way of doing things, so we don't diff --git a/yarn.lock b/yarn.lock index 0bebeff4aac..155d4353e7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2816,6 +2816,11 @@ resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.8.1.tgz#e81ad28a60bee0328c6d2384e029aec626f1ae67" integrity sha512-e+2rjEwK6KDaNOm5Aa9wNGgyS9oSZU/4pfSMMPYNOfjvFI0WVXm29+ITRFr6aKDvvKo7uU1jV68MW4ScsfDi7Q== +"@types/inflection@^1.5.28": + version "1.5.28" + resolved "https://registry.yarnpkg.com/@types/inflection/-/inflection-1.5.28.tgz#43d55e0d72cf333a2dffd9c4ec0407455a1b0931" + integrity sha1-Q9VeDXLPMzot/9nE7AQHRVobCTE= + "@types/is-hotkey@^0.1.1": version "0.1.3" resolved "https://registry.yarnpkg.com/@types/is-hotkey/-/is-hotkey-0.1.3.tgz#1e86be048d3af160e8e676d5cd463f6f7061589a"