Skip to content

Commit

Permalink
fix(gatsby-plugin-gatsby-cloud): Copying manifest (#31092) (#31094)
Browse files Browse the repository at this point in the history
Co-authored-by: Lennart <lekoarts@gmail.com>
  • Loading branch information
GatsbyJS Bot and LekoArts committed Apr 28, 2021
1 parent 668aa43 commit 9fbbde1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions integration-tests/functions/package.json
Expand Up @@ -22,8 +22,8 @@
"start-server-and-test": "^1.11.3"
},
"dependencies": {
"gatsby": "3.4.0-next.2-dev-1618947033238",
"gatsby-plugin-gatsby-cloud": "latest",
"gatsby": "^3.5.0-next.0",
"gatsby-plugin-gatsby-cloud": "^2.5.0-next.0",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
Expand Down
1 change: 1 addition & 0 deletions integration-tests/gatsby-pipeline/gatsby-config.js
Expand Up @@ -15,5 +15,6 @@ module.exports = {
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-gatsby-cloud`
],
}
11 changes: 6 additions & 5 deletions integration-tests/gatsby-pipeline/package.json
Expand Up @@ -6,14 +6,15 @@
"dependencies": {
"gatsby": "latest",
"gatsby-image": "latest",
"gatsby-plugin-gatsby-cloud": "latest",
"gatsby-plugin-react-helmet": "latest",
"gatsby-plugin-sharp": "latest",
"gatsby-source-filesystem": "latest",
"gatsby-transformer-sharp": "latest",
"prop-types": "^15.6.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-helmet": "^5.2.0"
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0"
},
"keywords": [
"gatsby"
Expand All @@ -38,4 +39,4 @@
"engines": {
"node": ">=12.13.0"
}
}
}
2 changes: 1 addition & 1 deletion integration-tests/gatsby-pipeline/src/components/seo.js
@@ -1,6 +1,6 @@
import React from "react"
import PropTypes from "prop-types"
import Helmet from "react-helmet"
import { Helmet } from "react-helmet"
import { StaticQuery, graphql } from "gatsby"

function SEO({ description, lang, meta, keywords, title }) {
Expand Down
@@ -1,13 +1,17 @@
import { copyFile } from "fs-extra"
import { copyFile, existsSync } from "fs-extra"
import {
PUBLIC_FUNCTIONS_FILENAME,
CACHE_FUNCTIONS_FILENAME,
} from "./constants"

export default async function copyFunctionsManifest(pluginData, siteDirectory) {
export default async function copyFunctionsManifest(pluginData) {
const { publicFolder, functionsFolder } = pluginData
const manifestPath = functionsFolder(CACHE_FUNCTIONS_FILENAME)
const publicManifestPath = publicFolder(PUBLIC_FUNCTIONS_FILENAME)

await copyFile(manifestPath, publicManifestPath)
const hasManifestFile = existsSync(manifestPath)

if (hasManifestFile) {
await copyFile(manifestPath, publicManifestPath)
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-gatsby-cloud/src/gatsby-node.js
Expand Up @@ -56,7 +56,7 @@ exports.onPostBuild = async (
await Promise.all([
buildHeadersProgram(pluginData, pluginOptions, reporter),
createRedirects(pluginData, redirects, rewrites),
copyFunctionsManifest(pluginData, redirects, rewrites),
copyFunctionsManifest(pluginData),
])
}

Expand Down

0 comments on commit 9fbbde1

Please sign in to comment.