Skip to content

Commit 7b1b84d

Browse files
merging all conflicts
2 parents 7790ef2 + 0057efa commit 7b1b84d

File tree

590 files changed

+70888
-25
lines changed

Some content is hidden

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

590 files changed

+70888
-25
lines changed

Diff for: .eslintignore

+3
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

Diff for: .flowconfig

+1
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/.*

Diff for: .github/labeler.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
beta:
2+
- beta/**/*

Diff for: .github/workflows/analyze.yml

+96
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: bundle_analysis_upload.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/

Diff for: .github/workflows/analyze_comment.yml

+72
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

Diff for: .github/workflows/beta_site_lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Beta Site Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
11+
name: Lint on node 12.x and ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Use Node.js 12.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12.x
19+
20+
- name: Install deps and build (with cache)
21+
uses: bahmutov/[email protected]
22+
with:
23+
working-directory: 'beta'
24+
25+
26+
- name: Lint codebase
27+
run: cd beta && yarn ci-check

Diff for: .github/workflows/label.yml

+22
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 }}"

Diff for: .github/workflows/nodejs.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
11+
name: Lint on node 12.x and ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Use Node.js 12.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12.x
19+
20+
- name: Install deps and build (with cache)
21+
uses: bahmutov/[email protected]
22+
23+
- name: Lint codebase
24+
run: yarn ci-check

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
.idea
44
.vscode
55
node_modules
6-
public
6+
/public
77
yarn-error.log

Diff for: beta/.env.development

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_HJ_SITE_ID = 2411683
2+
NEXT_PUBLIC_HJ_SITE_V = 6

Diff for: beta/.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_HJ_SITE_ID = 2411651
2+
NEXT_PUBLIC_HJ_SITE_V = 6

Diff for: beta/.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scripts
2+
plugins
3+
next.config.js

Diff for: beta/.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"root": true,
3+
"extends": "next",
4+
"env": {
5+
"node": true,
6+
"commonjs": true,
7+
"browser": true,
8+
"es6": true
9+
}
10+
}

Diff for: beta/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

Diff for: beta/.husky/pre-commit

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
cd beta
5+
yarn generate-ids
6+
git add -u src/pages/**/*.md
7+
yarn prettier
8+
yarn lint:fix

Diff for: beta/.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/pages/docs/**/*.md
2+
src/pages/blog/**/*.md

Diff for: beta/.prettierrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"bracketSpacing": false,
3+
"singleQuote": true,
4+
"bracketSameLine": true,
5+
"trailingComma": "es5",
6+
"printWidth": 80
7+
}

0 commit comments

Comments
 (0)