Skip to content

Commit

Permalink
Merge branch 'main' into add-browser-name-compatibility-list
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored Jan 27, 2025
2 parents a53b138 + 0eafcf7 commit 08a0dce
Show file tree
Hide file tree
Showing 101 changed files with 3,707 additions and 2,513 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ cloud-function/**/*.js
filecheck/*.js
mdn/content/
tool/*.js
bins/*.mjs
4 changes: 3 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ jobs:
# so you have to set it to something. So let's (ab)use the content
# we use for the end-to-end testing.
CONTENT_ROOT: testing/content/files
run: yarn build:prepare
# We use the legacy version for now to include spas and popularities in
# the package.
run: yarn build:legacy:prepare

- name: Publish
if: steps.release.outputs.release_created
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/npm-published-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
REACT_APP_DISABLE_AUTH: true
CONTENT_ROOT: testing/content/files
run: |
yarn build:prepare
yarn build:legacy:prepare
- name: Build and install tarball
run: |
Expand All @@ -70,6 +70,14 @@ jobs:
yarn add file:$TARBALL
yarn install
- name: (mdn/content) yarn rari-build --help
working-directory: mdn/content
run: yarn rari-build --help

- name: (mdn/content) yarn rari-tool --help
working-directory: mdn/content
run: yarn rari-tool --help

- name: (mdn/content) yarn yari-build --help
working-directory: mdn/content
run: yarn yari-build --help
Expand Down Expand Up @@ -107,7 +115,7 @@ jobs:
- name: SSR build a page
working-directory: mdn/content
run: |
yarn build files/en-us/mdn/kitchensink/index.md
yarn rari-build -f ${PWD}/files/en-us/mdn/kitchensink/index.md
- name: Debug server's stdout and stderr if tests failed
if: failure()
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ jobs:
BUILD_GOOGLE_ANALYTICS_MEASUREMENT_ID: G-XXXXXXXX
run: |
yarn build:prepare
# BUILD_FOLDERSEARCH=mdn/kitchensink yarn build:docs
BUILD_FOLDERSEARCH=web/javascript/reference/global_objects/array/foreach yarn build:docs
yarn build -f $CONTENT_ROOT/en-us/web/javascript/reference/global_objects/array/foreach -f $CONTENT_ROOT/en-us/mdn/kitchensink
yarn render:html
- name: Serve and lhci
Expand Down
57 changes: 28 additions & 29 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ jobs:
mv mdn/translated-content-de/files/de mdn/translated-content/files/
rm -rf mdn/translated-content-de
- name: Clean and commit de
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
working-directory: mdn/translated-content
run: |
git add files/de
git -c user.name='MDN' -c user.email='[email protected]' commit -m 'de'
- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
Expand All @@ -151,7 +158,8 @@ jobs:
if: ${{ ! vars.SKIP_BUILD }}
run: yarn --frozen-lockfile
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
# Use a GITHUB_TOKEN to bypass rate limiting for ripgrep and rari.
# See https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Python
Expand Down Expand Up @@ -198,6 +206,12 @@ jobs:
GENERIC_CONTENT_ROOT: ${{ github.workspace }}/mdn/generic-content/files
BASE_URL: "https://developer.mozilla.org"

# rari
BUILD_OUT_ROOT: "client/build"
LIVE_SAMPLES_BASE_URL: https://live.mdnplay.dev
INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.mdn.mozilla.net
ADDITIONAL_LOCALES_FOR_GENERICS_AND_SPAS: de

# The default for this environment variable is geared for writers
# (aka. local development). Usually defaults are supposed to be for
# secure production but this is an exception and default
Expand Down Expand Up @@ -245,14 +259,14 @@ jobs:
REACT_APP_MDN_PLUS_10Y_PLAN: price_1KeG02JNcmPzuWtRlrSiLTI6

# Surveys.
REACT_APP_SURVEY_START_HOMEPAGE_FEEDBACK_2024: 1731369600000 # new Date("2024-11-12Z").getTime()
REACT_APP_SURVEY_END_HOMEPAGE_FEEDBACK_2024: 1733616000000 # new Date("2024-12-08Z").getTime()
REACT_APP_SURVEY_RATE_FROM_HOMEPAGE_FEEDBACK_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_HOMEPAGE_FEEDBACK_2024: 1 # 100%
REACT_APP_SURVEY_START_WEBDX_EDITING_2024: 1731628800000 # new Date("2024-11-15Z").getTime()
REACT_APP_SURVEY_END_WEBDX_EDITING_2024: 1732320000000 # new Date("2024-11-23Z").getTime()
REACT_APP_SURVEY_RATE_FROM_WEBDX_EDITING_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_WEBDX_EDITING_2024: 0.1 # 10%
REACT_APP_SURVEY_START_HOUSE_SURVEY_2025: 1736208000000 # new Date("2025-01-07Z").getTime()
REACT_APP_SURVEY_END_HOUSE_SURVEY_2025: 1737072000000 # new Date("2025-01-17Z").getTime()
REACT_APP_SURVEY_RATE_FROM_HOUSE_SURVEY_2025: 0.0
REACT_APP_SURVEY_RATE_TILL_HOUSE_SURVEY_2025: 0.05 # 5%

# Telemetry.
REACT_APP_GLEAN_CHANNEL: prod
Expand Down Expand Up @@ -285,39 +299,24 @@ jobs:
echo "CONTENT_ROOT=$CONTENT_ROOT"
echo "CONTENT_TRANSLATED_ROOT=$CONTENT_TRANSLATED_ROOT"
yarn build:sw
yarn build:prepare
yarn build:client
yarn build:ssr
yarn tool:legacy build-robots-txt
yarn tool sync-translated-content es fr ja ko pt-br ru zh-cn zh-tw
yarn rari content sync-translated-content
yarn rari git-history
# Build using one process per locale.
# Note: We have 4 cores, but 9 processes is a reasonable number.
for locale in en-us de es fr ja ko pt-br ru zh-cn zh-tw; do
yarn build:docs --locale $locale 2>&1 | sed "s/^/[$locale] /" &
pids+=($!)
done
for pid in "${pids[@]}"; do
wait $pid
done
yarn rari build --all --issues client/build/issues.json --templ-stats
du -sh client/build
# Build the blog
yarn build:blog
# Build the curriculum
yarn build:curriculum
# Generate sitemap index file
yarn build --sitemap-index
# SSR all pages
yarn render:html
# Generate whatsdeployed files.
yarn tool whatsdeployed --output client/build/_whatsdeployed/code.json
yarn tool whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
yarn tool:legacy whatsdeployed --output client/build/_whatsdeployed/code.json
yarn tool:legacy whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool:legacy whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ jobs:
REACT_APP_SURVEY_END_WEB_APP_AUGUST_2024: 1723593600000 # new Date("2024-08-14Z").getTime()
REACT_APP_SURVEY_RATE_FROM_WEB_APP_AUGUST_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_WEB_APP_AUGUST_2024: 0.05 # 5%
REACT_APP_SURVEY_START_HOUSE_SURVEY_2025: 0 # stage
REACT_APP_SURVEY_END_HOUSE_SURVEY_2025: 1737072000000 # new Date("2025-01-17Z").getTime()
REACT_APP_SURVEY_RATE_FROM_HOUSE_SURVEY_2025: 0.0
REACT_APP_SURVEY_RATE_TILL_HOUSE_SURVEY_2025: 0.05 # 5%

# Telemetry.
REACT_APP_GLEAN_CHANNEL: stage
Expand Down Expand Up @@ -313,23 +317,20 @@ jobs:
yarn build:sw
yarn build:client
yarn build:ssr
yarn tool build-robots-txt
yarn tool:legacy build-robots-txt
yarn rari content sync-translated-content
yarn rari git-history
yarn rari build --all --issues client/build/issues.json --templ-stats
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
# SSR all pages
yarn render:html
# Generate whatsdeployed files.
yarn tool whatsdeployed --output client/build/_whatsdeployed/code.json
yarn tool whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
yarn tool:legacy whatsdeployed --output client/build/_whatsdeployed/code.json
yarn tool:legacy whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool:legacy whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
Expand Down
59 changes: 52 additions & 7 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ env:
on:
workflow_dispatch:
inputs:
rari-ref:
description: "rari ref to build (leave blank for npm release)"
type: string
default: ""

content-ref:
description: "content ref to build"
type: string
default: "main"

notes:
description: "Notes"
required: false
Expand Down Expand Up @@ -37,6 +47,13 @@ jobs:
if: github.repository == 'mdn/yari'

steps:
- name: Print information about build
run: |
echo "rari-ref: ${{ github.event.inputs.rari-ref }}"
echo "content-ref: ${{ github.event.inputs.content-ref }}"
echo "notes: ${{ github.event.inputs.notes || env.DEFAULT_NOTES }}"
echo "invalidate: ${{ github.event.inputs.invalidate }}"
- uses: actions/checkout@v4

- uses: actions/checkout@v4
Expand All @@ -49,6 +66,7 @@ jobs:
# but for now it's good enough. We'll need all the history
# so we can figure out each document's last-modified date.
fetch-depth: 0
ref: ${{ github.event.inputs.content-ref }}

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
Expand Down Expand Up @@ -109,7 +127,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
cache: ${{ github.event.inputs.rari-ref == '' && 'yarn' || '' }}

- name: Install all yarn packages
if: ${{ ! vars.SKIP_BUILD }}
Expand All @@ -119,9 +137,36 @@ jobs:
# See https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Print information about build
- uses: actions/checkout@v4
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
with:
repository: mdn/rari
path: mdn/rari
ref: ${{ github.event.inputs.rari-ref }}

- name: Cache Cargo registry
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- uses: dtolnay/rust-toolchain@stable
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}

- name: sccache-cache
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
uses: mozilla-actions/[email protected]

- name: Build rari
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
run: |
echo "notes: ${{ github.event.inputs.notes || env.DEFAULT_NOTES }}"
cd mdn/rari
cargo build --release
cp target/release/rari ../../node_modules/@mdn/rari/bin/
- name: Print information about CPU
run: cat /proc/cpuinfo
Expand Down Expand Up @@ -204,7 +249,7 @@ jobs:
yarn build:sw
yarn build:client
yarn build:ssr
yarn tool build-robots-txt
yarn tool:legacy build-robots-txt
yarn rari content sync-translated-content
yarn rari git-history
Expand All @@ -215,9 +260,9 @@ jobs:
yarn render:html
# Generate whatsdeployed files.
yarn tool whatsdeployed --output client/build/_whatsdeployed/code.json
yarn tool whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
yarn tool:legacy whatsdeployed --output client/build/_whatsdeployed/code.json
yarn tool:legacy whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool:legacy whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ jobs:
env:
ENV_FILE: .env.testing
run: |
yarn build:prepare
yarn build:docs
yarn build:legacy:prepare
yarn build:legacy
yarn render:html
yarn start:static-server > /tmp/stdout.log 2> /tmp/stderr.log &
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.0.1"
".": "4.2.2"
}
Loading

0 comments on commit 08a0dce

Please sign in to comment.