Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Move types package into main package #6371

Merged
merged 7 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .changeset/brave-paws-sneeze.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
"@keystone-next/cloudinary": major
"@keystone-next/keystone": major
"@keystone-next/types": major
---

Removed unused legacy filter code
10 changes: 10 additions & 0 deletions .changeset/cold-turkeys-lie.md
Original file line number Diff line number Diff line change
@@ -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`
16 changes: 8 additions & 8 deletions docs/pages/docs/apis/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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({
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/apis/context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/apis/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/docs/guides/custom-admin-ui-navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/guides/custom-admin-ui-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/docs/guides/custom-fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
orderDirectionEnum,
filters,
FieldDefaultValue,
} from '@keystone-next/types';
} from '@keystone-next/keystone/types';

export type MyIntFieldConfig<TGeneratedListTypes extends BaseGeneratedListTypes> =
CommonFieldConfig<TGeneratedListTypes> & {
Expand Down Expand Up @@ -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<typeof controller>) => (
<FieldContainer>
Expand Down Expand Up @@ -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] + '';
Expand All @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/guides/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/docs/guides/virtual-fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion examples-staging/basic/admin/config.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/basic/admin/fieldViews/Test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion examples-staging/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/basic/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/mutations/addToCart.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeystoneContext } from '@keystone-next/types';
import { KeystoneContext } from '@keystone-next/keystone/types';
import { Session } from '../types';

async function addToCart(
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/mutations/checkout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeystoneContext } from '@keystone-next/types';
import { KeystoneContext } from '@keystone-next/keystone/types';

// import stripeConfig from '../lib/stripe';

Expand Down
1 change: 0 additions & 1 deletion examples-staging/ecommerce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/schemas/Order.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/seed-data/index.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/tests/mutations.test.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/types.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion examples-staging/roles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-logo/admin/config.tsx
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 0 additions & 1 deletion examples/custom-admin-ui-logo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-navigation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-navigation/admin/config.ts
Original file line number Diff line number Diff line change
@@ -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'] = {
Expand Down
1 change: 0 additions & 1 deletion examples/custom-admin-ui-navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
},
"dependencies": {
"@keystone-next/keystone": "^24.0.0",
"@keystone-next/types": "^24.0.0",
"react": "^17.0.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-pages/admin/config.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 0 additions & 1 deletion examples/custom-admin-ui-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion examples/custom-field-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion examples/custom-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-field/stars-field/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-field/stars-field/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion examples/testing/example.test.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Loading