Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further preparation for supporting Docusaurus v3 #229

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#patreon: cmfcmf
ko_fi: cmfcmf
custom:
- https://www.buymeacoffee.com/cmfcmf
- https://www.buymeacoffee.com/cmfcmf
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
- uses: wagoid/commitlint-github-action@v5
52 changes: 28 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,37 @@ jobs:
- "canary"

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- run: npm ci
- run: npm run lint
- run: pnpm install
- run: pnpm run lint

- run: npm install --workspaces --save-dev '@docusaurus/core@${{ matrix.docusaurus-version }}' '@docusaurus/preset-classic@${{ matrix.docusaurus-version }}' '@docusaurus/module-type-aliases@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-blog@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-docs@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-pages@${{ matrix.docusaurus-version }}' '@docusaurus/theme-common@${{ matrix.docusaurus-version }}' '@docusaurus/theme-classic@${{ matrix.docusaurus-version }}' '@docusaurus/types@${{ matrix.docusaurus-version }}'
- run: npm dedupe
- run: pnpm -r add --save-dev '@docusaurus/core@${{ matrix.docusaurus-version }}' '@docusaurus/preset-classic@${{ matrix.docusaurus-version }}' '@docusaurus/module-type-aliases@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-blog@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-docs@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-pages@${{ matrix.docusaurus-version }}' '@docusaurus/theme-common@${{ matrix.docusaurus-version }}' '@docusaurus/theme-classic@${{ matrix.docusaurus-version }}' '@docusaurus/types@${{ matrix.docusaurus-version }}'
- run: pnpm dedupe

- run: npm run build
- run: pnpm run build

- run: npm run test
- run: pnpm run test

# Install OS dependencies
# Run `apt update` beforehand to avoid 404 Not Found errors during apt install.
- run: sudo apt update
if: runner.os == 'Linux'
- run: npx playwright install-deps
# Install Browsers
- run: npx playwright install
- run: npm run test:e2e -- -- --browser=all --forbid-only
# Install OS dependencies
# Run `apt update` beforehand to avoid 404 Not Found errors during apt install.
- run: sudo apt update
if: runner.os == 'Linux'
- run: pnpm --filter docusaurus-search-local --fail-if-no-match exec playwright install-deps
# Install Browsers
- run: pnpm --filter docusaurus-search-local --fail-if-no-match exec playwright install
- run: pnpm run test:e2e -- --browser=all --forbid-only

# TODO: Cannot run browser tests for these for now.
- run: npm run build -w example-docs -- --config docusaurus.config.noTrailingSlash.js
- run: npm run build -w example-docs -- --config docusaurus.config.subDirectory.js
- run: npm run build -w example-docs -- --config docusaurus.config.noTrailingSlashSubdirectory.js
# TODO: Cannot run browser tests for these for now.
- run: pnpm --filter example-docs --fail-if-no-match run build --config docusaurus.config.noTrailingSlash.js
- run: pnpm --filter example-docs --fail-if-no-match run build --config docusaurus.config.subDirectory.js
- run: pnpm --filter example-docs --fail-if-no-match run build --config docusaurus.config.noTrailingSlashSubdirectory.js
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies = true
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ lunr.js
lib
.husky
.vscode
example-docs
example-docs*
pnpm-lock.yaml
16 changes: 7 additions & 9 deletions .syncpackrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,25 @@
{
"label": "All dependencies should use the same Node.js types.",
"dependencies": ["@types/node"],
"pinVersion": "^18"
"pinVersion": "^18.19.64"
},
{
"label": "Example Docs must always use the local version of the search plugin",
"packages": ["example-docs"],
"dependencies": ["@cmfcmf/docusaurus-search-local"],
"pinVersion": "*"
"pinVersion": "workspace:*"
},
{
"label": "The Docusaurus dev dependencies must all have the highest version supported by the plugin.",
"packages": ["**"],
"dependencies": ["@docusaurus/**"],
"dependencyTypes": ["dev"],
"pinVersion": "^2.4.3"
"dependencyTypes": ["dev", "prod"],
"pinVersion": "catalog:"
},
{
"label": "The Docusaurus peer dependencies must all have the lowest version supported by the plugin.",
"packages": ["**"],
"dependencies": ["@docusaurus/**"],
"dependencyTypes": ["peer"],
"pinVersion": "^2.0.0"
"dependencies": ["clsx"],
"dependencyTypes": ["prod"],
"isIgnored": true
}
]
}
4 changes: 2 additions & 2 deletions .versionrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module.exports = {
sign: true,
scripts: {
// Make sure that there is nothing to format before generating the changelog.
prechangelog: "npm run lint",
prechangelog: "pnpm run lint",
// Format the generated changelog.
postchangelog: "npm run format",
postchangelog: "pnpm run format",
},
header: `\
# Change Log
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Thank you for your interest in contributing to the project!
To get up and running, follow these steps:

1. Clone the repository
2. Install dependencies: `npm install`
3. Build everything `npm run build`
4. Run tests: `npm run test`
2. Install dependencies: `pnpm install`
3. Build everything `pnpm run build`
4. Run tests: `pnpm run test`
5. Run end to end tests using Playwright:
```bash
npm run test:e2e # add `-- -- --debug` to step through the tests
pnpm run test:e2e # add `-- -- --debug` to step through the tests
```
6. Test search manually: `npm run serve`
6. Test search manually: `pnpm run serve`

You can view debug information at http://localhost:3000/\_\_docusaurus/debug (generated by [@docusaurus/plugin-debug](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-debug))

Expand Down
Loading
Loading