Skip to content

Commit 52fcc0e

Browse files
committedFeb 25, 2023
chore: Switch from lerna to turborepo
1 parent 7ca4e82 commit 52fcc0e

22 files changed

+36608
-12721
lines changed
 

‎.github/workflows/main.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ jobs:
1313
matrix:
1414
node-version: [16.x, 18.x]
1515
docusaurus-version:
16+
- "v2.3.1"
1617
- "v2.2.0"
18+
- "v2.1.0"
19+
- "v2.0.1"
1720
- "canary"
1821

1922
steps:
@@ -22,29 +25,26 @@ jobs:
2225
uses: actions/setup-node@v2
2326
with:
2427
node-version: ${{ matrix.node-version }}
25-
cache: 'yarn'
28+
cache: 'npm'
2629

27-
- run: yarn install --frozen-lockfile
28-
- run: yarn lint
30+
- run: npm ci
31+
- run: npm run lint
2932

30-
- run: yarn -W add '@docusaurus/core@${{ matrix.docusaurus-version }}' '@docusaurus/preset-classic@${{ matrix.docusaurus-version }}'
31-
- run: yarn --cwd packages/docusaurus-search-local add --dev '@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 }}'
33+
- 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 }}'
34+
- run: npm dedupe
3235

33-
- run: yarn --cwd packages/docusaurus-search-local build:server
34-
- run: yarn --cwd packages/docusaurus-search-local build:client
36+
- run: npm run build
37+
38+
- run: npm run test
3539

3640
# Install OS dependencies
3741
# Run `apt update` beforehand to avoid 404 Not Found errors during apt install.
38-
- run: sudo apt update && yarn playwright install-deps
42+
- run: sudo apt update && npx playwright install-deps
3943
# Install Browsers
40-
- run: yarn playwright install
41-
42-
- run: yarn --cwd packages/example-docs build
43-
- run: yarn test
44-
- run: yarn --cwd packages/example-docs serve &
45-
- run: yarn test:e2e --browser=all
44+
- run: npx playwright install
45+
- run: npm run test:e2e -- -- --browser=all --forbid-only
4646

4747
# TODO: Cannot run browser tests for these for now.
48-
- run: yarn --cwd packages/example-docs build --config docusaurus.config.noTrailingSlash.js
49-
- run: yarn --cwd packages/example-docs build --config docusaurus.config.subDirectory.js
50-
- run: yarn --cwd packages/example-docs build --config docusaurus.config.noTrailingSlashSubdirectory.js
48+
- run: npm run build -w example-docs -- --config docusaurus.config.noTrailingSlash.js
49+
- run: npm run build -w example-docs -- --config docusaurus.config.subDirectory.js
50+
- run: npm run build -w example-docs -- --config docusaurus.config.noTrailingSlashSubdirectory.js

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/packages/docusaurus-search-local/src/client/theme/SearchBar/generated.js
22
/packages/docusaurus-search-local/lib
33
/scripts/preview.webm
4+
.turbo
45

56
# Created by https://www.gitignore.io/api/node
67
# Edit at https://www.gitignore.io/?templates=node

‎.syncpackrc

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"versionGroups": [
3+
{
4+
"label": "Example Docs must always use the local version of the search plugin",
5+
"packages": ["example-docs"],
6+
"dependencies": ["@cmfcmf/docusaurus-search-local"],
7+
"pinVersion": "*"
8+
},
9+
{
10+
"label": "The Docusaurus dev dependencies must all have the highest version supported by the plugin.",
11+
"packages": ["**"],
12+
"dependencies": ["@docusaurus/**"],
13+
"dependencyTypes": ["dev"],
14+
"pinVersion": "^2.3.1"
15+
},
16+
{
17+
"label": "The Docusaurus peer dependencies must all have the lowest version supported by the plugin.",
18+
"packages": ["**"],
19+
"dependencies": ["@docusaurus/**"],
20+
"dependencyTypes": ["peer"],
21+
"pinVersion": "^2.0.0"
22+
},
23+
{
24+
"label": "All dependencies should follow the versions of the search plugin",
25+
"packages": ["**"],
26+
"dependencies": ["**"],
27+
"snapTo": ["@cmfcmf/docusaurus-search-local"]
28+
}
29+
]
30+
}

‎.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"lib/**": true,
44
"example-docs/**": true
55
},
6-
"jest.jestCommandLine": "yarn test"
6+
"jest.jestCommandLine": "npx turbo test --",
77
}

‎CONTRIBUTING.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ 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: `yarn install`
9-
3. Build everthing `yarn build`
10-
4. Run tests: `yarn test`
8+
2. Install dependencies: `npm install`
9+
3. Build everything `npm run build`
10+
4. Run tests: `npm run test`
1111
5. Run end to end tests using Playwright:
1212
```bash
13-
yarn build-and-serve
14-
# in another terminal:
15-
yarn test:e2e # add --debug to step through the tests
13+
npm run test:e2e # add `-- -- --debug` to step through the tests
1614
```
15+
6. Test search manually: `npm run serve`
1716

1817
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))

‎README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Feature Highlights:
2626
## Installation
2727

2828
```bash
29-
yarn add @cmfcmf/docusaurus-search-local
29+
npm install @cmfcmf/docusaurus-search-local
3030
```
3131

3232
or
3333

3434
```bash
35-
npm install @cmfcmf/docusaurus-search-local
35+
yarn add @cmfcmf/docusaurus-search-local
3636
```
3737

3838
## Usage
@@ -131,10 +131,10 @@ The following options are available (defaults are shown below):
131131

132132
You can now use the search bar to search your documentation.
133133

134-
**Important: Search only works for the statically built documentation (i.e., after you ran `yarn build` in your documentation folder).**
134+
**Important: Search only works for the statically built documentation (i.e., after you ran `npm run docusaurus build` in your documentation folder).**
135135

136-
**Search does **not** work in development (i.e., when running `yarn start`).**
137-
If you want to test search locally, first build the documentation with `yarn build`, and then serve it via `yarn serve`.
136+
**Search does **not** work in development (i.e., when running `npm run docusaurus start`).**
137+
If you want to test search locally, first build the documentation with `npm run docusaurus build`, and then serve it via `npm run docusaurus serve`.
138138

139139
### Non-English Documentation
140140

@@ -164,7 +164,7 @@ Read more at: https://docusaurus.io/docs/i18n/tutorial#translate-json-files
164164

165165
If building your documentation produces an error, you can build it in debug mode to figure out
166166
which page is causing it. To do so, simply set the `DEBUG` environment variable when building
167-
your documentation: `DEBUG=1 yarn build`.
167+
your documentation: `DEBUG=1 npm run docusaurus build`.
168168

169169
## CONTRIBUTING
170170

‎babel.config.js

-8
This file was deleted.

‎lerna.json

-14
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.