Skip to content

docs: fix the playground, and typecheck the examples in CI - #52

Open
david-chau wants to merge 1 commit into
mainfrom
fix/playground-currency-import
Open

docs: fix the playground, and typecheck the examples in CI#52
david-chau wants to merge 1 commit into
mainfrom
fix/playground-currency-import

Conversation

@david-chau

Copy link
Copy Markdown
Owner

The playground was a white screen:

Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/react-financial-input.js'
does not provide an export named 'searchCurrencies' (at CurrencyCombobox.tsx:5:3)

What happened

0.10.0 moved the currency helpers to their own entry point. App.tsx was updated by hand for the parse split; CurrencyCombobox.tsx was missed, and kept importing searchCurrencies, toFlagEmoji, CurrencyOption and CurrencyPreset from the root.

StackBlitz serves examples/playground straight from main, so the demo the README opens with has been broken since 0.10.0.

Why nothing caught it

The playground has its own tsconfig.json, but CI never installs it — so it was the one piece of TypeScript in the repo that no run ever compiled. Unit tests cover the entry-point split (lib/entryPoints.test.ts) but say nothing about whether the examples follow it.

The guard

tsconfig-examples.json maps the package name onto lib/, so the examples typecheck against the entry points as they are now, with no install step. It is wired into npm run typecheck, which CI already runs.

Reverting the import reproduces the failure:

CurrencyCombobox.tsx(5,3): error TS2305: Module '"react-financial-input"' has no exported member 'searchCurrencies'.

Release

docs: on purpose. Only examples/ and the typecheck script change — nothing in the published tarball moves, and StackBlitz reads main rather than npm, so merging is the fix.

The playground was a white screen:

    does not provide an export named 'searchCurrencies'

0.10.0 moved the currency helpers to their own entry point.
examples/playground/src/App.tsx was updated by hand for the parse split;
CurrencyCombobox.tsx was missed, and kept importing searchCurrencies,
toFlagEmoji and their two types from the root.

Nothing caught it. The playground has its own tsconfig, but CI never
installed it, so it was the one piece of TypeScript in the repo that no
run ever compiled. StackBlitz serves it straight from main, so the demo
the README opens with was broken from 0.10.0 until now.

tsconfig-examples.json maps the package name onto lib/ and typechecks
the examples against the entry points as they are now — no install step,
and it fails on exactly this. Reverting the import reproduces four
TS2305s.

docs: only examples/ and the typecheck script change; nothing in the
published tarball moves, and StackBlitz reads main rather than npm.
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