Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from nodejs:main #1562

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9b63b5f
Blog: v23.1.0 release post (#7140)
aduh95 Oct 24, 2024
d0ca997
feat(blog): enable events (#7137)
AugustinMauroy Oct 25, 2024
0a4a99f
fix: remove unused i18n key (#7138)
AugustinMauroy Oct 26, 2024
32fd063
content/chore(learn): give visibility to the status page (#7139)
AugustinMauroy Oct 27, 2024
3d144f7
hotfix: fix prettier:fix script to pass --write argument
bmuenzenmeyer Oct 28, 2024
ccfd4b3
Improve npm documentation for dependency management (#7146)
Makena-Wambui Oct 28, 2024
89ff7a3
Meta: adding docs about how to add/modify learn page (#7116)
AugustinMauroy Oct 28, 2024
90afad3
Blog: v22.11.0 release post (#7152)
richardlau Oct 29, 2024
63e12e7
Docs: add .mjs example to WebAssembly usage section (#7147)
Makena-Wambui Oct 31, 2024
d97bede
test: release data coverage (7130) (#7150)
rakeshkumar1019 Oct 31, 2024
f64f547
style: make sidebars sticky (#7132)
arthurjdam Oct 31, 2024
1756a08
meta: bump actions/cache from 4.1.0 to 4.1.2 (#7162)
dependabot[bot] Nov 1, 2024
33c6599
meta: bump actions/checkout from 4.2.1 to 4.2.2 (#7163)
dependabot[bot] Nov 1, 2024
fcff96f
refactor: Moving the version support button to the footer (#7156)
canerakdas Nov 1, 2024
5b51d17
meta: bump thollander/actions-comment-pull-request from 2.5.0 to 3.0.…
dependabot[bot] Nov 1, 2024
6fccb38
meta: bump actions/upload-artifact from 4.4.1 to 4.4.3 (#7161)
dependabot[bot] Nov 1, 2024
c3efd76
meta: bump actions/dependency-review-action from 4.3.4 to 4.4.0 (#7160)
dependabot[bot] Nov 1, 2024
e430fa1
meta: bump the testing group with 2 updates (#7168)
dependabot[bot] Nov 3, 2024
e5936be
meta: bump shiki from 1.17.7 to 1.22.2 (#7175)
dependabot[bot] Nov 3, 2024
e2e6c33
meta: bump @types/node from 20.16.5 to 20.17.5 (#7174)
dependabot[bot] Nov 3, 2024
cd077a1
meta: bump typescript from 5.5.4 to 5.6.3 (#7172)
dependabot[bot] Nov 3, 2024
914b960
meta: bump actions/setup-node from 4.0.4 to 4.1.0 (#7165)
dependabot[bot] Nov 3, 2024
845a142
content(learn): Profiling a Node.js application (#7158)
Makena-Wambui Nov 3, 2024
8cf21b0
meta: bump @types/react from 18.3.11 to 18.3.12 in the react group (#…
dependabot[bot] Nov 3, 2024
ac593bd
meta: bump @eslint/js from 9.10.0 to 9.14.0 (#7173)
dependabot[bot] Nov 5, 2024
30619f6
meta: bump github/codeql-action from 3.26.12 to 3.27.0 (#7159)
dependabot[bot] Nov 5, 2024
cb43b64
meta: bump the storybook group with 6 updates (#7167)
dependabot[bot] Nov 5, 2024
9017bea
fix: Consistent color transitions and Tailwind updates (#7179)
canerakdas Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Git Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
Expand All @@ -76,7 +76,7 @@ jobs:
# regardless of having code changes or not
fetch-depth: 1

- uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
Expand All @@ -89,7 +89,7 @@ jobs:
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
# We want to ensure that the Node.js version running here respects our supported versions
node-version-file: '.nvmrc'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -60,7 +60,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -73,6 +73,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
category: '/language:${{matrix.language}}'
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
egress-policy: audit

- name: Git Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Review Dependencies
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
10 changes: 5 additions & 5 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ jobs:
egress-policy: audit

- name: Git Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: Add Comment to PR
# Signal that a lighthouse run is about to start
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
uses: thollander/actions-comment-pull-request@e2c37e53a7d2227b61585343765f73a9ca57eda9 # v3.0.0
with:
message: |
Running Lighthouse audit...
# Used later to edit the existing comment
comment_tag: 'lighthouse_audit'
comment-tag: 'lighthouse_audit'

- name: Capture Vercel Preview
uses: patrickedqvist/wait-for-vercel-preview@06c79330064b0e6ef7a2574603b62d3c98789125 # v1.3.2
Expand Down Expand Up @@ -103,9 +103,9 @@ jobs:

- name: Add Comment to PR
# Replace the previous message with our formatted lighthouse results
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
uses: thollander/actions-comment-pull-request@e2c37e53a7d2227b61585343765f73a9ca57eda9 # v3.0.0
with:
# Reference the previously created comment
comment_tag: 'lighthouse_audit'
comment-tag: 'lighthouse_audit'
message: |
${{ steps.format_lighthouse_score.outputs.comment }}
12 changes: 6 additions & 6 deletions .github/workflows/lint-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ jobs:
egress-policy: audit

- name: Git Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: Restore Lint Cache
uses: actions/cache/restore@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.turbo/cache
Expand All @@ -95,7 +95,7 @@ jobs:
cache-lint-

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
# We want to ensure that the Node.js version running here respects our supported versions
node-version-file: '.nvmrc'
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
(github.event_name == 'pull_request_target' &&
startsWith(github.event.pull_request.head.ref, 'dependabot/') == false &&
github.event.pull_request.head.ref != 'chore/crowdin')
uses: actions/cache/save@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.turbo/cache
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
egress-policy: audit

- name: Git Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
Expand All @@ -173,7 +173,7 @@ jobs:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
# We want to ensure that the Node.js version running here respects our supported versions
node-version-file: '.nvmrc'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
egress-policy: audit

- name: Git Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

Expand All @@ -51,14 +51,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: Upload Artifacts
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: Upload Scan Results
uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
sarif_file: results.sarif
12 changes: 6 additions & 6 deletions .github/workflows/translations-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
egress-policy: audit

- uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
- uses: thollander/actions-comment-pull-request@e2c37e53a7d2227b61585343765f73a9ca57eda9 # v3.0.0
with:
message: |
> [!NOTE]\
Expand All @@ -53,7 +53,7 @@ jobs:
> We recommend giving a read on our [Translation Guidelines](https://github.com/nodejs/nodejs.org/blob/main/TRANSLATION.md).
>
> Thank you!
comment_tag: use_crowdin
comment-tag: use_crowdin

format_crowdin_pull_request:
# We should only run the automated Format Command on Crowdin-based Pull Requests
Expand All @@ -75,13 +75,13 @@ jobs:
egress-policy: audit

- name: Git Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}

- name: Restore Lint Cache
uses: actions/cache/restore@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
apps/site/.eslintmdcache
Expand All @@ -97,7 +97,7 @@ jobs:
cache-lint-

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
# We want to ensure that the Node.js version running here respects our supported versions
node-version-file: '.nvmrc'
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
commit_message: 'chore: automated format of translated files'

- name: Save Lint Cache
uses: actions/cache/save@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
apps/site/.eslintmdcache
Expand Down
97 changes: 97 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Thank you for your interest in contributing to the Node.js Website. Before you p
- [Commit Guidelines](#commit-guidelines)
- [Pull Request Policy](#pull-request-policy)
- [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11)
- [Adding a Learn Page](#adding-a-learn-page)

## Contributing

Expand Down Expand Up @@ -241,3 +242,99 @@ By contributing to this project, I certify that:
[Conventional Commits]: https://www.conventionalcommits.org/
[Commit Signing]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
[Husky]: https://typicode.github.io/husky/

## Adding a Learn Page

Since the redesign of the website, we have a new section called 'Learn'. This is intended to provide a more explanatory set of resources than the API docs, which are designed purely to explain the available APIs.

The Learn section is separate from the API docs and is intended to provide a more narrative, tutorial style set of resources. This is a place where we can provide more context and guidance on how to use the APIs and how to build applications with them.

The Learn section is also divided into several sub-categories. Note that the sub-categories must be on the same topic.

### Structure of the Learn section

The file structure of the Learn section is as follows:

```
site/
├─ pages/
│ ├─ en/
│ │ ├─ learn/
│ │ │ ├─ sub-categories/
│ │ │ │ ├─ article.md
```

The frontmatter of the `article.md` file should look like this:

```yaml
title: A super cool title
layout: learn
authors: github_username, another_github_username
```

A little bit of explanation about the frontmatter:

- `title`: The title of the article. This will be displayed as the title of the page. We recommend that you use the same title as the navigation entry. How to enter navigation entries is explained later in this document.
- `layout`: This must be set to `learn` so that the new article has the same style as other Learn pages.
- `authors`: A list of the GitHub usernames of the authors of the article. This is used to display the authors' profile pictures on the page. The frontmatter must always have the `github_username` followed by `, `. The comma and space is important.

### Modify the navigation

The data of the navigation is stored in app/site/navigation.json. To add a new entry to the navigation, you need to add a new object to the sideNavigation.learn.

```json
{
"sideNavigation": {
"learn": [
{
"label": "Sub-category",
"items": {
"article": {
"link": "/learn/sub-category/article",
"label": "components.navigation.learn.sub-category.article"
}
}
}
]
}
}
```

The `label` key is used to display the title of the article in the navigation. To add a new i18n key we recommend you to read [the translation guide](./TRANSLATION.md#adding-new-translation-keys).

### Add the article

To add a new article, you need to create a new markdown file in the `site/pages/en/learn/your-sub-category` directory.

1. Create your new markdown file in the `site/pages/en/learn/your-sub-category` directory.
2. Add the frontmatter to the file.
3. Write your article.
4. Add the navigation entry to `app/site/navigation.json`.
5. Add the translation key to the translation files.

DONE!

### Edit the article

To edit an existing article, you need to find the markdown file in the `site/pages/en/learn/your-sub-category` directory.

> [!NOTE]
> If you rewrite a big part of the article you can add yourself as an author in the frontmatter. **But** if you only fix a typo or a small part of the article, you don't need to add yourself as an author.

### Accessible MDX components

#### Codebox

The codebox component is used to display code snippets. If two code snippets follow without any text between them, they will be displayed in the same codebox, but with two tabs.

```md
'''cjs
const http = require('node:http');
'''

'''mjs
import http from 'node:http';
'''
```

`cjs` and `mjs` are variants of `js`, it's just to display the correct language in the codebox (cjs = CommonJS, mjs = ES Module).
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ These are maintained in different repositories and we urge users to open **issue

[Translation Guidelines][]

[Status Page](https://status.nodejs.org/) of the Node.js web infrastructure.

## Thanks

- Thanks to all contributors and collaborators that make this project possible.
Expand Down
Loading