Skip to content

Commit

Permalink
Merge branch 'main' into npm
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Oct 14, 2024
2 parents cfbe861 + b37a6e1 commit a10cfc2
Show file tree
Hide file tree
Showing 759 changed files with 50,714 additions and 22,993 deletions.
2 changes: 2 additions & 0 deletions .env-dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ CONTENT_ROOT=../content/files
#CONTENT_TRANSLATED_ROOT=../translated-content/files
#CONTRIBUTOR_SPOTLIGHT_ROOT=../mdn-contributor-spotlight/contributors

REACT_APP_DEV_MODE=true

# See documentation in docs/envvars.md for more information about this
#BUILD_FLAW_LEVELS=broken_links:error, macros:ignore
4 changes: 3 additions & 1 deletion .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ REACT_APP_AUTOCOMPLETE_SEARCH_WIDGET=true

# These are set to fake values just to make sure the paths that
# injects the relevant script tags actually run in end-to-end testing.
BUILD_GOOGLE_ANALYTICS_ACCOUNT=UA-00000000-0
BUILD_GOOGLE_ANALYTICS_MEASUREMENT_ID=G-XXXXXXXX

# The functional tests are done in a production'y way as if it had
# to go into full production mode.
Expand All @@ -34,3 +34,5 @@ BUILD_ALWAYS_ALLOW_ROBOTS=true
REACT_APP_ENABLE_PLUS=true

REACT_APP_FXA_SIGNIN_URL=/users/fxa/login/authenticate/

BASE_URL="https://developer.mozilla.org"
34 changes: 27 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
// @ts-check
const path = require("node:path");
const { readGitignoreFiles } = require("eslint-gitignore");

const ignores = readGitignoreFiles({
cwd: path.join(".git", "info"),
patterns: ["exclude"],
});
/** @type {string[]} */
let ignores = [];
try {
ignores = readGitignoreFiles({
cwd: path.join(".git", "info"),
patterns: ["exclude"],
});
} catch (error) {
if (error.code === "ENOTDIR") {
console.log(
`${path.join(
".git",
"info",
"exclude"
)} dir doesn't exist, we're probably a submodule`
);
} else {
throw error;
}
}

module.exports = {
ignorePatterns: ignores,
Expand Down Expand Up @@ -32,14 +49,17 @@ module.exports = {
{
files: ["**/*.ts", "**/*.tsx"],
parser: "@typescript-eslint/parser",
extends: ["plugin:@typescript-eslint/recommended"],
extends: [
"plugin:@typescript-eslint/recommended",
//"plugin:@typescript-eslint/stylistic",
],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ ignoreRestSiblings: true },
],
"n/no-deprecated-api": "off",
"n/no-extraneous-import": [
"error",
{
Expand All @@ -48,7 +68,7 @@ module.exports = {
],
"n/no-missing-import": "off",
"n/no-unpublished-import": "off",
"n/shebang": "off",
"n/hashbang": "off",
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/** linguist-generated=false

17 changes: 17 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ----------------------------------------------------------------------------
# MDN Yari CODEOWNERS
# ----------------------------------------------------------------------------
# Order is important. The last matching pattern takes precedence.
# For more detailed information, see:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
# ----------------------------------------------------------------------------

# ----------------------------------------------------------------------------
# DEFAULT OWNERS
# ----------------------------------------------------------------------------
* @mdn/core-dev

# These are @mdn-bot because the auto-merge GHA workflow uses the PAT of this account.
# If another reviewer is specified, update the PAT token or auto-merge will cease to be automatic.
/package.json @mdn-bot
/package-lock.json @mdn-bot
42 changes: 42 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 35
groups:
sentry:
patterns:
- "@sentry/*"
types:
patterns:
- "@types/*"
update-types:
- "minor"
- "patch"
ignore:
# Temporarily disable updates to Dinocons
- dependency-name: "@mdn/dinocons"
Expand All @@ -19,18 +29,50 @@ updates:
directory: "/deployer"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"

- package-ecosystem: "pip"
directory: "/testing/integration"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"

- package-ecosystem: npm
directory: "/client/pwa"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: npm
directory: "/cloud-function"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: npm
directory: "/lib/locale-utils"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: npm
directory: "/lib/pong"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: npm
directory: "/lib/slug-utils"
schedule:
Expand Down
90 changes: 78 additions & 12 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,88 @@
blog:
- changed-files:
- any-glob-to-any-file: "**/blog/**/*"

browser-compat:
- "client/src/document/ingredients/browser-compatability-table/**/*"
- changed-files:
- any-glob-to-any-file: "**/browser-compatability-table/**/*"

macros:
- "kumascript/**/*"
- changed-files:
- any-glob-to-any-file: "kumascript/**/*"

cloud-function:
- changed-files:
- any-glob-to-any-file: "cloud-function/**/*"

copy:
- changed-files:
- any-glob-to-any-file: "copy/**/*"

dependencies:
- "**/poetry.lock"
- "**/package-lock.json"
- changed-files:
- any-glob-to-any-file:
- "**/poetry.lock"
- "**/package-lock.json"
deployer:
- "deployer/**/*"
- changed-files:
- any-glob-to-any-file: "deployer/**/*"

filecheck:
- changed-files:
- any-glob-to-any-file: "filecheck/**/*"

flaw-system:
- "build/flaws/**/*"
- changed-files:
- any-glob-to-any-file: "build/flaws/**/*"

github-actions:
- ".github/workflows/**/*"
- changed-files:
- any-glob-to-any-file: ".github/workflows/**/*"

markdown:
- "markdown/**/*"
- changed-files:
- any-glob-to-any-file: "markdown/**/*"

metrics:
- changed-files:
- any-glob-to-any-file: "**/telemetry/**/*"

placement:
- changed-files:
- any-glob-to-any-file:
- "**/placement/**/*"
- "**/pong/**/*"

plus:
- "client/src/plus/**/*"
- changed-files:
- any-glob-to-any-file:
- "**/plus/**/*"
- "**/plus-docs/**/*"

plus:ai-help:
- changed-files:
- any-glob-to-any-file: "**/ai-help/**/*"

plus:offline:
- "client/pwa/src/**/*"
- "client/src/offline-settings/**/*"
- changed-files:
- any-glob-to-any-file:
- "client/pwa/src/**/*"
- "client/src/offline-settings/**/*"

plus:playground:
- changed-files:
- any-glob-to-any-file: "**/playground/**/*"

plus:updates:
- changed-files:
- any-glob-to-any-file: "client/src/plus/updates/**/*"

python:
- "**/*.py"
- changed-files:
- any-glob-to-any-file: "**/*.py"

redirects:
- changed-files:
- any-glob-to-any-file:
- "cloud-function/src/middlewares/redirect-*"
- "libs/fundamental-redirects/**/*"
4 changes: 2 additions & 2 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
if: github.event.pull_request.user.login == 'dependabot[bot]'

steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.AUTOMERGE_TOKEN }}

Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: mdn/content
path: mdn/content
Expand All @@ -51,30 +51,33 @@ jobs:
# so we can figure out each document's last-modified date.
fetch-depth: 0

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: mdn/translated-content
path: mdn/translated-content
# See matching warning for mdn/content checkout step
fetch-depth: 0

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: mdn/mdn-contributor-spotlight
path: mdn/mdn-contributor-spotlight

- name: Setup Node.js environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: "**/package-lock.json"

- name: Install all npm packages
run: npm ci
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down Expand Up @@ -123,30 +126,27 @@ jobs:

# This just makes sure the Google Analytics script gets used even if
# it goes nowhere.
BUILD_GOOGLE_ANALYTICS_ACCOUNT: UA-00000000-0
BUILD_GOOGLE_ANALYTICS_MEASUREMENT_ID: G-XXXXXXXX

# This removes the ability to sign in
REACT_APP_DISABLE_AUTH: true

run: |
set -eo pipefail
# Info about which CONTENT_* environment variables were set and to what.
echo "CONTENT_ROOT=$CONTENT_ROOT"
echo "CONTENT_TRANSLATED_ROOT=$CONTENT_TRANSLATED_ROOT"
npm run build:prepare
# (July 15, 2021) This is a temporary solution. This should become an
# integrated part of 'build:prepare'.
# See https://github.com/mdn/yari/issues/4217
npm run tool popularities
npm run tool sync-translated-content
# Spread the work across 2 processes. Why 2? Because that's what you
# get in the default GitHub hosting Linux runners.
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
npm run build -- --locale en-us --locale ja --locale fr &
npm run build:docs -- --locale en-us --locale ja --locale fr &
build1=$!
npm run build -- --not-locale en-us --not-locale ja --not-locale fr &
npm run build:docs -- --not-locale en-us --not-locale ja --not-locale fr &
build2=$!
# You must explicitly specify the job you're waiting-on to ensure
Expand All @@ -162,6 +162,9 @@ jobs:
# Generate sitemap index file
npm run build --sitemap-index
# SSR all pages
npm run render:html
# Generate whatsdeployed files.
npm run tool whatsdeployed -- --output client/build/_whatsdeployed/code.json
npm run tool whatsdeployed $CONTENT_ROOT -- --output client/build/_whatsdeployed/content.json
Expand Down Expand Up @@ -203,7 +206,7 @@ jobs:
poetry run deployer search-index ../client/build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.DEPLOYER_STAGE_AND_DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEPLOYER_STAGE_AND_DEV_AWS_SECRET_ACCESS_KEY }}
Expand Down
Loading

0 comments on commit a10cfc2

Please sign in to comment.