Skip to content

Commit e093121

Browse files
committed
Merge branch 'dev' into layout-algolia
2 parents 96b9170 + 0770fa0 commit e093121

File tree

701 files changed

+37269
-9158
lines changed

Some content is hidden

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

701 files changed

+37269
-9158
lines changed

.all-contributorsrc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10830,6 +10830,69 @@
1083010830
"contributions": [
1083110831
"content"
1083210832
]
10833+
},
10834+
{
10835+
"login": "Erlangshen219",
10836+
"name": "Erlangshen219",
10837+
"avatar_url": "https://avatars.githubusercontent.com/u/104747507?v=4",
10838+
"profile": "https://github.com/Erlangshen219",
10839+
"contributions": [
10840+
"content"
10841+
]
10842+
},
10843+
{
10844+
"login": "AyDeveloper",
10845+
"name": "AyDeveloper",
10846+
"avatar_url": "https://avatars.githubusercontent.com/u/72970379?v=4",
10847+
"profile": "https://oxpampam.netlify.app/",
10848+
"contributions": [
10849+
"content"
10850+
]
10851+
},
10852+
{
10853+
"login": "jeremyfritzen",
10854+
"name": "jeremyfritzen",
10855+
"avatar_url": "https://avatars.githubusercontent.com/u/26802442?v=4",
10856+
"profile": "https://github.com/jeremyfritzen",
10857+
"contributions": [
10858+
"content"
10859+
]
10860+
},
10861+
{
10862+
"login": "fuzheng1998",
10863+
"name": "Zheng Fu",
10864+
"avatar_url": "https://avatars.githubusercontent.com/u/24203166?v=4",
10865+
"profile": "https://github.com/fuzheng1998",
10866+
"contributions": [
10867+
"code"
10868+
]
10869+
},
10870+
{
10871+
"login": "xiaolou86",
10872+
"name": "xiaolou86",
10873+
"avatar_url": "https://avatars.githubusercontent.com/u/20718693?v=4",
10874+
"profile": "https://github.com/xiaolou86",
10875+
"contributions": [
10876+
"content"
10877+
]
10878+
},
10879+
{
10880+
"login": "aztecEagle22",
10881+
"name": "aztecEagle22",
10882+
"avatar_url": "https://avatars.githubusercontent.com/u/152518936?v=4",
10883+
"profile": "https://github.com/aztecEagle22",
10884+
"contributions": [
10885+
"content"
10886+
]
10887+
},
10888+
{
10889+
"login": "Messi-Q",
10890+
"name": "QIAN",
10891+
"avatar_url": "https://avatars.githubusercontent.com/u/21357985?v=4",
10892+
"profile": "https://github.com/Messi-Q",
10893+
"contributions": [
10894+
"content"
10895+
]
1083310896
}
1083410897
],
1083510898
"contributorsPerLine": 7,

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["next/core-web-vitals", "prettier"],
2+
"extends": ["next/core-web-vitals", "prettier", "plugin:storybook/recommended"],
33
"env": { "es6": true },
44
"plugins": ["simple-import-sort"],
55
"rules": {

.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: 18 additions & 10 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:":
24-
- /content/translations/**/*
25-
- src/intl/*
26-
- src/utils/translations.js
33+
- src/content/translations/**/*
34+
- src/intl/**/*
35+
- src/lib/utils/translations.ts
2736

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

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ feed.xml
4141
# Sitemaps
4242
sitemap*.xml
4343

44+
# Robots.txt
45+
robots.txt
46+
4447
# Local Netlify folder
4548
.netlify

.storybook/i18next.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import i18n, { Resource } from "i18next"
2+
import { initReactI18next } from "react-i18next"
3+
4+
export const baseLocales = {
5+
en: { title: "English", left: "En" },
6+
zh: { title: "中国人", left: "Zh" },
7+
ru: { title: "Русский", left: "Ru" },
8+
uk: { title: "українська", left: "Uk" },
9+
}
10+
11+
// Only i18n files named in this array are being exposed to Storybook. Add filenames as necessary.
12+
const ns = [
13+
"common",
14+
"glossary",
15+
"page-about",
16+
"page-index",
17+
"page-learn",
18+
"page-upgrades",
19+
"page-developers-index",
20+
]
21+
const supportedLngs = Object.keys(baseLocales)
22+
23+
/**
24+
* Taking the ns array and generating those files for each language available.
25+
*/
26+
const resources: Resource = ns.reduce((acc, n) => {
27+
supportedLngs.forEach((lng) => {
28+
if (!acc[lng]) acc[lng] = {}
29+
30+
try {
31+
acc[lng] = {
32+
...acc[lng],
33+
[n]: {
34+
...acc[lng][n],
35+
...require(`../src/intl/${lng}/${n}.json`),
36+
},
37+
}
38+
} catch {
39+
acc[lng] = {
40+
...acc[lng],
41+
[n]: {
42+
...acc[lng][n],
43+
...require(`../src/intl/en/${n}.json`),
44+
},
45+
}
46+
}
47+
})
48+
49+
return acc
50+
}, {})
51+
52+
i18n.use(initReactI18next).init({
53+
debug: true,
54+
fallbackLng: "en",
55+
interpolation: { escapeValue: false },
56+
react: { useSuspense: false },
57+
supportedLngs,
58+
resources,
59+
})
60+
61+
export default i18n

.storybook/main.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import path from "path"
2+
3+
import type { StorybookConfig } from "@storybook/nextjs"
4+
import { propNames } from "@chakra-ui/react"
5+
6+
/**
7+
* Note regarding package.json settings related to Storybook:
8+
*
9+
* There is a resolutions option set for the package `jackspeak`. This is related to a
10+
* workaround provided to make sure storybook ( as of v7.5.2) works correctly with
11+
* Yarn v1
12+
*
13+
* Reference: https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092
14+
*
15+
* The primary recommendation is to upgrade to Yarn 3 if possible
16+
*/
17+
18+
/**
19+
* Temporary list of allowed stories during migration to NextJS
20+
*/
21+
const tempStoryList = ["../src/components/Buttons/**/*.stories.@(ts|tsx)"]
22+
23+
const config: StorybookConfig = {
24+
stories: tempStoryList,
25+
addons: [
26+
"@storybook/addon-links",
27+
"@storybook/addon-essentials",
28+
"@storybook/addon-onboarding",
29+
"@storybook/addon-interactions",
30+
"@chakra-ui/storybook-addon",
31+
"storybook-react-i18next"
32+
],
33+
staticDirs: ["../public"],
34+
framework: {
35+
name: "@storybook/nextjs",
36+
options: {},
37+
},
38+
docs: {
39+
autodocs: "tag",
40+
},
41+
refs: {
42+
"@chakra-ui/react": {
43+
disable: true,
44+
},
45+
},
46+
webpackFinal: async (config: any) => {
47+
// Add path aliases
48+
config.resolve.alias["@"] = path.resolve(__dirname, "../src")
49+
config.resolve.alias["@/public"] = path.resolve(__dirname, "../public")
50+
51+
return config
52+
},
53+
typescript: {
54+
reactDocgenTypescriptOptions: {
55+
shouldExtractLiteralValuesFromEnum: true,
56+
/**
57+
* For handling bloated controls table of Chakra Props
58+
*
59+
* https://github.com/chakra-ui/chakra-ui/issues/2009#issuecomment-852793946
60+
*/
61+
propFilter: (prop) => {
62+
const excludedPropNames = propNames.concat([
63+
"as",
64+
"apply",
65+
"sx",
66+
"__css",
67+
])
68+
const isStyledSystemProp = excludedPropNames.includes(prop.name)
69+
const isHTMLElementProp =
70+
prop.parent?.fileName.includes("node_modules") ?? false
71+
return !(isStyledSystemProp || isHTMLElementProp)
72+
},
73+
},
74+
},
75+
}
76+
export default config

.storybook/manager.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { addons } from "@storybook/manager-api"
2+
import theme from "./theme"
3+
// @ts-ignore
4+
import favicon from "../public/favicon.png"
5+
6+
addons.setConfig({
7+
theme,
8+
})
9+
10+
// In order to override the default favicon, and inject a data hash link to the png
11+
const link = document.createElement("link")
12+
link.setAttribute("rel", "shortcut icon")
13+
link.setAttribute("href", favicon)
14+
document.head.appendChild(link)

.storybook/preview-logo.svg

Lines changed: 9 additions & 0 deletions
Loading

.storybook/preview.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { extendBaseTheme } from "@chakra-ui/react"
2+
import type { Preview } from "@storybook/react"
3+
4+
import theme from "../src/@chakra-ui/theme"
5+
6+
import i18n, { baseLocales } from "./i18next"
7+
8+
const extendedTheme = extendBaseTheme(theme)
9+
10+
const chakraBreakpointArray = Object.entries(extendedTheme.breakpoints)
11+
12+
const preview: Preview = {
13+
globals: {
14+
locale: 'en',
15+
locales: baseLocales,
16+
},
17+
parameters: {
18+
i18n,
19+
actions: { argTypesRegex: "^on[A-Z].*" },
20+
controls: {
21+
matchers: {
22+
color: /(background|color)$/i,
23+
date: /Date$/i,
24+
},
25+
},
26+
backgrounds: {
27+
disable: true,
28+
},
29+
chakra: {
30+
theme: extendedTheme,
31+
},
32+
layout: "centered",
33+
// Modify viewport selection to match Chakra breakpoints (or custom breakpoints)
34+
viewport: {
35+
viewports: chakraBreakpointArray.reduce((prevVal, currVal) => {
36+
const [token, key] = currVal
37+
38+
// Replace base value
39+
if (token === "base")
40+
return {
41+
...prevVal,
42+
base: {
43+
name: "base",
44+
styles: {
45+
width: "375px", // A popular minimum mobile width
46+
height: "600px",
47+
},
48+
},
49+
}
50+
51+
return {
52+
...prevVal,
53+
[token]: {
54+
name: token,
55+
styles: {
56+
width: key,
57+
height: "600px",
58+
},
59+
},
60+
}
61+
}, {}),
62+
},
63+
},
64+
}
65+
66+
export default preview

0 commit comments

Comments
 (0)