use node16 module resolution
This commit is contained in:
parent
08b120bc8d
commit
a906263f74
@ -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>
|
||||
>(
|
||||
|
@ -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, {
|
||||
|
@ -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";
|
||||
|
@ -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/**/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -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": {
|
||||
|
@ -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";
|
||||
|
@ -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": {
|
||||
|
@ -15,4 +15,4 @@
|
||||
*/
|
||||
|
||||
export * from "./index.js";
|
||||
export { SynchronousCryptoWorkerPlain as SynchronousCryptoWorker } from "./crypto/workers/synchronousWorkerPlain.js";
|
||||
export { SynchronousCryptoWorkerPlain } from "./crypto/workers/synchronousWorkerPlain.js";
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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`
|
||||
|
@ -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``;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -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`
|
||||
|
@ -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 {
|
||||
|
@ -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`
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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";
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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/**/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user