Skip to content

Commit b160811

Browse files
authored
Merge pull request #11822 from ethereum/dev
NextJS migration
2 parents 3131a03 + 791cf2b commit b160811

File tree

4,819 files changed

+135070
-233288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,819 files changed

+135070
-233288
lines changed

.env.example

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
# rename this file to .env and supply the values listed below
22
# also make sure they are available to the build tool (e.g. Netlify)
3-
# warning: variables prefixed with GATSBY_ will be made available to client-side code
3+
# warning: variables prefixed with NEXT_PUBLIC_ will be made available to client-side code
44
# be careful not to expose sensitive data (e.g. your Algolia admin key)
5-
ALGOLIA_ADMIN_KEY=insertValue
6-
ETHERSCAN_API_KEY=insertValue
7-
GATSBY_ALGOLIA_APP_ID=insertValue
8-
GATSBY_ALGOLIA_SEARCH_KEY=insertValue
9-
GATSBY_ALGOLIA_BASE_SEARCH_INDEX_NAME=insertValue
10-
GATSBY_GITHUB_TOKEN_READ_ONLY=insertValue
11-
GATSBY_FUNCTIONS_PATH=insertValue
125

13-
# Build pages only for the specified langs. Leave it empty to build all the langs
14-
# e.g. `en,fr` will only build english and french pages
15-
# Note: always include `en` as it is the default lang of the site
16-
GATSBY_BUILD_LANGS=
6+
# Algolia environment (app ID, search key and base search index name required for search)
7+
# NEXT_PUBLIC_ALGOLIA_APP_ID=insertValue
8+
# NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=insertValue
9+
# NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME=insertValue
10+
# NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY=insertValue
11+
12+
# Etherscan API key (required for Etherscan API fetches)
13+
# ETHERSCAN_API_KEY=insertValue
14+
15+
# Google API key and Calendar ID (required to fetch Calendar events)
16+
# GOOGLE_API_KEY=
17+
# GOOGLE_CALENDAR_ID=
1718

18-
# Folders or files to ignore from the `src/content` folder
19-
IGNORE_CONTENT=**/docs,**/tutorials
19+
# Matomo environment (URL and site ID required for analytics)
20+
NEXT_PUBLIC_MATOMO_URL=
21+
NEXT_PUBLIC_MATOMO_SITE_ID=
2022

2123
# Used to avoid loading Matomo in our preview deploys
22-
IS_PREVIEW_DEPLOY=false
24+
IS_PREVIEW_DEPLOY=false
25+
26+
# Build pages only for the specified langs. Leave it empty to build all the langs
27+
# e.g. `en,fr` will only build English and French pages
28+
# Note: always include `en` as it is the default lang of the site
29+
BUILD_LOCALES=
30+
31+
# If resource constraints are being hit during builds, change LIMIT_CPUS to a
32+
# fixed number of CPUs (e.g. 2) to limit the demand during build time
33+
LIMIT_CPUS=

.eslintignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# The content is used as a code example in /src/pages/index.js
2-
src/data/CreateWallet.js
1+
.next
2+
dist
3+
node_modules/

.eslintrc.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"extends": ["next/core-web-vitals", "prettier", "plugin:storybook/recommended"],
3+
"env": { "es6": true },
4+
"plugins": ["simple-import-sort"],
5+
"rules": {
6+
"simple-import-sort/imports": [
7+
"error",
8+
{
9+
"groups": [
10+
// Node.js builtins.
11+
[
12+
"^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)"
13+
],
14+
// Packages. `react` related packages come first.
15+
// Also, put `react-icons` in sorting order not with `react`
16+
["^react(?!-.)$", "^\\w", "^@\\w"],
17+
// The Chakra theme directory if imported to story file or other places
18+
["^@/@chakra-ui"],
19+
// From the `types` directory.
20+
["^@/lib/types", "^@/lib/interfaces"],
21+
// From the `components` directory.
22+
["^@/components"],
23+
// From the `utils` directory.
24+
["^@/lib/utils"],
25+
// From the `data` directory.
26+
["^@/data"],
27+
// From the `constants` directory.
28+
["^@/lib/constants"],
29+
// Parent imports. Put `..` last.
30+
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
31+
// Other relative imports. Put same-folder imports and `.` last.
32+
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
33+
// Style imports.
34+
["^.+\\.s?css$"],
35+
// Side effect imports.
36+
["^\\u0000"]
37+
]
38+
}
39+
],
40+
"simple-import-sort/exports": "error"
41+
}
42+
}

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
* @wackerow @corwintines @pettinarip @minimalsm @nhsz
99

1010
# Owners of specific files
11-
/src/data/consensus-bounty-hunters.csv @djrtwo @asanso @fredriksvantes
11+
/src/data/consensus-bounty-hunters.json @djrtwo @asanso @fredriksvantes

.github/labeler.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
11
"review needed :eyes:":
22
- src/**/*
3+
- public/*
34

45
"documentation :book:":
56
- README.md
67

78
"tooling :wrench:":
89
- .github/**/*
910
- src/scripts/*
10-
- netlify.toml
11+
- src/lib/*
12+
- src/hooks/*
1113

1214
"dependencies :package:":
1315
- package.json
1416
- yarn.lock
1517

1618
"internal :house:":
17-
- gatsby-browser.js
18-
- gatsby-config.js
19-
- gatsby-node.js
20-
- gatsby-ssr.js
2119
- .all-contributorsrc
20+
- i18n.config.json
21+
- next.config.js
22+
- next-i18next.config,js
23+
- next-sitemap.config.js
24+
- tsconfig.json
25+
- .nvmrc
26+
- .eslintignore
27+
- .eslintrc.json
28+
- .prettierignore
29+
- .prettierrc
30+
- netlify.toml
2231

2332
"translation :earth_africa:":
2433
- src/content/translations/**/*
25-
- src/intl/*
26-
- src/utils/translations.js
34+
- src/intl/**/*
35+
- src/lib/utils/translations.ts
2736

2837
"content :fountain_pen:":
2938
- src/pages/*
30-
- src/pages-conditional/*
31-
- src/content/**/*
39+
- public/content/**/*
3240

3341
"event :date:":
3442
- src/data/community-events.json

.github/workflows/chromatic.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ on:
1414
# Only run on file changes in any of these paths
1515
- "src/components/**/*"
1616
- "src/pages/**/*"
17-
- "src/pages-conditional/**/*"
18-
- "src/templates/**/*"
19-
- "src/@chakra-ui/gatsby-plugin/**/*"
17+
- "src/layouts/**/*"
18+
- "src/@chakra-ui/**/*"
2019

2120
# List of jobs
2221
jobs:

.gitignore

Lines changed: 33 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,48 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
17-
# Coverage directory used by tools like istanbul
18-
coverage
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
192

20-
# nyc test coverage
21-
.nyc_output
22-
23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
317

32-
# Compiled binary addons (http://nodejs.org/api/addons.html)
33-
build/Release
8+
# testing
9+
/coverage
3410

35-
# Dependency directories
36-
node_modules/
37-
jspm_packages/
11+
# next.js
12+
/.next/
13+
/out/
3814

39-
# Typescript v1 declaration files
40-
typings/
15+
# production
16+
/build
4117

42-
# Optional npm cache directory
43-
.npm
18+
# misc
19+
.DS_Store
20+
*.pem
4421

45-
# Optional eslint cache
46-
.eslintcache
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
4726

48-
# Optional REPL history
49-
.node_repl_history
27+
# local env files
28+
.env*.local
29+
.env
5030

51-
# Output of 'npm pack'
52-
*.tgz
31+
# vercel
32+
.vercel
5333

54-
# dotenv environment variable files
55-
.env
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
5637

57-
# gatsby files
58-
.cache/
59-
public
38+
# rss feeds
39+
feed.xml
6040

61-
# Mac files
62-
.DS_Store
41+
# Sitemaps
42+
sitemap*.xml
6343

64-
# Yarn
65-
yarn-error.log
66-
.pnp/
67-
.pnp.js
68-
# Yarn Integrity file
69-
.yarn-integrity
44+
# Robots.txt
45+
robots.txt
7046

7147
# Local Netlify folder
7248
.netlify
73-
74-
# Custom build files
75-
# This file is generated by `yarn copy-contributors` command
76-
src/data/contributors.json
77-
# These files are generated by `yarn merge-translations` command
78-
src/intl/*.json
79-
i18n/locales
80-
i18n/merged
81-
# Auto generated code when gatsby build the site
82-
src/gatsby-types.d.ts
83-
84-
# Exported Crowdin files
85-
.crowdin
86-
87-
# vscode workplace configuration
88-
.vscode
89-
90-
# storybook static files
91-
storybook-static/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

.prettierignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
.cache
2-
package.json
1+
.next
2+
node_modules
3+
yarn.lock
34
package-lock.json
4-
public
5+
public
6+
build

.storybook/babel-storybook-config.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

.storybook/i18next.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import i18n, { Resource } from "i18next"
2-
import { initReactI18next } from "gatsby-plugin-react-i18next"
2+
import { initReactI18next } from "react-i18next"
33

44
export const baseLocales = {
55
en: { title: "English", left: "En" },
@@ -21,30 +21,31 @@ const ns = [
2121
const supportedLngs = Object.keys(baseLocales)
2222

2323
/**
24-
* Taking the ns array and combining all the ids
25-
* under a single ns per language, set to the default of "translation"
24+
* Taking the ns array and generating those files for each language available.
2625
*/
2726
const resources: Resource = ns.reduce((acc, n) => {
2827
supportedLngs.forEach((lng) => {
2928
if (!acc[lng]) acc[lng] = {}
29+
3030
try {
3131
acc[lng] = {
32-
translation: {
33-
...acc[lng].translation,
34-
32+
...acc[lng],
33+
[n]: {
34+
...acc[lng][n],
3535
...require(`../src/intl/${lng}/${n}.json`),
3636
},
3737
}
3838
} catch {
3939
acc[lng] = {
40-
translation: {
41-
...acc[lng].translation,
42-
40+
...acc[lng],
41+
[n]: {
42+
...acc[lng][n],
4343
...require(`../src/intl/en/${n}.json`),
4444
},
4545
}
4646
}
4747
})
48+
4849
return acc
4950
}, {})
5051

0 commit comments

Comments
 (0)