Skip to content

Commit

Permalink
fix more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamsi committed Jun 30, 2024
1 parent 4e1bc8f commit 4a81dc4
Show file tree
Hide file tree
Showing 61 changed files with 431 additions and 129 deletions.
18 changes: 9 additions & 9 deletions examples/auth/app/(admin)/.admin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable */
import * as view0 from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view'
import * as view1 from '@keystone-6/core/fields/types/text/views'
import * as view2 from '@keystone-6/core/fields/types/password/views'
import * as view3 from '@keystone-6/core/fields/types/checkbox/views'
import * as view4 from '@keystone-6/core/fields/types/timestamp/views'
import * as view5 from '@keystone-6/core/fields/types/relationship/views'
import * as view6 from '@keystone-6/core/fields/types/integer/views'
import * as view7 from '@keystone-6/core/fields/types/select/views'
import * as view8 from '@keystone-6/core/fields/types/json/views'
import * as view0 from "@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view"
import * as view1 from "@keystone-6/core/fields/types/text/views"
import * as view2 from "@keystone-6/core/fields/types/password/views"
import * as view3 from "@keystone-6/core/fields/types/checkbox/views"
import * as view4 from "@keystone-6/core/fields/types/timestamp/views"
import * as view5 from "@keystone-6/core/fields/types/relationship/views"
import * as view6 from "@keystone-6/core/fields/types/integer/views"
import * as view7 from "@keystone-6/core/fields/types/select/views"
import * as view8 from "@keystone-6/core/fields/types/json/views"

const adminConfig = {}

Expand Down
4 changes: 0 additions & 4 deletions examples/auth/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// you don't need this if you're building something outside of the Keystone repo

export default {
experimental: {
// without this, 'Error: Expected Upload to be a GraphQL nullable type.'
serverComponentsExternalPackages: ['graphql'],
},
eslint: {
ignoreDuringBuilds: true,
},
Expand Down
12 changes: 6 additions & 6 deletions examples/custom-admin-ui-navigation/app/(admin)/.admin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable */
import * as view0 from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view'
import * as view1 from '@keystone-6/core/fields/types/text/views'
import * as view2 from '@keystone-6/core/fields/types/select/views'
import * as view3 from '@keystone-6/core/fields/types/checkbox/views'
import * as view4 from '@keystone-6/core/fields/types/relationship/views'
import * as view5 from '@keystone-6/core/fields/types/timestamp/views'
import * as view0 from "@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view"
import * as view1 from "@keystone-6/core/fields/types/text/views"
import * as view2 from "@keystone-6/core/fields/types/select/views"
import * as view3 from "@keystone-6/core/fields/types/checkbox/views"
import * as view4 from "@keystone-6/core/fields/types/relationship/views"
import * as view5 from "@keystone-6/core/fields/types/timestamp/views"

import * as adminConfig from '../config'

Expand Down
21 changes: 21 additions & 0 deletions examples/custom-field-view/app/(admin)/.admin/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable */
import * as view0 from "@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view"
import * as view1 from "@keystone-6/core/fields/types/text/views"
import * as view2 from "@keystone-6/core/fields/types/select/views"
import * as view3 from "@keystone-6/core/fields/types/checkbox/views"
import * as view4 from "@keystone-6/core/fields/types/relationship/views"
import * as view5 from "@keystone-6/core/fields/types/timestamp/views"
import * as view6 from "@keystone-6/core/fields/types/json/views"
import * as view7 from "../../.././fields/related-links/components"
import * as view8 from "@/fields/related-links/components"

const adminConfig = {}

export const config = {
lazyMetadataQuery: {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"keystone","loc":{"start":22,"end":30}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminMeta","loc":{"start":39,"end":48}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lists","loc":{"start":59,"end":64}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key","loc":{"start":77,"end":80}},"arguments":[],"directives":[],"loc":{"start":77,"end":80}},{"kind":"Field","name":{"kind":"Name","value":"isHidden","loc":{"start":91,"end":99}},"arguments":[],"directives":[],"loc":{"start":91,"end":99}},{"kind":"Field","name":{"kind":"Name","value":"fields","loc":{"start":110,"end":116}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path","loc":{"start":131,"end":135}},"arguments":[],"directives":[],"loc":{"start":131,"end":135}},{"kind":"Field","name":{"kind":"Name","value":"createView","loc":{"start":148,"end":158}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMode","loc":{"start":175,"end":184}},"arguments":[],"directives":[],"loc":{"start":175,"end":184}}],"loc":{"start":159,"end":198}},"loc":{"start":148,"end":198}}],"loc":{"start":117,"end":210}},"loc":{"start":110,"end":210}}],"loc":{"start":65,"end":220}},"loc":{"start":59,"end":220}}],"loc":{"start":49,"end":228}},"loc":{"start":39,"end":228}}],"loc":{"start":31,"end":234}},"loc":{"start":22,"end":234}}]}}]},
fieldViews: [view0,view1,view2,view3,view4,view5,view6,view7,view8],
adminMetaHash: 'o10uod',
adminConfig,
apiPath: '/api/graphql',
adminPath: '',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { ItemPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage'

export default ItemPage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { CreateItemPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage'

export default CreateItemPage
4 changes: 4 additions & 0 deletions examples/custom-field-view/app/(admin)/[listKey]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { ListPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage'

export default ListPage
16 changes: 16 additions & 0 deletions examples/custom-field-view/app/(admin)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client'
import { Layout } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App'
import { config } from './.admin'


export default function AdminLayout ({
children,
}: {
children: React.ReactNode
}) {
return (
<Layout config={config as any}>
{children}
</Layout>
)
}
4 changes: 4 additions & 0 deletions examples/custom-field-view/app/(admin)/no-access/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { getNoAccessPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage'

export default getNoAccessPage({ sessionsEnabled: false })
2 changes: 2 additions & 0 deletions examples/custom-field-view/app/(admin)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { HomePage as default } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage'
11 changes: 11 additions & 0 deletions examples/custom-field-view/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default function RootLayout ({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
5 changes: 5 additions & 0 deletions examples/custom-field-view/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
3 changes: 3 additions & 0 deletions examples/custom-field-view/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Task {
assignedTo: Person
finishBy: DateTime
relatedLinks: JSON
moreLinks: JSON
}

enum TaskPriorityType {
Expand Down Expand Up @@ -117,6 +118,7 @@ input TaskUpdateInput {
assignedTo: PersonRelateToOneForUpdateInput
finishBy: DateTime
relatedLinks: JSON
moreLinks: JSON
}

input PersonRelateToOneForUpdateInput {
Expand All @@ -137,6 +139,7 @@ input TaskCreateInput {
assignedTo: PersonRelateToOneForCreateInput
finishBy: DateTime
relatedLinks: JSON
moreLinks: JSON
}

input PersonRelateToOneForCreateInput {
Expand Down
1 change: 1 addition & 0 deletions examples/custom-field-view/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ model Task {
assignedToId String? @map("assignedTo")
finishBy DateTime?
relatedLinks String?
moreLinks String?
@@index([assignedToId])
}
Expand Down
8 changes: 8 additions & 0 deletions examples/custom-field-view/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ export const lists = {
itemView: { fieldMode: 'edit' },
},
}),
moreLinks: json({
ui: {
views: '@/fields/related-links/components',
createView: { fieldMode: 'edit' },
listView: { fieldMode: 'hidden' },
itemView: { fieldMode: 'edit' },
},
}),
},
}),
Person: list({
Expand Down
37 changes: 37 additions & 0 deletions examples/custom-field-view/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"module": "esnext",
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"paths": {
"@/fields/*": ["./fields/*"]
},
"plugins": [
{
"name": "next"
}
]
},
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
19 changes: 19 additions & 0 deletions examples/custom-field/app/(admin)/.admin/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable */
import * as view0 from "@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view"
import * as view1 from "../../.././1-text-field/views"
import * as view2 from "../../.././2-stars-field/views"
import * as view3 from "../../.././4-conditional-field/views"
import * as view4 from "../../.././3-pair-field/views"
import * as view5 from "../../.././3-pair-field-nested/views"
import * as view6 from "../../.././3-pair-field-json/views"

const adminConfig = {}

export const config = {
lazyMetadataQuery: {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"keystone","loc":{"start":22,"end":30}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminMeta","loc":{"start":39,"end":48}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lists","loc":{"start":59,"end":64}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key","loc":{"start":77,"end":80}},"arguments":[],"directives":[],"loc":{"start":77,"end":80}},{"kind":"Field","name":{"kind":"Name","value":"isHidden","loc":{"start":91,"end":99}},"arguments":[],"directives":[],"loc":{"start":91,"end":99}},{"kind":"Field","name":{"kind":"Name","value":"fields","loc":{"start":110,"end":116}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path","loc":{"start":131,"end":135}},"arguments":[],"directives":[],"loc":{"start":131,"end":135}},{"kind":"Field","name":{"kind":"Name","value":"createView","loc":{"start":148,"end":158}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMode","loc":{"start":175,"end":184}},"arguments":[],"directives":[],"loc":{"start":175,"end":184}}],"loc":{"start":159,"end":198}},"loc":{"start":148,"end":198}}],"loc":{"start":117,"end":210}},"loc":{"start":110,"end":210}}],"loc":{"start":65,"end":220}},"loc":{"start":59,"end":220}}],"loc":{"start":49,"end":228}},"loc":{"start":39,"end":228}}],"loc":{"start":31,"end":234}},"loc":{"start":22,"end":234}}]}}]},
fieldViews: [view0,view1,view2,view3,view4,view5,view6],
adminMetaHash: 'fhppxz',
adminConfig,
apiPath: '/api/graphql',
adminPath: '',
};
4 changes: 4 additions & 0 deletions examples/custom-field/app/(admin)/[listKey]/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { ItemPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage'

export default ItemPage
4 changes: 4 additions & 0 deletions examples/custom-field/app/(admin)/[listKey]/create/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { CreateItemPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage'

export default CreateItemPage
4 changes: 4 additions & 0 deletions examples/custom-field/app/(admin)/[listKey]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { ListPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage'

export default ListPage
16 changes: 16 additions & 0 deletions examples/custom-field/app/(admin)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client'
import { Layout } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App'
import { config } from './.admin'


export default function AdminLayout ({
children,
}: {
children: React.ReactNode
}) {
return (
<Layout config={config as any}>
{children}
</Layout>
)
}
4 changes: 4 additions & 0 deletions examples/custom-field/app/(admin)/no-access/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { getNoAccessPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage'

export default getNoAccessPage({ sessionsEnabled: false })
2 changes: 2 additions & 0 deletions examples/custom-field/app/(admin)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export { HomePage as default } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage'
11 changes: 11 additions & 0 deletions examples/custom-field/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default function RootLayout ({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
5 changes: 5 additions & 0 deletions examples/custom-field/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
37 changes: 37 additions & 0 deletions examples/custom-field/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"module": "esnext",
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"paths": {
"@/fields/*": ["./fields/*"]
},
"plugins": [
{
"name": "next"
}
]
},
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
5 changes: 5 additions & 0 deletions examples/document-field/next-env.d copy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
5 changes: 4 additions & 1 deletion examples/document-field/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
5 changes: 0 additions & 5 deletions examples/document-field/next.config.js

This file was deleted.

18 changes: 18 additions & 0 deletions examples/document-field/src/app/(admin)/.admin/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable */
import * as view0 from "@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view"
import * as view1 from "@keystone-6/core/fields/types/text/views"
import * as view2 from "@keystone-6/core/fields/types/select/views"
import * as view3 from "@keystone-6/fields-document/views"
import * as view4 from "@keystone-6/core/fields/types/timestamp/views"
import * as view5 from "@keystone-6/core/fields/types/relationship/views"

const adminConfig = {}

export const config = {
lazyMetadataQuery: {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"keystone","loc":{"start":22,"end":30}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminMeta","loc":{"start":39,"end":48}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lists","loc":{"start":59,"end":64}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key","loc":{"start":77,"end":80}},"arguments":[],"directives":[],"loc":{"start":77,"end":80}},{"kind":"Field","name":{"kind":"Name","value":"isHidden","loc":{"start":91,"end":99}},"arguments":[],"directives":[],"loc":{"start":91,"end":99}},{"kind":"Field","name":{"kind":"Name","value":"fields","loc":{"start":110,"end":116}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path","loc":{"start":131,"end":135}},"arguments":[],"directives":[],"loc":{"start":131,"end":135}},{"kind":"Field","name":{"kind":"Name","value":"createView","loc":{"start":148,"end":158}},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMode","loc":{"start":175,"end":184}},"arguments":[],"directives":[],"loc":{"start":175,"end":184}}],"loc":{"start":159,"end":198}},"loc":{"start":148,"end":198}}],"loc":{"start":117,"end":210}},"loc":{"start":110,"end":210}}],"loc":{"start":65,"end":220}},"loc":{"start":59,"end":220}}],"loc":{"start":49,"end":228}},"loc":{"start":39,"end":228}}],"loc":{"start":31,"end":234}},"loc":{"start":22,"end":234}}]}}]},
fieldViews: [view0,view1,view2,view3,view4,view5],
adminMetaHash: '1oos0js',
adminConfig,
apiPath: '/api/graphql',
adminPath: '',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { ItemPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage'

export default ItemPage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { CreateItemPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage'

export default CreateItemPage
4 changes: 4 additions & 0 deletions examples/document-field/src/app/(admin)/[listKey]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use client'
import { ListPage } from '@keystone-6/core/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage'

export default ListPage
Loading

0 comments on commit 4a81dc4

Please sign in to comment.