aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-02-16 03:23:42 +0100
committerFlorian Dold <florian@dold.me>2023-02-16 03:23:42 +0100
commita906263f74627dd928c581f388cf12faa3b43476 (patch)
tree1497bad4effb9298b2a08659b9b37d9fb5a3440a
parent08b120bc8d4a738b80c3e0d3f1703b1320f32080 (diff)
use node16 module resolution
-rw-r--r--packages/demobank-ui/src/hooks/access.ts10
-rw-r--r--packages/demobank-ui/src/hooks/circuit.ts8
-rw-r--r--packages/demobank-ui/src/pages/Routing.tsx4
-rw-r--r--packages/demobank-ui/tsconfig.json4
-rw-r--r--packages/taler-util/package.json3
-rw-r--r--packages/taler-util/src/index.browser.ts2
-rw-r--r--packages/taler-wallet-core/package.json4
-rw-r--r--packages/taler-wallet-core/src/index.browser.ts2
-rw-r--r--packages/taler-wallet-webextension/src/browserHttpLib.ts8
-rw-r--r--packages/taler-wallet-webextension/src/components/index.stories.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/Button.tsx4
-rw-r--r--packages/taler-wallet-webextension/src/mui/Grid.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/Menu.stories.tsx3
-rw-r--r--packages/taler-wallet-webextension/src/mui/Modal.tsx4
-rw-r--r--packages/taler-wallet-webextension/src/mui/Paper.tsx4
-rw-r--r--packages/taler-wallet-webextension/src/mui/Popover.tsx6
-rw-r--r--packages/taler-wallet-webextension/src/mui/Portal.tsx8
-rw-r--r--packages/taler-wallet-webextension/src/mui/TextField.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/Typography.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/FormControl.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/FormHelperText.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/FormLabel.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/InputBase.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/InputFilled.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/InputLabel.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/input/InputStandard.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/mui/style.tsx4
-rw-r--r--packages/taler-wallet-webextension/src/popup/Application.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/serviceWorkerHttpLib.ts8
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Application.tsx2
-rw-r--r--packages/taler-wallet-webextension/src/wallet/QrReader.tsx2
-rw-r--r--packages/taler-wallet-webextension/trim-extension.cjs2
-rw-r--r--packages/taler-wallet-webextension/tsconfig.json6
-rw-r--r--packages/web-util/package.json20
34 files changed, 77 insertions, 65 deletions
diff --git a/packages/demobank-ui/src/hooks/access.ts b/packages/demobank-ui/src/hooks/access.ts
index 9c162acfe..9314af557 100644
--- a/packages/demobank-ui/src/hooks/access.ts
+++ b/packages/demobank-ui/src/hooks/access.ts
@@ -162,7 +162,7 @@ export function useAccountDetails(
> {
const { fetcher } = useAuthenticatedBackend();
- const { data, error } = useSWR<
+ const { data, error } = useSWR.default<
HttpResponseOk<SandboxBackend.Access.BankAccountBalanceResponse>,
RequestError<SandboxBackend.SandboxError>
>([`access-api/accounts/${account}`], fetcher, {
@@ -192,7 +192,7 @@ export function useWithdrawalDetails(
> {
const { fetcher } = useAuthenticatedBackend();
- const { data, error } = useSWR<
+ const { data, error } = useSWR.default<
HttpResponseOk<SandboxBackend.Access.BankAccountGetWithdrawalResponse>,
RequestError<SandboxBackend.SandboxError>
>([`access-api/accounts/${account}/withdrawals/${wid}`], fetcher, {
@@ -222,7 +222,7 @@ export function useTransactionDetails(
> {
const { fetcher } = useAuthenticatedBackend();
- const { data, error } = useSWR<
+ const { data, error } = useSWR.default<
HttpResponseOk<SandboxBackend.Access.BankAccountTransactionInfo>,
RequestError<SandboxBackend.SandboxError>
>([`access-api/accounts/${account}/transactions/${tid}`], fetcher, {
@@ -261,7 +261,7 @@ export function usePublicAccounts(
data: afterData,
error: afterError,
isValidating: loadingAfter,
- } = useSWR<
+ } = useSWR.default<
HttpResponseOk<SandboxBackend.Access.PublicAccountsResponse>,
RequestError<SandboxBackend.SandboxError>
>([`public-accounts`, args?.page, PAGE_SIZE], paginatedFetcher);
@@ -329,7 +329,7 @@ export function useTransactions(
data: afterData,
error: afterError,
isValidating: loadingAfter,
- } = useSWR<
+ } = useSWR.default<
HttpResponseOk<SandboxBackend.Access.BankAccountTransactionsResponse>,
RequestError<SandboxBackend.SandboxError>
>(
diff --git a/packages/demobank-ui/src/hooks/circuit.ts b/packages/demobank-ui/src/hooks/circuit.ts
index 91922a6ba..19a48224f 100644
--- a/packages/demobank-ui/src/hooks/circuit.ts
+++ b/packages/demobank-ui/src/hooks/circuit.ts
@@ -194,7 +194,7 @@ export function useBusinessAccountDetails(
> {
const { fetcher } = useAuthenticatedBackend();
- const { data, error } = useSWR<
+ const { data, error } = useSWR.default<
HttpResponseOk<SandboxBackend.Circuit.CircuitAccountData>,
RequestError<SandboxBackend.SandboxError>
>([`circuit-api/accounts/${account}`], fetcher, {
@@ -232,7 +232,7 @@ export function useBusinessAccounts(
data: afterData,
error: afterError,
// isValidating: loadingAfter,
- } = useSWR<
+ } = useSWR.default<
HttpResponseOk<SandboxBackend.Circuit.CircuitAccounts>,
RequestError<SandboxBackend.SandboxError>
>(
@@ -302,7 +302,7 @@ export function useCashouts(): HttpResponse<
> {
const { fetcher, multiFetcher } = useAuthenticatedBackend();
- const { data: list, error: listError } = useSWR<
+ const { data: list, error: listError } = useSWR.default<
HttpResponseOk<SandboxBackend.Circuit.Cashouts>,
RequestError<SandboxBackend.SandboxError>
>([`circuit-api/cashouts`], fetcher, {
@@ -316,7 +316,7 @@ export function useCashouts(): HttpResponse<
const paths = (list?.data.cashouts || []).map(
(cashoutId) => `circuit-api/cashouts/${cashoutId}`,
);
- const { data: cashouts, error: productError } = useSWR<
+ const { data: cashouts, error: productError } = useSWR.default<
HttpResponseOk<SandboxBackend.Circuit.CashoutStatusResponse>[],
RequestError<SandboxBackend.SandboxError>
>([paths], multiFetcher, {
diff --git a/packages/demobank-ui/src/pages/Routing.tsx b/packages/demobank-ui/src/pages/Routing.tsx
index cff561aac..55317f4ed 100644
--- a/packages/demobank-ui/src/pages/Routing.tsx
+++ b/packages/demobank-ui/src/pages/Routing.tsx
@@ -19,8 +19,8 @@ import {
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
import { createHashHistory } from "history";
-import { h, VNode } from "preact";
-import Router, { route, Route } from "preact-router";
+import { h, VNode, } from "preact";
+import { Router, route, Route } from "preact-router";
import { useEffect } from "preact/hooks";
import { Loading } from "../components/Loading.js";
import { PageStateType, usePageContext } from "../context/pageState.js";
diff --git a/packages/demobank-ui/tsconfig.json b/packages/demobank-ui/tsconfig.json
index daa274983..78a686aff 100644
--- a/packages/demobank-ui/tsconfig.json
+++ b/packages/demobank-ui/tsconfig.json
@@ -25,7 +25,7 @@
// "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). */,
+ "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'. */
@@ -48,4 +48,4 @@
"include": [
"src/**/*"
]
-} \ No newline at end of file
+}
diff --git a/packages/taler-util/package.json b/packages/taler-util/package.json
index 9cf47d256..21bee4683 100644
--- a/packages/taler-util/package.json
+++ b/packages/taler-util/package.json
@@ -46,7 +46,8 @@
"#http-impl": {
"type": "./lib/http-impl.node.js",
"node": "./lib/http-impl.node.js",
- "qtart": "./lib/http-impl.qtart.js"
+ "qtart": "./lib/http-impl.qtart.js",
+ "default": "./lib/http-impl.missing.js"
}
},
"scripts": {
diff --git a/packages/taler-util/src/index.browser.ts b/packages/taler-util/src/index.browser.ts
index 2a600644d..ec77b10c0 100644
--- a/packages/taler-util/src/index.browser.ts
+++ b/packages/taler-util/src/index.browser.ts
@@ -22,4 +22,4 @@ export * from "./index.js";
// The web stuff doesn't support package.json export declarations yet,
// so we export more stuff here than we should.
-export * from "./http.js";
+export * from "./http-common.js";
diff --git a/packages/taler-wallet-core/package.json b/packages/taler-wallet-core/package.json
index 72b4eb410..14c407e99 100644
--- a/packages/taler-wallet-core/package.json
+++ b/packages/taler-wallet-core/package.json
@@ -43,8 +43,10 @@
},
"imports": {
"#host-impl": {
+ "types": "./lib/host-impl.node.js",
"node": "./lib/host-impl.node.js",
- "qtart": "./lib/host-impl.qtart.js"
+ "qtart": "./lib/host-impl.qtart.js",
+ "default": "./lib/host-impl.missing.js"
}
},
"devDependencies": {
diff --git a/packages/taler-wallet-core/src/index.browser.ts b/packages/taler-wallet-core/src/index.browser.ts
index 02d3665c2..9409673a0 100644
--- a/packages/taler-wallet-core/src/index.browser.ts
+++ b/packages/taler-wallet-core/src/index.browser.ts
@@ -15,4 +15,4 @@
*/
export * from "./index.js";
-export { SynchronousCryptoWorkerPlain as SynchronousCryptoWorker } from "./crypto/workers/synchronousWorkerPlain.js";
+export { SynchronousCryptoWorkerPlain } from "./crypto/workers/synchronousWorkerPlain.js";
diff --git a/packages/taler-wallet-webextension/src/browserHttpLib.ts b/packages/taler-wallet-webextension/src/browserHttpLib.ts
index 3b8bb1881..2b6ca019c 100644
--- a/packages/taler-wallet-webextension/src/browserHttpLib.ts
+++ b/packages/taler-wallet-webextension/src/browserHttpLib.ts
@@ -21,13 +21,15 @@ import {
Logger,
RequestThrottler,
TalerErrorCode,
+ TalerError,
+} from "@gnu-taler/taler-util";
+
+import {
HttpRequestLibrary,
HttpRequestOptions,
HttpResponse,
Headers,
- TalerError,
-} from "@gnu-taler/taler-util";
-
+} from "@gnu-taler/taler-util/http";
const logger = new Logger("browserHttpLib");
diff --git a/packages/taler-wallet-webextension/src/components/index.stories.tsx b/packages/taler-wallet-webextension/src/components/index.stories.tsx
index 469ed82fa..4a7a068d3 100644
--- a/packages/taler-wallet-webextension/src/components/index.stories.tsx
+++ b/packages/taler-wallet-webextension/src/components/index.stories.tsx
@@ -24,5 +24,5 @@ export * as a2 from "./PendingTransactions.stories.js";
export * as a3 from "./Amount.stories.js";
export * as a4 from "./ShowFullContractTermPopup.stories.js";
export * as a5 from "./TermsOfService/stories.js";
-export * as a6 from "./QR.stories";
+export * as a6 from "./QR.stories.js";
export * as a7 from "./AmountField.stories.js";
diff --git a/packages/taler-wallet-webextension/src/mui/Button.tsx b/packages/taler-wallet-webextension/src/mui/Button.tsx
index 31e97f008..aad8f5002 100644
--- a/packages/taler-wallet-webextension/src/mui/Button.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Button.tsx
@@ -16,9 +16,9 @@
import { ComponentChildren, h, VNode, JSX } from "preact";
import { css } from "@linaria/core";
// eslint-disable-next-line import/extensions
-import { theme, Colors, rippleEnabled, rippleEnabledOutlined } from "./style";
+import { theme, Colors, rippleEnabled, rippleEnabledOutlined } from "./style.js";
// eslint-disable-next-line import/extensions
-import { alpha } from "./colors/manipulation";
+import { alpha } from "./colors/manipulation.js";
import { useState } from "preact/hooks";
import { SafeHandler } from "./handlers.js";
diff --git a/packages/taler-wallet-webextension/src/mui/Grid.tsx b/packages/taler-wallet-webextension/src/mui/Grid.tsx
index e9b839b2f..2db439778 100644
--- a/packages/taler-wallet-webextension/src/mui/Grid.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Grid.tsx
@@ -17,7 +17,7 @@ import { css } from "@linaria/core";
import { h, JSX, VNode, ComponentChildren, createContext } from "preact";
import { useContext } from "preact/hooks";
// eslint-disable-next-line import/extensions
-import { theme } from "./style";
+import { theme } from "./style.js";
type ResponsiveKeys = "xs" | "sm" | "md" | "lg" | "xl";
diff --git a/packages/taler-wallet-webextension/src/mui/Menu.stories.tsx b/packages/taler-wallet-webextension/src/mui/Menu.stories.tsx
index e2bba2678..200af8f57 100644
--- a/packages/taler-wallet-webextension/src/mui/Menu.stories.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Menu.stories.tsx
@@ -47,8 +47,7 @@ export const BasicExample = (): VNode => {
};
import { styled } from "@linaria/react";
-// eslint-disable-next-line import/extensions
-import { theme } from "./style";
+import { theme } from "./style.js";
import { Typography } from "./Typography.js";
import { Divider } from "./Divider.js";
diff --git a/packages/taler-wallet-webextension/src/mui/Modal.tsx b/packages/taler-wallet-webextension/src/mui/Modal.tsx
index 7b1cf3f3a..0ea1372fa 100644
--- a/packages/taler-wallet-webextension/src/mui/Modal.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Modal.tsx
@@ -18,11 +18,11 @@ import { css } from "@linaria/core";
import { h, JSX, VNode, ComponentChildren } from "preact";
import { useCallback, useEffect, useRef, useState } from "preact/hooks";
// eslint-disable-next-line import/extensions
-import { alpha } from "./colors/manipulation";
+import { alpha } from "./colors/manipulation.js";
import { ModalManager } from "./ModalManager.js";
import { Portal } from "./Portal.js";
// eslint-disable-next-line import/extensions
-import { theme } from "./style";
+import { theme } from "./style.js";
const baseStyle = css`
position: fixed;
diff --git a/packages/taler-wallet-webextension/src/mui/Paper.tsx b/packages/taler-wallet-webextension/src/mui/Paper.tsx
index 0c805e307..a44b1be0d 100644
--- a/packages/taler-wallet-webextension/src/mui/Paper.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Paper.tsx
@@ -16,9 +16,9 @@
import { css } from "@linaria/core";
import { h, JSX, VNode, ComponentChildren } from "preact";
// eslint-disable-next-line import/extensions
-import { alpha } from "./colors/manipulation";
+import { alpha } from "./colors/manipulation.js";
// eslint-disable-next-line import/extensions
-import { theme } from "./style";
+import { theme } from "./style.js";
const borderVariant = {
outlined: css`
diff --git a/packages/taler-wallet-webextension/src/mui/Popover.tsx b/packages/taler-wallet-webextension/src/mui/Popover.tsx
index 69e0ab10a..da551c65d 100644
--- a/packages/taler-wallet-webextension/src/mui/Popover.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Popover.tsx
@@ -15,11 +15,7 @@
*/
import { css } from "@linaria/core";
-import { h, JSX, VNode, ComponentChildren } from "preact";
-// eslint-disable-next-line import/extensions
-import { alpha } from "./colors/manipulation";
-// eslint-disable-next-line import/extensions
-import { theme } from "./style";
+import { h, VNode, ComponentChildren } from "preact";
const baseStyle = css``;
diff --git a/packages/taler-wallet-webextension/src/mui/Portal.tsx b/packages/taler-wallet-webextension/src/mui/Portal.tsx
index 2026d7e5a..1d835abac 100644
--- a/packages/taler-wallet-webextension/src/mui/Portal.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Portal.tsx
@@ -26,11 +26,9 @@ import {
cloneElement,
Fragment,
} from "preact";
-import { Ref, useEffect, useMemo, useState } from "preact/hooks";
-// eslint-disable-next-line import/extensions
-import { alpha } from "./colors/manipulation";
-// eslint-disable-next-line import/extensions
-import { theme } from "./style";
+import { Ref, useEffect, useState } from "preact/hooks";
+
+import { theme } from "./style.js";
const baseStyle = css`
position: fixed;
diff --git a/packages/taler-wallet-webextension/src/mui/TextField.tsx b/packages/taler-wallet-webextension/src/mui/TextField.tsx
index 42ac49a00..4d7c9a472 100644
--- a/packages/taler-wallet-webextension/src/mui/TextField.tsx
+++ b/packages/taler-wallet-webextension/src/mui/TextField.tsx
@@ -23,7 +23,7 @@ import { SelectFilled } from "./input/SelectFilled.js";
import { SelectOutlined } from "./input/SelectOutlined.js";
import { SelectStandard } from "./input/SelectStandard.js";
// eslint-disable-next-line import/extensions
-import { Colors } from "./style";
+import { Colors } from "./style.js";
export interface Props {
autoComplete?: string;
diff --git a/packages/taler-wallet-webextension/src/mui/Typography.tsx b/packages/taler-wallet-webextension/src/mui/Typography.tsx
index b3a9e0010..3b4357918 100644
--- a/packages/taler-wallet-webextension/src/mui/Typography.tsx
+++ b/packages/taler-wallet-webextension/src/mui/Typography.tsx
@@ -17,7 +17,7 @@ import { css } from "@linaria/core";
import { ComponentChildren, h, VNode } from "preact";
import { useTranslationContext } from "../context/translation.js";
// eslint-disable-next-line import/extensions
-import { theme } from "./style";
+import { theme } from "./style.js";
type VariantEnum =
| "body1"
diff --git a/packages/taler-wallet-webextension/src/mui/input/FormControl.tsx b/packages/taler-wallet-webextension/src/mui/input/FormControl.tsx
index e80e7f8d8..23dfcfd08 100644
--- a/packages/taler-wallet-webextension/src/mui/input/FormControl.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/FormControl.tsx
@@ -17,7 +17,7 @@ import { css } from "@linaria/core";
import { ComponentChildren, createContext, h, VNode } from "preact";
import { useContext, useMemo, useState } from "preact/hooks";
// eslint-disable-next-line import/extensions
-import { Colors } from "../style";
+import { Colors } from "../style.js";
export interface Props {
color: Colors;
diff --git a/packages/taler-wallet-webextension/src/mui/input/FormHelperText.tsx b/packages/taler-wallet-webextension/src/mui/input/FormHelperText.tsx
index 5e40ba616..5fa48a169 100644
--- a/packages/taler-wallet-webextension/src/mui/input/FormHelperText.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/FormHelperText.tsx
@@ -16,7 +16,7 @@
import { css } from "@linaria/core";
import { ComponentChildren, h, VNode } from "preact";
// eslint-disable-next-line import/extensions
-import { theme } from "../style";
+import { theme } from "../style.js";
import { useFormControl } from "./FormControl.js";
const root = css`
diff --git a/packages/taler-wallet-webextension/src/mui/input/FormLabel.tsx b/packages/taler-wallet-webextension/src/mui/input/FormLabel.tsx
index 11404b5c1..68fbdc38e 100644
--- a/packages/taler-wallet-webextension/src/mui/input/FormLabel.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/FormLabel.tsx
@@ -16,7 +16,7 @@
import { css } from "@linaria/core";
import { ComponentChildren, h, VNode } from "preact";
// eslint-disable-next-line import/extensions
-import { Colors, theme } from "../style";
+import { Colors, theme } from "../style.js";
import { useFormControl } from "./FormControl.js";
export interface Props {
diff --git a/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx b/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
index 94304f16b..d811a3dbb 100644
--- a/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/InputBase.tsx
@@ -23,7 +23,7 @@ import {
useState,
} from "preact/hooks";
// eslint-disable-next-line import/extensions
-import { theme } from "../style";
+import { theme } from "../style.js";
import { FormControlContext, useFormControl } from "./FormControl.js";
const rootStyle = css`
diff --git a/packages/taler-wallet-webextension/src/mui/input/InputFilled.tsx b/packages/taler-wallet-webextension/src/mui/input/InputFilled.tsx
index 9ab91e7fd..a984f8451 100644
--- a/packages/taler-wallet-webextension/src/mui/input/InputFilled.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/InputFilled.tsx
@@ -16,7 +16,7 @@
import { css } from "@linaria/core";
import { h, VNode } from "preact";
// eslint-disable-next-line import/extensions
-import { Colors, theme } from "../style";
+import { Colors, theme } from "../style.js";
import { useFormControl } from "./FormControl.js";
import { InputBase, InputBaseComponent, InputBaseRoot } from "./InputBase.js";
diff --git a/packages/taler-wallet-webextension/src/mui/input/InputLabel.tsx b/packages/taler-wallet-webextension/src/mui/input/InputLabel.tsx
index 35cbd7a41..2d4743e59 100644
--- a/packages/taler-wallet-webextension/src/mui/input/InputLabel.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/InputLabel.tsx
@@ -16,7 +16,7 @@
import { css } from "@linaria/core";
import { ComponentChildren, h, VNode } from "preact";
// eslint-disable-next-line import/extensions
-import { Colors, theme } from "../style";
+import { Colors, theme } from "../style.js";
import { useFormControl } from "./FormControl.js";
import { FormLabel } from "./FormLabel.js";
diff --git a/packages/taler-wallet-webextension/src/mui/input/InputStandard.tsx b/packages/taler-wallet-webextension/src/mui/input/InputStandard.tsx
index 45614f618..f5b70f07c 100644
--- a/packages/taler-wallet-webextension/src/mui/input/InputStandard.tsx
+++ b/packages/taler-wallet-webextension/src/mui/input/InputStandard.tsx
@@ -16,7 +16,7 @@
import { css } from "@linaria/core";
import { h, VNode } from "preact";
// eslint-disable-next-line import/extensions
-import { Colors, theme } from "../style";
+import { Colors, theme } from "../style.js";
import { useFormControl } from "./FormControl.js";
import { InputBase, InputBaseComponent, InputBaseRoot } from "./InputBase.js";
diff --git a/packages/taler-wallet-webextension/src/mui/style.tsx b/packages/taler-wallet-webextension/src/mui/style.tsx
index c3071b314..3fcf3ac1e 100644
--- a/packages/taler-wallet-webextension/src/mui/style.tsx
+++ b/packages/taler-wallet-webextension/src/mui/style.tsx
@@ -26,9 +26,9 @@ import {
purple,
red,
// eslint-disable-next-line import/extensions
-} from "./colors/constants";
+} from "./colors/constants.js";
// eslint-disable-next-line import/extensions
-import { getContrastRatio } from "./colors/manipulation";
+import { getContrastRatio } from "./colors/manipulation.js";
export type Colors =
| "primary"
diff --git a/packages/taler-wallet-webextension/src/popup/Application.tsx b/packages/taler-wallet-webextension/src/popup/Application.tsx
index ebbbc4c2a..acb16b1d5 100644
--- a/packages/taler-wallet-webextension/src/popup/Application.tsx
+++ b/packages/taler-wallet-webextension/src/popup/Application.tsx
@@ -22,7 +22,7 @@
import { createHashHistory } from "history";
import { ComponentChildren, Fragment, h, VNode } from "preact";
-import Router, { route, Route } from "preact-router";
+import { route, Route, Router } from "preact-router";
import { useEffect, useState } from "preact/hooks";
import PendingTransactions from "../components/PendingTransactions.js";
import { PopupBox } from "../components/styled/index.js";
diff --git a/packages/taler-wallet-webextension/src/serviceWorkerHttpLib.ts b/packages/taler-wallet-webextension/src/serviceWorkerHttpLib.ts
index 00c0085ef..921acd63b 100644
--- a/packages/taler-wallet-webextension/src/serviceWorkerHttpLib.ts
+++ b/packages/taler-wallet-webextension/src/serviceWorkerHttpLib.ts
@@ -18,15 +18,17 @@
* Imports.
*/
import {
- Logger,
RequestThrottler,
TalerErrorCode,
+ TalerError,
+} from "@gnu-taler/taler-util";
+
+import {
Headers,
HttpRequestLibrary,
HttpRequestOptions,
HttpResponse,
- TalerError,
-} from "@gnu-taler/taler-util";
+} from "@gnu-taler/taler-util/http";
/**
* An implementation of the [[HttpRequestLibrary]] using the
diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx
index 007f12bb7..bc6678a21 100644
--- a/packages/taler-wallet-webextension/src/wallet/Application.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx
@@ -23,7 +23,7 @@
import { TranslatedString } from "@gnu-taler/taler-util";
import { createHashHistory } from "history";
import { ComponentChildren, Fragment, h, VNode } from "preact";
-import Router, { route, Route } from "preact-router";
+import { route, Route, Router } from "preact-router";
import { useEffect } from "preact/hooks";
import { CurrentAlerts } from "../components/CurrentAlerts.js";
import { LogoHeader } from "../components/LogoHeader.js";
diff --git a/packages/taler-wallet-webextension/src/wallet/QrReader.tsx b/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
index c1972823a..0cbb12d40 100644
--- a/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
@@ -115,7 +115,7 @@ function drawIntoCanvasAndGetQR(
context.clearRect(0, 0, canvas.width, canvas.height);
context.drawImage(tag, 0, 0, canvas.width, canvas.height);
const imgData = context.getImageData(0, 0, canvas.width, canvas.height);
- const code = jsQR(imgData.data, canvas.width, canvas.height, {
+ const code = jsQR.default(imgData.data, canvas.width, canvas.height, {
inversionAttempts: "attemptBoth",
});
if (code) {
diff --git a/packages/taler-wallet-webextension/trim-extension.cjs b/packages/taler-wallet-webextension/trim-extension.cjs
index 4305e792b..00e8f9f01 100644
--- a/packages/taler-wallet-webextension/trim-extension.cjs
+++ b/packages/taler-wallet-webextension/trim-extension.cjs
@@ -7,7 +7,7 @@ module.exports = function({ types: t }) {
visitor: {
ImportDeclaration: (x) => {
const src = x.node.source;
- if (src.value.startsWith("./")) {
+ if (src.value.startsWith(".")) {
if (src.value.endsWith(".js")) {
const newVal = src.value.replace(/[.]js$/, "")
x.node.source = t.stringLiteral(newVal);
diff --git a/packages/taler-wallet-webextension/tsconfig.json b/packages/taler-wallet-webextension/tsconfig.json
index 5fc45caae..303cf879e 100644
--- a/packages/taler-wallet-webextension/tsconfig.json
+++ b/packages/taler-wallet-webextension/tsconfig.json
@@ -8,8 +8,8 @@
"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
- "moduleResolution": "Node",
- "module": "ESNext",
+ "moduleResolution": "Node16",
+ "module": "ES2020",
"target": "ES6",
"skipLibCheck": true,
"preserveSymlinks": true,
@@ -41,4 +41,4 @@
"include": [
"src/**/*"
]
-} \ No newline at end of file
+}
diff --git a/packages/web-util/package.json b/packages/web-util/package.json
index 5ff01d06a..4b2f0d27c 100644
--- a/packages/web-util/package.json
+++ b/packages/web-util/package.json
@@ -12,10 +12,22 @@
"license": "AGPL-3.0-or-later",
"private": false,
"exports": {
- "./lib/tests/swr": "./lib/tests/swr.mjs",
- "./lib/tests/mock": "./lib/tests/mock.mjs",
- "./lib/index.browser": "./lib/index.browser.mjs",
- "./lib/index.node": "./lib/index.node.cjs"
+ "./lib/tests/swr": {
+ "types": "./lib/tests/swr.js",
+ "default": "./lib/tests/swr.mjs"
+ },
+ "./lib/tests/mock": {
+ "types": "./lib/tests/mock.js",
+ "default": "./lib/tests/mock.mjs"
+ },
+ "./lib/index.browser": {
+ "types": "./lib/index.browser.js",
+ "default": "./lib/index.browser.mjs"
+ },
+ "./lib/index.node": {
+ "types": "./lib/index.node.js",
+ "default": "./lib/index.node.cjs"
+ }
},
"scripts": {
"prepare": "tsc && ./build.mjs",