Skip to content

Commit 9fbbde1

Browse files
GatsbyJS BotLekoArts
andauthored
fix(gatsby-plugin-gatsby-cloud): Copying manifest (#31092) (#31094)
Co-authored-by: Lennart <[email protected]>
1 parent 668aa43 commit 9fbbde1

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

integration-tests/functions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"start-server-and-test": "^1.11.3"
2323
},
2424
"dependencies": {
25-
"gatsby": "3.4.0-next.2-dev-1618947033238",
26-
"gatsby-plugin-gatsby-cloud": "latest",
25+
"gatsby": "^3.5.0-next.0",
26+
"gatsby-plugin-gatsby-cloud": "^2.5.0-next.0",
2727
"react": "^17.0.1",
2828
"react-dom": "^17.0.1"
2929
}

integration-tests/gatsby-pipeline/gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ module.exports = {
1515
},
1616
`gatsby-transformer-sharp`,
1717
`gatsby-plugin-sharp`,
18+
`gatsby-plugin-gatsby-cloud`
1819
],
1920
}

integration-tests/gatsby-pipeline/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
"dependencies": {
77
"gatsby": "latest",
88
"gatsby-image": "latest",
9+
"gatsby-plugin-gatsby-cloud": "latest",
910
"gatsby-plugin-react-helmet": "latest",
1011
"gatsby-plugin-sharp": "latest",
1112
"gatsby-source-filesystem": "latest",
1213
"gatsby-transformer-sharp": "latest",
13-
"prop-types": "^15.6.2",
14-
"react": "^16.9.0",
15-
"react-dom": "^16.9.0",
16-
"react-helmet": "^5.2.0"
14+
"prop-types": "^15.7.2",
15+
"react": "^17.0.2",
16+
"react-dom": "^17.0.2",
17+
"react-helmet": "^6.1.0"
1718
},
1819
"keywords": [
1920
"gatsby"
@@ -38,4 +39,4 @@
3839
"engines": {
3940
"node": ">=12.13.0"
4041
}
41-
}
42+
}

integration-tests/gatsby-pipeline/src/components/seo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
22
import PropTypes from "prop-types"
3-
import Helmet from "react-helmet"
3+
import { Helmet } from "react-helmet"
44
import { StaticQuery, graphql } from "gatsby"
55

66
function SEO({ description, lang, meta, keywords, title }) {
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
import { copyFile } from "fs-extra"
1+
import { copyFile, existsSync } from "fs-extra"
22
import {
33
PUBLIC_FUNCTIONS_FILENAME,
44
CACHE_FUNCTIONS_FILENAME,
55
} from "./constants"
66

7-
export default async function copyFunctionsManifest(pluginData, siteDirectory) {
7+
export default async function copyFunctionsManifest(pluginData) {
88
const { publicFolder, functionsFolder } = pluginData
99
const manifestPath = functionsFolder(CACHE_FUNCTIONS_FILENAME)
1010
const publicManifestPath = publicFolder(PUBLIC_FUNCTIONS_FILENAME)
1111

12-
await copyFile(manifestPath, publicManifestPath)
12+
const hasManifestFile = existsSync(manifestPath)
13+
14+
if (hasManifestFile) {
15+
await copyFile(manifestPath, publicManifestPath)
16+
}
1317
}

packages/gatsby-plugin-gatsby-cloud/src/gatsby-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ exports.onPostBuild = async (
5656
await Promise.all([
5757
buildHeadersProgram(pluginData, pluginOptions, reporter),
5858
createRedirects(pluginData, redirects, rewrites),
59-
copyFunctionsManifest(pluginData, redirects, rewrites),
59+
copyFunctionsManifest(pluginData),
6060
])
6161
}
6262

0 commit comments

Comments
 (0)