commit 9332b0158de03db163a190e1fba4f5dc2178065c parent 53146dc6c116dcb5eb0f6c30a4c49b0e7dbb7a0b Author: Florian Dold <florian@dold.me> Date: Wed, 19 Feb 2025 13:12:15 +0100 more shared tsconfigs, fix compiler errors Diffstat:
25 files changed, 226 insertions(+), 240 deletions(-)
diff --git a/packages/aml-backoffice-ui/tsconfig.json b/packages/aml-backoffice-ui/tsconfig.json @@ -12,5 +12,13 @@ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, "skipLibCheck": true /* Skip type checking of declaration files. */ }, + "references": [ + { + "path": "../taler-util/" + }, + { + "path": "../web-util/" + } + ], "include": ["src/**/*"] } diff --git a/packages/anastasis-cli/tsconfig.json b/packages/anastasis-cli/tsconfig.json @@ -1,25 +1,9 @@ { - "compileOnSave": true, + "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "composite": true, - "target": "ES2020", - "module": "Node16", - "moduleResolution": "Node16", - "sourceMap": true, "lib": ["ES2020"], - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "strict": true, - "strictPropertyInitialization": false, "outDir": "lib", - "noImplicitAny": true, - "noImplicitThis": true, - "incremental": true, - "esModuleInterop": true, - "importHelpers": true, - "rootDir": "src", - "baseUrl": "./src", - "typeRoots": ["./node_modules/@types"] + "rootDir": "src" }, "include": ["src/**/*"], "references": [ diff --git a/packages/anastasis-webui/tsconfig.json b/packages/anastasis-webui/tsconfig.json @@ -7,15 +7,25 @@ "ES2020" ], "allowJs": true /* Allow javascript files to be compiled. */, - // "checkJs": true, /* Report errors in .js files. */ "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, "jsxFactory": "h", "jsxFragmentFactory": "Fragment", "noEmit": true /* Do not emit outputs. */, /* Module Resolution Options */ - "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, + "allowSyntheticDefaultImports": true, "skipLibCheck": true /* Skip type checking of declaration files. */ }, + "references": [ + { + "path": "../taler-util/" + }, + { + "path": "../web-util/" + }, + { + "path": "../anastasis-core/" + } + ], "include": [ "src/**/*" ] diff --git a/packages/auditor-backoffice-ui/tsconfig.json b/packages/auditor-backoffice-ui/tsconfig.json @@ -1,15 +1,20 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": [ - "es2020", - "dom" - ], + "lib": ["es2020", "dom"], "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, "jsxFactory": "h" /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */, "jsxFragmentFactory": "Fragment", // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories "noEmit": true /* Do not emit outputs. */, "skipLibCheck": true /* Skip type checking of declaration files. */ }, + "references": [ + { + "path": "../taler-util/" + }, + { + "path": "../web-util/" + } + ], "include": ["src/**/*", "tests/**/*"] } diff --git a/packages/bank-ui/src/components/Cashouts/index.ts b/packages/bank-ui/src/components/Cashouts/index.ts @@ -14,7 +14,6 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { Loading, RouteDefinition, utils } from "@gnu-taler/web-util/browser"; import { AbsoluteTime, AmountJson, @@ -22,6 +21,8 @@ import { TalerCorebankApi, TalerError, } from "@gnu-taler/taler-util"; +import { Loading, RouteDefinition, utils } from "@gnu-taler/web-util/browser"; +import { VNode } from "preact"; import { ErrorLoadingWithDebug } from "../ErrorLoadingWithDebug.js"; import { useComponentState } from "./state.js"; import { FailedView, ReadyView } from "./views.js"; @@ -79,7 +80,7 @@ const viewMapping: utils.StateViewMap<State> = { ready: ReadyView, }; -export const Cashouts = utils.compose( +export const Cashouts: (p: Props) => VNode = utils.compose( (p: Props) => useComponentState(p), viewMapping, ); diff --git a/packages/bank-ui/src/components/EmptyComponentExample/index.ts b/packages/bank-ui/src/components/EmptyComponentExample/index.ts @@ -15,6 +15,7 @@ */ import { HookError, Loading, utils } from "@gnu-taler/web-util/browser"; +import { VNode } from "preact"; import { useComponentState } from "./state.js"; import { LoadingUriView, ReadyView } from "./views.js"; @@ -50,7 +51,7 @@ const viewMapping: utils.StateViewMap<State> = { ready: ReadyView, }; -export const ComponentName = utils.compose( +export const ComponentName: (p: Props) => VNode = utils.compose( (p: Props) => useComponentState(p), viewMapping, ); diff --git a/packages/bank-ui/src/components/Transactions/index.ts b/packages/bank-ui/src/components/Transactions/index.ts @@ -15,11 +15,11 @@ */ import { AbsoluteTime, AmountJson, TalerError } from "@gnu-taler/taler-util"; -import { Loading, utils } from "@gnu-taler/web-util/browser"; +import { Loading, RouteDefinition, utils } from "@gnu-taler/web-util/browser"; +import { VNode } from "preact"; import { ErrorLoadingWithDebug } from "../ErrorLoadingWithDebug.js"; import { useComponentState } from "./state.js"; import { ReadyView } from "./views.js"; -import { RouteDefinition } from "@gnu-taler/web-util/browser"; export interface Props { account: string; @@ -78,7 +78,7 @@ const viewMapping: utils.StateViewMap<State> = { ready: ReadyView, }; -export const Transactions = utils.compose( +export const Transactions: (p: Props) => VNode = utils.compose( (p: Props) => useComponentState(p), viewMapping, ); diff --git a/packages/bank-ui/src/pages/AccountPage/index.ts b/packages/bank-ui/src/pages/AccountPage/index.ts @@ -20,13 +20,12 @@ import { TalerCorebankApi, TalerError, } from "@gnu-taler/taler-util"; -import { Loading, utils } from "@gnu-taler/web-util/browser"; +import { Loading, RouteDefinition, utils } from "@gnu-taler/web-util/browser"; +import { Fragment, VNode } from "preact"; import { ErrorLoadingWithDebug } from "../../components/ErrorLoadingWithDebug.js"; import { LoginForm } from "../LoginForm.js"; import { useComponentState } from "./state.js"; import { InvalidIbanView, ReadyView } from "./views.js"; -import { RouteDefinition } from "@gnu-taler/web-util/browser"; -import { Fragment } from "preact"; export interface Props { account: string; @@ -134,7 +133,7 @@ const viewMapping: utils.StateViewMap<State> = { ready: ReadyView, }; -export const AccountPage = utils.compose( +export const AccountPage: (p: Props) => VNode = utils.compose( (p: Props) => useComponentState(p), viewMapping, ); diff --git a/packages/bank-ui/src/pages/BankFrame.stories.tsx b/packages/bank-ui/src/pages/BankFrame.stories.tsx @@ -19,11 +19,17 @@ * @author Sebastian Javier Marchano (sebasjm) */ +import { RouteDefinition } from "@gnu-taler/web-util/browser"; import * as tests from "@gnu-taler/web-util/testing"; +import { ComponentChildren } from "preact"; import { BankFrame } from "./BankFrame.js"; export default { title: "bank frame", }; -export const Ready = tests.createExample(BankFrame, {}); +export const Ready: tests.ExampleItemSetup<{ + account?: string; + routeAccountDetails?: RouteDefinition; + children: ComponentChildren; +}> = tests.createExample(BankFrame, {}); diff --git a/packages/bank-ui/src/pages/OperationState/index.ts b/packages/bank-ui/src/pages/OperationState/index.ts @@ -22,7 +22,8 @@ import { TalerError, WithdrawUriResult, } from "@gnu-taler/taler-util"; -import { Loading, utils } from "@gnu-taler/web-util/browser"; +import { Loading, RouteDefinition, utils } from "@gnu-taler/web-util/browser"; +import { VNode } from "preact"; import { ErrorLoadingWithDebug } from "../../components/ErrorLoadingWithDebug.js"; import { useComponentState } from "./state.js"; import { @@ -35,7 +36,6 @@ import { NeedConfirmationView, ReadyView, } from "./views.js"; -import { RouteDefinition } from "@gnu-taler/web-util/browser"; export interface Props { currency: string; @@ -160,7 +160,7 @@ const viewMapping: utils.StateViewMap<State> = { ready: ReadyView, }; -export const OperationState = utils.compose( +export const OperationState: (p: Props) => VNode = utils.compose( (p: Props) => useComponentState(p), viewMapping, ); diff --git a/packages/bank-ui/src/pages/PaymentOptions.tsx b/packages/bank-ui/src/pages/PaymentOptions.tsx @@ -15,7 +15,10 @@ */ import { AmountJson } from "@gnu-taler/taler-util"; -import { RouteDefinition, useTranslationContext } from "@gnu-taler/web-util/browser"; +import { + RouteDefinition, + useTranslationContext, +} from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useBankState } from "../hooks/bank-state.js"; import { PaytoWireTransferForm } from "./PaytoWireTransferForm.js"; @@ -62,23 +65,7 @@ const TALER_SCREEN_ID = 105; // ); // } -/** - * Let the user choose a payment option, - * then specify the details trigger the action. - */ -export function PaymentOptions({ - routeClose, - routeCashout, - routeChargeWallet, - routeWireTransfer, - tab, - limit, - balance, - onOperationCreated, - onClose, - routeOperationDetails, - onAuthorizationRequired, -}: { +export interface PaymentOptionProps { limit: AmountJson; balance: AmountJson; tab: "charge-wallet" | "wire-transfer" | undefined; @@ -95,7 +82,25 @@ export function PaymentOptions({ subject?: string; amount?: string; }>; -}): VNode { +} + +/** + * Let the user choose a payment option, + * then specify the details trigger the action. + */ +export function PaymentOptions({ + routeClose, + routeCashout, + routeChargeWallet, + routeWireTransfer, + tab, + limit, + balance, + onOperationCreated, + onClose, + routeOperationDetails, + onAuthorizationRequired, +}: PaymentOptionProps): VNode { const { i18n } = useTranslationContext(); const [bankState, updateBankState] = useBankState(); diff --git a/packages/bank-ui/tsconfig.json b/packages/bank-ui/tsconfig.json @@ -10,5 +10,13 @@ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, "skipLibCheck": true /* Skip type checking of declaration files. */ }, + "references": [ + { + "path": "../taler-util/" + }, + { + "path": "../web-util/" + } + ], "include": ["src/**/*"] } diff --git a/packages/challenger-ui/tsconfig.json b/packages/challenger-ui/tsconfig.json @@ -10,5 +10,13 @@ "noEmit": true, /* Do not emit outputs. */ "skipLibCheck": true /* Skip type checking of declaration files. */ }, + "references": [ + { + "path": "../taler-util/" + }, + { + "path": "../web-util/" + } + ], "include": ["src/**/*"] } diff --git a/packages/idb-bridge/tsconfig.json b/packages/idb-bridge/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "lib": ["ES2020"], "outDir": "lib", - "rootDir": "./src", + "rootDir": "./src" }, "include": ["src/**/*"] } diff --git a/packages/kyc-ui/src/pages/TriggerKyc.tsx b/packages/kyc-ui/src/pages/TriggerKyc.tsx @@ -106,6 +106,8 @@ export function TriggerKyc({ onKycStarted }: Props): VNode { description: i18n.str`access denied`, when: AbsoluteTime.now(), }); + + break; } case HttpStatusCode.NotFound: { notify({ @@ -114,6 +116,8 @@ export function TriggerKyc({ onKycStarted }: Props): VNode { description: i18n.str`not found`, when: AbsoluteTime.now(), }); + + break; } case HttpStatusCode.Conflict: { notify({ @@ -122,6 +126,7 @@ export function TriggerKyc({ onKycStarted }: Props): VNode { description: i18n.str`conflict`, when: AbsoluteTime.now(), }); + break; } } } diff --git a/packages/kyc-ui/tsconfig.json b/packages/kyc-ui/tsconfig.json @@ -1,4 +1,5 @@ { + "extends": "../../tsconfig.defaults.json", "compilerOptions": { /* Basic Options */ "target": "ES2020", @@ -11,37 +12,20 @@ "jsxFragmentFactory": "Fragment", "resolveJsonModule": true, "noEmit": true /* Do not emit outputs. */, - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - /* Module Resolution Options */ "moduleResolution": "Node16" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, "esModuleInterop": true /* */, - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - /* Source Map Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ "skipLibCheck": true /* Skip type checking of declaration files. */ }, + "references": [ + { + "path": "../taler-util/" + }, + { + "path": "../web-util/" + } + ], "include": ["src/**/*"] } diff --git a/packages/merchant-backend-ui/src/pages/OfferRefund.tsx b/packages/merchant-backend-ui/src/pages/OfferRefund.tsx @@ -15,59 +15,70 @@ */ /** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ -import { Fragment, h, render, VNode } from 'preact'; -import { render as renderToString } from 'preact-render-to-string'; -import { useEffect } from 'preact/hooks'; -import { Footer } from '../components/Footer'; -import { QR } from '../components/QR'; + * + * @author Sebastian Javier Marchano (sebasjm) + */ +import { Fragment, h, render, VNode } from "preact"; +import { render as renderToString } from "preact-render-to-string"; +import { useEffect } from "preact/hooks"; +import { Footer } from "../components/Footer"; +import { QR } from "../components/QR"; import "../css/pure-min.css"; import "../css/style.css"; -import { Page, QRPlaceholder, WalletLink } from '../styled'; +import { Page, QRPlaceholder, WalletLink } from "../styled"; /** * This page creates a refund offer QR code - * + * * It will build into a mustache html template for server side rendering - * + * * server side rendering params: * - order_status_url * - taler_refund_qrcode_svg * - taler_refund_uri - * + * * request params: * - refund_uri * - order_status_url */ -interface Props { +export interface Props { refundURI?: string; order_status_url?: string; qr_code?: string; } function Head({ order_summary }: { order_summary?: string }): VNode { - return <Fragment> - <meta charSet="UTF-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <meta name="taler-support" content="uri" /> - <meta name="taler-uri" content="{{ taler_refund_uri }}"></meta> - <noscript> - <meta http-equiv="refresh" content="1" /> - </noscript> - <title>Refund available for {order_summary ? order_summary : `{{ order_summary }}`}</title> - </Fragment> + return ( + <Fragment> + <meta charSet="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="taler-support" content="uri" /> + <meta name="taler-uri" content="{{ taler_refund_uri }}"></meta> + <noscript> + <meta http-equiv="refresh" content="1" /> + </noscript> + <title> + Refund available for{" "} + {order_summary ? order_summary : `{{ order_summary }}`} + </title> + </Fragment> + ); } -export function OfferRefund({ refundURI, qr_code, order_status_url }: Props): VNode { +export function OfferRefund({ + refundURI, + qr_code, + order_status_url, +}: Props): VNode { useEffect(() => { const longpollDelayMs = 60 * 1000; const delayMs = 500; let checkUrl: URL; try { - checkUrl = new URL(order_status_url ? order_status_url : "{{& order_status_url }}"); + checkUrl = new URL( + order_status_url ? order_status_url : "{{& order_status_url }}", + ); } catch (e) { return; } @@ -99,49 +110,55 @@ export function OfferRefund({ refundURI, qr_code, order_status_url }: Props): VN }; req.onerror = function () { setTimeout(retryOnce, delayMs); - } + }; req.open("GET", checkUrl.href); req.send(); } setTimeout(check, delayMs); - }) - return <Page> - <section> - <h1>Collect Taler refund</h1> - <p> - Scan this QR code with your Taler mobile wallet: - </p> - <QRPlaceholder dangerouslySetInnerHTML={{ __html: qr_code ? qr_code : `{{{ taler_refund_qrcode_svg }}}` }} /> - <p> - <WalletLink href={refundURI ? refundURI : `{{ taler_refund_uri }}`}> - Or open your Taler wallet - </WalletLink> - </p> - <p> - <a href="https://wallet.taler.net/">Don't have a Taler wallet yet? Install it!</a> - </p> - </section> - <Footer /> - </Page> + }); + return ( + <Page> + <section> + <h1>Collect Taler refund</h1> + <p>Scan this QR code with your Taler mobile wallet:</p> + <QRPlaceholder + dangerouslySetInnerHTML={{ + __html: qr_code ? qr_code : `{{{ taler_refund_qrcode_svg }}}`, + }} + /> + <p> + <WalletLink href={refundURI ? refundURI : `{{ taler_refund_uri }}`}> + Or open your Taler wallet + </WalletLink> + </p> + <p> + <a href="https://wallet.taler.net/"> + Don't have a Taler wallet yet? Install it! + </a> + </p> + </section> + <Footer /> + </Page> + ); } export function mount(): void { try { - const fromLocation = new URL(window.location.href).searchParams - const os = fromLocation.get('order_summary') || undefined; + const fromLocation = new URL(window.location.href).searchParams; + const os = fromLocation.get("order_summary") || undefined; if (os) { render(<Head order_summary={os} />, document.head); } - const uri = fromLocation.get('refund_uri') || undefined; - const osu = fromLocation.get('order_status_url') || undefined; + const uri = fromLocation.get("refund_uri") || undefined; + const osu = fromLocation.get("order_status_url") || undefined; const qr_code = uri ? renderToString(<QR text={uri} />) : undefined; - render(<OfferRefund - refundURI={uri} order_status_url={osu} - qr_code={qr_code} - />, document.body); + render( + <OfferRefund refundURI={uri} order_status_url={osu} qr_code={qr_code} />, + document.body, + ); } catch (e) { console.error("got error", e); if (e instanceof Error) { @@ -150,9 +167,9 @@ export function mount(): void { } } -export function buildTimeRendering(): { head: string, body: string } { +export function buildTimeRendering(): { head: string; body: string } { return { head: renderToString(<Head />), - body: renderToString(<OfferRefund />) - } + body: renderToString(<OfferRefund />), + }; } diff --git a/packages/merchant-backend-ui/src/pages/RequestPayment.stories.tsx b/packages/merchant-backend-ui/src/pages/RequestPayment.stories.tsx @@ -15,31 +15,34 @@ */ /** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ - -import { FunctionalComponent, h } from 'preact'; -import { createSVG } from '../components/QR'; -import { RequestPayment as TestedComponent } from './RequestPayment'; + * + * @author Sebastian Javier Marchano (sebasjm) + */ +import { FunctionalComponent, h } from "preact"; +import { createSVG } from "../components/QR"; +import { RequestPayment as TestedComponent } from "./RequestPayment"; export default { - title: 'RequestPayment', + title: "RequestPayment", component: TestedComponent, - argTypes: { - }, + argTypes: {}, }; -function createExample<Props>(Component: FunctionalComponent<Props>, props: Partial<Props>) { - const r = (args: any) => <Component {...args} /> - r.args = props - return r +function createExample<Props>( + Component: FunctionalComponent<Props>, + props: Partial<Props>, +) { + const r = (args: any) => <Component {...args} />; + r.args = props; + return r; } -const PAYTO_URI_EXAMPLE = 'taler+http://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0' +const PAYTO_URI_EXAMPLE = + "taler+http://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0"; export const Example = createExample(TestedComponent, { - payURI: 'taler+http://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0', - qr_code: createSVG(PAYTO_URI_EXAMPLE) + payURI: + "taler+http://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0", + qr_code: createSVG(PAYTO_URI_EXAMPLE), }); diff --git a/packages/merchant-backend-ui/src/pages/RequestPayment.tsx b/packages/merchant-backend-ui/src/pages/RequestPayment.tsx @@ -22,9 +22,9 @@ import { Fragment, h, render, VNode } from "preact"; import { render as renderToString } from "preact-render-to-string"; import { useEffect } from "preact/hooks"; import { Footer } from "../components/Footer"; +import { QR } from "../components/QR"; import "../css/pure-min.css"; import "../css/style.css"; -import { QR } from "../components/QR"; import { Page, QRPlaceholder, WalletLink } from "../styled"; /** @@ -44,7 +44,7 @@ import { Page, QRPlaceholder, WalletLink } from "../styled"; * - order_status_url */ -interface Props { +export interface Props { payURI?: string; order_status_url?: string; qr_code?: string; @@ -78,7 +78,7 @@ export function RequestPayment({ let checkUrl: URL; try { checkUrl = new URL( - order_status_url ? order_status_url : "{{& order_status_url }}" + order_status_url ? order_status_url : "{{& order_status_url }}", ); } catch (e) { return; @@ -102,7 +102,7 @@ export function RequestPayment({ if (resp.fulfillment_url) { window.location.replace(resp.fulfillment_url); } else { - window.location.reload() + window.location.reload(); } } catch (e) { console.error("could not parse response:", e); @@ -114,7 +114,7 @@ export function RequestPayment({ if (resp.fulfillment_url) { window.location.replace(resp.fulfillment_url); } else { - window.location.reload() + window.location.reload(); } } catch (e) { console.error("could not parse response:", e); @@ -185,7 +185,7 @@ export function mount(): void { render( <RequestPayment payURI={uri} order_status_url={osu} qr_code={qr_code} />, - document.body + document.body, ); } catch (e) { console.error("got error", e); diff --git a/packages/merchant-backend-ui/tsconfig.json b/packages/merchant-backend-ui/tsconfig.json @@ -1,61 +1,18 @@ { + "extends": "../../tsconfig.defaults.json", "compilerOptions": { - /* Basic Options */ - "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "ESNext", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - // "lib": [], /* Specify library files to be included in the compilation: */ - "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "jsxFactory": "h", /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */ - "jsxFragmentFactory": "Fragment", // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - "esModuleInterop": true, /* */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - - /* Source Map Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - - /* Advanced Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */ + /* Basic Options */ + // "lib": [], /* Specify library files to be included in the compilation: */ + "allowJs": true /* Allow javascript files to be compiled. */, + "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, + "jsxFactory": "h" /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */, + "jsxFragmentFactory": "Fragment", // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories + "noEmit": true /* Do not emit outputs. */, + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + /* Module Resolution Options */ + "esModuleInterop": true /* */, + "skipLibCheck": true /* Skip type checking of declaration files. */ }, "include": ["src/**/*", "tests/**/*"] } diff --git a/packages/taler-harness/tsconfig.json b/packages/taler-harness/tsconfig.json @@ -1,25 +1,10 @@ { - "compileOnSave": true, + "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "composite": true, - "target": "ES2020", - "module": "Node16", - "moduleResolution": "Node16", - "sourceMap": true, "lib": ["ES2020"], - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "strict": true, - "strictPropertyInitialization": false, "outDir": "lib", - "noImplicitAny": true, - "noImplicitThis": true, - "incremental": true, - "esModuleInterop": true, - "importHelpers": true, "rootDir": "src", - "baseUrl": "./src", - "typeRoots": ["./node_modules/@types"] + "baseUrl": "./src" }, "include": ["src/**/*"], "references": [ diff --git a/packages/taler-wallet-cli/tsconfig.json b/packages/taler-wallet-cli/tsconfig.json @@ -4,9 +4,9 @@ "lib": ["ES2020"], "outDir": "lib", "rootDir": "src", - "baseUrl": "./src", + "baseUrl": "./src" }, - "include": ["src/**/*", "../taler-util/src/twrpc.ts"], + "include": ["src/**/*"], "references": [ { "path": "../taler-wallet-core/" diff --git a/packages/taler-wallet-core/tsconfig.json b/packages/taler-wallet-core/tsconfig.json @@ -4,7 +4,7 @@ "lib": ["ES2020"], "types": ["node"], "outDir": "lib", - "rootDir": "./src", + "rootDir": "./src" }, "references": [ { diff --git a/packages/taler-wallet-embedded/tsconfig.json b/packages/taler-wallet-embedded/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "lib", "allowJs": true, "checkJs": true, - "rootDir": "./src", + "rootDir": "./src" }, "include": ["src/**/*"], "references": [ diff --git a/packages/taler-wallet-webextension/tsconfig.json b/packages/taler-wallet-webextension/tsconfig.json @@ -8,7 +8,7 @@ "skipLibCheck": true, "preserveSymlinks": true, "outDir": "lib", - "rootDir": "./src", + "rootDir": "./src" }, "references": [ {