Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gatsby-source-wordpress): remove runApisInSteps and call runApi…
…Steps for each gatsby-node api (#37039) remove runApisInSteps and call runApiSteps for each gatsby-node api
- Loading branch information
1 parent
b69709c
commit 88b9dc5
Showing
3 changed files
with
33 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,64 @@ | ||
import { runApisInSteps } from "./utils/run-steps" | ||
import { runApiSteps, findApiName } from "./utils/run-steps" | ||
import * as steps from "./steps" | ||
|
||
module.exports = runApisInSteps({ | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
"onPluginInit|unstable_onPluginInit": [ | ||
const pluginInitApiName = findApiName(`onPluginInit|unstable_onPluginInit`) | ||
|
||
exports[pluginInitApiName] = runApiSteps( | ||
[ | ||
steps.setGatsbyApiToState, | ||
steps.setErrorMap, | ||
steps.tempPreventMultipleInstances, | ||
steps.setRequestHeaders, | ||
], | ||
pluginInitApiName | ||
) | ||
|
||
pluginOptionsSchema: steps.pluginOptionsSchema, | ||
exports.pluginOptionsSchema = steps.pluginOptionsSchema | ||
|
||
createSchemaCustomization: [ | ||
exports.createSchemaCustomization = runApiSteps( | ||
[ | ||
steps.setGatsbyApiToState, | ||
steps.ensurePluginRequirementsAreMet, | ||
steps.ingestRemoteSchema, | ||
steps.createSchemaCustomization, | ||
], | ||
`createSchemaCustomization` | ||
) | ||
|
||
sourceNodes: [ | ||
exports.sourceNodes = runApiSteps( | ||
[ | ||
steps.setGatsbyApiToState, | ||
steps.persistPreviouslyCachedImages, | ||
steps.sourceNodes, | ||
steps.setImageNodeIdCache, | ||
], | ||
`sourceNodes` | ||
) | ||
|
||
onPreExtractQueries: [ | ||
steps.onPreExtractQueriesInvokeLeftoverPreviewCallbacks, | ||
], | ||
exports.onPreExtractQueries = runApiSteps( | ||
[steps.onPreExtractQueriesInvokeLeftoverPreviewCallbacks], | ||
`onPreExtractQueries` | ||
) | ||
|
||
onPostBuild: [steps.setImageNodeIdCache, steps.logPostBuildWarnings], | ||
exports.onPostBuild = runApiSteps( | ||
[steps.setImageNodeIdCache, steps.logPostBuildWarnings], | ||
`onPostBuild` | ||
) | ||
|
||
onCreatePage: [ | ||
exports.onCreatePage = runApiSteps( | ||
[ | ||
steps.onCreatepageSavePreviewNodeIdToPageDependency, | ||
steps.onCreatePageRespondToPreviewStatusQuery, | ||
], | ||
`onCreatePage` | ||
) | ||
|
||
onCreateDevServer: [ | ||
exports.onCreateDevServer = runApiSteps( | ||
[ | ||
steps.imageRoutes, | ||
steps.setImageNodeIdCache, | ||
steps.logPostBuildWarnings, | ||
steps.startPollingForContentUpdates, | ||
], | ||
}) | ||
`onCreateDevServer` | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters