Skip to content

Commit 7ab3555

Browse files
Merge remote-tracking branch 'upstream/dev' into refactor/shadcn-static-layout
2 parents 96364a2 + 6eed7bc commit 7ab3555

File tree

99 files changed

+7646
-3759
lines changed

Some content is hidden

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

99 files changed

+7646
-3759
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12389,6 +12389,15 @@
1238912389
"contributions": [
1239012390
"bug"
1239112391
]
12392+
},
12393+
{
12394+
"login": "zaryab2000",
12395+
"name": "Zaryab",
12396+
"avatar_url": "https://avatars.githubusercontent.com/u/42082608?v=4",
12397+
"profile": "https://www.zaryabs.com/",
12398+
"contributions": [
12399+
"content"
12400+
]
1239212401
}
1239312402
],
1239412403
"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

.eslintrc.json

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
"env": {
1010
"es6": true
1111
},
12-
"plugins": [
13-
"simple-import-sort",
14-
"@typescript-eslint",
15-
"unused-imports"
16-
],
12+
"plugins": ["simple-import-sort", "@typescript-eslint", "unused-imports"],
1713
"parser": "@typescript-eslint/parser",
1814
"rules": {
1915
"simple-import-sort/imports": [
@@ -26,55 +22,29 @@
2622
],
2723
// Packages. `react` related packages come first.
2824
// Also, put `react-icons` in sorting order not with `react`
29-
[
30-
"^react(?!-.)$",
31-
"^\\w",
32-
"^@\\w"
33-
],
25+
["^react(?!-.)$", "^\\w", "^@\\w"],
3426
// The Chakra theme directory if imported to story file or other places
35-
[
36-
"^@/@chakra-ui"
37-
],
27+
["^@/@chakra-ui"],
3828
// From the `types` directory.
39-
[
40-
"^@/lib/types",
41-
"^@/lib/interfaces"
42-
],
29+
["^@/lib/types", "^@/lib/interfaces"],
4330
// From the `components` directory.
44-
[
45-
"^@/components"
46-
],
31+
["^@/components"],
4732
// From the `utils` directory.
48-
[
49-
"^@/lib/utils"
50-
],
33+
["^@/lib/utils"],
5134
// From the `data` directory.
52-
[
53-
"^@/data"
54-
],
35+
["^@/data"],
5536
// From the `constants` directory.
5637
["^@/lib/constants"],
5738
// From the `.storybook/utils` file
5839
["^@/storybook-utils"],
5940
// Parent imports. Put `..` last.
60-
[
61-
"^\\.\\.(?!/?$)",
62-
"^\\.\\./?$"
63-
],
41+
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
6442
// Other relative imports. Put same-folder imports and `.` last.
65-
[
66-
"^\\./(?=.*/)(?!/?$)",
67-
"^\\.(?!/?$)",
68-
"^\\./?$"
69-
],
43+
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
7044
// Style imports.
71-
[
72-
"^.+\\.s?css$"
73-
],
45+
["^.+s?css$"],
7446
// Side effect imports.
75-
[
76-
"^\\u0000"
77-
]
47+
["^\\u0000"]
7848
]
7949
}
8050
],
@@ -89,7 +59,7 @@
8959
],
9060
"unused-imports/no-unused-vars": [
9161
"error",
92-
{
62+
{
9363
"args": "all",
9464
"argsIgnorePattern": "^_$",
9565
"varsIgnorePattern": "^_$"
@@ -98,4 +68,3 @@
9868
"unused-imports/no-unused-imports-ts": "warn"
9969
}
10070
}
101-

.github/workflows/non-english-warning.yml

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

.storybook/preview.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import ThemeProvider from "@/components/ThemeProvider"
77

88
import i18n, { baseLocales } from "./i18next"
99

10+
import "@docsearch/css"
1011
import "../src/styles/global.css"
1112
import "../src/styles/fonts.css"
13+
import "../src/styles/docsearch.css"
1214

1315
MotionGlobalConfig.skipAnimations = isChromatic()
1416

README.md

Lines changed: 3 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

@@ -1892,6 +1894,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
18921894
<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>
18931895
<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>
18941896
<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>
1897+
<td align="center" valign="top" width="14.28%"><a href="https://www.zaryabs.com/"><img src="https://avatars.githubusercontent.com/u/42082608?v=4?s=100" width="100px;" alt="Zaryab"/><br /><sub><b>Zaryab</b></sub></a><br /><a href="#content-zaryab2000" title="Content">🖋</a></td>
18951898
</tr>
18961899
</tbody>
18971900
</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: 34 additions & 2 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,7 +27,7 @@ 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",
@@ -53,13 +58,30 @@ module.exports = (phase, { defaultConfig }) => {
5358
// Modify the file loader rule to ignore *.svg, since we have it handled now.
5459
fileLoaderRule.exclude = /\.svg$/i
5560

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+
)
71+
5672
return config
5773
},
5874
i18n,
5975
trailingSlash: true,
6076
images: {
6177
deviceSizes: [640, 750, 828, 1080, 1200, 1504, 1920],
6278
},
79+
env: {
80+
NEXT_PUBLIC_CONTEXT: process.env.CONTEXT,
81+
},
82+
experimental: {
83+
instrumentationHook: true,
84+
},
6385
}
6486

6587
if (phase !== PHASE_DEVELOPMENT_SERVER) {
@@ -88,5 +110,15 @@ module.exports = (phase, { defaultConfig }) => {
88110
}
89111
}
90112

91-
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+
)
92124
}

package.json

Lines changed: 12 additions & 4 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,18 +34,26 @@
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",
40+
"@radix-ui/react-compose-refs": "^1.1.0",
41+
"@radix-ui/react-dialog": "^1.1.1",
3942
"@radix-ui/react-navigation-menu": "^1.2.0",
4043
"@radix-ui/react-popover": "^1.1.1",
44+
"@radix-ui/react-portal": "^1.1.1",
45+
"@radix-ui/react-progress": "^1.1.0",
4146
"@radix-ui/react-radio-group": "^1.2.0",
4247
"@radix-ui/react-slot": "^1.1.0",
48+
"@radix-ui/react-switch": "^1.1.0",
4349
"@radix-ui/react-visually-hidden": "^1.1.0",
50+
"@sentry/nextjs": "^8.19.0",
4451
"@socialgouv/matomo-next": "^1.8.0",
4552
"chart.js": "^4.4.2",
4653
"chartjs-plugin-datalabels": "^2.2.0",
4754
"class-variance-authority": "^0.7.0",
4855
"clsx": "^2.1.1",
56+
"cmdk": "^1.0.0",
4957
"embla-carousel-react": "^7.0.0",
5058
"ethereum-blockies-base64": "^1.0.2",
5159
"framer-motion": "^10.13.0",
@@ -76,6 +84,7 @@
7684
"remark-gfm": "^3.0.1",
7785
"tailwind-merge": "^2.3.0",
7886
"tailwindcss-animate": "^1.0.7",
87+
"usehooks-ts": "^3.1.0",
7988
"yaml-loader": "^0.8.0"
8089
},
8190
"devDependencies": {
@@ -124,11 +133,10 @@
124133
"tsconfig-paths-webpack-plugin": "4.1.0",
125134
"typescript": "^5.5.2",
126135
"unified": "^10.0.0",
127-
"unist-util-visit": "^5.0.0",
128-
"usehooks-ts": "^3.1.0"
136+
"unist-util-visit": "^5.0.0"
129137
},
130138
"resolutions": {
131139
"jackspeak": "2.1.1",
132140
"sharp": "0.32.6"
133141
}
134-
}
142+
}

public/_redirects

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,3 @@
173173
/*/guides/how-to-register-an-ethereum-account /:splat/guides/how-to-create-an-ethereum-account/ 301!
174174

175175
/*/deprecated-software /:splat/dapps/ 301!
176-
177-
/*/developers/docs/smart-contracts/languages/ /:splat/developers/docs/smart-contracts/languages/
178-
179-
/*/languages /:splat/developers/docs/programming-languages/ 301!

0 commit comments

Comments
 (0)