Skip to content

Commit 607a1df

Browse files
committed
Import plugin-authoring symbols from sdk/core in file-secrets and keychain
1 parent 10e16a5 commit 607a1df

7 files changed

Lines changed: 31 additions & 7 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@executor-js/plugin-file-secrets": patch
3+
"@executor-js/plugin-keychain": patch
4+
---
5+
6+
Import plugin-authoring symbols from `@executor-js/sdk/core` instead of the package root. The published root is the Promise surface and does not export `StorageError`, `definePlugin`, `PluginCtx`, or `Plugin`, so both packages failed to load when installed from npm.

packages/plugins/file-secrets/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ProviderKey,
1010
StorageError,
1111
type CredentialProvider,
12-
} from "@executor-js/sdk";
12+
} from "@executor-js/sdk/core";
1313

1414
// ---------------------------------------------------------------------------
1515
// Auth file location

packages/plugins/file-secrets/src/promise.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Plugin } from "@executor-js/sdk";
1+
import { type Plugin } from "@executor-js/sdk/core";
22

33
import {
44
fileSecretsPlugin as fileSecretsPluginEffect,
@@ -9,7 +9,7 @@ import {
99
export type { FileSecretsPluginConfig } from "./index";
1010

1111
// Explicit return type so the emitted dist/promise.d.ts references
12-
// `import("@executor-js/sdk").Plugin` rather than the Promise-surface
12+
// `import("@executor-js/sdk/core").Plugin` rather than the Promise-surface
1313
// root specifier (which doesn't re-export Plugin).
1414
export const fileSecretsPlugin = (
1515
config?: FileSecretsPluginConfig,

packages/plugins/keychain/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Effect } from "effect";
22

3-
import { definePlugin, type CredentialProvider, type PluginCtx } from "@executor-js/sdk";
3+
import { definePlugin, type CredentialProvider, type PluginCtx } from "@executor-js/sdk/core";
44

55
import {
66
deletePassword,

packages/plugins/keychain/src/promise.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Plugin } from "@executor-js/sdk";
1+
import { type Plugin } from "@executor-js/sdk/core";
22

33
import {
44
keychainPlugin as keychainPluginEffect,
@@ -9,7 +9,7 @@ import {
99
export type { KeychainPluginConfig } from "./index";
1010

1111
// Explicit return type so the emitted dist/promise.d.ts references
12-
// `import("@executor-js/sdk").Plugin` rather than the Promise-surface
12+
// `import("@executor-js/sdk/core").Plugin` rather than the Promise-surface
1313
// root specifier (which doesn't re-export Plugin).
1414
export const keychainPlugin = (
1515
config?: KeychainPluginConfig,

packages/plugins/keychain/src/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ProviderKey,
66
type CredentialProvider,
77
type ProviderItemId,
8-
} from "@executor-js/sdk";
8+
} from "@executor-js/sdk/core";
99

1010
import type { KeychainError } from "./errors";
1111
import { getPassword, setPassword, deletePassword } from "./keyring";

scripts/smoke-test-packed.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ type SmokeFailure = {
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 (
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 '([^']+)'/);

0 commit comments

Comments
 (0)