-
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.
Merge branch 'master' into feat/package
- Loading branch information
Showing
92 changed files
with
3,612 additions
and
4,035 deletions.
There are no files selected for viewing
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
65 changes: 65 additions & 0 deletions
65
e2e-tests/production-runtime/cypress/integration/modified-exports-ts.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,65 @@ | ||
/** | ||
* Test that page templates have certain exports removed while other files are left alone. | ||
* | ||
* Page templates support only a default exported React component and named exports of | ||
* `config` and `getServerData`, so it's not necessary (or possible) to test other exports | ||
* in page templates. | ||
*/ | ||
|
||
const config = `config exported from a non-page template module` | ||
const getServerData = `getServerData exported from a non-page template module` | ||
const helloWorld = `hello world` | ||
|
||
describe(`modifed exports`, () => { | ||
beforeEach(() => { | ||
cy.visit(`/modified-exports-ts`).waitForRouteChange() | ||
}) | ||
|
||
describe(`page templates`, () => { | ||
it(`should have exports named config removed`, () => { | ||
cy.getTestElement(`modified-exports-page-template-config`) | ||
.invoke(`text`) | ||
.should(`contain`, `undefined`) | ||
}) | ||
it(`should have exports named getServerData removed`, () => { | ||
cy.getTestElement(`modified-exports-page-template-get-server-data`) | ||
.invoke(`text`) | ||
.should(`contain`, `undefined`) | ||
}) | ||
it(`should have imported exports named config left alone`, () => { | ||
cy.getTestElement(`unmodified-exports-page-template-config`) | ||
.invoke(`text`) | ||
.should(`contain`, config) | ||
}) | ||
it(`should have imported exports named getServerData left alone`, () => { | ||
cy.getTestElement(`unmodified-exports-page-template-get-server-data`) | ||
.invoke(`text`) | ||
.should(`contain`, getServerData) | ||
}) | ||
it(`should have other imported exports left alone`, () => { | ||
cy.getTestElement(`unmodified-exports-page-template-hello-world`) | ||
.invoke(`text`) | ||
.should(`contain`, helloWorld) | ||
}) | ||
}) | ||
|
||
describe(`other JS files`, () => { | ||
it(`should have exports named config left alone`, () => { | ||
cy.getTestElement(`unmodified-exports-config`) | ||
.invoke(`text`) | ||
.should(`contain`, config) | ||
}) | ||
|
||
it(`should have exports named getServerData left alone`, () => { | ||
cy.getTestElement(`unmodified-exports-get-server-data`) | ||
.invoke(`text`) | ||
.should(`contain`, getServerData) | ||
}) | ||
|
||
it(`should have other named exports left alone`, () => { | ||
cy.getTestElement(`unmodified-exports-hello-world`) | ||
.invoke(`text`) | ||
.should(`contain`, helloWorld) | ||
}) | ||
}) | ||
}) |
39 changes: 39 additions & 0 deletions
39
e2e-tests/production-runtime/src/pages/modified-exports-ts.tsx
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,39 @@ | ||
import React from "react" | ||
import UnmodifiedExports, { | ||
config as importedConfig, | ||
getServerData as importedGetServerData, | ||
helloWorld, | ||
} from "../components/unmodified-exports" | ||
|
||
function ModifiedExports() { | ||
return ( | ||
<div> | ||
<p>This is the modified exports for page templates test page</p> | ||
{/* Use typeof to avoid runtime error */} | ||
<p data-testid="modified-exports-page-template-config">{typeof config}</p> | ||
<p data-testid="modified-exports-page-template-get-server-data"> | ||
{typeof getServerData} | ||
</p> | ||
<p data-testid="unmodified-exports-page-template-config"> | ||
{importedConfig()} | ||
</p> | ||
<p data-testid="unmodified-exports-page-template-get-server-data"> | ||
{importedGetServerData()} | ||
</p> | ||
<p data-testid="unmodified-exports-page-template-hello-world"> | ||
{helloWorld()} | ||
</p> | ||
<UnmodifiedExports /> | ||
</div> | ||
) | ||
} | ||
|
||
export function config() { | ||
return () => "config exported from a page template module" // Expects config to be a function factory | ||
} | ||
|
||
export function getServerData() { | ||
return "getServerData exported from a page template module" | ||
} | ||
|
||
export default ModifiedExports |
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,6 +1,6 @@ | ||
{ | ||
"name": "babel-preset-gatsby", | ||
"version": "2.11.0-next.1", | ||
"version": "2.11.0-next.2", | ||
"author": "Philipp Spiess <[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
|
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,7 +1,7 @@ | ||
{ | ||
"name": "gatsby-cli", | ||
"description": "Gatsby command-line interface for creating new sites and running Gatsby commands", | ||
"version": "4.11.0-next.1", | ||
"version": "4.11.0-next.3", | ||
"author": "Kyle Mathews <[email protected]>", | ||
"bin": { | ||
"gatsby": "cli.js" | ||
|
@@ -26,7 +26,7 @@ | |
"common-tags": "^1.8.2", | ||
"configstore": "^5.0.1", | ||
"convert-hrtime": "^3.0.0", | ||
"create-gatsby": "^2.11.0-next.1", | ||
"create-gatsby": "^2.11.0-next.2", | ||
"envinfo": "^7.8.1", | ||
"execa": "^5.1.1", | ||
"fs-exists-cached": "^1.0.0", | ||
|
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,7 +1,7 @@ | ||
{ | ||
"name": "gatsby-dev-cli", | ||
"description": "CLI helpers for contributors working on Gatsby", | ||
"version": "4.11.0-next.0", | ||
"version": "4.11.0-next.1", | ||
"author": "Kyle Mathews <[email protected]>", | ||
"bin": { | ||
"gatsby-dev": "./dist/index.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "gatsby-link", | ||
"description": "An enhanced Link component for Gatsby sites with support for resource prefetching", | ||
"version": "4.11.0-next.2", | ||
"version": "4.11.0-next.3", | ||
"author": "Kyle Mathews <[email protected]>", | ||
"bugs": { | ||
"url": "https://github.com/gatsbyjs/gatsby/issues" | ||
|
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,7 +1,7 @@ | ||
{ | ||
"name": "gatsby-plugin-catch-links", | ||
"description": "Intercepts local links from markdown and other non-react pages and does a client-side pushState to avoid the browser having to refresh the page.", | ||
"version": "4.11.0-next.0", | ||
"version": "4.11.0-next.1", | ||
"author": "Kyle Mathews <[email protected]>", | ||
"bugs": { | ||
"url": "https://github.com/gatsbyjs/gatsby/issues" | ||
|
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,7 +1,7 @@ | ||
{ | ||
"name": "gatsby-plugin-cxs", | ||
"description": "Gatsby plugin to add SSR support for ctx", | ||
"version": "4.11.0-next.2", | ||
"version": "4.11.0-next.3", | ||
"author": "Chen-Tai Hou <[email protected]>", | ||
"bugs": { | ||
"url": "https://github.com/gatsbyjs/gatsby/issues" | ||
|
@@ -15,7 +15,7 @@ | |
"babel-preset-gatsby-package": "^2.11.0-next.0", | ||
"cross-env": "^7.0.3", | ||
"cxs": "^6.2.0", | ||
"gatsby-plugin-utils": "^3.5.0-next.1" | ||
"gatsby-plugin-utils": "^3.5.0-next.2" | ||
}, | ||
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-cxs#readme", | ||
"keywords": [ | ||
|
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,7 +1,7 @@ | ||
{ | ||
"name": "gatsby-plugin-feed", | ||
"description": "Creates an RSS feed for your Gatsby site.", | ||
"version": "4.11.0-next.2", | ||
"version": "4.11.0-next.3", | ||
"author": "Nicholas Young <[email protected]>", | ||
"bugs": { | ||
"url": "https://github.com/gatsbyjs/gatsby/issues" | ||
|
@@ -11,7 +11,7 @@ | |
"@hapi/joi": "^15.1.1", | ||
"common-tags": "^1.8.2", | ||
"fs-extra": "^10.0.0", | ||
"gatsby-plugin-utils": "^3.5.0-next.1", | ||
"gatsby-plugin-utils": "^3.5.0-next.2", | ||
"lodash.merge": "^4.6.2", | ||
"rss": "^1.2.2" | ||
}, | ||
|
Oops, something went wrong.