Skip to content
Open
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
2 changes: 1 addition & 1 deletion examples/playground/src/CurrencyCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
CurrencyPreset,
searchCurrencies,
toFlagEmoji
} from 'react-financial-input';
} from 'react-financial-input/currency';

/*
Copied verbatim from the library's own story, save for the import above.
Expand Down
3 changes: 3 additions & 0 deletions examples/playground/src/styles.css.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// A side-effect import of the opt-in stylesheet. TypeScript has no idea what a
// .css file is, and there is nothing to type — this just says it exists.
declare module 'react-financial-input/styles.css';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
],
"scripts": {
"build": "vite build && tsc -p ./tsconfig-build.json && node scripts/fixDeclarationImports.mjs",
"typecheck": "tsc --noEmit -p ./tsconfig.json",
"typecheck": "tsc --noEmit -p ./tsconfig.json && tsc --noEmit -p ./tsconfig-examples.json",
"test": "vitest run",
"test:watch": "vitest",
"coverage": "vitest run --coverage",
Expand Down
33 changes: 33 additions & 0 deletions tsconfig-examples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
The examples, typechecked against the library source.

examples/playground has its own tsconfig for anyone who installs and runs
it, but nothing in CI installed it — so when the currency helpers moved to
their own entry point, App.tsx was updated by hand and CurrencyCombobox.tsx
was missed. The playground on StackBlitz went to a white screen with
"does not provide an export named 'searchCurrencies'", and nothing failed.

Mapping the package name onto lib/ means the examples are checked against
the entry points as they are now, on every run, with no install step.
*/
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"strict": true,
"skipLibCheck": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
"react-financial-input": ["./lib/index.ts"],
"react-financial-input/parse": ["./lib/parse.ts"],
"react-financial-input/currency": ["./lib/currency.ts"],
"react-financial-input/events": ["./lib/events.ts"]
}
},
"include": ["examples"],
"exclude": ["**/node_modules", "**/dist"]
}
Loading