Skip to content

chore: bump Docusaurus + React, use yarn #1615

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 9 additions & 4 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,23 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'
always-auth: 'true'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Build docs
run: |
npm ci --force
npm run build
yarn --immutable
yarn build
env:
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/lychee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'
always-auth: 'true'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Build docs
run: |
npm ci --force
npm run build
yarn --immutable
yarn build
env:
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,30 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Enable corepack
run: |
corepack enable

- name: Install Dependencies
run: npm ci --force
run: yarn --immutable
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: |
npm ci
npm run redoc:test
yarn --immutable
yarn redoc:test

# TODO
# - uses: actions/setup-python@v5
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/publish-theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'
always-auth: 'true'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Enable corepack
run: |
Expand All @@ -49,13 +59,17 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'
always-auth: 'true'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Setup git user and npm
run: |
Expand Down
45 changes: 34 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,29 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'
always-auth: 'true'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Enable corepack
run: |
corepack enable

- name: Install Dependencies
run: npm ci --force
run: yarn --immutable
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: npm run build
- run: yarn build
env:
INTERCOM_APP_ID: ${{ secrets.INTERCOM_APP_ID }}
SEGMENT_TOKEN: ${{ secrets.SEGMENT_TOKEN }}
Expand All @@ -54,15 +63,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Install Dependencies
run: npm ci --force
run: yarn --immutable
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -87,16 +101,25 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Activate cache for Node.js
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: yarn.lock

- name: Enable corepack
run: |
corepack enable

- name: Install Dependencies
run: npm ci --force
run: yarn --immutable
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: npm run lint:code
- run: yarn lint:code
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ coverage
pids
.idea
.vscode
yarn.lock
tmp
types
.history
Expand All @@ -23,4 +22,4 @@ sources/api/*
!sources/api/getting-started.mdx
apify-api.yaml
static/api
apify-docs-theme/package-lock.json
**/package-lock.json
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
30 changes: 15 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@

<!-- vale off -->
1. Clone the repository
2. Run `npm install`
3. Start development server: `npm start`
2. Run `yarn`
3. Start development server: `yarn start`
<!-- vale on -->

This will be enough to work on Platform, Academy and OpenAPI. If you want to work on the entire documentation set, you need to join them using nginx.

#### Join all repositories with nginx

1. Clone all the repositories
2. Run `npm start:dev` instead of `npm start` from the main repository
3. Run `npm start -- --port <number>` to start Docusaurus instance on specific port, refer to the table for each repository port
2. Run `yarn start:dev` instead of `yarn start` from the main repository
3. Run `yarn start -- --port <number>` to start Docusaurus instance on specific port, refer to the table for each repository port

|Repository|Port|
|:---|:---|
Expand Down Expand Up @@ -155,12 +155,12 @@ The API reference documentation at [docs.apify.com](https://docs.apify.com/) is

1. Install Node.js
2. Clone the repository
3. Run `npm install`
3. Run `yarn`

### Basic commands

- `npm start` - Starts docs preview server including API reference
- `npm test` - Validates the definition
- `yarn start` - Starts docs preview server including API reference
- `yarn test` - Validates the definition

### Adding new documentation

Expand Down Expand Up @@ -246,7 +246,7 @@ Add languages by adding new folders at the appropriate path level.
#### Submitting changes

1. Make your changes following the guidelines above
2. Test locally using provided npm commands
2. Test locally using provided `yarn` commands
3. Submit a pull request to the `main` branch
4. Ensure all CI checks pass

Expand All @@ -258,8 +258,8 @@ Add languages by adding new folders at the appropriate path level.

```bash

npm install
npm start
yarn
yarn start

```

Expand All @@ -268,7 +268,7 @@ Add languages by adding new folders at the appropriate path level.
- Clone all documentation repositories
- Configure nginx server
- Update hosts file
- Use `npm start:dev`
- Use `yarn start:dev`

## Quality check

Expand All @@ -277,15 +277,15 @@ Add languages by adding new folders at the appropriate path level.
1. Markdown:

```bash
npm run lint:md # Checks for any issues using markdownlint
npm run lint:md:fix # Applies fixes
yarn lint:md # Checks for any issues using markdownlint
yarn lint:md:fix # Applies fixes
```

2. Code:

```bash
npm run lint:code # Checks .js & .ts files
npm run lint:code:fix # Applies fixes
yarn lint:code # Checks .js & .ts files
yarn lint:code:fix # Applies fixes
```

3. Prose:
Expand Down
Loading