History

Import plugin-authoring symbols from sdk/core in file-secrets and keychain

Rhys Sullivan committed 2 months ago

Commit 607a1df1 parent 10e16a57 files · +31 −7Browse files

Showing the changes to scripts (1 of 7 files). Show all

Unified · Split

scripts/smoke-test-packed.ts+18−0
@@ -78,6 +78,13 @@ type SmokeFailure = { · 77 unmodified lines
7878
7979 const PRIVATE_PACKAGE_RE = /Cannot find package '(@executor-js\/[^']+)'/;
8080
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+
8188 const firstMeaningfulLine = (stderr: string): string => {
8289 const lines = stderr
8390 .split("\n")
@@ -182,6 +189,17 @@ const smokeTestPackage = async ( · 98 unmodified lines
182189 console.log(` FAIL ${spec} — references private '${offending}'`);
183190 continue;
184191 }
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+ }
185203 const peerMatch =
186204 stderr.match(/Cannot find package '([^']+)'/) ??
187205 stderr.match(/Cannot find module '([^']+)'/);