Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
"@types/express": "^4.17.3",
"@types/fs-extra": "^8.1.1",
"@types/got": "^9.6.11",
"@types/jaeger-client": "^3.15.4",
"@types/jaeger-client": "^3.18.0",
"@types/jest": "^24.9.1",
"@types/joi": "^14.3.4",
"@types/lodash": "^4.14.168",
"@types/node": "^12.20.6",
"@types/node-fetch": "^2.5.8",
"@types/node-fetch": "^2.5.10",
"@types/normalize-path": "^3.0.0",
"@types/react": "^16.9.56",
"@types/semver": "^7.3.4",
"@types/signal-exit": "^3.0.0",
"@types/stack-trace": "^0.0.29",
"@types/webpack-merge": "^4.1.5",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.20.0",
"@typescript-eslint/parser": "^4.22.0",
"babel-jest": "^24.9.0",
"chalk": "^4.1.0",
"chokidar": "^3.5.1",
Expand Down Expand Up @@ -60,7 +60,7 @@
"lerna": "^3.22.1",
"lint-staged": "^10.5.4",
"markdown-magic": "^0.2.1",
"npm-packlist": "^2.1.4",
"npm-packlist": "^2.1.5",
"npm-run-all": "4.1.5",
"plop": "^1.9.1",
"prettier": "2.1.2",
Expand Down Expand Up @@ -112,7 +112,7 @@
"private": true,
"resolutions": {
"theme-ui": "0.4.0-rc.14",
"csstype": "2.6.14"
"csstype": "2.6.17"
},
"scripts": {
"bootstrap": "npm-run-all -s check-versions \"lerna-prepare -- --{@}\" --",
Expand Down
3 changes: 2 additions & 1 deletion packages/gatsby-plugin-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"babel-preset-gatsby-package": "^1.4.0-next.0",
"cross-env": "^7.0.3"
"cross-env": "^7.0.3",
"gatsby-plugin-utils": "^1.4.0-next.0"
},
"peerDependencies": {
"gatsby": "^3.0.0-next.0"
Expand Down
51 changes: 41 additions & 10 deletions packages/gatsby-plugin-flow/src/__tests__/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,48 @@
import { onCreateBabelConfig } from "../gatsby-node"
import * as path from "path"

describe(`gatsby-plugin-flow`, () => {
describe(`onCreateBabelConfig`, () => {
it(`sets the correct babel preset`, () => {
const actions = { setBabelPreset: jest.fn() }
import { testPluginOptionsSchema } from "gatsby-plugin-utils"

onCreateBabelConfig({ actions }, null)
import { onCreateBabelConfig, pluginOptionsSchema } from "../gatsby-node"

expect(actions.setBabelPreset).toHaveBeenCalledTimes(1)
expect(actions.setBabelPreset).toHaveBeenCalledWith({
name: expect.stringContaining(path.join(`@babel`, `preset-flow`)),
})
describe(`onCreateBabelConfig`, () => {
it(`sets the correct babel preset`, () => {
const actions = { setBabelPreset: jest.fn() }

onCreateBabelConfig({ actions })

expect(actions.setBabelPreset).toHaveBeenCalledTimes(1)
expect(actions.setBabelPreset).toHaveBeenCalledWith({
name: expect.stringContaining(path.join(`@babel`, `preset-flow`)),
})
})
})

describe(`pluginOptionsSchema`, () => {
it(`should provide meaningful errors when fields are invalid`, async () => {
const expectedErrors = [`"optionA" is not allowed`]

const { isValid, errors } = await testPluginOptionsSchema(
pluginOptionsSchema,
{
optionA: `This option shouldn't exist`,
}
)

expect(isValid).toBe(false)
expect(errors).toEqual(expectedErrors)
})

it.each`
options
${undefined}
${{}}
`(`should validate the schema: $options`, async ({ options }) => {
const { isValid, errors } = await testPluginOptionsSchema(
pluginOptionsSchema,
options
)

expect(isValid).toBe(true)
expect(errors).toEqual([])
})
})
4 changes: 3 additions & 1 deletion packages/gatsby-plugin-flow/src/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export const onCreateBabelConfig = ({ actions }, pluginOptions) => {
export const onCreateBabelConfig = ({ actions }) => {
actions.setBabelPreset({
name: require.resolve(`@babel/preset-flow`),
})
}

export const pluginOptionsSchema = ({ Joi }) => Joi.object({})
6 changes: 3 additions & 3 deletions packages/gatsby-plugin-netlify-cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"dependencies": {
"@pieh/friendly-errors-webpack-plugin": "1.7.0-chalk-2",
"copy-webpack-plugin": "^7.0.0",
"html-webpack-plugin": "^5.2.0",
"html-webpack-tags-plugin": "^3.0.0",
"html-webpack-plugin": "^5.3.1",
"html-webpack-tags-plugin": "^3.0.1",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "1.3.9",
"mini-css-extract-plugin": "1.5.0",
"netlify-identity-widget": "^1.9.1",
"webpack": "^5.23.00"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"fs-extra": "^8.1.0",
"kebab-hash": "^0.1.2",
"lodash": "^4.17.21",
"webpack-assets-manifest": "^5.0.1"
"webpack-assets-manifest": "^5.0.5"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-preload-fonts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"chalk": "^4.1.0",
"date-fns": "^2.16.1",
"date-fns": "^2.21.1",
"fs-extra": "^8.1.0",
"gatsby-core-utils": "^2.4.0-next.3",
"graphql-request": "^1.8.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sitemap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The options are as follows:
- `output` (string = `/sitemap`) Folder path where sitemaps are stored.
- `createLinkInHead` (boolean = true) Whether to populate the `<head>` of your site with a link to the sitemap.
- `entryLimit` (number = 45000) Number of entries per sitemap file, a sitemap index and multiple sitemaps are created if you have more entries.
- `exclude` (string[] = []) An array of paths to exclude from the sitemap. While this is usually an array of strings it is possible to enter other data types into this array for custom filtering. Doing so will require customization of the [`filterPages`](#filterPages) function.
- `excludes` (string[] = []) An array of paths to exclude from the sitemap. While this is usually an array of strings it is possible to enter other data types into this array for custom filtering. Doing so will require customization of the [`filterPages`](#filterPages) function.
- `query` (GraphQL Query) The query for the data you need to generate the sitemap. It's required to get the site's URL, if you are not fetching it from `site.siteMetadata.siteUrl`, you will need to set a custom [`resolveSiteUrl`](#resolveSiteUrl) function. If you override the query, you may need to pass in a custom [`resolvePagePath`](#resolvePagePath), [`resolvePages`](#resolvePages) to keep everything working. If you fetch pages without using `allSitePage.nodes` query structure you will definately need to customize the [`resolvePages`](#resolvePages) function.
- [`resolveSiteUrl`](#resolveSiteUrl) (function) Takes the output of the data query and lets you return the site URL. Sync or async functions allowed.
- [`resolvePagePath`](#resolvePagePath) (function) Takes a page object and returns the uri of the page (no domain or protocol).
Expand Down
6 changes: 3 additions & 3 deletions packages/gatsby-source-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@graphql-tools/links": "^7.0.3",
"@graphql-tools/utils": "^7.0.2",
"@graphql-tools/wrap": "^7.0.1",
"@graphql-tools/links": "^7.1.0",
"@graphql-tools/utils": "^7.7.3",
"@graphql-tools/wrap": "^7.0.5",
"apollo-link": "1.2.14",
"apollo-link-http": "^1.5.17",
"dataloader": "^2.0.0",
Expand Down
Loading