Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/babel-preset-gatsby/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export function loadCachedConfig() {
export default function preset(_, options = {}) {
let { targets = null } = options

// TODO(v3): Remove process.env.GATSBY_BUILD_STAGE, needs to be passed as an option
const stage = options.stage || process.env.GATSBY_BUILD_STAGE || `test`
const stage = options.stage || `test`
const pluginBabelConfig = loadCachedConfig()
let isBrowser
// unused because of cloud builds
Expand Down
20 changes: 1 addition & 19 deletions packages/gatsby-plugin-feed/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ const publicPath = `./public`

exports.pluginOptionsSchema = pluginOptionsSchema

// TODO: remove in the next major release
// A default function to transform query data into feed entries.
const serialize = ({ query: { site, allMarkdownRemark } }) =>
allMarkdownRemark.edges.map(edge => {
return {
...edge.node.frontmatter,
description: edge.node.excerpt,
url: site.siteMetadata.siteUrl + edge.node.fields.slug,
guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
custom_elements: [{ "content:encoded": edge.node.html }],
}
})

exports.onPostBuild = async ({ graphql }, pluginOptions) => {
/*
* Run the site settings query to gather context, then
Expand All @@ -47,12 +34,7 @@ exports.onPostBuild = async ({ graphql }, pluginOptions) => {
...feed,
}

const serializer =
feed.serialize && typeof feed.serialize === `function`
? feed.serialize
: serialize

const rssFeed = (await serializer(locals)).reduce((merged, item) => {
const rssFeed = (await feed.serialize(locals)).reduce((merged, item) => {
merged.item(item)
return merged
}, new RSS(setup(locals)))
Expand Down
8 changes: 5 additions & 3 deletions packages/gatsby-plugin-google-analytics/src/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
exports.pluginOptionsSchema = ({ Joi }) =>
// TODO: make sure that trackingId gets required() when releasing a major version
Joi.object({
trackingId: Joi.string().description(
`The property ID; the tracking code won't be generated without it`
),
trackingId: Joi.string()
.description(
`The property ID; the tracking code won't be generated without it`
)
.required(),
head: Joi.boolean()
.default(false)
.description(
Expand Down