Repository navigation
Expand file tree
/
Copy pathpnpm-workspace.yaml
More file actions
178 lines (173 loc) · 18.5 KB
/
Copy pathpnpm-workspace.yaml
File metadata and controls
178 lines (173 loc) · 18.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
packages:
- "apps/*"
- "packages/*"
- "tooling/*"
allowBuilds:
core-js: true
esbuild: true
protobufjs: true
# Reached through lingo.dev (packages/surveys' i18n:generate) via @openrouter/ai-sdk-provider. Its postinstall (`node scripts/check-types.js || true`, reviewed for 0.3.16) only fetches openrouter.ai's model list to warn that its bundled model types are stale, and exits 0 either way; nothing it does is needed, so it is denied rather than left unreviewed, which pnpm treats as an install failure.
"@openrouter/sdk": false
# Single source of truth for the version of every dependency used by two or more workspaces. Packages reference these as `"typescript": "catalog:"` and never as a literal version, so a shared dependency cannot drift between packages: bumping one means editing the entry here, which changes every consumer at once.
#
# `tooling/scripts/check-catalog.mjs` (run by `pnpm check`, `make check` and CI) enforces both halves of that: it fails if a workspace declares a literal version for a name listed here, and if a dependency is declared by 2+ workspaces without being listed here at all.
#
# What else belongs here: a version family that has to move as one even where each member has a single consumer (the Storybook packages, Vitest and its coverage provider), and every name an override below points at with `"catalog:"`, so the override and the direct dependency cannot pin two different versions. dotenv-cli, cross-env and preact (packages/surveys), glob (packages/i18n-utils) and js-yaml (the root) have one consumer each today and are kept here rather than moved back; check-catalog.mjs does not reject a single-consumer entry. Any other dependency with one consumer stays a literal in its own package.json. `saveExact: true` (below) is why every entry is a bare exact version; the sole exception in the workspace is packages/survey-ui's react/react-dom `peerDependencies`, which are intentionally a `^19.0.0` range (a published package's peer range, not a pinned install) and are therefore excluded from the catalog rather than collapsed into the exact version.
catalog:
# --- build & test toolchain ---
typescript: 5.9.3
# Vite+ ships its own Vite core (Rolldown-based Vite 8) and Vitest; every workspace resolves both through these aliases and the overrides below, so no package can pull a second copy. The override does not reach a peer that pnpm auto-installs, so a workspace that declares `vitest` must also declare `"vite": "catalog:"`: packages/types did not, and vitest's `vite` peer there resolved a real vite 8.0.16 (GHSA-rq7h-c2jc-7f22, GHSA-587h-7wmj-h5pm and three more) until 2026-10-24.
vite: npm:@voidzero-dev/vite-plus-core@1.3.0
vitest: 5.0.5
"@vitest/coverage-v8": 5.0.5
vite-plugin-dts: 4.5.4
vite-tsconfig-paths: 6.1.1
"@vitejs/plugin-react": 6.1.2
jsdom: 29.1.1
postcss: 8.5.31
rimraf: 6.1.3
tsx: 4.23.13
dotenv-cli: 11.0.0
cross-env: 10.1.0
glob: 13.0.6
# Read by tooling/scripts/check-catalog.mjs.
js-yaml: 4.3.2
"@playwright/test": 1.63.0
"@testing-library/react": 16.3.3
# --- types ---
"@types/node": 25.4.0
"@types/react": 19.3.0
"@types/react-dom": 19.3.0
# --- storybook ---
storybook: 10.6.3
"@storybook/react": 10.6.3
"@storybook/react-vite": 10.6.3
"@storybook/addon-a11y": 10.6.3
"@storybook/addon-docs": 10.6.3
"@storybook/addon-links": 10.6.3
# --- ui runtime shared by web, survey-ui and surveys ---
react: 19.3.0
react-dom: 19.3.0
preact: 10.29.8
tailwindcss: 4.3.3
"@tailwindcss/postcss": 4.3.3
"@tailwindcss/vite": 4.3.3
clsx: 2.1.1
tailwind-merge: 3.7.0
class-variance-authority: 0.7.1
lucide-react: 0.577.0
# Shared by apps/web (the admin SPA) and apps/website (rendered to static HTML at build time).
"@tanstack/react-router": 1.170.41
date-fns: 4.4.0
isomorphic-dompurify: 3.9.0
"@formkit/auto-animate": 0.9.0
react-day-picker: 9.14.0
"@radix-ui/react-checkbox": 1.3.11
"@radix-ui/react-dropdown-menu": 2.1.24
"@radix-ui/react-popover": 1.1.23
"@radix-ui/react-radio-group": 1.4.7
"@radix-ui/react-slot": 1.3.3
i18next: 25.8.20
i18next-icu: 2.4.4
react-i18next: 16.5.8
# --- server runtime ---
zod: 4.6.7
# --- toolchain: build, test, lint (Oxlint), format (Oxfmt), type-check, task runner ---
vite-plus: 1.3.0
# Security overrides for transitive dependencies that still fail audit without a pin. Remove each override once its upstream dependency chain adopts a patched version: drop it, resolve the workspace (`pnpm install --lockfile-only`) and re-run `pnpm audit`.
#
# The `load-bearing:` notes name the packages in the current lockfile that depend on the pinned package (re-checked on 2026-10-24, after the documentation app's tooling was removed, and against the lockfile's snapshots again on 2026-10-25), so the next cleanup can check those upstreams instead of re-deriving them. On 2026-10-24, dropping every override below against the lockfile still resolved lodash 4.17.23 and minimatch 10.2.1; the other pins were kept at their overridden versions by the existing lockfile, so whether they are still needed is only known by dropping them one at a time.
overrides:
lodash: 4.18.1 # GHSA-r5fr-rjxr-66jc + GHSA-f23m-r3pf-42rh: <=4.17.23 vulnerable, patched in 4.17.24. load-bearing: @microsoft/api-extractor (dev, via vite-plugin-dts) resolves 4.17.23.
minimatch@10: 10.2.5 # GHSA-7r86-cg39-jmmj + GHSA-23c5-xmqv-rm74: 10.0.0–10.2.2 vulnerable, patched in 10.2.3. load-bearing: @microsoft/api-extractor pins 10.2.1; glob 13 (rimraf, storybook's react-docgen plugin) is on the same line.
# GHSA-r28c-9q8g-f849 and GHSA-fxqj-rqcc-2cmp: postcss path traversal and parser denial-of-service findings are patched in 8.5.23. Points at the catalog entry (8.5.31 since vite-plus-core 1.3.0 declares postcss ^8.5.29, 2026-10-24), so the override and the direct dependencies of packages/surveys and tooling/vite-plugins cannot pin two different versions.
# load-bearing: @tailwindcss/postcss, autoprefixer and vite (vite-plus-core) depend on it.
postcss: "catalog:"
# ENG-2403 / GHSA-2v37-7h3g-55p8 (CVE-2026-67213): nanoid <3.3.18 customAlphabet/customRandom loop
# indefinitely when called with size 0 (DoS). Raises the 3.x pin from 3.3.17 to 3.3.18 (still <4).
# load-bearing: postcss resolves 3.3.17.
nanoid@3: 3.3.18
# ENG-1111 / GHSA-58qx-3vcg-4xpx: ws is patched in 8.20.1+. GHSA-96hv-2xvq-fx4p raises that to 8.21.0.
# load-bearing: @vitest/browser, happy-dom and storybook (all dev) depend on it.
ws@8: 8.21.0
# Dependabot security batch (transitive-only).
esbuild: 0.28.1 # ENG-1327 / GHSA-g7r4-m6w7-qqqr (>=0.27.3 <0.28.1). load-bearing: vite (vite-plus-core), tsx, storybook, unplugin and terser-webpack-plugin (all dev) depend on it.
# GHSA-4cwx-7wf7-3272, GHSA-8xcm-r25x-g524, GHSA-jr45-8vmc-qm54, GHSA-m8rv-5g2x-5cg5 and GHSA-v3r7-h72x-cjcm: undici request handling findings, patched in 7.29.0 on the 7.x line.
# GHSA-rfgv-xxqx-mfg5, GHSA-w293-vg96-wgc3, GHSA-3wwx-pv8p-q78v, GHSA-pmjh-fq2x-6v4x, GHSA-3xpg-4rpp-hhhm, GHSA-2jfj-6hjv-fm6j, GHSA-rx4f-c7p8-82vq, GHSA-r53p-7pc4-xj5r, GHSA-2gqq-gqf2-x968 and GHSA-8436-99hf-9mmv (patched in 7.29.1), then GHSA-xjj6-f33q-929c, GHSA-4qv8-2p9j-2685 and GHSA-f72v-6w45-q472 (patched in 7.30.1): WebSocket, retry-handler, decompression, cache and TLS-reconnect findings on the 7.x line. Raised to 7.30.1 on 2026-10-24.
# load-bearing: jsdom (dev, the Vitest DOM environment) resolves the 7.x line.
undici@7: 7.30.1
# === Dependabot security batch (ENG-2821/ENG-2822, ENG-2823/ENG-2824, ENG-2839..ENG-2845) ===
# ENG-2823 / GHSA-c83g-rgw3-j3cx (CVE-2026-73089): browserslist's query-result and AST caches grow
# without eviction, so a stream of distinct queries (e.g. `since <year>-<month>-<day>`) accumulates
# unbounded heap until the process OOMs.
# ENG-2824 / GHSA-73wf-gq98-2v4g (CVE-2026-73088): normalizeStats() does an unguarded `for...in` over
# untrusted browserslist-stats.json keys, so a key matching an Object.prototype member name (e.g.
# `toString`, `__proto__`) crashes the process or repoints the result object's prototype. Both patched
# in 4.28.7.
# load-bearing: no direct dependency — autoprefixer (packages/surveys, dev) resolves 4.28.1 and the
# @babel/core / storybook / webpack build chain (dev-only) resolves 4.28.2.
browserslist: 4.28.7
# ENG-2887 / GHSA-px8p-9vwx-vf98 (CVE-2026-45820): fflate's unzipSync() can loop indefinitely on a malformed ZIP archive whose central-directory entry declares the ZIP64 sentinel (compressed_size=0xFFFFFFFF) but omits the required ZIP64 extra field; the out-of-bounds read that should supply the real size returns undefined, which coerces to 0 and keeps the loop condition true forever (DoS). Affects the 0.4.x line from 0.4.5; patched in 0.4.9.
# load-bearing: posthog-js (browser, apps/web) resolves 0.4.8; @vitest/ui and @types/three (apps/website), both dev, depend on it too.
fflate: 0.4.9
# === Dependabot security batch (ENG-3091..ENG-3110) ===
# ENG-3100 / GHSA-w5vr-8v7q-w6rv (CVE-2026-45819): baseline-browser-mapping <2.11.0 calls
# `process.exit()` when it can't parse browserslist-stats.json, taking down the whole process instead
# of throwing; patched in 2.11.0. Pinned to 2.11.20 (already resolved elsewhere in the tree, so this
# coerces the vulnerable copy up rather than introducing a new version).
# load-bearing: browserslist (dev, see above) depends on it.
baseline-browser-mapping: 2.11.20
# === Removed once upstream caught up (kept as a record of what no longer needs a pin) ===
# ajv@6, @babel/core, body-parser, engine.io@6, linkify-it, protobufjs@7 and uuid@11
# all resolve to the patched version on their own now.
# fast-xml-parser, @opentelemetry/core and brace-expansion@1 went with @redocly/cli too: their only consumers were its openapi-sampler (also redoc's), its OpenTelemetry 0.53 / 1.26 exporter chain and its glob 7 (via minimatch 3), so the tree resolves none of the three without them.
# dompurify, js-yaml@4, undici@6, @opentelemetry/propagator-jaeger, fast-uri@3, @faker-js/faker and brace-expansion@2 went with @redocly/cli (the v3 API reference tooling, removed with the documentation app): re-resolved without them, both against the lockfile and from scratch, the tree holds no @faker-js/faker, propagator-jaeger or undici 6 at all, js-yaml 4 is only the root's direct 4.3.2, and dompurify (isomorphic-dompurify, posthog-js), fast-uri (ajv) and brace-expansion 2 (minimatch 9) resolve patched versions on their own.
# The same three, plus source-map-js, were re-resolved in place on 2026-10-24 rather than pinned, because every consumer's range already admits the patched release: dompurify 3.4.15 -> 3.4.17 (GHSA-cg2g-xh64-v4q7, GHSA-mrv2-3pqr-j5jr and three low IN_PLACE / SMIL findings; isomorphic-dompurify wants ^3.4.0, posthog-js ^3.4.13), fast-uri 3.1.6 -> 3.1.9 (GHSA-qw65-cvwx-89v3, GHSA-58mr-gqgx-xq4g and five more; ajv wants ^3.0.1), brace-expansion 2.1.4 -> 2.1.7 (GHSA-6j4f-fj2g-mc7p, GHSA-qhr7-859c-m2p7, GHSA-q2hr-2g5m-vwhr; minimatch 9 wants ^2.0.2) and source-map-js 1.2.1 -> 1.2.2 (GHSA-68fv-2mgg-jv7q; @tailwindcss/node, css-tree and @vue/compiler-core want ^1.x). The lockfile is what holds them there, so a future `pnpm audit` regression on these four means a lockfile refresh, not a new override.
# shell-quote was retired by bumping concurrently to 9.2.4 (shell-quote 1.9.0) instead; js-cookie and form-data@4 no longer resolve at all, their consumers (forma2's react-use, and @redocly/cli) having left the tree. concurrently 9.2.5 (shell-quote 1.12.0) then closed GHSA-pqg4-j6r4-53mv on 2026-10-24.
# GHSA-6j4f-fj2g-mc7p (parseCommaParts recursion, patched in 5.0.10), GHSA-qhr7-859c-m2p7 (nested brace groups recursion, 5.0.11) and GHSA-q2hr-2g5m-vwhr (quadratic `{a},b}` rewrite, 5.0.12) raised the 5.x pin from 5.0.9 to 5.0.12 on 2026-10-24.
# ENG-2234 / GHSA-mh99-v99m-4gvg + GHSA-rgw5-rvv9-x895: brace-expansion's recursive expansion has no bound on total output length, so a crafted `{a,b}{c,d}...` pattern grows the result set exponentially (DoS). GHSA-rgw5-rvv9-x895 (unbounded intermediate arrays) bypasses the CVE-2026-14257 mitigation; GHSA-mh99-v99m-4gvg covers only the 1.x and 2.x lines. Every line reaches brace-expansion via minimatch. Pinned to the lowest maintenance release closing both advisories on the line. The 1.x and 2.x lines need no pin any more (see the record above).
# load-bearing: minimatch 10 depends on it, from @microsoft/api-extractor (via vite-plugin-dts) and glob 13 (rimraf, storybook's react-docgen plugin), all dev.
brace-expansion@5: 5.0.12
# GHSA-mrhx-c7xc-m3w5: zod <4.6.6 can exhaust memory while validating oversized constrained collections; patched in 4.6.6. Points at the catalog entry, so the override and every workspace's zod are the same (patched, see patchedDependencies) 4.6.7. Scoped to the three parents that pin the vulnerable copy rather than written as a `zod@<4.6.6` selector: pnpm applies a version selector to every zod range that intersects it, peer ranges included, so that form rewrote the zod peer of @hookform/resolvers (apps/web), ai, @ai-sdk/* and @openrouter/* to an exact 4.6.7 and would silently move any future zod 3 consumer onto zod 4. A new dependency that pins a vulnerable zod is not covered by this override; Dependabot alerts and `pnpm audit` report it.
# load-bearing: lingo.dev 0.138.10 (packages/surveys, dev), @lingo.dev/_spec 0.49.3 and @lingo.dev/_sdk 0.17.3 pin zod 4.4.3 exactly; lingo.dev's ai, @ai-sdk/* and @openrouter/* providers take zod as a peer and resolve their parent's 4.6.7 through it.
"lingo.dev>zod": "catalog:"
"@lingo.dev/_spec>zod": "catalog:"
"@lingo.dev/_sdk>zod": "catalog:"
vite@*: "catalog:"
vitest@*: "catalog:"
# One React in the install. Without these, react-i18next (a dependency of packages/surveys, which renders with Preact and declares no React) and the storybook tooling get an auto-installed React of their own, at whatever version pnpm picks for the unmet peer. Pinning both keeps one React version in the lockfile, so no package renders with one React while its hooks come from another (under the hoisted linker that nested copy broke react-i18next's hooks in apps/web/).
react: "catalog:"
react-dom: "catalog:"
autoInstallPeers: true
linkWorkspacePackages: true
sharedWorkspaceLockfile: true
access: public
enablePrePostScripts: true
# The strict linker, pnpm's default, written out so a global or user-level `node-linker` cannot switch a checkout back to the flat layout (ENG-1674). A workspace resolves only what its own package.json declares, plus the root package.json's dependencies through the root node_modules as an ancestor (tooling/scripts' js-yaml relies on that; the root's own @types/node and typescript are there for the root tsconfig.json's `types: ["node"]` and .vscode's `typescript.tsdk`), so an import that a workspace's own source or config makes for a package it does not declare fails instead of resolving through another package's copy. That check stops at workspace code: pnpm's default `hoistPattern: ["*"]` still hoists every package into node_modules/.pnpm/node_modules, so a package loaded by a third-party tool from inside the store (a Vitest environment, which goes through Vitest's shared peer set, a PostCSS or Vite plugin, a Storybook addon) still resolves without the declaration. Declaring those is a convention the install does not check. Declare a missing dependency in the package that imports it (as `catalog:` when two workspaces share it); do not bring back `shamefullyHoist` or add a `publicHoistPattern` for it. Setting `hoistPattern: []` would close the gap but needs its own install, build and Storybook verification. An existing checkout installed with the old hoisted linker must run `pnpm install --config.confirmModulesPurge=false` once (see AGENTS.md); `confirmModulesPurge` is deliberately not set here.
nodeLinker: isolated
# The isolated linker's command shims (node_modules/.bin) otherwise export NODE_PATH pointing into node_modules/.pnpm, which is a second way for a tool to load a package nobody declared, and which Storybook inlines into the build: the @chromatic-com/storybook manager bundle in storybook-static carried the build machine's absolute store paths.
extendNodePath: false
saveExact: true
# Supply-chain release cooldown: refuse to install package versions published less than
# 3 days (4320 minutes) ago, so compromised releases are usually detected/yanked before we
# can pull them. pnpm 11 already defaults to 1 day; we raise it to 3 days and pin it
# explicitly. Note: with trustLockfile disabled (below), `pnpm install` re-verifies entries
# already in the lockfile against this policy too — a lockfile bump younger than 3 days
# (e.g. written by a bot) fails install until it ages or is excluded below. Intended.
minimumReleaseAge: 4320
# Keep the install-time re-verification of lockfile entries active (this is pnpm's default;
# pinned explicitly so a future default flip can't silently weaken the cooldown).
trustLockfile: false
patchedDependencies:
# zod 4.6.7: drops the `export * as locales` re-export from the classic, core and mini entries so the bundled locale error tables (one module per language, 63 in 4.6.7) cannot reach the client bundle — they would sit in the shared zod chunk of the root-layout client entry, including the public survey route every respondent loads. Measured on 2026-10-25 with vite-plus 1.3.0, the build already drops the unused namespace on its own (with the patch reverted, apps/web/dist carries no non-English locale string for zod 4.3.6 or 4.6.7, and the packages/surveys build none for 4.6.7), so the patch is a guard against a bundler or import change that stops tree-shaking it, not the only thing keeping the tables out.
# Removing it from `v4/classic/external.js` alone changes nothing: that file also does `export * as core from "../core/index.js"`, and `v4/core/index.js` re-exports the same locales namespace, so both have to go — and `v4/mini/external.js` with them, or `zod/mini` would pull the tables straight back in. The `.cjs`, `.d.ts` and `.d.cts` twins of the three files are patched the same way.
# The direct `import en from "../locales/en.js"` that installs the default error map (in `v4/classic/schemas.js` since 4.6; it was in `external.js` in 4.3) is left intact, and the `zod/locales` subpath export still resolves, so localized messages stay available to anyone who imports them explicitly.
# pnpm fails the install loudly on a hash mismatch, so the next zod bump means re-doing the patch (`pnpm patch zod@<version>`, delete the same lines, `pnpm patch-commit`), not force-applying this one.
"zod@4.6.7": patches/zod@4.6.7.patch
peerDependencyRules:
allowAny:
- vite
- vitest
allowedVersions:
vite: "*"
vitest: "*"