From 410b9b1621359b0b720306e5d8b76b8aee746c55 Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Mon, 16 Nov 2026 23:39:00 +0000 Subject: [PATCH] REPO_POLICIES: node and yarn States once that a stage with no yarn.lock gets no node and no yarn, which two paragraphs here said; puts the short lists of yarn settings and of the files a yarn stage copies inline; joins the two sentences on Alpine's and Debian's yarn; every setting, file and condition stays. Model: opus-5-5 --- prompts/REPO_POLICIES.md | 45 +++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/prompts/REPO_POLICIES.md b/prompts/REPO_POLICIES.md index c9a4b1d..bbda88b 100644 --- a/prompts/REPO_POLICIES.md +++ b/prompts/REPO_POLICIES.md @@ -225,25 +225,30 @@ style conventions are in separate documents: - A tool from outside the distribution is never installed as "latest" or "lts"; it is always an exact version. +## node and yarn + - Use `yarn`, not `npm`. `script/bootstrap` installs node, yarn and the node packages only when - `yarn.lock` is in the tree. With no `yarn.lock`, it installs no node and no - yarn. It installs the node packages with `yarn install --immutable`. That - install fails when a package's `checksum` is wrong, or when `package.json` - is out of step with `yarn.lock`. + `yarn.lock` is in the tree. A `Dockerfile` stage that needs no yarn copies + no `yarn.lock` before it runs `script/bootstrap`, so `script/bootstrap` + installs no node and no yarn there. The stages in the `prompts` repo's + `examples/go.Dockerfile` and `examples/python-test-phase.Dockerfile` are + such stages. + + `script/bootstrap` installs the node packages with + `yarn install --immutable`, which fails when a package's `checksum` is + wrong, or when `package.json` is out of step with `yarn.lock`. Each repository commits the yarn that runs. `yarnPath` in `.yarnrc.yml` points at the release file in `.yarn/releases/`. The distribution's yarn - only starts that file, and that file does the work. Alpine packages yarn 1, - and Debian 13 packages yarn 4.1. The same committed yarn does the work on - both. Corepack never runs, and no yarn is downloaded. + only starts that file, and that file does the work. So Alpine's yarn 1 and + Debian 13's yarn 4.1 run the same committed yarn. Corepack never runs, and + no yarn is downloaded. - `.yarnrc.yml` holds these settings: - - `yarnPath` - - `nodeLinker: node-modules` - - `enableTelemetry: false`, because yarn otherwise sends usage reports from - any host that is not CI + `.yarnrc.yml` holds `yarnPath`, `nodeLinker: node-modules` and + `enableTelemetry: false`. Without the last, yarn sends usage reports from + any host that is not CI. By default, yarn runs no dependency's install script. A dependency that must run one is named in `package.json`, as @@ -263,18 +268,10 @@ style conventions are in separate documents: exit 1. A `Dockerfile` stage that needs yarn may start from any distribution that - packages node and yarn. It copies all of these before it runs - `script/bootstrap`: - - `package.json` - - `yarn.lock` - - `.yarnrc.yml` - - `.yarn/releases/` - - With only `package.json` and `yarn.lock`, the install fails. Alpine's yarn 1 - then says to enable corepack; never do that, and copy the missing files - instead. The stages in the `prompts` repo's `examples/go.Dockerfile` and - `examples/python-test-phase.Dockerfile` need no yarn and copy no - `yarn.lock`, so `script/bootstrap` installs no node and no yarn there. + packages node and yarn. Before it runs `script/bootstrap`, it copies + `package.json`, `yarn.lock`, `.yarnrc.yml` and `.yarn/releases/`. With only + the first two, the install fails, and Alpine's yarn 1 says to enable + corepack. Never do that; copy the missing files instead. - **`script/bootstrap` installs a pinned tool by comparing versions, never by testing presence.** An `if ! command -v ; then install; fi` guard tests