Skip to content

fix: generated AffitorTracker uses loadAffitor - #34

Merged
sonpiaz merged 1 commit into
mainfrom
fix/qa-17-tracker-uses-loadaffitor
Oct 13, 2026
Merged

sonpiaz merged 1 commit into
mainfrom
fix/qa-17-tracker-uses-loadaffitor

Conversation

@sonpiaz

@sonpiaz sonpiaz commented Oct 13, 2026

Copy link
Copy Markdown
Member

What

The <AffitorTracker /> component that affitor init / affitor onboard write into a brand's app now calls loadAffitor(programId) instead of init({ programId }).

Why

@affitor/sdk exports loadAffitor and _resetAffitor from its root (2.1.0 published 14/06 and 2.1.1 published 12/10; /pure, /react, /server add no init). The generated file imported init, so it broke type-checking in the brand's own repo. Published affitor@0.4.1 and 0.4.2 both generate it.

Compiled the generated component (trackerComponentSource(123, true)) against the published @affitor/sdk@2.1.1 with tsc --strict --jsx react-jsx --moduleResolution bundler:

result
main error TS2305: Module '"@affitor/sdk"' has no exported member 'init'. (exit 2)
this branch exit 0

Test

  • tests/wizard.test.ts now pins import { loadAffitor } from '@affitor/sdk';, loadAffitor(123) / loadAffitor("prog_abc"), and no init( / import { init }.
  • npm test: recipes 19/19, cli 113/113, mcp 20/20. npm run build passes.

Not in this PR

onboard still calls the wizard with programId: "" (src/commands/onboard.ts:103), so its generated tracker gets an empty id. Needs the program id from the API before the wizard runs; separate PR. Brands get the fix only after the next npm publish.

QA finding QA-17: .internal/qa/2026-10-12/FINDINGS.md

🤖 Generated with Claude Code

@affitor/sdk (2.1.0 and 2.1.1) exports loadAffitor, not init. The
component that affitor init and onboard write into a brand's app imported
init, so it failed type-checking (TS2305) in the brand's own build.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonpiaz
sonpiaz merged commit e58c9dd into main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant