|
22 | 22 | // 2. A slot in `CoreServiceName` with no entry at all — which would fall |
23 | 23 | // back to `undefined` and print a remedy naming nothing. |
24 | 24 | // |
25 | | -// `null` is a legitimate entry: it means nothing ships for that slot yet, and |
26 | | -// the message says so instead of naming a plausible package. |
| 25 | +// `null` is a legitimate entry, and it means "no name belongs in an `Install X` |
| 26 | +// sentence" — which covers TWO situations. Nothing provides the slot at all |
| 27 | +// (`search`, `workflow`, `graphql`), or a provider exists but cannot be |
| 28 | +// installed: `@objectstack/service-ai` registers `ai` in objectstack-ai/cloud |
| 29 | +// and is `private: true`. This script can only see workspace packages, so it |
| 30 | +// cannot tell those apart — `REMEDY_DETAIL` in the same file is where the |
| 31 | +// second kind gets an accurate sentence, and the reason a bare `null` must not |
| 32 | +// be read here (or reported) as "nothing exists". |
27 | 33 |
|
28 | 34 | import { readFileSync, readdirSync, existsSync } from 'node:fs'; |
29 | 35 | import { join } from 'node:path'; |
@@ -86,7 +92,9 @@ for (const [slot, pkg] of table) { |
86 | 92 | problems.push( |
87 | 93 | ` ${slot} → ${pkg}\n` |
88 | 94 | + ' Not a workspace package. Point it at the package that actually registers\n' |
89 | | - + ` the '${slot}' slot, or use \`null\` if nothing ships for it yet.`, |
| 95 | + + ` the '${slot}' slot, or use \`null\` if no installable package provides it\n` |
| 96 | + + ' (adding a REMEDY_DETAIL sentence if something ships that simply cannot\n' |
| 97 | + + ' be installed, e.g. a private package in another repository).', |
90 | 98 | ); |
91 | 99 | } |
92 | 100 | } |
@@ -115,7 +123,12 @@ if (problems.length > 0) { |
115 | 123 | } |
116 | 124 |
|
117 | 125 | const named = [...table.values()].filter(Boolean).length; |
| 126 | +// Deliberately NOT "nothing ships yet" — `null` means "no name belongs in an |
| 127 | +// `Install X` sentence", which also covers a provider that exists but cannot be |
| 128 | +// installed (`ai`, whose `@objectstack/service-ai` is private to the cloud |
| 129 | +// repo). Saying "nothing ships" here would repeat, in this script's own output, |
| 130 | +// the conflation the table was corrected to stop making. |
118 | 131 | console.log( |
119 | | - `✓ check:service-providers — ${table.size} slot(s): ${named} name a real workspace ` |
120 | | - + `package, ${table.size - named} correctly report that nothing ships yet.`, |
| 132 | + `✓ check:service-providers — ${table.size} slot(s): ${named} name an installable workspace ` |
| 133 | + + `package, ${table.size - named} name none (see REMEDY_DETAIL for those that still ship something).`, |
121 | 134 | ); |
0 commit comments