Repository navigation
fix(sdk-vue,sdk-svelte,sdk-solid): import agent API from @wraith-protocol/sdk-agent - #253
Open
Classictowo wants to merge 1 commit into
Open
Classictowo wants to merge 1 commit into
Classictowo wants to merge 1 commit into
Conversation
…ocol/sdk-agent The Vue, Svelte and Solid companions imported Wraith, WraithAgent and Chain from the core @wraith-protocol/sdk, but wraith-protocol#193 moved those exports to @wraith-protocol/sdk-agent, so importing any companion on the server threw before any code ran: SyntaxError: The requested module '@wraith-protocol/sdk' does not provide an export named 'Chain' Fix: import the agent names from @wraith-protocol/sdk-agent and declare it as a workspace dependency in each companion; externalize it in each tsup config; point the useWraith/createActivity test mocks at the new module; and drop the three companions from verify-ssr-imports.mjs KNOWN_IMPORT_FAILURES. The root pnpm build now also builds @wraith-protocol/sdk-agent so the unit tests and the SSR import check resolve its built dist. Closes wraith-protocol#249
|
@Classictowo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
truthixify
requested changes
Oct 16, 2026
Contributor
There was a problem hiding this comment.
The companion-package import correction looks right, but the required test jobs fail at the formatting gate. Prettier reports changes in packages/sdk-solid/src/primitives/createActivity.ts and packages/sdk-svelte/src/primitives/useWraith.ts. Please format those files and rerun CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On
develop, importing@wraith-protocol/sdk-vue,@wraith-protocol/sdk-svelteor@wraith-protocol/sdk-solidfrom Node throws before any code runs:#193 moved
Wraith,WraithAgentandChainfrom@wraith-protocol/sdkto@wraith-protocol/sdk-agent, but these three companions still imported them from the core. React and agent were unaffected.Closes #249
Changes
packages/sdk-vue/src/composables/useWraith.ts,packages/sdk-svelte/src/primitives/useWraith.tsandpackages/sdk-solid/src/primitives/createActivity.tsnow importWraith,WraithAgent,Chainand the agent types from@wraith-protocol/sdk-agent.@wraith-protocol/sdk-agent: workspace:*to each companion'sdependencies(lockfile updated).@wraith-protocol/sdk-agentto each companion's tsupexternallist, and the rootpnpm buildnow also builds@wraith-protocol/sdk-agent. The companions' unit tests and the SSR import check load that package's builtdist/, so it must exist afterpnpm build(the SSR script itself documents "runpnpm buildfirst").useWraith/createActivitymocks at@wraith-protocol/sdk-agent.KNOWN_IMPORT_FAILURESinscripts/compat/verify-ssr-imports.mjs; they import cleanly now, so the check fails until the entries are removed (as its comment describes).Verification
pnpm buildproducesdist/for the core andpackages/sdk-agent/dist/.node scripts/compat/verify-ssr-imports.mjs- every companion imports and renders server-side:dist), ESM and CJS, all three companions:pnpm test:typespasses;packages/sdk-vue/test/useWraith.test.ts(5 tests) andpackages/sdk-solid/test/createActivity.test.ts(13 tests) pass;pnpm --filter @wraith-protocol/sdk-svelte test(10 tests) passes.pnpm test:compatreaches the SSR step green; the only local failure on this Windows runner isverify-package.mjs'sEPERMsymlink step, which is unrelated to this change and passes on Linux CI.Notes
COMPAT.mdreports "stale" on a Windows checkout purely because of CRLF line endings;node scripts/compat/check.mjs --writeproduces a zero-byte diff against the committed file, so it is left untouched.