|
| 1 | +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. |
| 2 | + |
| 3 | +/** |
| 4 | + * ui-package-population -- the ONE place the size of the ui package population |
| 5 | + * is written down, as anti-vacuity floors. |
| 6 | + * |
| 7 | + * import { UI_PUBLISHED_PACKAGE_FLOOR } from './helpers/ui-package-population.mjs'; |
| 8 | + * expect(published.length).toBeGreaterThanOrEqual(UI_PUBLISHED_PACKAGE_FLOOR); |
| 9 | + * |
| 10 | + * A floor here answers one question: "did the scan find a population at all, |
| 11 | + * or did a lost workspace root, a broken glob or a renamed manifest field leave |
| 12 | + * it reading nothing?" It is NOT a census. A census pinned at today's measured |
| 13 | + * value goes red on every legitimate package deletion, and one deletion then |
| 14 | + * edits a floor in every file that spelled the count (objectstack#26444 counted |
| 15 | + * five for a single retirement). So each floor sits at about two thirds of the |
| 16 | + * value measured below -- the `vite-dts-wiring-ratchet` precedent: measured 22, |
| 17 | + * floor 15 -- and is written once, here, for every reader: |
| 18 | + * |
| 19 | + * - `scripts/check-node-esm-load.mjs` and `scripts/check-published-dist-tooling.mjs` |
| 20 | + * (`MIN_PACKAGES`, the gates' own refusal to judge a collapsed scan); |
| 21 | + * - `package-files-exist`, `side-effects-declaration-consistency`, |
| 22 | + * `check-dist-completeness`, `zero-test-member-exclusion-9106`, |
| 23 | + * `check-doc-links` and `quick-reference-commands-4149` under `scripts/__tests__/`. |
| 24 | + * |
| 25 | + * It is an `.mjs` module, not a `.ts` helper like its neighbours, because the two |
| 26 | + * gate scripts above import it at run time under plain `node`. |
| 27 | + * |
| 28 | + * Re-measuring: a floor moves only when its population has shrunk to near it, |
| 29 | + * and then to about two thirds of the new measurement, with the measurement and |
| 30 | + * its commit recorded in the table below. ⛔ Never raise a floor to track growth: |
| 31 | + * growth is routine and the floor's job is only to refuse an empty scan. |
| 32 | + * |
| 33 | + * Measured on objectstack `origin/main` `6a7c0fe3` (2026-10-27, right after |
| 34 | + * `@object-ui/app-shell` became private): |
| 35 | + * |
| 36 | + * population measured floor margin |
| 37 | + * published packages (release group) 36 24 12 |
| 38 | + * workspace members (packages/*, apps/*, examples/*) 43 28 15 |
| 39 | + * `sideEffects: false` declarers 11 7 4 |
| 40 | + * `sideEffects` array declarers 17 11 6 |
| 41 | + * tsc-built packages 11 7 4 |
| 42 | + */ |
| 43 | + |
| 44 | +/** |
| 45 | + * Packages that publish to npm: not `private: true`, in the changesets release |
| 46 | + * group. Readers whose population is a superset of these (packages declaring |
| 47 | + * `files` or `exports`, package directories carrying a README) read this floor |
| 48 | + * too: if the published set is there, so is theirs. |
| 49 | + */ |
| 50 | +export const UI_PUBLISHED_PACKAGE_FLOOR = 24; |
| 51 | + |
| 52 | +/** Every manifest under the three workspace globs, private ones included. */ |
| 53 | +export const UI_WORKSPACE_MEMBER_FLOOR = 28; |
| 54 | + |
| 55 | +/** Packages declaring `"sideEffects": false`. */ |
| 56 | +export const UI_SIDE_EFFECTS_FALSE_FLOOR = 7; |
| 57 | + |
| 58 | +/** Packages declaring `sideEffects` as an array of paths. */ |
| 59 | +export const UI_SIDE_EFFECTS_ARRAY_FLOOR = 11; |
| 60 | + |
| 61 | +/** Packages whose build runs `tsc` (the `check-dist-completeness` population). */ |
| 62 | +export const UI_TSC_BUILT_PACKAGE_FLOOR = 7; |
0 commit comments