Files
Sébastien Lorber 29c3b5ce11 feat(core): Docusaurus Faster is stable + v4 future flag turns it on by default (#11802)
* feat(core): promote `future.experimental_faster` to `future.faster` + add `future.v4.fasterByDefault` flag

Stabilize the Docusaurus Faster config by removing the `experimental_` prefix.
Add a `fasterByDefault` v4 future flag that enables all faster features by default
when `v4: true` is used, allowing granular overrides. Init templates now include
`@docusaurus/faster` as a dependency since they use `v4: true`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: apply lint autofix

* fix(docs): remove broken #faster anchor link in fasterByDefault docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ci): add Yarn PnP packageExtension for @docusaurus/bundler → @docusaurus/faster

Yarn PnP strict mode doesn't resolve optional dependencies automatically.
Add a packageExtension so @docusaurus/bundler can resolve @docusaurus/faster
in the e2e Yarn Berry tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(core): declare @docusaurus/faster as optional peer dep instead of CI packageExtension

Revert the packageExtensions workaround in the e2e CI workflow and instead
declare @docusaurus/faster as an optional peer dependency of @docusaurus/core,
matching the existing pattern in @docusaurus/bundler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: retrigger CI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* empty

* add randomness to e2e test script version, to avoid using cached versions when trying to run this locally

* Rspack + PnP doesn't work, so add a warning in this case + fallback to Webpack
This should fix the e2e pnp workflows

* refactor: apply lint autofix

* typo

* typo

* revert wrong change

* also use slower minimizers

* comment

* restore snapshots

* ensure faster key resolution is always exhaustive, no hardcoding of keys

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2026-03-13 17:17:28 +01:00

69 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -xeuo pipefail
rm -rf ../test-website
CUSTOM_REGISTRY_URL="http://localhost:4873"
NEW_VERSION="$(node -p "require('./packages/docusaurus/package.json').version")-NEW-$RANDOM"
CONTAINER_NAME="verdaccio"
EXTRA_OPTS=""
usage() { echo "Usage: $0 [-s] [-t]" 1>&2; exit 1; }
while getopts ":st" o; do
case "${o}" in
s)
EXTRA_OPTS="${EXTRA_OPTS} --skip-install"
;;
t)
EXTRA_OPTS="${EXTRA_OPTS} --typescript"
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ ! -z $EXTRA_OPTS ]
then
echo create-docusaurus extra options = ${EXTRA_OPTS}
fi
# Run Docker container with private npm registry Verdaccio
docker run -d --rm --name "$CONTAINER_NAME" -p 4873:4873 -v "$PWD/admin/verdaccio.yaml":/verdaccio/conf/config.yaml verdaccio/verdaccio:latest
# Build packages
yarn build:packages
# Publish the monorepo
npx --no-install lerna publish --exact --yes --no-verify-access --no-git-reset --no-git-tag-version --no-push --registry "$CUSTOM_REGISTRY_URL" "$NEW_VERSION"
# Revert version changes
git diff --name-only -- '*.json' | sed 's, ,\\&,g' | xargs git checkout --
# The website is generated outside the repo to minimize chances of yarn resolving the wrong version
cd ..
echo Generating test-website in `pwd`
# Build skeleton website with new version
npm_config_registry="$CUSTOM_REGISTRY_URL" npx --yes --loglevel silly create-docusaurus@"$NEW_VERSION" test-website classic --javascript $EXTRA_OPTS
# Stop Docker container
if [[ -z "${KEEP_CONTAINER:-true}" ]] && ( $(docker container inspect "$CONTAINER_NAME" > /dev/null 2>&1) ); then
# Remove Docker container
docker container stop $CONTAINER_NAME > /dev/null
fi
echo "The website with to-be published packages was successfully build to the $(tput setaf 2)test-website$(tput sgr 0) directory."