Repository navigation
fix(sdk-vue,sdk-svelte,sdk-solid): import agent API from @wraith-protocol/sdk-agent - #253
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! 🚀 |
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.
…ent-imports-249 # Conflicts: # CHANGELOG.md # packages/sdk-solid/src/primitives/createActivity.ts # packages/sdk-svelte/src/primitives/useWraith.ts # scripts/compat/verify-ssr-imports.mjs
truthixify
left a comment
There was a problem hiding this comment.
Reviewed exact head 4566432. The companion imports and workspace dependencies are correct, all required checks are green, and a clean offline install followed by the root build and SSR import/render smoke test passed for agent, React, Solid, Svelte, and Vue. The one long added patch line is benign CHANGELOG prose.
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.