Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 98bec1c

Browse files
committed
merge changes
1 parent 5504008 commit 98bec1c

14 files changed

+52
-52
lines changed

www/gatsby-config.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,17 @@ if (langCodes.length > 0) {
6060
`docs/docs/data-fetching.md`,
6161
]
6262
dynamicPlugins.push(
63-
...langCodes.map(code => ({
64-
resolve: `gatsby-source-git`,
65-
options: {
66-
name: `docs-${code}`,
67-
remote: `https://github.com/gatsbyjs/gatsby-${code}.git`,
68-
branch: `master`,
69-
patterns: [`docs/**`, ...naughtyFiles.map(file => `!${file}`)],
70-
},
71-
})),
63+
...langCodes.map(code => {
64+
return {
65+
resolve: `gatsby-source-git`,
66+
options: {
67+
name: `docs-${code}`,
68+
remote: `https://github.com/gatsbyjs/gatsby-${code}.git`,
69+
branch: `master`,
70+
patterns: [`docs/**`, ...naughtyFiles.map(file => `!${file}`)],
71+
},
72+
}
73+
}),
7274
{
7375
resolve: `gatsby-plugin-i18n`, // local plugin
7476
options: {

www/src/components/__tests__/mdx-link.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ import React from "react"
22
import { render } from "@testing-library/react"
33
import MdxLink, { shouldRenderRawLink } from "../mdx-link"
44

5-
jest.mock("../localized-link", () => {
5+
jest.mock(`../localized-link`, () =>
66
// Mock the component to use a different tag so we can easily differentiate
7-
return () => <span />
8-
})
7+
() => <span />
8+
)
99

10-
describe("mdx-link", () => {
11-
it("creates a raw link on external links", () => {
10+
describe(`mdx-link`, () => {
11+
it(`creates a raw link on external links`, () => {
1212
const { container } = render(
1313
<MdxLink href="https://github.com/gatsbyjs.gatsby" />
1414
)
15-
expect(container.firstChild.nodeName).toBe("A")
15+
expect(container.firstChild.nodeName).toBe(`A`)
1616
})
1717

18-
it("creates a raw link on hashes", () => {
18+
it(`creates a raw link on hashes`, () => {
1919
const { container } = render(<MdxLink href="#gatsby" />)
20-
expect(container.firstChild.nodeName).toBe("A")
20+
expect(container.firstChild.nodeName).toBe(`A`)
2121
})
2222

23-
it("creates a raw link on files", () => {
23+
it(`creates a raw link on files`, () => {
2424
const { container } = render(<MdxLink href="/gatsby-cheat-sheet.pdf" />)
25-
expect(container.firstChild.nodeName).toBe("A")
25+
expect(container.firstChild.nodeName).toBe(`A`)
2626
})
2727

28-
it("creates a localized link for internal links", () => {
28+
it(`creates a localized link for internal links`, () => {
2929
const { container } = render(<MdxLink href="/docs" />)
30-
expect(container.firstChild.nodeName).toBe("SPAN")
30+
expect(container.firstChild.nodeName).toBe(`SPAN`)
3131
})
3232
})

www/src/components/email-capture-form.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const SuccessMessage = styled(`div`)`
8282

8383
function Form({ isHomepage, portalId, formId, sfdcCampaignId, onSuccess }) {
8484
const emailRef = React.useRef(null)
85-
const [errorMessage, setErrorMessage] = React.useState("")
85+
const [errorMessage, setErrorMessage] = React.useState(``)
8686
const [fieldErrors, setFieldErrors] = React.useState({})
8787

8888
const onSubmit = React.useCallback(
@@ -220,12 +220,12 @@ function Form({ isHomepage, portalId, formId, sfdcCampaignId, onSuccess }) {
220220
}
221221

222222
function EmailCaptureForm({
223-
formId = "089352d8-a617-4cba-ba46-6e52de5b6a1d",
223+
formId = `089352d8-a617-4cba-ba46-6e52de5b6a1d`,
224224
signupMessage = `Enjoyed this post? Receive the next one in your inbox!`,
225225
isHomepage = false,
226226
className = ``,
227227
}) {
228-
const [successMessage, setSuccessMessage] = React.useState("")
228+
const [successMessage, setSuccessMessage] = React.useState(``)
229229

230230
const FormComponent = props => (
231231
<Form

www/src/components/lang-list.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ import langs from "../../i18n.json"
77
export default function LangList() {
88
return (
99
<ul>
10-
{langs.map(({ name, localName, code }) => {
11-
return (
12-
<li key={code}>
13-
<a href={`https://github.com/gatsbyjs/gatsby-${code}`}>
14-
{name} / {localName}
15-
</a>
16-
</li>
17-
)
18-
})}
10+
{langs.map(({ name, localName, code }) => (
11+
<li key={code}>
12+
<a href={`https://github.com/gatsbyjs/gatsby-${code}`}>
13+
{name} / {localName}
14+
</a>
15+
</li>
16+
))}
1917
</ul>
2018
)
2119
}

www/src/components/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const LocaleContext = React.createContext(defaultLang)
1919

2020
export default function DefaultLayout({ location, locale, children }) {
2121
return (
22-
<IconContext.Provider value={{ style: { verticalAlign: "middle" } }}>
22+
<IconContext.Provider value={{ style: { verticalAlign: `middle` } }}>
2323
<LocaleContext.Provider value={locale || defaultLang}>
2424
<Global styles={globalStyles} />
2525
<SiteMetadata pathname={location.pathname} locale={locale} />

www/src/components/page-with-plugin-searchbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Fragment } from "react"
44
import loadable from "@loadable/component"
55
import { mediaQueries } from "gatsby-design-tokens/dist/theme-gatsbyjs-org"
66

7-
const PluginSearchBar = loadable(() => import("./plugin-searchbar-body"))
7+
const PluginSearchBar = loadable(() => import(`./plugin-searchbar-body`))
88

99
const PageWithPluginSearchBar = ({ isPluginsIndex, location, children }) => (
1010
<Fragment>

www/src/components/script-loader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ function ScriptLoader({ async = true, children, src }) {
99
useEffect(() => {
1010
if (
1111
ref.current.lastChild &&
12-
ref.current.lastChild.getAttribute("src") === src
12+
ref.current.lastChild.getAttribute(`src`) === src
1313
) {
1414
return
1515
}
16-
const script = document.createElement("script")
17-
script.setAttribute("async", async)
18-
script.setAttribute("src", src)
16+
const script = document.createElement(`script`)
17+
script.setAttribute(`async`, async)
18+
script.setAttribute(`src`, src)
1919

2020
ref.current.appendChild(script)
2121
}, [])

www/src/templates/template-api-markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default function APITemplate({ data, location, pageContext }) {
119119
>
120120
<div>
121121
<MDXRenderer slug={page.fields.slug}>{page.body}</MDXRenderer>
122-
<h2>{page.frontmatter.contentsHeading || "APIs"}</h2>
122+
<h2>{page.frontmatter.contentsHeading || `APIs`}</h2>
123123
<APIContents docs={mergedFuncs} />
124124
<h2>Reference</h2>
125125
<APIReference

www/src/templates/template-docs-markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function DocsTemplate({ data, location, pageContext: { next, prev } }) {
3737
return (
3838
<PageWithSidebar
3939
location={location}
40-
enableScrollSync={urlSegment === "tutorial"}
40+
enableScrollSync={urlSegment === `tutorial`}
4141
>
4242
<Helmet>
4343
<title>{page.frontmatter.title}</title>

www/src/utils/i18n.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const allLangs = require("../../i18n.json")
2-
const defaultLang = "en"
1+
const allLangs = require(`../../i18n.json`)
2+
const defaultLang = `en`
33

44
// Only allow languages defined in the LOCALES env variable.
55
// This allows us to compile only languages that are "complete" or test only
@@ -10,7 +10,7 @@ function getLanguages() {
1010
return []
1111
}
1212

13-
const langCodes = process.env.LOCALES.split(" ")
13+
const langCodes = process.env.LOCALES.split(` `)
1414
const langs = []
1515
for (let code of langCodes) {
1616
const lang = allLangs.find(lang => lang.code === code)

www/src/utils/node/docs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
241241
// Add slugs for docs pages
242242
if (fileNode.sourceInstanceName === `docs`) {
243243
slug = docSlugFromPath(parsedFilePath)
244-
locale = "en"
244+
locale = `en`
245245

246246
// Set released status and `published at` for blog posts.
247247
if (_.includes(parsedFilePath.dir, `blog`)) {
@@ -286,7 +286,7 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
286286
fileNode.sourceInstanceName === `packages` &&
287287
parsedFilePath.name === `README`
288288
) {
289-
locale = "en"
289+
locale = `en`
290290
slug = `/packages/${parsedFilePath.dir}/`
291291
createNodeField({
292292
node,

www/src/utils/node/starters.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
7979
})
8080
}
8181

82-
const fetchGithubData = async ({ owner, repo, reporter }, retry = 0) => {
83-
return githubApiClient
82+
const fetchGithubData = async ({ owner, repo, reporter }, retry = 0) =>
83+
githubApiClient
8484
.request(
8585
`
8686
query {
@@ -106,7 +106,7 @@ const fetchGithubData = async ({ owner, repo, reporter }, retry = 0) => {
106106
}
107107

108108
const githubUrl = `https://github.com/${owner}/${repo}`
109-
const { url } = await fetch(githubUrl, { method: "HEAD" })
109+
const { url } = await fetch(githubUrl, { method: `HEAD` })
110110
const { owner: newOwner, name: newRepo } = parseGHUrl(url)
111111

112112
reporter.warn(
@@ -118,7 +118,6 @@ const fetchGithubData = async ({ owner, repo, reporter }, retry = 0) => {
118118
retry + 1
119119
)
120120
})
121-
}
122121

123122
exports.onCreateNode = ({ node, actions, getNode, reporter }) => {
124123
const { createNodeField } = actions

www/src/utils/sidebar/item-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const itemListLookup = {
5454

5555
function getItemList(path) {
5656
const { basePath } = getLocaleAndBasePath(path)
57-
const [urlSegment] = basePath.split("/").slice(1)
57+
const [urlSegment] = basePath.split(`/`).slice(1)
5858
return itemListLookup[urlSegment]
5959
}
6060

www/src/views/starter/source.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ const Source = ({ startersYaml, repoUrl, starter }) => (
7777
}}
7878
>
7979
<TechWithIcon icon={CodesandboxIcon}>CodeSandbox</TechWithIcon>
80-
</a>{" "}
80+
</a>
81+
{` `}
8182
&nbsp;
8283
<a
8384
href={`https://app.netlify.com/start/deploy?repository=${repoUrl}`}

0 commit comments

Comments
 (0)