Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Commit 6649944

Browse files
merging all conflicts
2 parents 8a808c6 + 38bf76a commit 6649944

File tree

880 files changed

+116972
-3609
lines changed

Some content is hidden

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

880 files changed

+116972
-3609
lines changed

.circleci/config.yml

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

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
node_modules/*
22

3+
# Skip beta
4+
beta/*
5+
36
# Ignore markdown files and examples
47
content/*
58

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[ignore]
22

3+
<PROJECT_ROOT>/beta/.*
34
<PROJECT_ROOT>/content/.*
45
<PROJECT_ROOT>/node_modules/.*
56
<PROJECT_ROOT>/public/.*

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
Note to Hacktoberfest 🎃 participants:
2-
3-
While we appreciate the enthusiasm, we are experiencing a high volume of drive-by pull requests (one-line changes, README tweaks, etc.). Please remember that hundreds of people are subscribed to this repo and will receive notifications for these PRs. Spam submissions will be closed and won't count towards your Hacktoberfest goals.
4-
5-
Please search for issues tagged [`good first issue`][gfi] or [`hacktoberfest`][hacktoberfest] to find things to work on.
6-
7-
You can also search [all of GitHub][all].
8-
9-
[gfi]: https://github.com/reactjs/reactjs.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue"
10-
[hacktoberfest]: https://github.com/reactjs/reactjs.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue"
11-
[all]: https://github.com/search?q=is%3Aissue+hacktoberfest
121
<!--
132
143
Thank you for the PR! Contributors like you keep React awesome!
154
165
Please see the Contribution Guide for guidelines:
176
18-
https://github.com/reactjs/reactjs.org/blob/master/CONTRIBUTING.md
7+
https://github.com/reactjs/reactjs.org/blob/main/CONTRIBUTING.md
198
209
If your PR references an existing issue, please add the issue number below
2110

.github/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
beta:
2+
- beta/**/*

.github/workflows/analyze.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Analyze Bundle
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main # change this if your default branch is named differently
8+
workflow_dispatch:
9+
10+
jobs:
11+
analyze:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up node
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: "14.x"
20+
21+
- name: Install dependencies
22+
uses: bahmutov/[email protected]
23+
with:
24+
working-directory: 'beta'
25+
26+
- name: Restore next build
27+
uses: actions/cache@v2
28+
id: restore-build-cache
29+
env:
30+
cache-name: cache-next-build
31+
with:
32+
path: beta/.next/cache
33+
# change this if you prefer a more strict cache
34+
key: ${{ runner.os }}-build-${{ env.cache-name }}
35+
36+
- name: Build next.js app
37+
# change this if your site requires a custom build command
38+
run: ./node_modules/.bin/next build
39+
working-directory: beta
40+
41+
# Here's the first place where next-bundle-analysis' own script is used
42+
# This step pulls the raw bundle stats for the current bundle
43+
- name: Analyze bundle
44+
run: npx -p nextjs-bundle-analysis report
45+
working-directory: beta
46+
47+
- name: Upload bundle
48+
uses: actions/upload-artifact@v2
49+
with:
50+
path: beta/.next/analyze/__bundle_analysis.json
51+
name: bundle_analysis.json
52+
53+
- name: Download base branch bundle stats
54+
uses: dawidd6/action-download-artifact@v2
55+
if: success() && github.event.number
56+
with:
57+
workflow: analyze.yml
58+
branch: ${{ github.event.pull_request.base.ref }}
59+
name: bundle_analysis.json
60+
path: beta/.next/analyze/base/bundle
61+
62+
# And here's the second place - this runs after we have both the current and
63+
# base branch bundle stats, and will compare them to determine what changed.
64+
# There are two configurable arguments that come from package.json:
65+
#
66+
# - budget: optional, set a budget (bytes) against which size changes are measured
67+
# it's set to 350kb here by default, as informed by the following piece:
68+
# https://infrequently.org/2021/03/the-performance-inequality-gap/
69+
#
70+
# - red-status-percentage: sets the percent size increase where you get a red
71+
# status indicator, defaults to 20%
72+
#
73+
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
74+
# entry in your package.json file.
75+
- name: Compare with base branch bundle
76+
if: success() && github.event.number
77+
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
78+
working-directory: beta
79+
80+
- name: Upload analysis comment
81+
uses: actions/upload-artifact@v2
82+
with:
83+
name: analysis_comment.txt
84+
path: beta/.next/analyze/__bundle_analysis_comment.txt
85+
86+
- name: Save PR number
87+
run: echo ${{ github.event.number }} > ./pr_number
88+
89+
- name: Upload PR number
90+
uses: actions/upload-artifact@v2
91+
with:
92+
name: pr_number
93+
path: ./pr_number
94+
95+
# The actual commenting happens in the other action, matching the guidance in
96+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Analyze Bundle (Comment)
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Analyze Bundle"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
if: >
13+
${{ github.event.workflow_run.event == 'pull_request' &&
14+
github.event.workflow_run.conclusion == 'success' }}
15+
steps:
16+
- name: Download base branch bundle stats
17+
uses: dawidd6/action-download-artifact@v2
18+
with:
19+
workflow: analyze.yml
20+
run_id: ${{ github.event.workflow_run.id }}
21+
name: analysis_comment.txt
22+
path: analysis_comment.txt
23+
24+
- name: Download PR number
25+
uses: dawidd6/action-download-artifact@v2
26+
with:
27+
workflow: analyze.yml
28+
run_id: ${{ github.event.workflow_run.id }}
29+
name: pr_number
30+
path: pr_number
31+
32+
- name: Get comment body
33+
id: get-comment-body
34+
if: success()
35+
run: |
36+
pr_number=$(cat pr_number/pr_number)
37+
body=$(cat analysis_comment.txt/__bundle_analysis_comment.txt)
38+
body="## Size Changes
39+
<details>
40+
41+
${body}
42+
43+
</details>"
44+
body="${body//'%'/'%25'}"
45+
body="${body//$'\n'/'%0A'}"
46+
body="${body//$'\r'/'%0D'}"
47+
echo ::set-output name=body::$body
48+
echo ::set-output name=pr-number::$pr_number
49+
50+
- name: Find Comment
51+
uses: peter-evans/find-comment@v1
52+
if: success()
53+
id: fc
54+
with:
55+
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
56+
body-includes: "<!-- __NEXTJS_BUNDLE -->"
57+
58+
- name: Create Comment
59+
uses: peter-evans/[email protected]
60+
if: success() && steps.fc.outputs.comment-id == 0
61+
with:
62+
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
63+
body: ${{ steps.get-comment-body.outputs.body }}
64+
65+
- name: Update Comment
66+
uses: peter-evans/[email protected]
67+
if: success() && steps.fc.outputs.comment-id != 0
68+
with:
69+
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
70+
body: ${{ steps.get-comment-body.outputs.body }}
71+
comment-id: ${{ steps.fc.outputs.comment-id }}
72+
edit-mode: replace
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Beta Site Lint / Heading ID check
2+
3+
on:
4+
push:
5+
branches:
6+
- main # change this if your default branch is named differently
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
14+
name: Lint on node 12.x and ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Use Node.js 12.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12.x
22+
23+
- name: Install deps and build (with cache)
24+
uses: bahmutov/[email protected]
25+
with:
26+
working-directory: 'beta'
27+
28+
29+
- name: Lint codebase
30+
run: cd beta && yarn ci-check

.github/workflows/label.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will triage pull requests and apply a label based on the
2+
# paths that are modified in the pull request.
3+
#
4+
# To use this workflow, you will need to set up a .github/labeler.yml
5+
# file with configuration. For more information, see:
6+
# https://github.com/actions/labeler
7+
8+
name: Labeler
9+
on: [pull_request_target]
10+
11+
jobs:
12+
label:
13+
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
19+
steps:
20+
- uses: actions/labeler@v2
21+
with:
22+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/nodejs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint / Flow check
2+
3+
on:
4+
push:
5+
branches:
6+
- main # change this if your default branch is named differently
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
14+
name: Lint on node 12.x and ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Use Node.js 12.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12.x
22+
23+
- name: Install deps and build (with cache)
24+
uses: bahmutov/[email protected]
25+
26+
- name: Lint codebase
27+
run: yarn ci-check

0 commit comments

Comments
 (0)