Skip to content

Commit

Permalink
Merge pull request #558 from AdguardTeam/AGDNS-2309-1
Browse files Browse the repository at this point in the history
AGDNS-2309 use pnpm
  • Loading branch information
sc0rp10 authored Aug 26, 2024
2 parents 7e266df + 0c23e55 commit 0c8d44d
Show file tree
Hide file tree
Showing 7 changed files with 10,036 additions and 8,591 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: ${{ env.NODE_VERSION }}

- name: yarn install
run: yarn install
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: yarn build
run: yarn build
- name: Run build
run: pnpm build

- name: deploy
- name: Deploy
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: yarn install
run: yarn install
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: sync translations
- name: Sync translations
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
run: yarn run crowdin:sync
run: pnpm run crowdin:sync

- name: create pull request
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: ${{ env.NODE_VERSION }}

- name: yarn install
run: yarn install
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: yarn lint:md
run: yarn lint:md
- name: pnpm lint:md
run: pnpm lint:md
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can help by contributing to the Knowledge Base, all details are described [i
First of all, you need to install the following:

- [git](https://github.com/git-guides/install-git)
- [yarn](https://classic.yarnpkg.com/lang/en/docs/install/)
- [pnpm](https://pnpm.io/installation)

Second, clone this repo to your local computer:

Expand All @@ -25,31 +25,31 @@ Alternatively, you can use the [Github app](https://desktop.github.com/) to do t

Then you should open Terminal on your computer, navigate to the directory where you cloned this repo and run this command to install the local dependencies:

- `yarn install`
- `pnpm install`

### Lint markdown

This command lints the markdown and outputs any errors to the console:

- `yarn lint:md`
- `pnpm lint:md`

Some of errors can be fixed automatically:

- `yarn lint:md --fix`
- `pnpm lint:md --fix`

VSCode users can install the [markdownlint extension][vscode-markdownlint] to see the errors in the editor.

### Run it locally

- `yarn start`
- `pnpm start`

This command [lints markdown syntax](#lint-markdown),
and if there is no markdownlint errors starts a local development server and opens up a browser window.
Most changes are reflected live without having to restart the server.

## How to build

- `yarn build`
- `pnpm build`

This command generates static content into the `build` directory and can be served using any static contents hosting service.

Expand All @@ -59,7 +59,7 @@ Localizations are not pushed to the repo and prepared on-the-fly (`i18n` folder

Here's how you can debug translations locally.

1. Download translations: `CROWDIN_PERSONAL_TOKEN="YOURTOKEN" yarn run crowdin download`
2. Run Docusaurus with the language of your choice: `yarn run start -- --locale de`
1. Download translations: `CROWDIN_PERSONAL_TOKEN="YOURTOKEN" pnpm run crowdin download`
2. Run Docusaurus with the language of your choice: `pnpm run start -- --locale de`

[vscode-markdownlint]: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "docusaurus start --host 0.0.0.0",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "yarn crowdin:sync && docusaurus deploy",
"deploy": "pnpm crowdin:sync && docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
Expand All @@ -18,8 +18,8 @@
},
"dependencies": {
"@crowdin/cli": "3.13.0",
"@docusaurus/core": "^2.2.0",
"@docusaurus/preset-classic": "^2.2.0",
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"@swc/core": "^1.7.18",
Expand All @@ -46,7 +46,6 @@
},
"devDependencies": {
"markdownlint": "^0.29.0",
"markdownlint-cli": "^0.35.0",
"nodejieba": "^2.6.0"
"markdownlint-cli": "^0.35.0"
}
}
Loading

0 comments on commit 0c8d44d

Please sign in to comment.