Skip to content

Commit 07702d3

Browse files
committed
chore: Switch from npm to pnpm
1 parent 20bb4fc commit 07702d3

File tree

13 files changed

+13922
-33515
lines changed

13 files changed

+13922
-33515
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,37 @@ jobs:
3939

4040
steps:
4141
- uses: actions/checkout@v4
42+
- uses: pnpm/action-setup@v4
43+
name: Install pnpm
44+
with:
45+
run_install: false
4246
- name: Use Node.js ${{ matrix.node-version }}
4347
uses: actions/setup-node@v4
4448
with:
4549
node-version: ${{ matrix.node-version }}
46-
cache: "npm"
50+
cache: "pnpm"
4751

48-
- run: npm ci
49-
- run: npm run lint
52+
- run: pnpm install --frozen-lockfile
53+
- run: pnpm run lint
5054

5155
- name: Installing Docusaurus ${{ matrix.docusaurus-version }} and dependencies
52-
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 }}'
53-
- run: npm dedupe
56+
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 }}'
57+
- run: pnpm dedupe
5458

55-
- run: npm run build
59+
- run: pnpm run build
5660

57-
- run: npm run test
61+
- run: pnpm run test
5862

5963
# Install OS dependencies
6064
# Run `apt update` beforehand to avoid 404 Not Found errors during apt install.
6165
- run: sudo apt update
6266
if: runner.os == 'Linux'
63-
- run: npx playwright install-deps
67+
- run: pnpm --filter docusaurus-search-local --fail-if-no-match exec playwright install-deps
6468
# Install Browsers
65-
- run: npx playwright install
66-
- run: npm run test:e2e -- -- --browser=all --forbid-only
69+
- run: pnpm --filter docusaurus-search-local --fail-if-no-match exec playwright install
70+
- run: pnpm run test:e2e -- --browser=all --forbid-only
6771

6872
# TODO: Cannot run browser tests for these for now.
69-
- run: npm run build -w example-docs -- --config docusaurus.config.noTrailingSlash.js
70-
- run: npm run build -w example-docs -- --config docusaurus.config.subDirectory.js
71-
- run: npm run build -w example-docs -- --config docusaurus.config.noTrailingSlashSubdirectory.js
73+
- run: pnpm --filter example-docs --fail-if-no-match run build --config docusaurus.config.noTrailingSlash.js
74+
- run: pnpm --filter example-docs --fail-if-no-match run build --config docusaurus.config.subDirectory.js
75+
- run: pnpm --filter example-docs --fail-if-no-match run build --config docusaurus.config.noTrailingSlashSubdirectory.js

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ lunr.js
22
lib
33
.husky
44
.vscode
5-
example-docs
5+
example-docs
6+
pnpm-lock.yaml

.syncpackrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"label": "Example Docs must always use the local version of the search plugin",
1010
"packages": ["example-docs"],
1111
"dependencies": ["@cmfcmf/docusaurus-search-local"],
12-
"pinVersion": "*"
12+
"pinVersion": "workspace:*"
1313
},
1414
{
1515
"label": "The Docusaurus dev dependencies must all have the highest version supported by the plugin.",
1616
"packages": ["**"],
1717
"dependencies": ["@docusaurus/**"],
1818
"dependencyTypes": ["dev"],
19-
"pinVersion": "^2.4.3"
19+
"pinVersion": "catalog:"
2020
},
2121
{
2222
"label": "The Docusaurus peer dependencies must all have the lowest version supported by the plugin.",

.versionrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ module.exports = {
66
sign: true,
77
scripts: {
88
// Make sure that there is nothing to format before generating the changelog.
9-
prechangelog: "npm run lint",
9+
prechangelog: "pnpm run lint",
1010
// Format the generated changelog.
11-
postchangelog: "npm run format",
11+
postchangelog: "pnpm run format",
1212
},
1313
header: `\
1414
# Change Log

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Thank you for your interest in contributing to the project!
55
To get up and running, follow these steps:
66

77
1. Clone the repository
8-
2. Install dependencies: `npm install`
9-
3. Build everything `npm run build`
10-
4. Run tests: `npm run test`
8+
2. Install dependencies: `pnpm install`
9+
3. Build everything `pnpm run build`
10+
4. Run tests: `pnpm run test`
1111
5. Run end to end tests using Playwright:
1212
```bash
13-
npm run test:e2e # add `-- -- --debug` to step through the tests
13+
pnpm run test:e2e # add `-- -- --debug` to step through the tests
1414
```
15-
6. Test search manually: `npm run serve`
15+
6. Test search manually: `pnpm run serve`
1616

1717
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))
1818

0 commit comments

Comments
 (0)