Replace NPM with PNPM

Faster, easier
This commit is contained in:
Soitora 2023-08-08 20:39:38 +02:00
parent 73a0604bef
commit 7d67ff8b73
No known key found for this signature in database
GPG Key ID: A6D711EB4F2CCD97
6 changed files with 4155 additions and 7051 deletions

View File

@ -36,11 +36,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
cache: pnpm
cache-dependency-path: "**/package-lock.json"
- name: Install and build
run: npm ci && npm run build
run: pnpm install && pnpm build
- name: Configure pages
uses: actions/configure-pages@v2

View File

@ -8,33 +8,33 @@ Before submitting your contribution, please make sure to take a moment and read
## Development Setup
You will need [Node.js](http://nodejs.org) **version 18+**, and [npm](https://docs.npmjs.com/try-the-latest-stable-version-of-npm) **version 9+**.
You will need [Node.js](http://nodejs.org) **version 18+**, and [pnpm](https://pnpm.io/installation) **version 8+**.
After cloning the repo and entering the the directory, go to the `/website` folder and run:
``` bash
# Installs any dependencies needed.
$ npm install
$ pnpm install
```
To run the project now, run:
``` bash
# This command start a local server you can access and edit live.
$ npm run dev
$ pnpm dev
```
### Commonly used NPM scripts
### Commonly used PNPM scripts
``` bash
# This command will generate a static site inside a dist directory in your project.
$ npm run build
$ pnpm build
# Run this command to preview the built files in a local server.
$ npm run preview
$ pnpm preview
```
**Please make sure to have `npm run test` pass successfully before submitting a PR.** Although the same tests will be run against your PR on the CI server, it is better to have it working locally.
**Please make sure to have `pnpm test` pass successfully before submitting a PR.** Although the same tests will be run against your PR on the CI server, it is better to have it working locally.
It is also recommended you lint your files before the PR.

View File

@ -4,4 +4,4 @@
[build]
base = "website"
publish = "src/.vitepress/dist"
command = "npm run build"
command = "pnpm build"

7037
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,12 +13,13 @@
"url": "https://github.com/tachiyomiorg/website/issues"
},
"scripts": {
"test": "npm run lint && npm run build && npm run preview",
"preinstall": "npx only-allow pnpm",
"test": "pnpm lint && pnpm build && pnpm preview",
"dev": "vitepress dev src",
"build": "vitepress build src",
"preview": "vitepress preview src",
"lint": "npm run lint:es && npm run lint:prettier && npm run lint:mdl && npm run lint:style",
"lint:fix": "npm run lint:es:fix && npm run lint:prettier:fix && npm run lint:style:fix",
"lint": "pnpm lint:es && pnpm lint:prettier && pnpm lint:mdl && pnpm lint:style",
"lint:fix": "pnpm lint:es:fix && pnpm lint:prettier:fix && pnpm lint:style:fix",
"lint:es": "eslint . --ext .vue,.js,.ts,.cjs,.mjs,.jsx,.tsx",
"lint:es:fix": "eslint . --ext .vue,.js,.ts,.cjs,.mjs,.jsx,.tsx --fix",
"lint:prettier": "prettier --check \"src/**/*\"",
@ -56,7 +57,7 @@
"vue-eslint-parser": "^9.3.1"
},
"simple-git-hooks": {
"pre-commit": "npm run lint-staged"
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*.{styl,vue}": "stylelint --fix",

4140
website/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff