Skip to content

Commit

Permalink
Merge branch 'main' into new-features-ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentdavid authored Apr 24, 2024
2 parents 1e76102 + 640194d commit 5c7fce1
Show file tree
Hide file tree
Showing 1,398 changed files with 151,137 additions and 20,851 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ module.exports = {
ignorePatterns: [
// Ignore code examples.
'docs/**/_examples/*',
'versioned_docs/*/**/_examples/*',
'general/**/_examples/*',
'!.markdownlint',
'!.lintstagedrc.mjs',
],
env: {
browser: true,
Expand Down
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "yarn"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

15 changes: 15 additions & 0 deletions .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Auto Author Assign

on:
pull_request_target:
types: [ opened, reopened ]

permissions:
pull-requests: write

jobs:
assign-author:
name: Auto assign PR
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v2.1.0
11 changes: 7 additions & 4 deletions .github/workflows/fetch-obsolete-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ on:

jobs:
run:
# Only run on the canonical repository.
if: github.repository == 'moodle/devdocs'

name: Update obsoletions and migrations with Wikimedia
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Run update script
run: yarn wikimedia-sync fetch-obsolete
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/label-new-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:

jobs:
automate-issues-labels:
# Only run on the canonical repository.
if: github.repository == 'moodle/devdocs'

runs-on: ubuntu-latest
steps:
- name: initial labeling
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lighthouse-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3
uses: actions/checkout@v4

- name: Wait for the Netlify Preview
uses: andrewnicols/wait-for-netlify-preview@v1.0.6
id: netlify
with:
site_id: "3c056055-e1bd-4cfd-8a02-ed35ab7aedfa"
max_timeout: 600
max_timeout: 900
netlify_secret: ${{ secrets.NETLIFY_SECRET }}

- name: Audit URLs using Lighthouse
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@ on:
pull_request:
paths:
- 'docs/**/*.md'
- 'docs/**/*.mdx'
- 'general/**/*.md'
- 'general/**/*.mdx'
- 'versioned_docs/**/*.md'
- 'versioned_docs/**/*.mdx'
- .markdownlint-cli2.cjs

jobs:
docs:
runs-on: ubuntu-latest

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

- name: Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "18"

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Lint markdown files
run: yarn mdlint-all
run: yarn mdlint-all && yarn mdxlint-all

- name: Check spelling
run: yarn spell
14 changes: 10 additions & 4 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ jobs:
runs-on: ubuntu-latest

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

- name: Setup Node.js environment
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "18"

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Lint markdown files
run: yarn mdlint-all

- name: Lint mdx files
run: yarn mdxlint-all

- name: Check spelling
run: yarn spell
11 changes: 7 additions & 4 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ jobs:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Docusaurus cache
uses: docuactions/cache@v1.1

- name: Test build website
run: yarn build
27 changes: 19 additions & 8 deletions .github/workflows/update-moodle-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,27 @@ on:
jobs:
run:
# Only run on the canonical repository.
# if: github.repository == 'moodle/devdocs'
if: github.repository == 'moodle/devdocs'

name: Fetch the list of components from Moodle
runs-on: ubuntu-latest
steps:
- name: Checkout DevDocs repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Checkout Moodle
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: moodle/moodle.git
ref: master
ref: main
path: .moodle
# The full history is required to generated the list of contributors.
fetch-depth: 0
Expand All @@ -48,7 +49,7 @@ jobs:
# Moodle versions.
- name: Copy component data
run: |
cp .moodle/lib/components.json data/master/
cp .moodle/lib/components.json data/main/
- name: Update component data spelling list
run: |
Expand All @@ -61,11 +62,21 @@ jobs:
run: |
../scripts/generate-contributor-list.sh > ../data/moodle-contributors.txt
- name: Fetch third-party libraries list
run: |
yarn libraries-fetch
- name: Generate third-party libraries credits
run: |
yarn libraries-generate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
data/*
general/community/credits/thirdpartylibs.md
commit-message: "[repo] Update Moodle Component metadata"
title: "[repo] Update Moodle Component metadata"
signoff: false
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/update-wikimedia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ jobs:
run:
# Only run on the canonical repository.
if: github.repository == 'moodle/devdocs'

name: Push migated pages to Wikimedia
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 18.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Run update script
run: yarn wikimedia-sync push-migrated
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ yarn-error.log*
.github/styles/Microsoft
.github/styles/write-good
.eslintcache
/.idea/

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
21 changes: 0 additions & 21 deletions .lintstagedrc.json

This file was deleted.

44 changes: 44 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright (c) Moodle Pty Ltd.
*
* Moodle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Moodle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Moodle. If not, see <http://www.gnu.org/licenses/>.
*/

// cspell-ignore

export default {
'*.css': ['stylelint --allow-empty-input --fix'],
'*.{js,jsx,ts,tsx,mjs}': ['eslint --fix'],
'*.mdx': [
'markdownlint-cli2 --config .markdownlint/mdx/fix/.markdownlint-cli2.cjs',
'cspell --no-must-find-files --no-progress',
],
'*.md': [
'markdownlint-cli2 --fix',
'cspell --no-must-find-files --no-progress',
],
'src/**/*.{js,jsx,ts,tsx,mjs}': [
'cspell --no-must-find-files --no-progress',
],
'data/migratedPages.yml': [
() => 'yarn mdfix-all',
() => 'yarn mdxfix-all',
],
'data/projects.json': [
'yarn ajv --spec=draft2019 validate -s static/schema/projects.json -d',
],
'data/versions.json': [
'yarn ajv --spec=draft2019 validate -s static/schema/versions.json -d',
],
};
Loading

0 comments on commit 5c7fce1

Please sign in to comment.