docs: enforce pnpm run <scriptname>

Can you believe it? pnpm <scriptname> goes through this bizarre
anti-logic wrt. running scripts.

If the script is a dedicated pnpm command, it will run that command.
Else if the script exists in package.json, it will run it.

At this point, it then tries to run it as a normal shell command. By
checking if <scriptname> is in $PATH and then executing that.

What the hell? This was helpfully revealed to my by a tester who found
`pnpm sort` was taking too long. That's because it was running
`sort(1)`.

Absolutely insane behaviour. Why???
This commit is contained in:
zkldi
2022-08-20 23:54:39 +01:00
parent 13f66e5772
commit 11f87f2706
+2 -2
View File
@@ -60,12 +60,12 @@ We also maintain a bit more human readable form for schemas in this documentatio
## Important Scripts
After doing **anything** to the collections, such as adding a new item to the database, you **MUST** run `pnpm sort` inside the `scripts/` folder.
After doing **anything** to the collections, such as adding a new item to the database, you **MUST** run `pnpm run sort` inside the `scripts/` folder.
This will deterministically sort the data you put into the collections, making sure that `git` history stays sane (i.e. it only says things that actually changed, changed).
!!! info
`pnpm sort` is an alias for `node deterministic-collection-sort.js`
`pnpm run sort` is an alias for `node deterministic-collection-sort.js`
Before sending any changes, run `pnpm test` to check all your data. If anything you've sent is invalid, it'll be logged in `failed-tests.log`, and the command won't pass.