Skip to content

Commit ee28793

Browse files
docs: update commands for pnpm migration
1 parent 673c7f6 commit ee28793

4 files changed

Lines changed: 45 additions & 45 deletions

File tree

CONFIGURATION.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ The schema ships with a small, query-driven set of indexes. The most important o
9494
Run the read-only benchmark against your own database to confirm the planner is using the expected indexes and to record baseline latencies:
9595

9696
```sh
97-
npm run db:benchmark
98-
npm run db:benchmark -- --runs 5 --kind 1 --limit 500
97+
pnpm run db:benchmark
98+
pnpm run db:benchmark --runs 5 --kind 1 --limit 500
9999
```
100100

101101
The `db:benchmark` script loads the local `.env` file automatically (via `node --env-file-if-exists=.env`), using the same `DB_HOST`/`DB_PORT`/`DB_USER`/`DB_PASSWORD`/`DB_NAME` variables as the relay. The benchmark issues only `EXPLAIN (ANALYZE, BUFFERS)` and `SELECT` statements — it never writes. Flags: `--runs <n>` (default 3), `--kind <n>` (default 1 / `TEXT_NOTE`; pass `0` for SET_METADATA), `--limit <n>` (default 500), `--horizon-days <n>` (default 7), `--help`.
102102

103103
For a full before/after proof of the index impact (seeds a throwaway dataset, drops and recreates the indexes, and prints a BEFORE/AFTER table), use:
104104

105105
```sh
106-
npm run db:verify-index-impact
106+
pnpm run db:verify-index-impact
107107
```
108108

109109
The hot-path index migration (`20260420_120000_add_hot_path_indexes.js`) uses `CREATE INDEX CONCURRENTLY`, so it can be applied to a running relay without taking `ACCESS EXCLUSIVE` locks on the `events` or `invoices` tables.

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Please keep the conversations civil, respectful and focus on the topic being dis
1111
Run dead code and dependency analysis before opening a pull request:
1212

1313
```
14-
npm run knip
14+
pnpm run knip
1515
```
1616

17-
`npm run lint` now runs Biome.
17+
`pnpm run lint` now runs Biome.
1818

1919
## Pull Request Process
2020

@@ -35,7 +35,7 @@ Every pull request that changes behavior, adds a feature, or fixes a bug **must
3535
To add a changeset:
3636

3737
```bash
38-
npx changeset
38+
pnpm exec changeset
3939
```
4040

4141
This interactive prompt will ask you to:
@@ -49,7 +49,7 @@ The command creates a file in `.changeset/` — commit it with your PR.
4949
If your PR only updates documentation and should not affect versioning, add an empty changeset:
5050

5151
```bash
52-
npx changeset --empty
52+
pnpm exec changeset --empty
5353
```
5454

5555
Commit the generated `.changeset/*.md` file with your PR. This satisfies CI without producing a version bump or changelog entry.
@@ -66,6 +66,6 @@ Commit the generated `.changeset/*.md` file with your PR. This satisfies CI with
6666
Run Biome checks before opening a pull request:
6767

6868
```
69-
npm run lint
70-
npm run format:check
69+
pnpm run lint
70+
pnpm run format:check
7171
```

README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,18 @@ Compressed files are also supported and decompressed on-the-fly:
255255
256256
Basic import:
257257
```
258-
npm run import -- ./events.jsonl
258+
pnpm run import ./events.jsonl
259259
```
260260
261261
Import a compressed backup:
262262
```
263-
npm run import -- ./events.jsonl.gz
264-
npm run import -- ./events.jsonl.xz
263+
pnpm run import ./events.jsonl.gz
264+
pnpm run import ./events.jsonl.xz
265265
```
266266
267267
Set a custom batch size (default: `1000`):
268268
```
269-
npm run import -- ./events.jsonl --batch-size 500
269+
pnpm run import ./events.jsonl --batch-size 500
270270
```
271271
272272
The importer:
@@ -437,14 +437,14 @@ Clone repository and enter directory:
437437
Install dependencies:
438438
439439
```
440-
npm install -g knex
441-
npm install
440+
corepack enable
441+
pnpm install
442442
```
443443
444444
Run migrations (at least once and after pulling new changes):
445445
446446
```
447-
NODE_OPTIONS="-r dotenv/config" npm run db:migrate
447+
NODE_OPTIONS="-r dotenv/config" pnpm run db:migrate
448448
```
449449
450450
Create .nostr folder inside nostream project folder and copy over the settings file:
@@ -457,19 +457,19 @@ Create .nostr folder inside nostream project folder and copy over the settings f
457457
To start in development mode:
458458
459459
```
460-
npm run dev
460+
pnpm run dev
461461
```
462462
463463
Or, start in production mode:
464464
465465
```
466-
npm run start
466+
pnpm run start
467467
```
468468
469469
To clean up the build, coverage and test reports run:
470470
471471
```
472-
npm run clean
472+
pnpm run clean
473473
```
474474
## Development Quick Start (Docker Compose)
475475
@@ -496,10 +496,10 @@ Start:
496496
Run code quality checks with Biome:
497497
498498
```
499-
npm run lint
500-
npm run lint:fix
501-
npm run format
502-
npm run format:check
499+
pnpm run lint
500+
pnpm run lint:fix
501+
pnpm run format
502+
pnpm run format:check
503503
```
504504
505505
### Unit tests
@@ -512,19 +512,19 @@ Open a terminal and change to the project's directory:
512512
Run unit tests with:
513513
514514
```
515-
npm run test:unit
515+
pnpm run test:unit
516516
```
517517
518518
Or, run unit tests in watch mode:
519519
520520
```
521-
npm run test:unit:watch
521+
pnpm run test:unit:watch
522522
```
523523
524524
To get unit test coverage run:
525525
526526
```
527-
npm run cover:unit
527+
pnpm run cover:unit
528528
```
529529
530530
To see the unit tests report open `.test-reports/unit/index.html` with a browser:
@@ -547,13 +547,13 @@ Open a terminal and change to the project's directory:
547547
Run integration tests with:
548548
549549
```
550-
npm run docker:test:integration
550+
pnpm run docker:test:integration
551551
```
552552
553553
And to get integration test coverage run:
554554
555555
```
556-
npm run docker:cover:integration
556+
pnpm run docker:cover:integration
557557
```
558558
559559
### Integration tests (Standalone)
@@ -582,7 +582,7 @@ Set the following environment variables:
582582
Then run the integration tests:
583583
584584
```
585-
npm run test:integration
585+
pnpm run test:integration
586586
```
587587
588588
To see the integration tests report open `.test-reports/integration/report.html` with a browser:
@@ -593,7 +593,7 @@ To see the integration tests report open `.test-reports/integration/report.html`
593593
To get the integration test coverage run:
594594
595595
```
596-
npm run cover:integration
596+
pnpm run cover:integration
597597
```
598598
599599
To see the integration test coverage report open `.coverage/integration/lcov-report/index.html` with a browser.
@@ -610,7 +610,7 @@ Nostream includes a specialized security tester to simulate Slowloris-style conn
610610
### Running the Tester
611611
```bash
612612
# Simulates 5,000 idle "zombie" connections + 100 events/sec spam
613-
npm run test:load -- --zombies 5000 --spam-rate 100
613+
pnpm run test:load --zombies 5000 --spam-rate 100
614614
```
615615

616616
### Analyzing Memory (Heap Snapshots)
@@ -657,10 +657,10 @@ Optional compression is supported for lower storage and transfer costs:
657657
- XZ via `lzma-native`
658658

659659
```
660-
npm run export # writes to events.jsonl
661-
npm run export -- backup-2024-01-01.jsonl # custom filename
662-
npm run export -- backup.jsonl.gz --compress --format=gzip
663-
npm run export -- backup.jsonl.xz --compress --format=xz
660+
pnpm run export # writes to events.jsonl
661+
pnpm run export backup-2024-01-01.jsonl # custom filename
662+
pnpm run export backup.jsonl.gz --compress --format=gzip
663+
pnpm run export backup.jsonl.xz --compress --format=xz
664664
```
665665

666666
Flags:
@@ -690,16 +690,16 @@ The script reads the same `DB_*` environment variables used by the relay (see [C
690690
Run the read-only query benchmark to record the planner's choices and timings for the relay's hot-path queries (REQ subscriptions, vanish checks, purge scans, pending-invoice polls):
691691

692692
```
693-
npm run db:benchmark
694-
npm run db:benchmark -- --runs 5 --kind 1 --limit 500
693+
pnpm run db:benchmark
694+
pnpm run db:benchmark --runs 5 --kind 1 --limit 500
695695
```
696696

697697
The benchmark only issues `EXPLAIN (ANALYZE, BUFFERS)` and `SELECT` statements against your configured database — it never writes. It loads `DB_*` variables from `.env` automatically (via `node --env-file-if-exists=.env`), so no extra setup is required beyond the one you already need to run the relay. Use it to confirm the `events_active_pubkey_kind_created_at_idx`, `events_deleted_at_partial_idx`, and `invoices_pending_created_at_idx` indexes are being picked up.
698698

699699
For a reproducible before/after proof on a throwaway dataset, run:
700700

701701
```
702-
npm run db:verify-index-impact
702+
pnpm run db:verify-index-impact
703703
```
704704

705705
It seeds ~200k synthetic events, drops the hot-path indexes, runs EXPLAIN (ANALYZE, BUFFERS) for each hot query, recreates the indexes, and prints a BEFORE/AFTER table. See the *Database indexes and benchmarking* section of [CONFIGURATION.md](CONFIGURATION.md).
@@ -712,31 +712,31 @@ corresponding data from the derived `event_tags` table when present.
712712
Dry run (no deletion):
713713

714714
```
715-
npm run clean-db -- --all --dry-run
715+
pnpm run clean-db --all --dry-run
716716
```
717717

718718
Full wipe:
719719

720720
```
721-
npm run clean-db -- --all --force
721+
pnpm run clean-db --all --force
722722
```
723723

724724
Delete events older than N days:
725725

726726
```
727-
npm run clean-db -- --older-than=30 --force
727+
pnpm run clean-db --older-than=30 --force
728728
```
729729

730730
Delete only selected kinds:
731731

732732
```
733-
npm run clean-db -- --kinds=1,7,4 --force
733+
pnpm run clean-db --kinds=1,7,4 --force
734734
```
735735

736736
Delete only selected kinds older than N days:
737737

738738
```
739-
npm run clean-db -- --older-than=30 --kinds=1,7,4 --force
739+
pnpm run clean-db --older-than=30 --kinds=1,7,4 --force
740740
```
741741

742742
By default, the script asks for explicit confirmation (`Type 'DELETE' to confirm`).

scripts/smoke-nip03.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ would use.
4949
## Running the automated script
5050
5151
```bash
52-
npm run smoke:nip03
52+
pnpm run smoke:nip03
5353
# or, with non-default relays:
54-
npx ts-node scripts/smoke-nip03.ts \
54+
pnpm exec ts-node scripts/smoke-nip03.ts \
5555
--local-relay ws://127.0.0.1:8008 \
5656
--source-relay wss://nostr-pub.wellorder.net
5757
```

0 commit comments

Comments
 (0)