From 11f87f2706b9a829ced9ddd7135d8d23a4746972 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sat, 20 Aug 2022 23:54:39 +0100 Subject: [PATCH] docs: enforce pnpm run Can you believe it? pnpm 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 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??? --- docs/docs/contributing/components/seeds.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/contributing/components/seeds.md b/docs/docs/contributing/components/seeds.md index ac4bcc6b2..060412e92 100644 --- a/docs/docs/contributing/components/seeds.md +++ b/docs/docs/contributing/components/seeds.md @@ -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.