gatsby-plugin-layout
Advanced tools
Comparing version 1.0.0-rc.3 to 1.0.0-rc.4
@@ -6,2 +6,8 @@ # Change Log | ||
<a name="1.0.0-rc.4"></a> | ||
# [1.0.0-rc.4](https://github.com/gatsbyjs/gatsby/compare/gatsby-plugin-layout@1.0.0-rc.3...gatsby-plugin-layout@1.0.0-rc.4) (2018-09-07) | ||
**Note:** Version bump only for package gatsby-plugin-layout | ||
<a name="1.0.0-rc.3"></a> | ||
@@ -8,0 +14,0 @@ |
"use strict"; | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
@@ -13,3 +11,2 @@ | ||
var component = _ref2.component; | ||
var userSpecifiedPath = true; | ||
var defaultLayoutComponentPath = "src/layouts/index"; | ||
@@ -20,3 +17,2 @@ | ||
component = path.join(store.getState().program.directory, defaultLayoutComponentPath); | ||
userSpecifiedPath = false; | ||
} | ||
@@ -26,8 +22,2 @@ | ||
throw new Error("You can only have single instance of gatsby-plugin-layout in your gatsby-config.js"); | ||
} else if (!fs.existsSync(component)) { | ||
if (userSpecifiedPath) { | ||
throw new Error("Couldn't find layout component at specified path: \"" + component + "\"."); | ||
} else { | ||
throw new Error("Couldn't find layout component at \"" + defaultLayoutComponentPath + ".\n\n" + "Please create layout component in that location or specify path to layout component in gatsby-config.js"); | ||
} | ||
} | ||
@@ -34,0 +24,0 @@ |
{ | ||
"name": "gatsby-plugin-layout", | ||
"version": "1.0.0-rc.3", | ||
"version": "1.0.0-rc.4", | ||
"description": "Stub description for gatsby-plugin-layout", | ||
@@ -33,3 +33,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "ded70b070587aa1a6097f3d5dcc607a9bb3479e7" | ||
"gitHead": "2a93b851ea620f3c8a8012724321beced179cb8a" | ||
} |
@@ -9,4 +9,15 @@ "use strict"; | ||
var Layout = preferDefault(require(GATSBY_LAYOUT_COMPONENT_PATH)); // eslint-disable-next-line react/prop-types,react/display-name | ||
var Layout; | ||
try { | ||
Layout = preferDefault(require(GATSBY_LAYOUT_COMPONENT_PATH)); | ||
} catch (e) { | ||
if (e.toString().indexOf("Error: Cannot find module") !== -1) { | ||
throw new Error("Couldn't find layout component at \"" + GATSBY_LAYOUT_COMPONENT_PATH + ".\n\n" + "Please create layout component in that location or specify path to layout component in gatsby-config.js"); | ||
} else { | ||
throw e; | ||
} | ||
} // eslint-disable-next-line react/prop-types,react/display-name | ||
module.exports = function (_ref) { | ||
@@ -13,0 +24,0 @@ var element = _ref.element, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
10278
1