chore: update docs to use pnpm (#21113)

This commit is contained in:
Daniel Dietzler 2025-08-21 22:25:05 +02:00 committed by GitHub
parent 4e03b06ff7
commit 34255453b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 44 additions and 44 deletions

View File

@ -5,13 +5,13 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
### Installation
```
$ npm install
$ pnpm install
```
### Local Development
```
$ npm run start
$ pnpm run start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
@ -19,7 +19,7 @@ This command starts a local development server and opens up a browser window. Mo
### Build
```
$ npm run build
$ pnpm run build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
@ -29,13 +29,13 @@ This command generates static content into the `build` directory and can be serv
Using SSH:
```
$ USE_SSH=true npm run deploy
$ USE_SSH=true pnpm run deploy
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> npm run deploy
$ GIT_USER=<Your GitHub username> pnpm run deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View File

@ -5,7 +5,7 @@ After making any changes in the `server/src/schema`, a database migration need t
1. Run the command
```bash
npm run migrations:generate <migration-name>
pnpm run migrations:generate <migration-name>
```
2. Check if the migration file makes sense.

View File

@ -204,8 +204,8 @@ When the Dev Container starts, it automatically:
1. **Runs post-create script** (`container-server-post-create.sh`):
- Adjusts file permissions for the `node` user
- Installs dependencies: `npm install` in all packages
- Builds TypeScript SDK: `npm run build` in `open-api/typescript-sdk`
- Installs dependencies: `pnpm install` in all packages
- Builds TypeScript SDK: `pnpm run build` in `open-api/typescript-sdk`
2. **Starts development servers** via VS Code tasks:
- `Immich API Server (Nest)` - API server with hot-reloading on port 2283
@ -243,7 +243,7 @@ To connect the mobile app to your Dev Container:
- **Server code** (`/server`): Changes trigger automatic restart
- **Web code** (`/web`): Changes trigger hot module replacement
- **Database migrations**: Run `npm run sync:sql` in the server directory
- **Database migrations**: Run `pnpm run sync:sql` in the server directory
- **API changes**: Regenerate TypeScript SDK with `make open-api`
## Testing
@ -273,19 +273,19 @@ make test-medium-dev # End-to-end tests
```bash
# Server tests
cd /workspaces/immich/server
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:cov # Coverage report
pnpm test # Run all tests
pnpm run test:watch # Watch mode
pnpm run test:cov # Coverage report
# Web tests
cd /workspaces/immich/web
npm test # Run all tests
npm run test:watch # Watch mode
pnpm test # Run all tests
pnpm run test:watch # Watch mode
# E2E tests
cd /workspaces/immich/e2e
npm run test # Run API tests
npm run test:web # Run web UI tests
pnpm run test # Run API tests
pnpm run test:web # Run web UI tests
```
### Code Quality Commands

View File

@ -8,34 +8,34 @@ When contributing code through a pull request, please check the following:
## Web Checks
- [ ] `npm run lint` (linting via ESLint)
- [ ] `npm run format` (formatting via Prettier)
- [ ] `npm run check:svelte` (Type checking via SvelteKit)
- [ ] `npm run check:typescript` (check typescript)
- [ ] `npm test` (unit tests)
- [ ] `pnpm run lint` (linting via ESLint)
- [ ] `pnpm run format` (formatting via Prettier)
- [ ] `pnpm run check:svelte` (Type checking via SvelteKit)
- [ ] `pnpm run check:typescript` (check typescript)
- [ ] `pnpm test` (unit tests)
## Documentation
- [ ] `npm run format` (formatting via Prettier)
- [ ] `pnpm run format` (formatting via Prettier)
- [ ] Update the `_redirects` file if you have renamed a page or removed it from the documentation.
:::tip AIO
Run all web checks with `npm run check:all`
Run all web checks with `pnpm run check:all`
:::
## Server Checks
- [ ] `npm run lint` (linting via ESLint)
- [ ] `npm run format` (formatting via Prettier)
- [ ] `npm run check` (Type checking via `tsc`)
- [ ] `npm test` (unit tests)
- [ ] `pnpm run lint` (linting via ESLint)
- [ ] `pnpm run format` (formatting via Prettier)
- [ ] `pnpm run check` (Type checking via `tsc`)
- [ ] `pnpm test` (unit tests)
:::tip AIO
Run all server checks with `npm run check:all`
Run all server checks with `pnpm run check:all`
:::
:::info Auto Fix
You can use `npm run __:fix` to potentially correct some issues automatically for `npm run format` and `lint`.
You can use `pnpm run __:fix` to potentially correct some issues automatically for `pnpm run format` and `lint`.
:::
## Mobile Checks

View File

@ -54,20 +54,20 @@ You can access the web from `http://your-machine-ip:3000` or `http://localhost:3
If you only want to do web development connected to an existing, remote backend, follow these steps:
1. Build the Immich SDK - `cd open-api/typescript-sdk && npm i && npm run build && cd -`
1. Build the Immich SDK - `cd open-api/typescript-sdk && pnpm i && pnpm run build && cd -`
2. Enter the web directory - `cd web/`
3. Install web dependencies - `npm i`
3. Install web dependencies - `pnpm i`
4. Start the web development server
```bash
IMMICH_SERVER_URL=https://demo.immich.app/ npm run dev
IMMICH_SERVER_URL=https://demo.immich.app/ pnpm run dev
```
If you're using PowerShell on Windows you may need to set the env var separately like so:
```powershell
$env:IMMICH_SERVER_URL = "https://demo.immich.app/"
npm run dev
pnpm run dev
```
#### `@immich/ui`
@ -75,12 +75,12 @@ npm run dev
To see local changes to `@immich/ui` in Immich, do the following:
1. Install `@immich/ui` as a sibling to `immich/`, for example `/home/user/immich` and `/home/user/ui`
2. Build the `@immich/ui` project via `npm run build`
2. Build the `@immich/ui` project via `pnpm run build`
3. Uncomment the corresponding volume in web service of the `docker/docker-compose.dev.yaml` file (`../../ui:/usr/ui`)
4. Uncomment the corresponding alias in the `web/vite.config.js` file (`'@immich/ui': path.resolve(\_\_dirname, '../../ui')`)
5. Uncomment the import statement in `web/src/app.css` file `@import '/usr/ui/dist/theme/default.css';` and comment out `@import '@immich/ui/theme/default.css';`
6. Start up the stack via `make dev`
7. After making changes in `@immich/ui`, rebuild it (`npm run build`)
7. After making changes in `@immich/ui`, rebuild it (`pnpm run build`)
### Mobile app

View File

@ -4,8 +4,8 @@
### Unit tests
Unit are run by calling `npm run test` from the `server/` directory.
You need to run `npm install` (in `server/`) before _once_.
Unit are run by calling `pnpm run test` from the `server/` directory.
You need to run `pnpm install` (in `server/`) before _once_.
### End to end tests
@ -17,14 +17,14 @@ make e2e
Before you can run the tests, you need to run the following commands _once_:
- `npm install` (in `e2e/`)
- `pnpm install` (in `e2e/`)
- `make open-api` (in the project root `/`)
Once the test environment is running, the e2e tests can be run via:
```bash
cd e2e/
npm test
pnpm test
```
The tests check various things including:

10
pnpm-lock.yaml generated
View File

@ -13123,7 +13123,7 @@ snapshots:
'@babel/preset-env': 7.27.2(@babel/core@7.27.7)
'@babel/preset-react': 7.27.1(@babel/core@7.27.7)
'@babel/preset-typescript': 7.27.1(@babel/core@7.27.7)
'@babel/runtime': 7.27.6
'@babel/runtime': 7.28.3
'@babel/runtime-corejs3': 7.27.6
'@babel/traverse': 7.27.7
'@docusaurus/logger': 3.8.1
@ -23113,7 +23113,7 @@ snapshots:
react-loadable-ssr-addon-v5-slorber@1.0.1(@docusaurus/react-loadable@6.0.0(react@18.3.1))(webpack@5.99.9):
dependencies:
'@babel/runtime': 7.27.6
'@babel/runtime': 7.28.3
react-loadable: '@docusaurus/react-loadable@6.0.0(react@18.3.1)'
webpack: 5.99.9
@ -23137,13 +23137,13 @@ snapshots:
react-router-config@5.1.1(react-router@5.3.4(react@18.3.1))(react@18.3.1):
dependencies:
'@babel/runtime': 7.27.6
'@babel/runtime': 7.28.3
react: 18.3.1
react-router: 5.3.4(react@18.3.1)
react-router-dom@5.3.4(react@18.3.1):
dependencies:
'@babel/runtime': 7.27.6
'@babel/runtime': 7.28.3
history: 4.10.1
loose-envify: 1.4.0
prop-types: 15.8.1
@ -23154,7 +23154,7 @@ snapshots:
react-router@5.3.4(react@18.3.1):
dependencies:
'@babel/runtime': 7.27.6
'@babel/runtime': 7.28.3
history: 4.10.1
hoist-non-react-statics: 3.3.2
loose-envify: 1.4.0