Showing the changes to scripts (1 of 7 files). Show all
Unified · Split
| @@ -78,6 +78,13 @@ type SmokeFailure = { · 77 unmodified lines | |||
| 78 | 78 | ||
| 79 | const PRIVATE_PACKAGE_RE = /Cannot find package '(@executor-js\/[^']+)'/; | 79 | const PRIVATE_PACKAGE_RE = /Cannot find package '(@executor-js\/[^']+)'/; |
| 80 | 80 | ||
| 81 | // `import { X } from "@executor-js/sdk"` where the published entry doesn't | ||
| 82 | // export `X` — the packed bundle references a symbol that only exists on a | ||
| 83 | // different subpath (or in the dev-time workspace view). This is a bundle | ||
| 84 | // bug, never a missing-peer environment issue, so it's a hard failure. | ||
| 85 | const MISSING_EXPORT_RE = | ||
| 86 | /The requested module '([^']+)' does not provide an export named '([^']+)'/; | ||
| 87 | |||
| 81 | const firstMeaningfulLine = (stderr: string): string => { | 88 | const firstMeaningfulLine = (stderr: string): string => { |
| 82 | const lines = stderr | 89 | const lines = stderr |
| 83 | .split("\n") | 90 | .split("\n") |
| @@ -182,6 +189,17 @@ const smokeTestPackage = async ( · 98 unmodified lines | |||
| 182 | console.log(` FAIL ${spec} — references private '${offending}'`); | 189 | console.log(` FAIL ${spec} — references private '${offending}'`); |
| 183 | continue; | 190 | continue; |
| 184 | } | 191 | } |
| 192 | const missingExportMatch = stderr.match(MISSING_EXPORT_RE); | ||
| 193 | if (missingExportMatch) { | ||
| 194 | const [, module, symbol] = missingExportMatch; | ||
| 195 | failures.push({ | ||
| 196 | pkg: pkg.name, | ||
| 197 | subpath, | ||
| 198 | reason: `published '${module}' does not export '${symbol}'`, | ||
| 199 | }); | ||
| 200 | console.log(` FAIL ${spec} — '${module}' does not export '${symbol}'`); | ||
| 201 | continue; | ||
| 202 | } | ||
| 185 | const peerMatch = | 203 | const peerMatch = |
| 186 | stderr.match(/Cannot find package '([^']+)'/) ?? | 204 | stderr.match(/Cannot find package '([^']+)'/) ?? |
| 187 | stderr.match(/Cannot find module '([^']+)'/); | 205 | stderr.match(/Cannot find module '([^']+)'/); |