Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/fix-plugin-sdk-root-imports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@executor-js/plugin-file-secrets": patch
"@executor-js/plugin-keychain": patch
---

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.
2 changes: 1 addition & 1 deletion packages/plugins/file-secrets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ProviderKey,
StorageError,
type CredentialProvider,
} from "@executor-js/sdk";
} from "@executor-js/sdk/core";

// ---------------------------------------------------------------------------
// Auth file location
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/file-secrets/src/promise.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Plugin } from "@executor-js/sdk";
import { type Plugin } from "@executor-js/sdk/core";

import {
fileSecretsPlugin as fileSecretsPluginEffect,
Expand All @@ -9,7 +9,7 @@ import {
export type { FileSecretsPluginConfig } from "./index";

// Explicit return type so the emitted dist/promise.d.ts references
// `import("@executor-js/sdk").Plugin` rather than the Promise-surface
// `import("@executor-js/sdk/core").Plugin` rather than the Promise-surface
// root specifier (which doesn't re-export Plugin).
export const fileSecretsPlugin = (
config?: FileSecretsPluginConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/keychain/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Effect } from "effect";

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

import {
deletePassword,
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/keychain/src/promise.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Plugin } from "@executor-js/sdk";
import { type Plugin } from "@executor-js/sdk/core";

import {
keychainPlugin as keychainPluginEffect,
Expand All @@ -9,7 +9,7 @@ import {
export type { KeychainPluginConfig } from "./index";

// Explicit return type so the emitted dist/promise.d.ts references
// `import("@executor-js/sdk").Plugin` rather than the Promise-surface
// `import("@executor-js/sdk/core").Plugin` rather than the Promise-surface
// root specifier (which doesn't re-export Plugin).
export const keychainPlugin = (
config?: KeychainPluginConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/keychain/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ProviderKey,
type CredentialProvider,
type ProviderItemId,
} from "@executor-js/sdk";
} from "@executor-js/sdk/core";

import type { KeychainError } from "./errors";
import { getPassword, setPassword, deletePassword } from "./keyring";
Expand Down
18 changes: 18 additions & 0 deletions scripts/smoke-test-packed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ type SmokeFailure = {

const PRIVATE_PACKAGE_RE = /Cannot find package '(@executor-js\/[^']+)'/;

// `import { X } from "@executor-js/sdk"` where the published entry doesn't
// export `X` — the packed bundle references a symbol that only exists on a
// different subpath (or in the dev-time workspace view). This is a bundle
// bug, never a missing-peer environment issue, so it's a hard failure.
const MISSING_EXPORT_RE =
/The requested module '([^']+)' does not provide an export named '([^']+)'/;

const firstMeaningfulLine = (stderr: string): string => {
const lines = stderr
.split("\n")
Expand Down Expand Up @@ -182,6 +189,17 @@ const smokeTestPackage = async (
console.log(` FAIL ${spec} — references private '${offending}'`);
continue;
}
const missingExportMatch = stderr.match(MISSING_EXPORT_RE);
if (missingExportMatch) {
const [, module, symbol] = missingExportMatch;
failures.push({
pkg: pkg.name,
subpath,
reason: `published '${module}' does not export '${symbol}'`,
});
console.log(` FAIL ${spec} — '${module}' does not export '${symbol}'`);
continue;
}
const peerMatch =
stderr.match(/Cannot find package '([^']+)'/) ??
stderr.match(/Cannot find module '([^']+)'/);
Expand Down
Loading