mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-23 05:57:05 +02:00
chore: add Node 24 to CI + fix deprecation warnings (#11168)
This commit is contained in:
parent
8061f2267b
commit
4af8982278
8 changed files with 12 additions and 6 deletions
1
.github/workflows/argos.yml
vendored
1
.github/workflows/argos.yml
vendored
|
@ -33,6 +33,7 @@ jobs:
|
||||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
|
cache: yarn
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn || yarn || yarn
|
run: yarn || yarn || yarn
|
||||||
|
|
1
.github/workflows/lighthouse-report.yml
vendored
1
.github/workflows/lighthouse-report.yml
vendored
|
@ -27,6 +27,7 @@ jobs:
|
||||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
|
cache: yarn
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn || yarn || yarn
|
run: yarn || yarn || yarn
|
||||||
|
|
2
.github/workflows/tests-e2e.yml
vendored
2
.github/workflows/tests-e2e.yml
vendored
|
@ -38,7 +38,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node: ['18.0', '20', '22']
|
node: ['18.0', '20', '22', '24']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
3
.github/workflows/tests-windows.yml
vendored
3
.github/workflows/tests-windows.yml
vendored
|
@ -27,7 +27,7 @@ jobs:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node: ['18.0', '20', '22']
|
node: ['18.0', '20', '22', '24']
|
||||||
steps:
|
steps:
|
||||||
- name: Support longpaths
|
- name: Support longpaths
|
||||||
run: git config --system core.longpaths true
|
run: git config --system core.longpaths true
|
||||||
|
@ -37,6 +37,7 @@ jobs:
|
||||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
|
cache: yarn
|
||||||
- name: Installation
|
- name: Installation
|
||||||
run: yarn || yarn || yarn
|
run: yarn || yarn || yarn
|
||||||
- name: Docusaurus Jest Tests
|
- name: Docusaurus Jest Tests
|
||||||
|
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
@ -27,7 +27,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node: ['18.0', '20', '22']
|
node: ['18.0', '20', '22', '24']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {
|
||||||
escapePath,
|
escapePath,
|
||||||
findAsyncSequential,
|
findAsyncSequential,
|
||||||
getFileLoaderUtils,
|
getFileLoaderUtils,
|
||||||
|
parseURLOrPath,
|
||||||
} from '@docusaurus/utils';
|
} from '@docusaurus/utils';
|
||||||
import escapeHtml from 'escape-html';
|
import escapeHtml from 'escape-html';
|
||||||
import {imageSizeFromFile} from 'image-size/fromFile';
|
import {imageSizeFromFile} from 'image-size/fromFile';
|
||||||
|
@ -50,7 +51,7 @@ async function toImageRequireNode(
|
||||||
);
|
);
|
||||||
relativeImagePath = `./${relativeImagePath}`;
|
relativeImagePath = `./${relativeImagePath}`;
|
||||||
|
|
||||||
const parsedUrl = url.parse(node.url);
|
const parsedUrl = parseURLOrPath(node.url, 'https://example.com');
|
||||||
const hash = parsedUrl.hash ?? '';
|
const hash = parsedUrl.hash ?? '';
|
||||||
const search = parsedUrl.search ?? '';
|
const search = parsedUrl.search ?? '';
|
||||||
const requireString = `${context.inlineMarkdownImageFileLoader}${
|
const requireString = `${context.inlineMarkdownImageFileLoader}${
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {
|
||||||
escapePath,
|
escapePath,
|
||||||
findAsyncSequential,
|
findAsyncSequential,
|
||||||
getFileLoaderUtils,
|
getFileLoaderUtils,
|
||||||
|
parseURLOrPath,
|
||||||
} from '@docusaurus/utils';
|
} from '@docusaurus/utils';
|
||||||
import escapeHtml from 'escape-html';
|
import escapeHtml from 'escape-html';
|
||||||
import {assetRequireAttributeValue, transformNode} from '../utils';
|
import {assetRequireAttributeValue, transformNode} from '../utils';
|
||||||
|
@ -51,7 +52,7 @@ async function toAssetRequireNode(
|
||||||
path.relative(path.dirname(context.filePath), assetPath),
|
path.relative(path.dirname(context.filePath), assetPath),
|
||||||
)}`;
|
)}`;
|
||||||
|
|
||||||
const parsedUrl = url.parse(node.url);
|
const parsedUrl = parseURLOrPath(node.url);
|
||||||
const hash = parsedUrl.hash ?? '';
|
const hash = parsedUrl.hash ?? '';
|
||||||
const search = parsedUrl.search ?? '';
|
const search = parsedUrl.search ?? '';
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,8 @@ export function isValidPathname(str: string): boolean {
|
||||||
|
|
||||||
export function parseURLOrPath(url: string, base?: string | URL): URL {
|
export function parseURLOrPath(url: string, base?: string | URL): URL {
|
||||||
try {
|
try {
|
||||||
// TODO when Node supports it, use URL.parse could be faster?
|
// TODO Docusaurus v4: use URL.parse()
|
||||||
|
// Node 24 supports it, use URL.parse could be faster?
|
||||||
// see https://kilianvalkhof.com/2024/javascript/the-problem-with-new-url-and-how-url-parse-fixes-that/
|
// see https://kilianvalkhof.com/2024/javascript/the-problem-with-new-url-and-how-url-parse-fixes-that/
|
||||||
return new URL(url, base ?? 'https://example.com');
|
return new URL(url, base ?? 'https://example.com');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue