Skip to content

Commit 6a57f30

Browse files
authored
Fix website build (#9470)
1 parent dd33740 commit 6a57f30

File tree

5 files changed

+33
-27
lines changed

5 files changed

+33
-27
lines changed

.github/workflows/website_preview.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@main
1818
- uses: ./.github/actions/ci-setup
19+
- run: git checkout HEAD -- examples/document-field-customisation/keystone-server
1920

2021
- run: pnpm install -w vercel@canary --ignore-scripts
21-
- run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
22-
- run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
22+
- run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
23+
- run: pnpm vercel build --token=${{ secrets.VERCEL_TOKEN }}
2324
- id: deploy
2425
run: |
25-
url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
26+
url=$(pnpm vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
2627
echo "url=$url" >> "$GITHUB_OUTPUT"

.github/workflows/website_production.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@main
2121
- uses: ./.github/actions/ci-setup
22+
- run: git checkout HEAD -- examples/document-field-customisation/keystone-server
2223

2324
- run: pnpm install -w vercel@canary --ignore-scripts
24-
- run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
25-
- run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
25+
- run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
26+
- run: pnpm vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
2627
- id: deploy
2728
run: |
28-
url=$(vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }})
29+
url=$(pnpm vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }})
2930
echo "url=$url" >> "$GITHUB_OUTPUT"

docs/components/docs/DocumentEditorDemo.tsx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
fields,
1111
} from '@keystone-6/fields-document/component-blocks'
1212
import { type document } from '@keystone-6/fields-document'
13-
import { Global, jsx } from '@emotion/react'
13+
import { Global } from '@emotion/react'
1414

1515
import { getInitialPropsValue } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/initial-values'
1616
import { DocumentEditor, } from '../../../packages/fields-document/src/DocumentEditor'
@@ -22,9 +22,11 @@ import {
2222
} from '../../../packages/fields-document/src/DocumentEditor/demo'
2323
import { FormValueContentFromPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/form-from-preview'
2424
import { createGetPreviewProps } from '../../../packages/fields-document/src/DocumentEditor/component-blocks/preview-props'
25-
import { componentBlocks as componentBlocksInSandboxProject } from '../../../tests/sandbox/component-blocks'
25+
import { componentBlocks as componentBlocksInExample } from '../../../examples/document-field-customisation/keystone-server/src/component-blocks'
2626
import { initialContent } from '../../lib/initialDocumentDemoContent'
2727
import { Code } from '../primitives/Code'
28+
import { KeystarProvider } from '@keystar/ui/core'
29+
import { useThemeContext } from '../../app/(site)/layout-client'
2830

2931
const headingLevels = ['1', '2', '3', '4', '5', '6'] as const
3032

@@ -86,11 +88,10 @@ type DocumentFeaturesFormValue = Parameters<
8688
const emptyObj = {}
8789

8890
const componentBlocks = {
89-
notice: componentBlocksInSandboxProject.notice,
90-
hero: componentBlocksInSandboxProject.hero,
91-
quote: componentBlocksInSandboxProject.quote,
92-
checkboxList: componentBlocksInSandboxProject.checkboxList,
93-
carousel: componentBlocksInSandboxProject.carousel,
91+
callout: componentBlocksInExample.callout,
92+
hero: componentBlocksInExample.hero,
93+
quote: componentBlocksInExample.quote,
94+
carousel: componentBlocksInExample.carousel,
9495
}
9596

9697
type DocumentFieldConfig = Parameters<typeof document>[0]
@@ -297,6 +298,7 @@ export function DocumentEditorDemo () {
297298
setKey(x => x + 1)
298299
}, [documentFeatures])
299300

301+
const { theme } = useThemeContext()
300302
return (
301303
<div
302304
css={{
@@ -336,15 +338,17 @@ export function DocumentEditorDemo () {
336338
marginBottom: 'var(--space-xlarge)',
337339
}}
338340
>
339-
<DocumentEditor
340-
key={key}
341-
value={value}
342-
onChange={setValue}
343-
componentBlocks={componentBlocks}
344-
documentFeatures={documentFeatures}
345-
relationships={emptyObj}
346-
initialExpanded
347-
/>
341+
<KeystarProvider colorScheme={theme}>
342+
<DocumentEditor
343+
key={key}
344+
value={value}
345+
onChange={setValue}
346+
componentBlocks={componentBlocks}
347+
documentFeatures={documentFeatures}
348+
relationships={emptyObj}
349+
initialExpanded
350+
/>
351+
</KeystarProvider>
348352
</div>
349353
<details css={{ marginBottom: 'var(--space-xlarge)' }}>
350354
<summary>View the Field Config</summary>

docs/lib/initialDocumentDemoContent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ export const initialContent = [
122122
},
123123
{
124124
type: 'component-block',
125-
component: 'notice',
125+
component: 'callout',
126126
props: {
127-
intent: 'info',
127+
tone: 'info',
128128
},
129129
children: [
130130
{
@@ -190,9 +190,9 @@ export const initialContent = [
190190
},
191191
{
192192
type: 'component-block',
193-
component: 'notice',
193+
component: 'callout',
194194
props: {
195-
intent: 'success',
195+
tone: 'positive',
196196
},
197197
children: [
198198
{

docs/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

0 commit comments

Comments
 (0)