Skip to content

Commit

Permalink
Move fields package into main package (#6362)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Aug 18, 2021
1 parent 595922b commit fd744dc
Show file tree
Hide file tree
Showing 260 changed files with 298 additions and 398 deletions.
1 change: 0 additions & 1 deletion .changeset/brave-paws-sneeze.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
"@keystone-next/cloudinary": major
"@keystone-next/fields": major
"@keystone-next/keystone": major
"@keystone-next/types": major
---
Expand Down
6 changes: 6 additions & 0 deletions .changeset/weak-monkeys-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystone-next/fields': major
'@keystone-next/keystone': minor
---

Moved `@keystone-next/fields` to `@keystone-next/keystone/fields`
12 changes: 6 additions & 6 deletions docs/pages/docs/apis/access-control.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `access` property of the [list configuration](./schema) and [field configura

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -98,7 +98,7 @@ For multi-item operations, e.g. `updateItems` or `deleteItems`, if the merged fi

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { checkbox } from '@keystone-next/fields';
import { checkbox } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -191,7 +191,7 @@ Concise syntax provides a single access control rule which is used for all opera

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -233,7 +233,7 @@ The excluded operations can still be access by using [`context.sudo()`](./contex

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -261,7 +261,7 @@ If the function returns `true` then the operation will be allowed.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -293,7 +293,7 @@ Imperative access control functions are passed a collection of arguments which c

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/apis/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For examples of how to use authentication in your system please see the [authent

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text, password, checkbox } from '@keystone-next/fields';
import { text, password, checkbox } from '@keystone-next/keystone/fields';
import { createAuth } from '@keystone-next/auth';

const { withAuth } = createAuth({
Expand Down
30 changes: 15 additions & 15 deletions docs/pages/docs/apis/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
// File types
file,
image,
} from '@keystone-next/fields';
} from '@keystone-next/keystone/fields';

// Complex types
import { document } from '@keystone-next/fields-document';
Expand Down Expand Up @@ -133,7 +133,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { checkbox } from '@keystone-next/fields';
import { checkbox } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -167,7 +167,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { integer } from '@keystone-next/fields';
import { integer } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -196,7 +196,7 @@ Currently the `json` field is non-orderable and non-filterable.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { json } from '@keystone-next/fields';
import { json } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -229,7 +229,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { float } from '@keystone-next/fields';
import { float } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -266,7 +266,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { decimal } from '@keystone-next/fields';
import { decimal } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -302,7 +302,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { password } from '@keystone-next/fields';
import { password } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -348,7 +348,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { select } from '@keystone-next/fields';
import { select } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -391,7 +391,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -428,7 +428,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { timestamp } from '@keystone-next/fields';
import { timestamp } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -478,7 +478,7 @@ Read our [relationships guide](../guides/relationships) for details on Keystone

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { relationship } from '@keystone-next/fields';
import { relationship } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -529,7 +529,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { autoIncrement } from '@keystone-next/fields';
import { autoIncrement } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -563,7 +563,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { virtual } from '@keystone-next/fields';
import { virtual } from '@keystone-next/keystone/fields';
import { schema } from '@keystone-next/types';

export default config({
Expand Down Expand Up @@ -604,7 +604,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { file } from '@keystone-next/fields';
import { file } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -634,7 +634,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { image } from '@keystone-next/fields';
import { image } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/apis/graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Consider the following system definition:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down
16 changes: 8 additions & 8 deletions docs/pages/docs/apis/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For examples of how to use hooks in your system please see the [hooks guide](../

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -79,7 +79,7 @@ The result of `resolveInput` will be passed as `resolvedData` into the next stag

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -142,7 +142,7 @@ These error messages will be returned as a `ValidationFailureError` from the Gra

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -197,7 +197,7 @@ It is invoked after all `validateInput` hooks have been run, but before the data

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -248,7 +248,7 @@ The `afterChange` function is used to perform side effects after the data for a

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -308,7 +308,7 @@ These error messages will be returned as a `ValidationFailureError` from the Gra

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -357,7 +357,7 @@ It is invoked after all `validateDelete` hooks have been run.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -395,7 +395,7 @@ The `afterDelete` function is used to perform side effects after the data for a

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/docs/apis/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This configuration option takes an object with field names as keys, and configur

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -101,7 +101,7 @@ Options:

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields`;
import { text } from '@keystone-next/keystone/fields`;

export default config({
lists: createSchema({
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/docs/guides/custom-fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ There are two parts to a field type:
- The **frontend** portion which defines how the field looks and behaves in the Admin UI.

The general approach to creating a custom field type is to take an existing field type and make the appropriate changes for your use case.
In this guide we're going to create a field type `myInt` which recreates the [`integer`](https://github.com/keystonejs/keystone/tree/master/packages/fields/src/types/integer) field type.
In this guide we're going to create a field type `myInt` which recreates the [`integer`](https://github.com/keystonejs/keystone/tree/master/packages/keystone/src/fields/types/integer) field type.

!> For inspiration, see [the source for the fields that Keystone provides](https://github.com/keystonejs/keystone/tree/master/packages/fields/src/types) and the [Custom Fields](https://github.com/keystonejs/keystone/tree/master/examples/custom-field) example project.
!> For inspiration, see [the source for the fields that Keystone provides](https://github.com/keystonejs/keystone/tree/master/packages/keystone/src/fields/types) and the [Custom Fields](https://github.com/keystonejs/keystone/tree/master/examples/custom-field) example project.

## Backend

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/guides/document-fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ We can achieve this with the `relationships` option to the document field.
```tsx
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { document } from '@keystone-next/fields-document';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down
10 changes: 5 additions & 5 deletions docs/pages/docs/guides/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Let's look at a basic example to log a message to the console whenever a new use

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -53,7 +53,7 @@ Let's write a hook which takes the data for a blog post and converts the first l

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -100,7 +100,7 @@ Let's use a validation hook to ensure that this value doesn't make it into our d

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down Expand Up @@ -144,7 +144,7 @@ Let's send an email after a user is created.

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';
// Keystone leaves it up to you to decide how best to implement email in your system
import { sendWelcomeEmail } from './lib/welcomeEmail';

Expand Down Expand Up @@ -197,7 +197,7 @@ You could always write this as a list hook, but it will make your code more clea

```typescript
import { config, createSchema, list } from '@keystone-next/keystone/schema';
import { text } from '@keystone-next/fields';
import { text } from '@keystone-next/keystone/fields';

export default config({
lists: createSchema({
Expand Down
Loading

0 comments on commit fd744dc

Please sign in to comment.