Skip to content

Commit

Permalink
Sync: merge major/website-redesign into main (#5356)
Browse files Browse the repository at this point in the history
Co-authored-by: Manish Kumar ⛄ <manishprivet@protonmail.com>
Co-authored-by: Wai.Tung <maledong_public@foxmail.com>
Co-authored-by: Shanmughapriyan S <priyanshan03@gmail.com>
Co-authored-by: Michael Esteban <mickel13@gmail.com>
Co-authored-by: Claudio Wunder <cwunder@gnome.org>
Co-authored-by: Teja Sai Sandeep Reddy Konala <sandeep.konala@knacksystems.com>
Co-authored-by: Claudio Wunder <cwunder@hubspot.com>
Co-authored-by: vasanth9 <cheepurupalli.vasanthkumar.com>
Co-authored-by: Aymen Naghmouchi <aymenadvance@gmail.com>
Co-authored-by: Teja Sai Sandeep Reddy Konala <tejasaisandeepreddykonala@MacBook-Pro.local>
Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
Co-authored-by: Guilherme Araújo <guilherme.araujo@maxxidata.com>
Co-authored-by: Augustin Mauroy <augustin.mauroy@outlook.fr>
Co-authored-by: HinataKah0 <128208841+HinataKah0@users.noreply.github.com>
Co-authored-by: Olaleye Blessing <Olayinkablexxy@gmail.com>
Co-authored-by: ktssr <31731919+ktssr@users.noreply.github.com>
Co-authored-by: Harkunwar Kochar <10580591+Harkunwar@users.noreply.github.com>
Co-authored-by: vasanthkumar <42891954+vasanth9@users.noreply.github.com>
Co-authored-by: Floran Hachez <floran.hachez@gmail.com>
Co-authored-by: Jatin <96469998+JatinSharma32@users.noreply.github.com>
  • Loading branch information
19 people authored May 4, 2023
1 parent 7cccb76 commit 71ef9e3
Show file tree
Hide file tree
Showing 190 changed files with 23,168 additions and 4,429 deletions.
11 changes: 10 additions & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# https://github.com/browserslist/browserslist#readme

defaults and supports es6-module
maintained node versions

[production]

cover 95%
not dead

[development]

defaults
Explorer >= 10
8 changes: 5 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ public/en/user-survey-report
public/static/documents
public/static/legacy

# These should be fixed in the future as the
# tests and scripts will be updated in this PR
tests
# We don't want to lint/prettify the Coverage Results
coverage

# MDX Plugin enforces Prettier formatting which should
# be done in the future as we don't want to update the Markdown file
# contents right now
pages/**/*.md

# We shouldn't lint statically generated Storybook files
storybook-static
53 changes: 50 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
{
"extends": ["eslint:recommended", "next"],
"root": true,
"overrides": [
{
"files": ["**/*.{mjs,js,jsx,ts,tsx}"],
"extends": ["plugin:prettier/recommended"],
"env": { "node": true, "es6": true }
"plugins": ["import"],
"env": { "node": true, "es6": true },
"rules": {
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
"internal",
"sibling",
"parent",
"index",
"type"
]
}
]
}
},
{
"files": ["**/**.test.{js,jsx,ts,tsx}"],
"extends": ["plugin:testing-library/react"],
"env": { "jest": true, "node": true, "browser": true }
},
{
"files": ["**/*.{ts,tsx}"],
"globals": { "globalThis": false }
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"globals": { "globalThis": false },
"rules": {
"@typescript-eslint/consistent-type-imports": "error"
}
},
{
"files": ["**/*.tsx"],
Expand All @@ -19,6 +47,7 @@
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"consistent-return": "off",
"react/destructuring-assignment": ["warn", "always"],
"react/function-component-definition": [
"error",
{
Expand All @@ -29,7 +58,19 @@
"react/jsx-filename-extension": [
2,
{ "extensions": [".js", ".jsx", ".ts", ".tsx"] }
]
],
"no-restricted-syntax": [
"error",
{
"selector": "ImportDeclaration[source.value='react'][specifiers.0.type='ImportDefaultSpecifier']",
"message": "Default React import not allowed since we use the TypeScript jsx-transform. If you need a global type that collides with a React named export (such as `MouseEvent`), try using `globalThis.MouseHandler`"
},
{
"selector": "ImportDeclaration[source.value='react'] :matches(ImportNamespaceSpecifier)",
"message": "Named * React import is not allowed. Please import what you need from React with Named Imports"
}
],
"@typescript-eslint/consistent-type-definitions": ["error", "type"]
}
},
{
Expand Down Expand Up @@ -68,6 +109,12 @@
"no-unused-vars": "off",
"prefer-promise-reject-errors": "off"
}
},
{
"files": ["**/*.stories.{ts,tsx}"],
"rules": {
"import/no-anonymous-default-export": "off"
}
}
]
}
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Please read the [Code of Conduct](https://github.com/nodejs/nodejs.org/blob/main/CODE_OF_CONDUCT.md) and the [Contributing Guidelines](https://github.com/nodejs/nodejs.org/blob/main/CONTRIBUTING.md) before opening a pull request.
-->

## Description

<!-- Write a brief description of the changes introduced by this PR -->

## Related Issues

<!--
Link to the issue that is fixed by this PR (if there is one)
e.g. Fixes #1234, Addresses #1234, Related to #1234, etc.
-->

### Check List

<!--
ATTENTION
Please follow this check list to ensure that you've followed all items before opening this PR
-->

- [ ] I have read the [Contributing Guidelines](https://github.com/nodejs/nodejs.org/blob/main/CONTRIBUTING.md) and made commit messages that follow the guideline.
- [ ] I have run `npx turbo lint` to ensure the code follows the style guide. And run `npx turbo lint:fix` to fix the style errors if necessary.
- [ ] I have run `npx turbo format` to ensure the code follows the style guide.
- [ ] I have run `npx turbo test` to check if all tests are passing, and/or `npx turbo test:snapshot` to update snapshots if I created and/or updated React Components.
- [ ] I've covered new added functionality with unit tests if necessary.
28 changes: 20 additions & 8 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -36,28 +38,36 @@ jobs:
- name: Setup GitHub Pages
uses: actions/configure-pages@v3

- name: Restore Next.js cache
- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
node_modules/.cache
key: build-${{ hashFiles('**/package-lock.json') }}-
restore-keys: |
build-${{ hashFiles('**/package-lock.json') }}-
enableCrossOsArchive: true

- name: Build Next.js
run: npm run build
run: npx turbo build
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
NODE_OPTIONS: '--max_old_space_size=4096'
NEXT_BASE_PATH: /nodejs.org

- name: Save Next.js cache
- name: Save Cache
uses: actions/cache/save@v3
with:
path: |
.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('.next/cache/eslint') }}
node_modules/.cache
key: build-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('node_modules/.cache') }}
enableCrossOsArchive: true

- name: Export Next.js static files
run: npm run export
run: npx turbo export

- name: Upload Artifact
uses: actions/upload-pages-artifact@v1
Expand All @@ -66,11 +76,13 @@ jobs:

deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build

steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
96 changes: 87 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request:
workflow_dispatch:

env:
FORCE_COLOR: 2

jobs:
lint:
name: Lint
Expand All @@ -15,6 +12,8 @@ jobs:
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -25,8 +24,77 @@ jobs:
- name: Install NPM packages
run: npm ci

- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-
restore-keys: |
tests-${{ hashFiles('**/package-lock.json') }}-
enableCrossOsArchive: true

- name: Run Linting
run: npm run lint
run: npx turbo lint
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

- name: Save Cache
uses: actions/cache/save@v3
with:
path: |
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('node_modules/.cache') }}
enableCrossOsArchive: true

unit-tests:
name: Tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install NPM packages
run: npm ci

- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-
restore-keys: |
tests-${{ hashFiles('**/package-lock.json') }}-
enableCrossOsArchive: true

- name: Run Unit Tests
run: npx turbo test:ci
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

- name: Save Cache
uses: actions/cache/save@v3
with:
path: |
node_modules/.cache
key: tests-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('node_modules/.cache') }}
enableCrossOsArchive: true

build:
name: Build on ${{ matrix.os }}
Expand All @@ -40,6 +108,8 @@ jobs:
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -50,21 +120,29 @@ jobs:
- name: Install NPM packages
run: npm ci

- name: Restore Next.js cache
- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
node_modules/.cache
key: build-${{ hashFiles('**/package-lock.json') }}-
restore-keys: |
build-${{ hashFiles('**/package-lock.json') }}-
enableCrossOsArchive: true

- name: Build Next.js
run: npm run build
run: npx turbo build
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Save Next.js cache
- name: Save Cache
uses: actions/cache/save@v3
with:
path: |
.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('.next/cache/eslint') }}
node_modules/.cache
key: build-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('node_modules/.cache') }}
enableCrossOsArchive: true
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ pages/en/blog/year-[0-9][0-9][0-9][0-9].md
# ESLint Cache Files
.eslintjscache
.eslintmdcache

# Jest
coverage
.swc

# Storybook
storybook-static

# Vercel Config
.vercel

# TurboRepo
.turbo
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ public/en/user-survey-report
public/static/documents
public/static/legacy

# We don't want to lint/prettify the Coverage Results
coverage

# MDX Plugin enforces Prettier formatting which should
# be done in the future as we don't want to update the Markdown file
# contents right now
Expand All @@ -15,3 +18,6 @@ pages/**/*.md
# Prettier's Handlebar parser is limited and chokes on some syntax features
# https://github.com/prettier/prettier/issues/11834
scripts/release-post/template.hbs

# We shouldn't lint statically generated Storybook files
storybook-static
Loading

2 comments on commit 71ef9e3

@vercel
Copy link

@vercel vercel bot commented on 71ef9e3 May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nodejs-org-stories – ./

nodejs-org-stories-git-main-openjs.vercel.app
nodejs-org-storybook.vercel.app
nodejs-org-stories-openjs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 71ef9e3 May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nodejs-org – ./

nodejs-org-openjs.vercel.app
node-js-org.vercel.app
nodejs-org-git-main-openjs.vercel.app

Please sign in to comment.