Skip to content

Commit

Permalink
Merge branch 'gh-pages' of github.com:expressjs/expressjs.com into pa…
Browse files Browse the repository at this point in the history
…tch-1
  • Loading branch information
bjohansebas committed Dec 12, 2024
2 parents 2f09244 + 693da28 commit 2684044
Show file tree
Hide file tree
Showing 890 changed files with 14,622 additions and 8,556 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEST="en/resources/contributing.md"
DEST="../../en/resources/contributing.md"

# This script replaces the contents of a section with the contents from
# the annotated source address.
Expand Down
20 changes: 20 additions & 0 deletions .github/scripts/get-express-version.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { readFile, writeFile } from 'node:fs/promises'
import path from 'node:path'

const NPMURL = 'https://registry.npmjs.org/express'

const response = await (await fetch(NPMURL)).json()

const { next, latest } = response['dist-tags']

try {
const filePath = path.resolve(path.join('..', '..', '_data', 'express.yml'))
let content = await readFile(filePath, 'utf8')

content = content.replace(/current_version: ".*"/, `current_version: "${latest}"`)
content = content.replace(/next_version: ".*"/, `next_version: "${next}"`)

await writeFile(filePath, content, 'utf8')
} catch (error) {
console.error('Error updating versions in _data/express.yml:', error)
}
5 changes: 2 additions & 3 deletions get-readmes.sh → .github/scripts/get-readmes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ expressjs connect-rid master
expressjs cookie-parser master
expressjs cookie-session master
expressjs cors master
expressjs csurf master
expressjs errorhandler master
expressjs method-override master
expressjs morgan master
Expand All @@ -30,7 +29,7 @@ expressjs express master/examples
LIST_END
) | while read org repo branch; do
# Write the README.md to a file named after the repo
DEST="_includes/readmes/$repo.md"
DEST="../../_includes/readmes/$repo.md"
# When fetching from a branch of a gh repo
GHURL="https://raw.githubusercontent.com/$org/$repo/$branch/README.md"
# When fetching from the latest release of a node module
Expand All @@ -43,7 +42,7 @@ LIST_END
# This allows us to specify a branch other than master if we want to.
# In this case, the branch name is added to the readme name in the filename.
if [ "$branch" != "master" ]; then
DEST="_includes/readmes/$repo-$branch.md"
DEST="../../_includes/readmes/$repo-$branch.md"
fi
echo "fetching $org/$repo/$branch from GitHub's raw content domain..."
curl -s $GHURL > $DEST
Expand Down
35 changes: 17 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,34 @@ on:
push:
branches:
- gh-pages
pull_request_review:
types: [submitted]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- "16"
if: |
github.event.pull_request.draft != true &&
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved') ||
github.event_name != 'pull_request_review'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Node.js ${{ matrix.node-version }}
shell: bash -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
dirname "$(npm which)" >> "$GITHUB_PATH"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Node.js dependencies
run: npm install

- name: List environment
id: list_env
shell: bash
run: |
echo "node@$(node -v)"
echo "npm@$(npm -v)"
npm -s ls
- name: Run tests
shell: bash
run: npm test

- name: Check Docker support
shell: bash
run: |
docker --version
make build
67 changes: 67 additions & 0 deletions .github/workflows/translation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Check Translation

on:
pull_request:
branches:
- gh-pages
paths:
- 'en/**'
- 'es/**'
- 'fr/**'
- 'it/**'
- 'id/**'
- 'ja/**'
- 'ko/**'
- 'pt-br/**'
- 'ru/**'
- 'sk/**'
- 'th/**'
- 'tr/**'
- 'uk/**'
- 'uz/**'
- 'zh-cn/**'
- 'zh-tw/**'
workflow_dispatch:
inputs:
prNumber:
description: 'PR number to check'
required: true

jobs:
check-translation:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check modified files and add labels
uses: actions/github-script@v5
with:
script: |
const languages = ['en', 'es', 'fr', 'it', 'id', 'ja', 'ko', 'pt-br', 'ru', 'sk', 'th', 'tr', 'uk', 'uz', 'zh-cn', 'zh-tw'];
const prNumber = context.eventName === 'workflow_dispatch' ? context.payload.inputs.prNumber : context.issue.number;
const { data: pullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
const { data: files } = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
const modifiedLanguages = new Set(files.map(file => file.filename.split('/')[0]));
const labelsToAdd = languages.filter(lang => !modifiedLanguages.has(lang)).map(lang => `requires-translation-${lang}`);
if (labelsToAdd.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequest.number,
labels: labelsToAdd
});
}
38 changes: 38 additions & 0 deletions .github/workflows/update-external-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update External Docs
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'

permissions:
pull-requests: write
contents: write

jobs:
update-docs:
runs-on: ubuntu-latest
if: github.repository_owner == 'expressjs'
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run scripts
working-directory: .github/scripts
run: |
bash ./get-contributing.sh
bash ./get-readmes.sh
node ./get-express-version.mjs
- name: Create Pull Request
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit-message: update external docs
title: 'Update external docs'
body: >
This auto-generated PR updates external documentation to the expressjs.com repository.
labels: doc
team_reviewers: expressjs/docs-captains
branch: external-docs-${{ github.sha }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ _site
*.iml
**/.idea
**/Thumbs.db
Gemfile.lock

.jekyll-metadata
vendor
.bundle
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.5
3 changes: 2 additions & 1 deletion 2x/applications.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@
<div id="container">
<a href='http://github.com/visionmedia/express' id='logo'>Express</a>
<div id="warning">
<center><strong>Express 2.x</strong> IS NO LONGER MAINTAINED</center>
<center><strong>Express 2.x</strong> IS END-OF-LIFE AND NO LONGER MAINTAINED</center>
<p>Known and unknown security and performance issues in 2.x have not been addressed since the last update (29 June, 2012). It is highly recommended to <a href="https://github.com/expressjs/express/wiki/Migrating-from-2.x-to-3.x">upgrade to <strong>Express 3.x</strong></a> or to <a href="http://expressjs.com/4x/api.html"><strong>Express 4.x</strong></a>.</p>
<p>If you are unable to upgrade past 2.x, please consider <a href="/en/support#commercial-support-options">Commercial Support Options</a>.</p>
</div>
<p id="tagline">
High performance, high class web development for
Expand Down
3 changes: 2 additions & 1 deletion 2x/contrib.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@
<div id="container">
<a href='http://github.com/visionmedia/express' id='logo'>Express</a>
<div id="warning">
<center><strong>Express 2.x</strong> IS NO LONGER MAINTAINED</center>
<center><strong>Express 2.x</strong> IS END-OF-LIFE AND NO LONGER MAINTAINED</center>
<p>Known and unknown security and performance issues in 2.x have not been addressed since the last update (29 June, 2012). It is highly recommended to <a href="https://github.com/expressjs/express/wiki/Migrating-from-2.x-to-3.x">upgrade to <strong>Express 3.x</strong></a> or to <a href="http://expressjs.com/4x/api.html"><strong>Express 4.x</strong></a>.</p>
<p>If you are unable to upgrade past 2.x, please consider <a href="/en/support#commercial-support-options">Commercial Support Options</a>.</p>
</div>
<p id="tagline">
High performance, high class web development for
Expand Down
3 changes: 2 additions & 1 deletion 2x/executable.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@
<div id="container">
<a href='http://github.com/visionmedia/express' id='logo'>Express</a>
<div id="warning">
<center><strong>Express 2.x</strong> IS NO LONGER MAINTAINED</center>
<center><strong>Express 2.x</strong> IS END-OF-LIFE AND NO LONGER MAINTAINED</center>
<p>Known and unknown security and performance issues in 2.x have not been addressed since the last update (29 June, 2012). It is highly recommended to <a href="https://github.com/expressjs/express/wiki/Migrating-from-2.x-to-3.x">upgrade to <strong>Express 3.x</strong></a> or to <a href="http://expressjs.com/4x/api.html"><strong>Express 4.x</strong></a>.</p>
<p>If you are unable to upgrade past 2.x, please consider <a href="/en/support#commercial-support-options">Commercial Support Options</a>.</p>
</div>
<p id="tagline">
High performance, high class web development for
Expand Down
3 changes: 2 additions & 1 deletion 2x/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@
</ul>
<a href='http://github.com/visionmedia/express' id='logo'>Express</a>
<div id="warning">
<center><strong>Express 2.x</strong> IS NO LONGER MAINTAINED</center>
<center><strong>Express 2.x</strong> IS END-OF-LIFE AND NO LONGER MAINTAINED</center>
<p>Known and unknown security and performance issues in 2.x have not been addressed since the last update (29 June, 2012). It is highly recommended to <a href="https://github.com/expressjs/express/wiki/Migrating-from-2.x-to-3.x">upgrade to <strong>Express 3.x</strong></a> or to <a href="http://expressjs.com/4x/api.html"><strong>Express 4.x</strong></a>.</p>
<p>If you are unable to upgrade past 2.x, please consider <a href="/en/support#commercial-support-options">Commercial Support Options</a>.</p>
</div>
<p id="tagline">
High performance, high class web development for
Expand Down
3 changes: 2 additions & 1 deletion 2x/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@
<div id="container">
<a href='http://github.com/visionmedia/express' id='logo'>Express</a>
<div id="warning">
<center><strong>Express 2.x</strong> IS NO LONGER MAINTAINED</center>
<center><strong>Express 2.x</strong> IS END-OF-LIFE AND NO LONGER MAINTAINED</center>
<p>Known and unknown security and performance issues in 2.x have not been addressed since the last update (29 June, 2012). It is highly recommended to use the latest version of Express.</p>
<p>If you are unable to upgrade past 2.x, please consider <a href="/en/support#commercial-support-options">Commercial Support Options</a>.</p>
</div>
<p id="tagline">
High performance, high class web development for
Expand Down
3 changes: 2 additions & 1 deletion 2x/migrate.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@
<div id="container">
<a href='http://github.com/visionmedia/express' id='logo'>Express</a>
<div id="warning">
<center><strong>Express 2.x</strong> IS NO LONGER MAINTAINED</center>
<center><strong>Express 2.x</strong> IS END-OF-LIFE AND NO LONGER MAINTAINED</center>
<p>Known and unknown security and performance issues in 2.x have not been addressed since the last update (29 June, 2012). It is highly recommended to <a href="https://github.com/expressjs/express/wiki/Migrating-from-2.x-to-3.x">upgrade to <strong>Express 3.x</strong></a> or to <a href="http://expressjs.com/4x/api.html"><strong>Express 4.x</strong></a>.</p>
<p>If you are unable to upgrade past 2.x, please consider <a href="/en/support#commercial-support-options">Commercial Support Options</a>.</p>
</div>
<p id="tagline">
High performance, high class web development for
Expand Down
3 changes: 2 additions & 1 deletion 2x/screencasts.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@
<div id="container">
<a href='http://github.com/visionmedia/express' id='logo'>Express</a>
<div id="warning">
<center><strong>Express 2.x</strong> IS NO LONGER MAINTAINED</center>
<center><strong>Express 2.x</strong> IS END-OF-LIFE AND NO LONGER MAINTAINED</center>
<p>Known and unknown security and performance issues in 2.x have not been addressed since the last update (29 June, 2012). It is highly recommended to <a href="https://github.com/expressjs/express/wiki/Migrating-from-2.x-to-3.x">upgrade to <strong>Express 3.x</strong></a> or to <a href="http://expressjs.com/4x/api.html"><strong>Express 4.x</strong></a>.</p>
<p>If you are unable to upgrade past 2.x, please consider <a href="/en/support#commercial-support-options">Commercial Support Options</a>.</p>
</div>
<p id="tagline">
High performance, high class web development for
Expand Down
44 changes: 30 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,32 @@ See [LICENSE.md](LICENSE.md) for the full license.

## Contributing translations

**IMPORTANT:** We have professional translations of the Express documentation into:
- German
- French
- Italian
- Spanish
- Brazilian Portuguese
- Japanese
- Simplified Chinese
- Traditional Chinese
- Russian
- Korean

Therefore we can no longer accept community translations for these languages, except for corrections
to the existing translations and updates to align with changes or additions to the English documentation.
We highly encourage community translations! We no longer have professional translations, and we believe in the power of our community to provide accurate and helpful translations.

The documentation is translated into these languages:
- English (`en`)
- Spanish (`es`)
- French (`fr`)
- Italian (`it`)
- Indonesian (`id`)
- Japanese (`ja`)
- Korean (`ko`)
- Brazilian Portuguese (`pt-br`)
- Russian (`ru`)
- Slovak (`sk`)
- Thai (`th`)
- Turkish (`tr`)
- Ukrainian (`uk`)
- Uzbek (`uz`)
- Simplified Chinese (`zh-cn`)
- Traditional Chinese (`zh-tw`)

To find translations that need to be done, you can [filter for merged PRs](https://github.com/expressjs/expressjs.com/pulls?q=is%3Apr+is%3Aclosed+label%3Arequires-translation-es) that include the tag for your language, such as `requires-translation-es`.

When you contribute a translation, please reference the original PR. This helps the person merging your translation to remove the `requires-translation-es` tag from the original PR.


### Adding new translations

To contribute a translation into another language, following the procedure below.

Expand All @@ -37,3 +49,7 @@ Follow these steps:
6. Create the header, footer, notice, and announcement file for the language in the `_includes/` directory, in the respective directories, and make necessary edits to the contents.
7. Create the announcement file for the language in the `_includes/` directory.
9. Make sure to append `/{{ page.lang }}` to all the links within the site.
10. Update the `CONTRIBUTING.md` and the `.github/workflows/translation.yml` files with the new language


Thank you for your interest in contributing to expressjs.com. Your efforts help make our documentation accessible to everyone!
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use the official Ruby image as the base
FROM ruby:3.3.5

# Install Jekyll and Bundler
RUN gem install jekyll bundler

# Set the working directory
WORKDIR /usr/src/app

# Change the permissions of the working directory
RUN chmod 777 /usr/src/app

# Copy the Gemfile into the image
COPY Gemfile ./
COPY Gemfile.lock ./

# Install the gems
RUN bundle install --no-cache

# Copy the rest of the project into the image
COPY . .

# Expose the port Jekyll will run on
EXPOSE 4000

# The default command to run Jekyll
CMD ["jekyll", "serve", "--host", "0.0.0.0", "--livereload"]
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
source 'https://rubygems.org'

gem 'github-pages', '110', group: :jekyll_plugins
ruby '3.3.5'

gem 'github-pages', group: :jekyll_plugins
gem 'webrick'

Loading

0 comments on commit 2684044

Please sign in to comment.