Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into refactor/trilemma-chak…
Browse files Browse the repository at this point in the history
…ra-updates
  • Loading branch information
TylerAPfledderer committed Nov 3, 2023
1 parent 83cc467 commit 6cfa88e
Show file tree
Hide file tree
Showing 261 changed files with 8,197 additions and 4,571 deletions.
66 changes: 65 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -8379,7 +8379,8 @@
"avatar_url": "https://avatars.githubusercontent.com/u/45835846?v=4",
"profile": "https://pandapip1.com/",
"contributions": [
"doc"
"doc",
"ideas"
]
},
{
Expand Down Expand Up @@ -10649,6 +10650,69 @@
"contributions": [
"ideas"
]
},
{
"login": "Wilson-Wu1",
"name": "Wilson Wu",
"avatar_url": "https://avatars.githubusercontent.com/u/41039035?v=4",
"profile": "https://www.linkedin.com/in/wilson-wu-2021/",
"contributions": [
"doc"
]
},
{
"login": "fvaysh",
"name": "VAS",
"avatar_url": "https://avatars.githubusercontent.com/u/126754021?v=4",
"profile": "https://github.com/fvaysh",
"contributions": [
"doc"
]
},
{
"login": "costgallo",
"name": "Costanza",
"avatar_url": "https://avatars.githubusercontent.com/u/49433698?v=4",
"profile": "https://github.com/costgallo",
"contributions": [
"doc"
]
},
{
"login": "joaolago1113",
"name": "joao",
"avatar_url": "https://avatars.githubusercontent.com/u/22820692?v=4",
"profile": "https://github.com/joaolago1113",
"contributions": [
"doc"
]
},
{
"login": "rgb2hsl",
"name": "Eugene",
"avatar_url": "https://avatars.githubusercontent.com/u/3310192?v=4",
"profile": "http://p2p.org",
"contributions": [
"content"
]
},
{
"login": "g0rbe",
"name": "Dániel Görbe",
"avatar_url": "https://avatars.githubusercontent.com/u/36860942?v=4",
"profile": "http://www.danielgorbe.com",
"contributions": [
"doc"
]
},
{
"login": "s-crypt",
"name": "s-crypt",
"avatar_url": "https://avatars.githubusercontent.com/u/41712656?v=4",
"profile": "https://blog.insubli.me",
"contributions": [
"content"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
* @samajammin @wackerow @corwintines @pettinarip @minimalsm @jmcook1186 @nhsz
* @wackerow @corwintines @pettinarip @minimalsm @nhsz

# Owners of specific files
/src/data/consensus-bounty-hunters.csv @djrtwo @asanso @fredriksvantes
1 change: 1 addition & 0 deletions .storybook/i18next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ns = [
"glossary",
"page-about",
"page-index",
"page-learn",
"page-upgrades",
"page-developers-index",
]
Expand Down
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config: StorybookConfig = {
"@chakra-ui/storybook-addon",
"storybook-react-i18next",
],
staticDirs: ["../static"],
staticDirs: ["../static", "../src/assets"],
babel: async () => ({
...babelConfig,
}),
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rogueassasin1729"><img src="https://avatars.githubusercontent.com/u/92800000?v=4?s=100" width="100px;" alt="rogueassasin1729"/><br /><sub><b>rogueassasin1729</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=rogueassasin1729" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://pandapip1.com/"><img src="https://avatars.githubusercontent.com/u/45835846?v=4?s=100" width="100px;" alt="Pandapip1"/><br /><sub><b>Pandapip1</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Pandapip1" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://pandapip1.com/"><img src="https://avatars.githubusercontent.com/u/45835846?v=4?s=100" width="100px;" alt="Pandapip1"/><br /><sub><b>Pandapip1</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Pandapip1" title="Documentation">📖</a> <a href="#ideas-Pandapip1" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://aldizh.github.io/"><img src="https://avatars.githubusercontent.com/u/2282120?v=4?s=100" width="100px;" alt="Aldi Zhupani"/><br /><sub><b>Aldi Zhupani</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AAldizh" title="Bug reports">🐛</a> <a href="https://github.com/ethereum/ethereum-org-website/commits?author=Aldizh" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/linhuatan"><img src="https://avatars.githubusercontent.com/u/94831627?v=4?s=100" width="100px;" alt="linhuatan"/><br /><sub><b>linhuatan</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=linhuatan" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://hugh.sh"><img src="https://avatars.githubusercontent.com/u/24587702?v=4?s=100" width="100px;" alt="Hugh"/><br /><sub><b>Hugh</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=hughcrt" title="Documentation">📖</a></td>
Expand Down Expand Up @@ -1666,6 +1666,15 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/robertkodra"><img src="https://avatars.githubusercontent.com/u/36516516?v=4?s=100" width="100px;" alt="Robert"/><br /><sub><b>Robert</b></sub></a><br /><a href="#content-robertkodra" title="Content">🖋</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/0xObsidian"><img src="https://avatars.githubusercontent.com/u/131651958?v=4?s=100" width="100px;" alt="obsidian"/><br /><sub><b>obsidian</b></sub></a><br /><a href="#content-0xObsidian" title="Content">🖋</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.scienft.com"><img src="https://avatars.githubusercontent.com/u/36033065?v=4?s=100" width="100px;" alt="Fekry Aiad"/><br /><sub><b>Fekry Aiad</b></sub></a><br /><a href="#ideas-MohamedFekryyy" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/wilson-wu-2021/"><img src="https://avatars.githubusercontent.com/u/41039035?v=4?s=100" width="100px;" alt="Wilson Wu"/><br /><sub><b>Wilson Wu</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Wilson-Wu1" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/fvaysh"><img src="https://avatars.githubusercontent.com/u/126754021?v=4?s=100" width="100px;" alt="VAS"/><br /><sub><b>VAS</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=fvaysh" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/costgallo"><img src="https://avatars.githubusercontent.com/u/49433698?v=4?s=100" width="100px;" alt="Costanza"/><br /><sub><b>Costanza</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=costgallo" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/joaolago1113"><img src="https://avatars.githubusercontent.com/u/22820692?v=4?s=100" width="100px;" alt="joao"/><br /><sub><b>joao</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=joaolago1113" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://p2p.org"><img src="https://avatars.githubusercontent.com/u/3310192?v=4?s=100" width="100px;" alt="Eugene"/><br /><sub><b>Eugene</b></sub></a><br /><a href="#content-rgb2hsl" title="Content">🖋</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.danielgorbe.com"><img src="https://avatars.githubusercontent.com/u/36860942?v=4?s=100" width="100px;" alt="Dániel Görbe"/><br /><sub><b>Dániel Görbe</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=g0rbe" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://blog.insubli.me"><img src="https://avatars.githubusercontent.com/u/41712656?v=4?s=100" width="100px;" alt="s-crypt"/><br /><sub><b>s-crypt</b></sub></a><br /><a href="#content-s-crypt" title="Content">🖋</a></td>
</tr>
</tbody>
</table>
Expand Down
6 changes: 3 additions & 3 deletions docs/review-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ This documentation outlines our current processes for how we prioritize items in

### General review process

We use a first-in, first-out system for reviewing pull requests. The longer a pull request has been open, the higher priority it is for our team to review. In some cases—for example, fixing a high-priority issue or merging low-hanging fruit for a deploy—we will stray from this process and use our best judgement to get higher-impact changes deployed more quickly.
We use a first-in, first-out system for reviewing pull requests. The longer a pull request has been open, the higher the priority it is for our team to review. In some cases—for example, fixing a high-priority issue or merging low-hanging fruit for a deploy—we will stray from this process and use our best judgement to get higher-impact changes deployed more quickly.

We aim to have every new PR reviewed with change requests, merged, or closed within 30 days of opening. As outlined in the following sections, different types of pull requests do have different levels of priority, and this may influence how promptly a pull request is acted on.

### Translations

Translation pull requests are considered high priority. These are when the translated and reviewed files from our translation management platform are submitted as a pull request. They are important to our core value of bringing Ethereum education to as many languages as possible. They also are the accumulation of months of work by translators and reviewers, and any delay to this already long process is undesirable.
Translation pull requests are considered high-priority. These are when the translated and reviewed files from our translation management platform are submitted as a pull request. They are important to our core value of bringing Ethereum education to as many languages as possible. They also are the accumulation of months of work by translators and reviewers, and any delay to this already long process is undesirable.

**Timeline:** PRs should be merged within 4 days of opening (by the next release).

Expand All @@ -24,7 +24,7 @@ Bug pull requests can vary from low-priority to high-priority depending on the s

### Features

Any new feature correlated to an approved issue is medium-priority. Similar to translators, code contributors dedicate a large amount of their time to improving [ethereum.org](http://ethereum.org) as a resource and addressing their efforts quickly is desirable. New features that were not discussed, requested or approved do not fall under this timeline.
Any new feature correlated with an approved issue is of medium priority. Similar to translators, code contributors dedicate a large amount of their time to improving [ethereum.org](http://ethereum.org) as a resource and addressing their efforts quickly is desirable. New features that were not discussed, requested or approved do not fall under this timeline.

**Timeline:** Major features should be merged within 30 days of opening. Minor features should be merged within 14 days of opening.

Expand Down
18 changes: 2 additions & 16 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const commonRedirectProps = {
* @returns boolean for if file is outdated or not
*/
const checkIsMdxOutdated = (filePath: string): boolean => {
const dirname = path.resolve("./")
// .replace(/\\/g, "/") to replace \ in windows paths ex: C:\\folder\\myfile.txt becomes C:/folder/myfile.txt
const dirname = path.resolve("./").replace(/\\/g, "/")
const splitPath = filePath.split(dirname)
const tempSplitPath = splitPath[1]
const tempSplit = tempSplitPath.split("/")
Expand Down Expand Up @@ -495,18 +496,3 @@ export const onPreBootstrap: GatsbyNode["onPreBootstrap"] = async ({
copyContributors()
reporter.info(`Contributors copied`)
}

// Build lambda functions when the build is complete and the `/public` folder exists
export const onPostBuild: GatsbyNode["onPostBuild"] = async (
gatsbyNodeHelpers
) => {
const { reporter } = gatsbyNodeHelpers

const reportOut = (report: { stderr: string; stdout: string }) => {
const { stderr, stdout } = report
if (stderr) reporter.error(stderr)
if (stdout) reporter.info(stdout)
}

reportOut(await exec("npm run build:lambda && cp netlify.toml public"))
}
8 changes: 5 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
# Default build command.
# command = "yarn build" # debug with: "yarn build --verbose"

# Directory with the serverless Lambda functions to deploy to AWS.
# netlify-lambda needs this netlify.toml file in order to build
# Directory with the serverless Lambda functions to deploy to AWS
functions = "public/functions"

[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "https://esp.ethereum.foundation"
Access-Control-Allow-Origin = "https://esp.ethereum.foundation"

[[plugins]]
package = "@netlify/plugin-gatsby"
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-org-website",
"version": "7.22.3",
"version": "7.23.0",
"description": "Website of ethereum.org",
"main": "index.js",
"repository": "[email protected]:ethereum/ethereum-org-website.git",
Expand Down Expand Up @@ -58,7 +58,6 @@
"is-relative-url": "^3.0.0",
"lodash": "^4.17.21",
"luxon": "^1.28.1",
"netlify-lambda": "^2.0.3",
"polished": "^4.1.4",
"prism-react-renderer": "^1.1.1",
"prismjs": "^1.27.0",
Expand All @@ -83,6 +82,7 @@
"@chakra-ui/cli": "^2.4.1",
"@chakra-ui/storybook-addon": "^5.0.1",
"@netlify/functions": "^1.2.0",
"@netlify/plugin-gatsby": "^3.7.2",
"@storybook/addon-a11y": "^7.0.23",
"@storybook/addon-actions": "^7.0.23",
"@storybook/addon-essentials": "^7.0.23",
Expand Down Expand Up @@ -121,7 +121,6 @@
"scripts": {
"postinstall": "yarn theme",
"build": "gatsby build",
"build:lambda": "cross-env NODE_OPTIONS=--openssl-legacy-provider netlify-lambda build src/lambda --config=./webpack.lambda.js",
"build:10gb": "cross-env NODE_OPTIONS=--max-old-space-size=10240 gatsby build",
"clean": "gatsby clean",
"crowdin-clean": "rm -rf .crowdin && mkdir .crowdin",
Expand All @@ -134,7 +133,6 @@
"optimize-images": "ts-node -O '{ \"module\": \"commonjs\" }' src/scripts/optimizeImages.ts",
"crowdin-contributors": "ts-node -O '{ \"module\": \"commonjs\" }' src/scripts/crowdin/getCrowdinContributors.ts",
"start": "gatsby develop",
"start:lambda": "netlify-lambda serve src/lambda",
"start:static": "gatsby build && gatsby serve",
"serve": "gatsby serve",
"type-check": "tsc --noEmit",
Expand Down
6 changes: 3 additions & 3 deletions src/@chakra-ui/gatsby-plugin/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ const styles = {
visibility: "visible",
},
"pre, code, kbd, samp": {
fontSize: "0.8em",
lineHeight: "1.1rem",
fontFamily: "SFMono-Regular,Menlo,Monaco,Consolas,monospace",
fontSize: "md",
lineHeight: "base",
fontFamily: "monospace",
},
}),
}
Expand Down
53 changes: 45 additions & 8 deletions src/api/calendarEvents.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
import axios from "axios"
import type { GatsbyFunctionRequest, GatsbyFunctionResponse } from "gatsby"
import { lambda } from "../lambda/calendarEvents"

async function handler(
__req: GatsbyFunctionRequest,
res: GatsbyFunctionResponse
): Promise<void> {
// passing env vars as arguments due to a bug on GC functions where env vars
// can not be accessed by imported functions
const { statusCode, body } = await lambda(
process.env.GOOGLE_API_KEY!,
process.env.GOOGLE_CALENDAR_ID!
)
res.status(statusCode).send(body)
const apiKey = process.env.GOOGLE_API_KEY
const calendarId = process.env.GOOGLE_CALENDAR_ID

try {
const futureEventsReq = await axios.get(
`https://content.googleapis.com/calendar/v3/calendars/${calendarId}/events`,
{
params: {
key: apiKey,
timeMin: new Date().toISOString(),
maxResults: 3,
singleEvents: true,
orderBy: "startTime",
},
}
)

const pastEventsReq = await axios.get(
`https://content.googleapis.com/calendar/v3/calendars/${calendarId}/events`,
{
params: {
key: apiKey,
timeMax: new Date().toISOString(),
maxResults: 4,
singleEvents: true,
orderBy: "startTime",
},
}
)

const response = {
pastEvents: pastEventsReq.data.items,
futureEvents: futureEventsReq.data.items,
}

res.status(200).send(JSON.stringify(response))
} catch (error) {
console.error(error)
res.status(500).send(
JSON.stringify({
msg: "Something went wrong with requesting the calendar events data.",
})
)
}
}

export default handler
34 changes: 28 additions & 6 deletions src/api/defipulse.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
import axios from "axios"
import takeRightWhile from "lodash/takeRightWhile"
import type { GatsbyFunctionRequest, GatsbyFunctionResponse } from "gatsby"

import { lambda } from "../lambda/defipulse"

async function handler(
__req: GatsbyFunctionRequest,
res: GatsbyFunctionResponse
): Promise<void> {
// passing env vars as arguments due to a bug on GC functions where env vars
// can not be accessed by imported functions
const { statusCode, body } = await lambda()
res.status(statusCode).send(body)
try {
const response = await axios.get(`https://api.llama.fi/charts/Ethereum`)
if (response.status < 200 || response.status >= 300) {
return res
.status(response.status)
.send(JSON.stringify(response.statusText))
}

const { data } = response

// get only the last 90 days
const daysToFetch = 90
const now = new Date()
const startDate = new Date(now.setDate(now.getDate() - daysToFetch))
const startTimestamp = Math.round(startDate.getTime() / 1000)

const trimmedData = takeRightWhile(
data,
({ date }) => Number(date) > startTimestamp
)

res.status(200).send(JSON.stringify(trimmedData))
} catch (error) {
console.error(error)
res.status(500).send(JSON.stringify({ msg: (error as Error)?.message }))
}
}

export default handler
Loading

0 comments on commit 6cfa88e

Please sign in to comment.