-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby): enable babel in deps (#15284)
* Add modules that use gatsby to query compiler * Run babel on modules that use Gatsby * Update snapshot * Set higher timeout in test * Apply suggestions from code review Co-Authored-By: Ward Peeters <ward@coding-tech.com> * Missing ) * Suggestions from Ward * Add tests for include and exclude functions * Add one more test for exclude function * moar tests * add some sanity e2e tests * Fix production runtime tests * fix(e2e-production-runtime): adjust siteMetadata to shape gatsby-seo needs
- Loading branch information
1 parent
8bcd843
commit 4ea3fa1
Showing
16 changed files
with
255 additions
and
47 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
e2e-tests/development-runtime/cypress/integration/functionality/queries-in-packages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
describe(`queries in packages`, () => { | ||
beforeEach(() => { | ||
cy.visit(`/queries-in-packages`).waitForRouteChange() | ||
}) | ||
|
||
it(`Should extract and run query from gatsby component`, () => { | ||
// we are using `gatsby-seo` package which sets | ||
// window's title to title passed as prop followed by siteMetadata.title | ||
cy.title().should( | ||
`eq`, | ||
`Testing queries in packages | Gatsby Default Starter` | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
e2e-tests/development-runtime/src/pages/queries-in-packages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react" | ||
import SEO from "gatsby-seo" | ||
|
||
import Layout from "../components/layout" | ||
|
||
export default () => ( | ||
<Layout> | ||
<SEO | ||
title="Testing queries in packages" | ||
keywords={[`gatsby`, `application`, `react`, `queries in component`]} | ||
/> | ||
</Layout> | ||
) |
14 changes: 14 additions & 0 deletions
14
e2e-tests/production-runtime/cypress/integration/queries-in-packages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
describe(`queries in packages`, () => { | ||
beforeEach(() => { | ||
cy.visit(`/queries-in-packages`).waitForRouteChange() | ||
}) | ||
|
||
it(`Should extract and run query from gatsby component`, () => { | ||
// we are using `gatsby-seo` package which sets | ||
// window's title to title passed as prop followed by siteMetadata.title | ||
cy.title().should( | ||
`eq`, | ||
`Testing queries in packages | Gatsby Default Starter` | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
e2e-tests/production-runtime/src/pages/queries-in-packages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import SEO from 'gatsby-seo' | ||
|
||
import Layout from '../components/layout' | ||
|
||
export default () => ( | ||
<Layout> | ||
<SEO | ||
title="Testing queries in packages" | ||
keywords={[`gatsby`, `application`, `react`, `queries in component`]} | ||
/> | ||
</Layout> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { store } from "../redux" | ||
import { memoize } from "lodash" | ||
import rpt from "read-package-tree" | ||
import { promisify } from "util" | ||
|
||
const rptAsync = promisify(rpt) | ||
// Returns [Object] with name and path | ||
module.exports = async () => { | ||
module.exports = memoize(async () => { | ||
const { program } = store.getState() | ||
const allNodeModules = await rptAsync( | ||
program.directory, | ||
// Include anything that has `gatsby` in its name but not `gatsby` itself | ||
(node, moduleName) => /gatsby/.test(moduleName) && moduleName !== `gatsby` | ||
) | ||
return allNodeModules.children | ||
} | ||
}) |
Oops, something went wrong.