Skip to content

Commit 3bd4d82

Browse files
authored
Merge pull request #13019 from ethereum/staging
Deploy v8.6.0
2 parents 9f9bb88 + cb98c4f commit 3bd4d82

File tree

184 files changed

+3496
-2384
lines changed

Some content is hidden

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

184 files changed

+3496
-2384
lines changed

.all-contributorsrc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12006,6 +12006,69 @@
1200612006
"contributions": [
1200712007
"content"
1200812008
]
12009+
},
12010+
{
12011+
"login": "ecabras",
12012+
"name": "ecabras",
12013+
"avatar_url": "https://avatars.githubusercontent.com/u/126670074?v=4",
12014+
"profile": "https://github.com/ecabras",
12015+
"contributions": [
12016+
"content"
12017+
]
12018+
},
12019+
{
12020+
"login": "raxhvl",
12021+
"name": "rahul",
12022+
"avatar_url": "https://avatars.githubusercontent.com/u/10168946?v=4",
12023+
"profile": "https://github.com/raxhvl",
12024+
"contributions": [
12025+
"content"
12026+
]
12027+
},
12028+
{
12029+
"login": "professorabhay",
12030+
"name": "Abhay Gupta ",
12031+
"avatar_url": "https://avatars.githubusercontent.com/u/76243309?v=4",
12032+
"profile": "https://abhayporwals.live/",
12033+
"contributions": [
12034+
"content"
12035+
]
12036+
},
12037+
{
12038+
"login": "somethingstup",
12039+
"name": "somethingstup",
12040+
"avatar_url": "https://avatars.githubusercontent.com/u/166286712?v=4",
12041+
"profile": "https://github.com/somethingstup",
12042+
"contributions": [
12043+
"doc"
12044+
]
12045+
},
12046+
{
12047+
"login": "woxjro",
12048+
"name": "woxjro",
12049+
"avatar_url": "https://avatars.githubusercontent.com/u/63214188?v=4",
12050+
"profile": "https://github.com/woxjro",
12051+
"contributions": [
12052+
"tool"
12053+
]
12054+
},
12055+
{
12056+
"login": "SeanXLChen",
12057+
"name": "bambooskySean",
12058+
"avatar_url": "https://avatars.githubusercontent.com/u/78134555?v=4",
12059+
"profile": "https://github.com/SeanXLChen",
12060+
"contributions": [
12061+
"code"
12062+
]
12063+
},
12064+
{
12065+
"login": "VikVM",
12066+
"name": "VikVM",
12067+
"avatar_url": "https://avatars.githubusercontent.com/u/60881781?v=4",
12068+
"profile": "https://github.com/VikVM",
12069+
"contributions": [
12070+
"content"
12071+
]
1200912072
}
1201012073
],
1201112074
"contributorsPerLine": 7,

.github/ISSUE_TEMPLATE/suggest_wallet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ body:
293293
id: wallet_eip_1559_support
294294
attributes:
295295
label: Does the wallet support EIP-1559 (type 2) transactions?
296-
description: Please provide information on the type of transactions this wallet supports.
296+
description: Does your wallet support EIP-1559 (type 2) transactions for Ethereum Mainnet. Please provide information on the type of transactions this wallet supports. If this is not applicable, please explain.
297297
validations:
298298
required: true
299299
- type: textarea
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Check for non-English updates outside of Crowdin
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "public/content/translations/**/*.md"
7+
- "src/intl/**/*.json"
8+
- "!src/intl/en/**"
9+
10+
jobs:
11+
check_branch_name:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Exit early if branch name contains 'crowdin'
15+
run: |
16+
if [[ "${{ github.head_ref }}" == *crowdin* ]]; then
17+
echo "Branch name contains 'crowdin', stopping workflow"
18+
exit 1
19+
fi
20+
21+
check_changes:
22+
needs: check_branch_name
23+
runs-on: ubuntu-latest
24+
outputs:
25+
all_changes_include_href: ${{ steps.check.outputs.all_changes_include_href }}
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
- name: Check changes
30+
id: check
31+
run: |
32+
git fetch origin ${{ github.base_ref }}
33+
DIFF=$(git diff --no-ext-diff --unified=0 origin/${{ github.base_ref }}..${{ github.head_ref }} -- 'public/content/translations/**/*.md' 'src/intl/**/*.json' '!src/intl/en/**' | grep -E -v '^[-+]href=')
34+
if [[ -z "$DIFF" ]]; then
35+
echo "ALL_CHANGES_INCLUDE_HREF=true" >> $GITHUB_ENV
36+
else
37+
echo "ALL_CHANGES_INCLUDE_HREF=false" >> $GITHUB_ENV
38+
fi
39+
echo "::set-output name=all_changes_include_href::$ALL_CHANGES_INCLUDE_HREF"
40+
41+
add_label_and_comment:
42+
needs: check_changes
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Add label and comment
46+
uses: actions/github-script@v5
47+
with:
48+
github-token: ${{secrets.GITHUB_TOKEN}}
49+
script: |
50+
const prNumber = context.issue.number;
51+
const repo = context.repo;
52+
const prAuthor = context.payload.pull_request.user.login;
53+
const allChangesIncludeHref = '${{ needs.check_changes.outputs.all_changes_include_href }}' === 'true';
54+
const status = allChangesIncludeHref ? 'question ❓' : 'blocked 🛑';
55+
await github.rest.issues.addLabels({
56+
...repo,
57+
issue_number: prNumber,
58+
labels: [status, 'non-crowdin translation updates']
59+
});
60+
const commentWithoutHrefs = `This pull request contains changes to non-English content, which must also be handled through the Crowdin platform instead of only on GitHub.`
61+
const commentWithHrefs = `This pull request contains changes to non-English content files, which may also need to be handled through the Crowdin platform instead of only on GitHub.
62+
await github.rest.issues.createComment({
63+
...repo,
64+
issue_number: prNumber,
65+
body: `
66+
Thank you for your contribution, @${prAuthor}!
67+
68+
${allChangesIncludeHref ? commentWithHrefs : commentWithoutHrefs}
69+
70+
We value your suggestion, and for any non-English content updates we request that you check out [how to help us translate](https://ethereum.org/en/contributing/translation-program/#help-us-translate), and suggest these updates directly in [our Crowdin project](https://crowdin.com/project/ethereum-org) if possible, where they can be properly reviewed.
71+
72+
Please post here or join [our Discord](https://ethereum.org/discord) if you have questions!
73+
`
74+
});

.github/workflows/stale.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
with:
1515
repo-token: ${{ secrets.GITHUB_TOKEN }}
1616
stale-issue-label: "Status: Stale"
17+
stale-pr-label: "Status: Stale"
1718
stale-issue-message: "This issue is stale because it has been open 30 days with no activity."
1819
stale-pr-message: "This issue is stale because it has been open 30 days with no activity."
1920
days-before-stale: 30
20-
days-before-close: 5
21+
days-before-close: -1
22+
operations-per-run: 250

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ robots.txt
5454
.vscode
5555

5656
# Crowdin report output
57-
src/data/crowdin/bucketsAwaitingReviewReport.csv
57+
src/data/crowdin/bucketsAwaitingReviewReport.csv

.storybook/ChakraDecorator.tsx

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import {
2+
ChakraBaseProvider,
3+
extendBaseTheme,
4+
useColorMode,
5+
} from "@chakra-ui/react"
6+
import type { Decorator } from "@storybook/react"
7+
8+
import theme from "../src/@chakra-ui/theme"
9+
import { useEffect, useMemo, useState } from "react"
10+
import i18n from "./i18next"
11+
12+
type DecoratorProps = Parameters<Decorator>
13+
14+
const ColorModeSync = ({ context }: { context: DecoratorProps[1] }) => {
15+
const { setColorMode } = useColorMode()
16+
17+
useEffect(() => {
18+
const isDarkMode = localStorage.getItem("chakra-ui-color-mode") === "dark"
19+
20+
context.globals.colorMode = isDarkMode ? "dark" : "light"
21+
}, [])
22+
23+
useEffect(() => {
24+
setColorMode(context.globals.colorMode)
25+
}, [setColorMode, context])
26+
27+
return null
28+
}
29+
30+
/**
31+
* This is a custom local setup of the official Chakra UI Storybook addon.
32+
*
33+
* A local version was created in response to provide a better sync between
34+
* updated local direction to the Chakra theme.
35+
*
36+
* (This would most likely not be updated in the addon due to ongoing creation of Chakra v3 at the time this
37+
* setup was created.)
38+
*
39+
* Will be deprecated and removed when Chakra v3 is available for migration.
40+
*
41+
*/
42+
export const ChakraDecorator: Decorator = (getStory, context) => {
43+
const [dir, updateDir] = useState<"ltr" | "rtl">()
44+
45+
i18n.on("languageChanged", (locale) => {
46+
const direction = i18n.dir(locale)
47+
document.documentElement.dir = direction
48+
updateDir(direction)
49+
})
50+
51+
const themeWithDirectionOverride = useMemo(() => {
52+
return extendBaseTheme({ direction: dir }, theme)
53+
}, [dir])
54+
55+
return (
56+
<ChakraBaseProvider theme={themeWithDirectionOverride}>
57+
<>
58+
<ColorModeSync context={context} />
59+
{getStory(context)}
60+
</>
61+
</ChakraBaseProvider>
62+
)
63+
}

.storybook/i18next.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const baseLocales = {
66
zh: { title: "中国人", left: "Zh" },
77
ru: { title: "Русский", left: "Ru" },
88
uk: { title: "українська", left: "Uk" },
9+
fa: { title: "فارسی", left: "Fa" },
910
}
1011

1112
// Only i18n files named in this array are being exposed to Storybook. Add filenames as necessary.

.storybook/main.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import path from "path"
2-
31
import type { StorybookConfig } from "@storybook/nextjs"
42
import { propNames } from "@chakra-ui/react"
53

4+
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin"
5+
66
/**
77
* Note regarding package.json settings related to Storybook:
88
*
@@ -21,7 +21,6 @@ const config: StorybookConfig = {
2121
"@storybook/addon-links",
2222
"@storybook/addon-essentials",
2323
"@storybook/addon-interactions",
24-
"@chakra-ui/storybook-addon",
2524
"storybook-react-i18next",
2625
],
2726
staticDirs: ["../public"],
@@ -37,11 +36,15 @@ const config: StorybookConfig = {
3736
disable: true,
3837
},
3938
},
40-
webpackFinal: async (config: any) => {
41-
// Add path aliases
42-
config.resolve.alias["@"] = path.resolve(__dirname, "../src")
43-
config.resolve.alias["@/public"] = path.resolve(__dirname, "../public")
44-
39+
webpackFinal: async (config) => {
40+
if (config.resolve) {
41+
config.resolve.plugins = [
42+
...(config.resolve.plugins || []),
43+
new TsconfigPathsPlugin({
44+
extensions: config.resolve.extensions,
45+
}),
46+
]
47+
}
4548
return config
4649
},
4750
typescript: {

.storybook/preview.ts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1-
import { extendBaseTheme } from "@chakra-ui/react"
21
import type { Preview } from "@storybook/react"
32

43
import theme from "../src/@chakra-ui/theme"
54

5+
import { ChakraDecorator } from "./ChakraDecorator"
66
import i18n, { baseLocales } from "./i18next"
77

88
import "../src/styles/global.css"
99

10-
const extendedTheme = extendBaseTheme(theme)
11-
12-
const chakraBreakpointArray = Object.entries(extendedTheme.breakpoints)
10+
const chakraBreakpointArray = Object.entries(theme.breakpoints) as [
11+
string,
12+
string
13+
][]
1314

1415
const preview: Preview = {
1516
globals: {
1617
locale: "en",
1718
locales: baseLocales,
1819
},
20+
globalTypes: {
21+
colorMode: {
22+
name: "Color Mode",
23+
description: "Change the color mode",
24+
toolbar: {
25+
icon: "circlehollow",
26+
items: [
27+
{ value: "light", icon: "circlehollow", title: "Light Mode" },
28+
{ value: "dark", icon: "circle", title: "Dark Mode" },
29+
],
30+
},
31+
},
32+
},
33+
decorators: [ChakraDecorator],
1934
parameters: {
2035
i18n,
2136
actions: { argTypesRegex: "^on[A-Z].*" },
@@ -33,15 +48,15 @@ const preview: Preview = {
3348
order: ["Atoms", "Molecules", "Organisms", "Templates", "Pages"],
3449
},
3550
},
36-
chakra: {
37-
theme: extendedTheme,
38-
},
3951
layout: "centered",
4052
// Modify viewport selection to match Chakra breakpoints (or custom breakpoints)
4153
viewport: {
4254
viewports: chakraBreakpointArray.reduce((prevVal, currVal) => {
4355
const [token, key] = currVal
4456

57+
// `key` value is in em. Need to convert to px for Chromatic Story mode snapshots
58+
const emToPx = (Number(key.replace("em", "")) * 16).toString() + "px"
59+
4560
// Replace base value
4661
if (token === "base")
4762
return {
@@ -60,7 +75,7 @@ const preview: Preview = {
6075
[token]: {
6176
name: token,
6277
styles: {
63-
width: key,
78+
width: emToPx,
6479
height: "600px",
6580
},
6681
},

0 commit comments

Comments
 (0)