Skip to content

Commit f10d0e5

Browse files
TylerBarnesgatsbybot
and
gatsbybot
authored
feat(gatsby): content sync debugging tweaks (#34487)
* Add verbose instructions and a new env var for node manifest warnings * Add author docs link in conceptual guide Co-authored-by: gatsbybot <[email protected]>
1 parent 15e549c commit f10d0e5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/docs/conceptual/content-sync.md

+5
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ The hierarchy is as follows, from most specific to least specific:
3737
3. An `id` property in the [page `context` passed to the `createPage` API][createpage] with a node id which matches the previewed node id. (automatic)
3838
4. The first matching node id found in Gatsby's [GraphQL query tracking][querytracking] which maps node id's to pages that query them. This allows nodes which have no direct top-level page correlated with them to be previewed throughout the site. (automatic)
3939

40+
## Source Plugin Authors
41+
42+
If you're a source plugin author, you can find instructions on adding Content Sync support to your source plugin and CMS extension in the [source plugin author docs](authordocs).
43+
4044
## Diagram
4145

4246
![Diagram of Content Sync on Gatsby Cloud. When a user clicks "Open Preview" the manifest id is created from the CMS and sent to Gatsby Cloud. The Content Sync UI then displays a loading state while it checks for a matching manifest id in Gatsby build public directory. At the same time a request is send to the preview webhook and Gatsby Cloud starts a build. If it finds a matching manifest id created from the CMS Gatsby maps data to correct page for preview and adds the manifest file to the build public directory. Now the Gatsby Cloud Preview Runner detects a node manifest to preview and redirects to the preview itself.](../images/content-sync-diagram.png)
4347

48+
[authordocs]: /docs/how-to/plugins-and-themes/creating-a-source-plugin/#enabling-content-sync
4449
[createnodemanifest]: /docs/reference/config-files/actions#unstable_createNodeManifest
4550
[createpage]: /docs/reference/config-files/actions#createPage
4651
[querytracking]: /docs/page-node-dependencies/

packages/gatsby/src/utils/node-manifest.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ export async function processNodeManifests(): Promise<Map<
323323
string,
324324
string
325325
> | null> {
326-
const verboseLogs = process.env.gatsby_log_level === `verbose`
326+
const verboseLogs =
327+
process.env.gatsby_log_level === `verbose` ||
328+
process.env.VERBOSE_NODE_MANIFEST === `true`
327329

328330
const startTime = Date.now()
329331
const { nodeManifests } = store.getState()
@@ -397,7 +399,7 @@ export async function processNodeManifests(): Promise<Map<
397399
...listOfUniqueErrorIds,
398400
].join(`, `)}]. `
399401
: ``) +
400-
`Visit https://gatsby.dev/nodemanifest for more info on Node Manifests`
402+
`To see full warning messages set process.env.VERBOSE_NODE_MANIFEST to "true".\nVisit https://gatsby.dev/nodemanifest for more info on Node Manifests.`
401403
)
402404

403405
// clean up all pending manifests from the store

0 commit comments

Comments
 (0)