Skip to content

Commit d530523

Browse files
committed
Merge branch 'dev' into shadcn-lang-picker
2 parents 38dc84d + 3bc62ca commit d530523

File tree

208 files changed

+4363
-2137
lines changed

Some content is hidden

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

208 files changed

+4363
-2137
lines changed

.all-contributorsrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12362,6 +12362,33 @@
1236212362
"contributions": [
1236312363
"content"
1236412364
]
12365+
},
12366+
{
12367+
"login": "tr1sm0s1n",
12368+
"name": "Mobin Mohanan",
12369+
"avatar_url": "https://avatars.githubusercontent.com/u/47410557?v=4",
12370+
"profile": "https://github.com/tr1sm0s1n",
12371+
"contributions": [
12372+
"content"
12373+
]
12374+
},
12375+
{
12376+
"login": "Baystef",
12377+
"name": "Adebayo Steve",
12378+
"avatar_url": "https://avatars.githubusercontent.com/u/36106823?v=4",
12379+
"profile": "https://github.com/Baystef",
12380+
"contributions": [
12381+
"code"
12382+
]
12383+
},
12384+
{
12385+
"login": "sanjanaynvsdl",
12386+
"name": "Sanjana",
12387+
"avatar_url": "https://avatars.githubusercontent.com/u/142678317?v=4",
12388+
"profile": "https://github.com/sanjanaynvsdl",
12389+
"contributions": [
12390+
"bug"
12391+
]
1236512392
}
1236612393
],
1236712394
"contributorsPerLine": 7,

.env.example

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,11 @@ BUILD_LOCALES=
3333

3434
# If resource constraints are being hit during builds, change LIMIT_CPUS to a
3535
# fixed number of CPUs (e.g. 2) to limit the demand during build time
36-
LIMIT_CPUS=
36+
LIMIT_CPUS=
37+
38+
# Sentry auth token required for error tracking
39+
SENTRY_AUTH_TOKEN=
40+
NEXT_PUBLIC_SENTRY_DSN=
41+
42+
# Enables the bundle analyzer
43+
ANALYZE=false

.storybook/i18next.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const ns = [
2121
"page-upgrades",
2222
"page-developers-index",
2323
"page-what-is-ethereum",
24+
"page-upgrades-index",
2425
] as const
2526
const supportedLngs = Object.keys(baseLocales)
2627

.storybook/main.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const config: StorybookConfig = {
4747
},
4848
},
4949
webpackFinal: async (config) => {
50+
config.module = config.module || {}
51+
config.module.rules = config.module.rules || []
52+
5053
if (config.resolve) {
5154
config.resolve.plugins = [
5255
...(config.resolve.plugins || []),
@@ -55,6 +58,22 @@ const config: StorybookConfig = {
5558
}),
5659
]
5760
}
61+
62+
// This modifies the existing image rule to exclude .svg files
63+
// since you want to handle those files with @svgr/webpack
64+
const imageRule = config.module.rules.find((rule) =>
65+
rule?.["test"]?.test(".svg")
66+
)
67+
if (imageRule) {
68+
imageRule["exclude"] = /\.svg$/
69+
}
70+
71+
// Configure .svg files to be loaded with @svgr/webpack
72+
config.module.rules.push({
73+
test: /\.svg$/,
74+
use: ["@svgr/webpack"],
75+
})
76+
5877
return config
5978
},
6079
typescript: {

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ yarn dev
9696
- Pro Tip:
9797
- Explore scripts within `package.json` for more build options
9898
- Get **faster** production builds by building only one language. E.g. in your `.env` file, set `BUILD_LOCALES=en` to build the content only in English
99+
- To build the site in other selected languages too, you need to set them in `BUILD_LOCALES`, eg: `BUILD_LOCALES=en,es` if you also want to build only English (required) and Spanish.
100+
- To build all languages, simply comment this line out with a hash mark, eg: `# BUILD_LOCALES=`
99101

100102
By default the script will build all the languages (complete list in `i18n.config.json`).
101103

@@ -1889,6 +1891,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
18891891
<td align="center" valign="top" width="14.28%"><a href="https://github.com/krishchvn"><img src="https://avatars.githubusercontent.com/u/58606754?v=4?s=100" width="100px;" alt="Krishnakumar Chavan"/><br /><sub><b>Krishnakumar Chavan</b></sub></a><br /><a href="#content-krishchvn" title="Content">🖋</a></td>
18901892
<td align="center" valign="top" width="14.28%"><a href="https://github.com/0xV4L3NT1N3"><img src="https://avatars.githubusercontent.com/u/33112835?v=4?s=100" width="100px;" alt="0xV4L3NT1N3"/><br /><sub><b>0xV4L3NT1N3</b></sub></a><br /><a href="#tool-0xV4L3NT1N3" title="Tools">🔧</a></td>
18911893
<td align="center" valign="top" width="14.28%"><a href="https://github.com/JoshDavisLight"><img src="https://avatars.githubusercontent.com/u/82784104?v=4?s=100" width="100px;" alt="Josh Davis"/><br /><sub><b>Josh Davis</b></sub></a><br /><a href="#content-JoshDavisLight" title="Content">🖋</a></td>
1894+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tr1sm0s1n"><img src="https://avatars.githubusercontent.com/u/47410557?v=4?s=100" width="100px;" alt="Mobin Mohanan"/><br /><sub><b>Mobin Mohanan</b></sub></a><br /><a href="#content-tr1sm0s1n" title="Content">🖋</a></td>
1895+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Baystef"><img src="https://avatars.githubusercontent.com/u/36106823?v=4?s=100" width="100px;" alt="Adebayo Steve"/><br /><sub><b>Adebayo Steve</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Baystef" title="Code">💻</a></td>
1896+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sanjanaynvsdl"><img src="https://avatars.githubusercontent.com/u/142678317?v=4?s=100" width="100px;" alt="Sanjana"/><br /><sub><b>Sanjana</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Asanjanaynvsdl" title="Bug reports">🐛</a></td>
18921897
</tr>
18931898
</tbody>
18941899
</table>

instrumentation.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as Sentry from "@sentry/nextjs"
2+
3+
export async function register() {
4+
const dsn = process.env.NEXT_PUBLIC_SENTRY_DSN
5+
6+
if (!dsn) {
7+
console.warn("Sentry DSN not found, skipping")
8+
return
9+
}
10+
11+
const commonSentryOptions = {
12+
dsn,
13+
enabled: process.env.NODE_ENV === "production",
14+
tracesSampleRate: 1.0,
15+
}
16+
17+
if (process.env.NEXT_RUNTIME === "nodejs") {
18+
Sentry.init({
19+
...commonSentryOptions,
20+
})
21+
}
22+
23+
if (process.env.NEXT_RUNTIME === "edge") {
24+
Sentry.init({
25+
...commonSentryOptions,
26+
})
27+
}
28+
}

next.config.js

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
22
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants")
3+
const { withSentryConfig } = require("@sentry/nextjs")
4+
5+
const withBundleAnalyzer = require("@next/bundle-analyzer")({
6+
enabled: process.env.ANALYZE === "true",
7+
})
38

49
const { i18n } = require("./next-i18next.config")
510

@@ -22,15 +27,47 @@ module.exports = (phase, { defaultConfig }) => {
2227
let nextConfig = {
2328
...defaultConfig,
2429
reactStrictMode: true,
25-
webpack: (config) => {
30+
webpack: (config, { webpack }) => {
2631
config.module.rules.push({
2732
test: /\.ya?ml$/,
2833
use: "yaml-loader",
2934
})
30-
config.module.rules.push({
31-
test: /\.svg$/,
32-
use: "@svgr/webpack",
33-
})
35+
36+
// SVG loader
37+
// Grab the existing rule that handles SVG imports
38+
const fileLoaderRule = config.module.rules.find((rule) =>
39+
rule.test?.test?.(".svg")
40+
)
41+
42+
config.module.rules.push(
43+
// Reapply the existing rule, but only for svg imports ending in ?url
44+
{
45+
...fileLoaderRule,
46+
test: /\.svg$/i,
47+
resourceQuery: /url/, // *.svg?url
48+
},
49+
// Convert all other *.svg imports to React components
50+
{
51+
test: /\.svg$/i,
52+
issuer: fileLoaderRule.issuer,
53+
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
54+
use: ["@svgr/webpack"],
55+
}
56+
)
57+
58+
// Modify the file loader rule to ignore *.svg, since we have it handled now.
59+
fileLoaderRule.exclude = /\.svg$/i
60+
61+
// Tree shake Sentry debug code
62+
// ref. https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/tree-shaking/#tree-shaking-with-nextjs
63+
config.plugins.push(
64+
new webpack.DefinePlugin({
65+
__SENTRY_DEBUG__: false,
66+
__RRWEB_EXCLUDE_IFRAME__: true,
67+
__RRWEB_EXCLUDE_SHADOW_DOM__: true,
68+
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
69+
})
70+
)
3471

3572
return config
3673
},
@@ -39,6 +76,12 @@ module.exports = (phase, { defaultConfig }) => {
3976
images: {
4077
deviceSizes: [640, 750, 828, 1080, 1200, 1504, 1920],
4178
},
79+
env: {
80+
NEXT_PUBLIC_CONTEXT: process.env.CONTEXT,
81+
},
82+
experimental: {
83+
instrumentationHook: true,
84+
},
4285
}
4386

4487
if (phase !== PHASE_DEVELOPMENT_SERVER) {
@@ -67,5 +110,15 @@ module.exports = (phase, { defaultConfig }) => {
67110
}
68111
}
69112

70-
return nextConfig
113+
return withBundleAnalyzer(
114+
withSentryConfig(nextConfig, {
115+
// TODO: temp config, update this to the correct org & project
116+
org: "ethereumorg-ow",
117+
project: "javascript-nextjs",
118+
authToken: process.env.SENTRY_AUTH_TOKEN,
119+
release: `${process.env.BUILD_ID}_${process.env.REVIEW_ID}`,
120+
disableLogger: true,
121+
silent: true,
122+
})
123+
)
71124
}

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-org-website",
3-
"version": "8.8.0",
3+
"version": "8.9.0",
44
"license": "MIT",
55
"private": true,
66
"scripts": {
@@ -34,14 +34,17 @@
3434
"@emotion/react": "^11.11.1",
3535
"@emotion/styled": "^11.11.0",
3636
"@hookform/resolvers": "^3.8.0",
37+
"@next/bundle-analyzer": "^14.2.5",
3738
"@radix-ui/react-accordion": "^1.2.0",
3839
"@radix-ui/react-checkbox": "^1.1.1",
3940
"@radix-ui/react-dialog": "^1.1.1",
4041
"@radix-ui/react-navigation-menu": "^1.2.0",
4142
"@radix-ui/react-popover": "^1.1.1",
4243
"@radix-ui/react-progress": "^1.1.0",
44+
"@radix-ui/react-radio-group": "^1.2.0",
4345
"@radix-ui/react-slot": "^1.1.0",
4446
"@radix-ui/react-visually-hidden": "^1.1.0",
47+
"@sentry/nextjs": "^8.19.0",
4548
"@socialgouv/matomo-next": "^1.8.0",
4649
"chart.js": "^4.4.2",
4750
"chartjs-plugin-datalabels": "^2.2.0",
@@ -78,6 +81,7 @@
7881
"remark-gfm": "^3.0.1",
7982
"tailwind-merge": "^2.3.0",
8083
"tailwindcss-animate": "^1.0.7",
84+
"usehooks-ts": "^3.1.0",
8185
"yaml-loader": "^0.8.0"
8286
},
8387
"devDependencies": {
@@ -126,8 +130,7 @@
126130
"tsconfig-paths-webpack-plugin": "4.1.0",
127131
"typescript": "^5.5.2",
128132
"unified": "^10.0.0",
129-
"unist-util-visit": "^5.0.0",
130-
"usehooks-ts": "^3.1.0"
133+
"unist-util-visit": "^5.0.0"
131134
},
132135
"resolutions": {
133136
"jackspeak": "2.1.1",

public/content/contributing/translation-program/translatathon/details/index.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ All translations will also be subject to a thorough review before being added to
7171
</ul>
7272
</ExpandableCard>
7373

74-
<ExpandableCard title="Which languages can I translate into?">
75-
You can translate into any language! It is recommended to only translate into your native language to ensure sufficient quality, but in short, all language available in Crowdin are in scope for the Translatathon.
76-
77-
If you want to translate into a language that isn't available in Crowdin, reach out to us and we will add any language per request.
74+
<ExpandableCard title="Can I compete as part of a team?">
75+
<p>No. This year, the Translatathon will only have one main individual track and there will be no team competition.</p>
76+
<p>You can still team up with your friends and translate together, however everyone will be competing in the Translatathon as an individual and only the number of your individual translated words will count towards your final score.</p>
77+
</ExpandableCard>
7878

79+
<ExpandableCard title="Which languages can I translate into?">
80+
<p>You can translate into any language! It is recommended to only translate into your native language to ensure sufficient quality, but in short, all language available in Crowdin are in scope for the Translatathon.</p>
81+
<p>If you want to translate into a language that isn't available in Crowdin, reach out to us and we will add any language per request.</p>
7982
</ExpandableCard>
8083

8184
<ApplyNow />

public/content/contributing/translation-program/translatathon/index.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,17 @@ For more details, [see the full Terms & conditions](/contributing/translation-pr
7979

8080
<StepByStepInstructions />
8181

82+
## Prizes
83+
84+
<TranslatathonPrizes />
85+
8286
## Stay up to date
8387

84-
<!-- TODO: Uncomment when the hubs page is ready -->
85-
<!-- <TranslationHubCallout>
88+
<TranslationHubCallout>
8689
<h3 style={{margin:0}}>Translataton hubs</h3>
8790

88-
THis year we bring IRL community hugs to join local communities and help translate.
89-
90-
this hubs are located all over the world, find out if there is one close to you and join the community
91-
</TranslationHubCallout> -->
91+
This year we bring IRL community hugs to join local communities and help translate. These hubs are located all over the world, find out if there is one close to you and join the community!
92+
</TranslationHubCallout>
9293

9394
<TranslatathonCalendar />
9495

0 commit comments

Comments
 (0)