Skip to content

Commit 6e38897

Browse files
committed
first commit
0 parents  commit 6e38897

File tree

5,239 files changed

+374117
-0
lines changed

Some content is hidden

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

5,239 files changed

+374117
-0
lines changed

.commitlintrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {
4+
"scope-enum": [
5+
2,
6+
"always",
7+
[
8+
"components",
9+
"constants",
10+
"hooks",
11+
"icons",
12+
"images",
13+
"pages",
14+
"styles",
15+
"templates",
16+
"utils"
17+
]
18+
]
19+
}
20+
}

.env.example

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
NEXT_PUBLIC_DEFAULT_SITE_URL=http://localhost:3000
2+
3+
WP_GRAPHQL_URL=https://neondatabase.wpengine.com/graphql
4+
WP_GRAPHQL_AUTH_TOKEN=
5+
WP_PREVIEW_SECRET=
6+
7+
NEXT_PUBLIC_GITHUB_PATH=https://github.com/neondatabase/website/tree/main/
8+
NEXT_PUBLIC_GITHUB_RAW_PATH=https://raw.githubusercontent.com/neondatabase/website/refs/heads/main/
9+
10+
NEXT_PUBLIC_ALGOLIA_APP_ID=
11+
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY=
12+
NEXT_PUBLIC_ALGOLIA_BLOG_INDEX_NAME=
13+
NEXT_PUBLIC_ALGOLIA_GUIDES_INDEX_NAME=
14+
15+
INKEEP_ORGANIZATION_ID=neon
16+
INKEEP_INTEGRATION_ID=
17+
INKEEP_INTEGRATION_API_KEY=
18+
19+
NEXT_PUBLIC_POSTHOG_KEY=
20+
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
21+
22+
NEXTAUTH_URL=
23+
NEXTAUTH_SECRET=
24+
DEPLOY_DATABASE_URL=
25+
DEPLOY_SHADOW_DATABASE_URL=
26+
27+
GITHUB_APP_SECRET=
28+
GITHUB_APP_CLIENT_ID=
29+
30+
DEPLOY_POSTGRES_DATABASE_URL=
31+
DEPLOY_POSTGRES_NEON_API_KEY=
32+
DEPLOY_POSTGRES_UPSTASH_REDIS_REST_URL=
33+
DEPLOY_POSTGRES_UPSTASH_REDIS_REST_TOKEN=

.eslintrc.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
},
6+
extends: [
7+
'airbnb',
8+
'airbnb/hooks',
9+
'airbnb/whitespace',
10+
'prettier',
11+
'plugin:@next/next/recommended',
12+
'plugin:cypress/recommended',
13+
],
14+
globals: {
15+
Atomics: 'readonly',
16+
SharedArrayBuffer: 'readonly',
17+
zaraz: true,
18+
},
19+
parserOptions: {
20+
ecmaFeatures: {
21+
jsx: true,
22+
},
23+
ecmaVersion: 2020,
24+
sourceType: 'module',
25+
},
26+
plugins: ['react'],
27+
rules: {
28+
// Removes "default" from "restrictedNamedExports", original rule setup — https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js#L65
29+
'no-restricted-exports': ['error', { restrictedNamedExports: ['then'] }],
30+
'no-unused-vars': 'error',
31+
'no-shadow': 'off',
32+
'no-undef': 'error',
33+
'react/require-default-props': 0,
34+
'react/prop-types': 'error',
35+
'react/no-array-index-key': 'off',
36+
'react/jsx-props-no-spreading': 'off',
37+
'react/no-danger': 'off',
38+
'react/react-in-jsx-scope': 'off',
39+
'react/forbid-prop-types': 'off',
40+
// Changes values from "function-expression" to "arrow-function", original rule setup — https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js#L528
41+
'react/function-component-definition': [
42+
'error',
43+
{
44+
namedComponents: 'arrow-function',
45+
unnamedComponents: 'arrow-function',
46+
},
47+
],
48+
'react/jsx-sort-props': [
49+
'error',
50+
{
51+
callbacksLast: true,
52+
shorthandLast: true,
53+
noSortAlphabetically: true,
54+
},
55+
],
56+
'import/order': [
57+
'error',
58+
{
59+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
60+
'newlines-between': 'always',
61+
alphabetize: {
62+
order: 'asc',
63+
caseInsensitive: true,
64+
},
65+
},
66+
],
67+
'jsx-a11y/label-has-associated-control': [
68+
'error',
69+
{
70+
required: {
71+
some: ['nesting', 'id'],
72+
},
73+
},
74+
],
75+
'jsx-a11y/label-has-for': [
76+
'error',
77+
{
78+
required: {
79+
some: ['nesting', 'id'],
80+
},
81+
},
82+
],
83+
},
84+
settings: {
85+
'import/resolver': {
86+
node: {
87+
paths: ['src'],
88+
},
89+
},
90+
},
91+
};

.github/workflows/e2e-tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: E2E on Chrome
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/components/pages/contact-sales/hero/**'
7+
- 'src/components/pages/partners/apply/**'
8+
- 'src/components/pages/blog-post/subscribe-form/**'
9+
- 'src/components/shared/subscribe/**'
10+
- 'src/components/shared/subscribe-minimalistic/**'
11+
- 'src/components/shared/subscription-form/**'
12+
- 'src/utils/forms.js'
13+
- 'src/constants/forms.js'
14+
- 'cypress/**'
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
install:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
24+
with:
25+
egress-policy: audit
26+
27+
- name: Checkout
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
30+
- name: Cypress run
31+
uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16
32+
with:
33+
browser: chrome
34+
build: npm run build
35+
start: npm run start
36+
wait-on: "http://localhost:3000"
37+
env:
38+
NEXT_PUBLIC_DEFAULT_SITE_URL: http://localhost:3000
39+
WP_HTACCESS_USERNAME: ${{ secrets.WP_HTACCESS_USERNAME }}
40+
WP_HTACCESS_PASSWORD: ${{ secrets.WP_HTACCESS_PASSWORD }}
41+
WP_GRAPHQL_URL: ${{ secrets.WP_GRAPHQL_URL }}
42+
NEXT_PUBLIC_GITHUB_PATH: ${{ secrets.NEXT_PUBLIC_GITHUB_PATH }}
43+
NEXT_PUBLIC_GITHUB_RAW_PATH: ${{ secrets.NEXT_PUBLIC_GITHUB_ROW_PATH }}
44+
NEXT_PUBLIC_SEGMENT_WRITE_KEY: ${{ secrets.NEXT_PUBLIC_SEGMENT_WRITE_KEY }}
45+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Format Markdown
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths:
8+
- 'content/**/*.md'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
format-markdown:
15+
permissions:
16+
contents: write # for Git to git push
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Harden the runner (Audit all outbound calls)
21+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
22+
with:
23+
egress-policy: audit
24+
25+
- name: Checkout repository
26+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
27+
with:
28+
fetch-depth: 2
29+
token: ${{ secrets.ACCESS_TOKEN }}
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
33+
with:
34+
node-version: 18
35+
36+
- name: Install Prettier
37+
run: npm install prettier
38+
39+
- name: Run Prettier
40+
run: npx prettier --write "content/**/*.md" --ignore-path .prettierignore
41+
42+
- name: Commit changes
43+
run: |
44+
git config user.name "GitHub Action"
45+
git config user.email "[email protected]"
46+
export HUSKY=0
47+
git add -A
48+
# Check for meaningful changes before committing
49+
if [ -n "$(git status --porcelain)" ]; then
50+
# Commit only modified markdown files, not all changes
51+
git commit -m "chore: format content markdown files with Prettier"
52+
echo "Changes committed"
53+
else
54+
echo "No significant changes to commit"
55+
exit 0
56+
fi
57+
58+
- name: Pull latest changes
59+
run: git pull --rebase
60+
61+
- name: Push changes
62+
run: git push
63+
env:
64+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

.github/workflows/linkinator.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Linkinator
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 1'
6+
7+
env:
8+
GATSBY_DEFAULT_SITE_URL: https://neon.com
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
linkinator:
14+
name: 'Checks broken links'
15+
runs-on: ubuntu-latest
16+
continue-on-error: true
17+
steps:
18+
- name: Harden the runner (Audit all outbound calls)
19+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
20+
with:
21+
egress-policy: audit
22+
23+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
24+
- uses: JustinBeckwith/linkinator-action@3d5ba091319fa7b0ac14703761eebb7d100e6f6d # v1.11.0
25+
with:
26+
paths: ${{ env.GATSBY_DEFAULT_SITE_URL }}
27+
concurrency: 100
28+
recurse: true
29+
retry: true
30+
skip: ".*(\\.js|\\.css|\\.woff2)$"
31+
linksToSkip: >-
32+
linkedin.com,
33+
googleapis.com
34+
verbosity: 'ERROR'
35+
markdown: false
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Update Frontmatter
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- 'content/docs/**/*.md'
9+
- '!content/docs/README.md' # Exclude the README.md file
10+
- '!content/docs/shared-content/**/*.md' # Exclude the shared-content folder
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
update-date:
17+
permissions:
18+
contents: write # for Git to git push
19+
runs-on: ubuntu-latest
20+
if: ${{ !contains(github.event.head_commit.message, 'auto-update') }}
21+
22+
steps:
23+
- name: Harden the runner (Audit all outbound calls)
24+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
25+
with:
26+
egress-policy: audit
27+
28+
- name: Checkout repository
29+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
30+
with:
31+
fetch-depth: 2
32+
token: ${{ secrets.ACCESS_TOKEN }}
33+
# ACCESS_TOKEN is a personal access token with repo scope
34+
# it needs to be updated in the repo secrets when it expires - Nov 10, 2024
35+
36+
- name: Set up Node.js
37+
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
38+
with:
39+
node-version: 18
40+
41+
- name: Get list of modified files
42+
id: get-modified-files
43+
run: |
44+
modified_files=$(git diff --name-only HEAD^ HEAD | grep '^content/docs/.*\.md$' | xargs)
45+
echo "Modified files: $modified_files"
46+
if [ -z "$modified_files" ]; then
47+
echo "No modified Markdown files to update."
48+
exit 0
49+
fi
50+
echo "modified_files=$modified_files" >> $GITHUB_OUTPUT
51+
52+
- name: Install packages
53+
run: npm ci
54+
55+
- name: Run update script
56+
run: node src/scripts/update-frontmatter.js ${{ steps.get-modified-files.outputs.modified_files }}
57+
58+
- name: Commit changes
59+
run: |
60+
git config user.name "GitHub Action"
61+
git config user.email "[email protected]"
62+
export HUSKY=0
63+
git add -A
64+
# Check for meaningful changes before committing
65+
if [ -n "$(git status --porcelain)" ]; then
66+
# Commit only modified markdown files, not all changes
67+
git commit -m "chore: update frontmatter date (auto-update)" ${{ steps.get-modified-files.outputs.modified_files }}
68+
echo "Changes committed"
69+
else
70+
echo "No significant changes to commit"
71+
exit 0
72+
fi
73+
74+
- name: Pull latest changes
75+
run: git pull --rebase
76+
77+
- name: Push changes
78+
run: git push origin HEAD:main
79+
env:
80+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

0 commit comments

Comments
 (0)