update web-utils imports

This commit is contained in:
Sebastian 2023-05-05 08:36:48 -03:00
parent d61e4fa719
commit e90991973c
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
42 changed files with 71 additions and 65 deletions

View File

@ -15,7 +15,13 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import { buildProd } from "@gnu-taler/web-util/lib/index.build"
import { build } from "@gnu-taler/web-util/build";
await buildProd(["src/index.tsx"])
await build({
source: {
js: ["src/index.tsx"],
assets: ["src/index.html"],
},
destination: "./dist/prod",
css: "sass",
});

View File

@ -15,21 +15,26 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import { serve } from "@gnu-taler/web-util/lib/index.node";
import { initializeDev, getFilesInSource } from "@gnu-taler/web-util/lib/index.build"
import { serve } from "@gnu-taler/web-util/node";
import { initializeDev, getFilesInDirectory } from "@gnu-taler/web-util/build";
const allTestFiles = getFilesInSource(/.test.tsx?$/);
const allTestFiles = getFilesInDirectory("src", /.test.tsx?$/);
const devEntryPoints = ["src/stories.tsx", "src/index.tsx", ...allTestFiles];
const buildDev = initializeDev(devEntryPoints)
const build = initializeDev({
source: {
js: devEntryPoints,
assets: ["src/index.html"],
},
destination: "./dist/dev",
css: "sass",
});
await buildDev();
await build();
serve({
folder: './dist/dev',
folder: "./dist/dev",
port: 8080,
source: './src',
insecure: true,
development: true,
onUpdate: buildDev
})
source: "./src",
onSourceUpdate: build,
});

View File

@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import { HttpError, utils } from "@gnu-taler/web-util/lib/index.browser";
import { HttpError, utils } from "@gnu-taler/web-util/browser";
import { Loading } from "../Loading.js";
// import { compose, StateViewMap } from "../../utils/index.js";
// import { wxApi } from "../../wxApi.js";

View File

@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { tests } from "@gnu-taler/web-util/lib/index.browser";
import * as tests from "@gnu-taler/web-util/testing";
import { ReadyView } from "./views.js";
export default {

View File

@ -19,8 +19,8 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { tests } from "@gnu-taler/web-util/lib/index.browser";
import { SwrMockEnvironment } from "@gnu-taler/web-util/lib/tests/swr";
import * as tests from "@gnu-taler/web-util/testing";
import { SwrMockEnvironment } from "@gnu-taler/web-util/testing";
import { expect } from "chai";
import { CASHOUT_API_EXAMPLE } from "../../endpoints.js";
import { Props } from "./index.js";

View File

@ -15,7 +15,7 @@
*/
import { h, VNode } from "preact";
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { State } from "./index.js";
import { format } from "date-fns";
import { Amounts } from "@gnu-taler/taler-util";

View File

@ -15,7 +15,7 @@
*/
import { Loading } from "../../components/Loading.js";
import { HookError, utils } from "@gnu-taler/web-util/lib/index.browser";
import { HookError, utils } from "@gnu-taler/web-util/browser";
//import { compose, StateViewMap } from "../../utils/index.js";
//import { wxApi } from "../../wxApi.js";
import { useComponentState } from "./state.js";

View File

@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { tests } from "@gnu-taler/web-util/lib/index.browser";
import * as tests from "@gnu-taler/web-util/testing";
import { ReadyView } from "./views.js";
export default {

View File

@ -15,7 +15,7 @@
*/
import { h, VNode } from "preact";
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { State } from "./index.js";
export function LoadingUriView({ error }: State.LoadingUriError): VNode {

View File

@ -21,7 +21,7 @@
import { Fragment, h, VNode } from "preact";
import { useEffect, useState } from "preact/hooks";
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { strings as messages } from "../i18n/strings.js";
type LangsNames = {

View File

@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import { HttpError, utils } from "@gnu-taler/web-util/lib/index.browser";
import { HttpError, utils } from "@gnu-taler/web-util/browser";
import { Loading } from "../Loading.js";
// import { compose, StateViewMap } from "../../utils/index.js";
// import { wxApi } from "../../wxApi.js";

View File

@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { tests } from "@gnu-taler/web-util/lib/index.browser";
import * as tests from "@gnu-taler/web-util/testing";
import { ReadyView } from "./views.js";
export default {

View File

@ -19,8 +19,9 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { ErrorType, tests } from "@gnu-taler/web-util/lib/index.browser";
import { SwrMockEnvironment } from "@gnu-taler/web-util/lib/tests/swr";
import { ErrorType } from "@gnu-taler/web-util/browser";
import * as tests from "@gnu-taler/web-util/testing";
import { SwrMockEnvironment } from "@gnu-taler/web-util/testing";
import { expect } from "chai";
import { TRANSACTION_API_EXAMPLE } from "../../endpoints.js";
import { Props } from "./index.js";

View File

@ -15,7 +15,7 @@
*/
import { h, VNode } from "preact";
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { State } from "./index.js";
import { format } from "date-fns";
import { Amounts } from "@gnu-taler/taler-util";

View File

@ -18,7 +18,7 @@ import {
globalLogLevel,
setGlobalLogLevelFromString,
} from "@gnu-taler/taler-util";
import { TranslationProvider } from "@gnu-taler/web-util/lib/index.browser";
import { TranslationProvider } from "@gnu-taler/web-util/browser";
import { FunctionalComponent, h } from "preact";
import { SWRConfig } from "swr";
import { BackendStateProvider } from "../context/backend.js";

View File

@ -19,7 +19,7 @@ import {
HttpResponseOk,
HttpResponsePaginated,
RequestError,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { useEffect, useState } from "preact/hooks";
import { useBackendContext } from "../context/backend.js";
import { MAX_RESULT_SIZE, PAGE_SIZE } from "../utils.js";

View File

@ -20,13 +20,13 @@ import {
HttpError,
RequestError,
useLocalStorage,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import {
HttpResponse,
HttpResponseOk,
RequestOptions,
} from "@gnu-taler/web-util/lib/index.browser";
import { useApiContext } from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { useApiContext } from "@gnu-taler/web-util/browser";
import { useCallback, useEffect, useState } from "preact/hooks";
import { useSWRConfig } from "swr";
import { useBackendContext } from "../context/backend.js";

View File

@ -20,7 +20,7 @@ import {
HttpResponsePaginated,
RequestError,
useApiContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { useEffect, useMemo, useState } from "preact/hooks";
import { useBackendContext } from "../context/backend.js";
import { MAX_RESULT_SIZE, PAGE_SIZE } from "../utils.js";

View File

@ -20,7 +20,7 @@
*/
import { StateUpdater } from "preact/hooks";
import { useLocalStorage } from "@gnu-taler/web-util/lib/index.browser";
import { useLocalStorage } from "@gnu-taler/web-util/browser";
export type ValueOrFunction<T> = T | ((p: T) => T);
const calculateRootPath = () => {

View File

@ -1,5 +1,5 @@
import { TranslatedString } from "@gnu-taler/taler-util";
import { memoryMap } from "@gnu-taler/web-util/lib/index.browser";
import { memoryMap } from "@gnu-taler/web-util/browser";
import { StateUpdater, useEffect, useState } from "preact/hooks";
export type NotificationMessage = ErrorNotification | InfoNotification;

View File

@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import { useLocalStorage } from "@gnu-taler/web-util/lib/index.browser";
import { useLocalStorage } from "@gnu-taler/web-util/browser";
interface Settings {
currentWithdrawalOperationId: string | undefined;

View File

@ -19,7 +19,7 @@ import {
ErrorType,
HttpResponsePaginated,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { Transactions } from "../components/Transactions/index.js";
import { useBackendContext } from "../context/backend.js";

View File

@ -20,7 +20,7 @@ import {
HttpResponsePaginated,
RequestError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { Fragment, h, VNode } from "preact";
import { useState } from "preact/hooks";
import { Cashouts } from "../components/Cashouts/index.js";

View File

@ -15,7 +15,7 @@
*/
import { Logger, TranslatedString } from "@gnu-taler/taler-util";
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { ComponentChildren, Fragment, h, VNode } from "preact";
import { StateUpdater, useEffect, useState } from "preact/hooks";
import talerLogo from "../assets/logo-white.svg";

View File

@ -24,7 +24,7 @@ import {
HttpResponsePaginated,
RequestError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { StateUpdater, useEffect, useState } from "preact/hooks";
import { Cashouts } from "../components/Cashouts/index.js";

View File

@ -25,7 +25,7 @@ import {
HttpResponse,
HttpResponsePaginated,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { Loading } from "../components/Loading.js";
import { useBackendContext } from "../context/backend.js";

View File

@ -15,10 +15,7 @@
*/
import { HttpStatusCode } from "@gnu-taler/taler-util";
import {
ErrorType,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
import { ErrorType, useTranslationContext } from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { useEffect, useRef, useState } from "preact/hooks";
import { useBackendContext } from "../context/backend.js";

View File

@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { tests } from "@gnu-taler/web-util/lib/index.browser";
import * as tests from "@gnu-taler/web-util/testing";
import { PaymentOptions } from "./PaymentOptions.js";
export default {

View File

@ -15,7 +15,7 @@
*/
import { AmountJson } from "@gnu-taler/taler-util";
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { h, VNode } from "preact";
import { useState } from "preact/hooks";
import { notifyInfo } from "../hooks/notification.js";

View File

@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { tests } from "@gnu-taler/web-util/lib/index.browser";
import * as tests from "@gnu-taler/web-util/testing";
import { PaytoWireTransferForm } from "./PaytoWireTransferForm.js";
export default {

View File

@ -26,7 +26,7 @@ import {
import {
RequestError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { h, VNode } from "preact";
import { useEffect, useRef, useState } from "preact/hooks";
import { notifyError } from "../hooks/notification.js";

View File

@ -15,7 +15,7 @@
*/
import { Logger } from "@gnu-taler/taler-util";
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { useState } from "preact/hooks";
import { Transactions } from "../components/Transactions/index.js";

View File

@ -19,7 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { tests } from "@gnu-taler/web-util/lib/index.browser";
import * as tests from "@gnu-taler/web-util/testing";
import { QrCodeSection } from "./QrCodeSection.js";
import { parseWithdrawUri } from "@gnu-taler/taler-util";

View File

@ -22,7 +22,7 @@ import {
import {
RequestError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { h, VNode } from "preact";
import { useEffect } from "preact/hooks";
import { QR } from "../components/QR.js";

View File

@ -17,7 +17,7 @@ import { HttpStatusCode, Logger } from "@gnu-taler/taler-util";
import {
RequestError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { useState } from "preact/hooks";
import { useBackendContext } from "../context/backend.js";

View File

@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { createHashHistory } from "history";
import { VNode, h } from "preact";
import { Route, Router, route } from "preact-router";

View File

@ -24,7 +24,7 @@ import {
import {
RequestError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { VNode, h } from "preact";
import { useEffect, useRef, useState } from "preact/hooks";
import { useAccessAPI } from "../hooks/access.js";

View File

@ -22,7 +22,7 @@ import {
import {
RequestError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { useMemo, useState } from "preact/hooks";
import { useAccessAnonAPI } from "../hooks/access.js";

View File

@ -19,10 +19,7 @@ import {
Logger,
WithdrawUriResult,
} from "@gnu-taler/taler-util";
import {
ErrorType,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
import { ErrorType, useTranslationContext } from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { Loading } from "../components/Loading.js";
import { useWithdrawalDetails } from "../hooks/access.js";

View File

@ -19,8 +19,8 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
import { setupI18n } from "@gnu-taler/taler-util";
import { parseGroupImport, tests } from "@gnu-taler/web-util/lib/index.browser";
import { parseGroupImport } from "@gnu-taler/web-util/browser";
import * as tests from "@gnu-taler/web-util/testing";
import * as components from "./components/index.examples.js";
import * as pages from "./pages/index.stories.js";

View File

@ -23,7 +23,7 @@ import { strings } from "./i18n/strings.js";
import * as pages from "./pages/index.stories.js";
import * as components from "./components/index.examples.js";
import { renderStories } from "@gnu-taler/web-util/lib/index.browser";
import { renderStories } from "@gnu-taler/web-util/browser";
import "./scss/main.scss";

View File

@ -19,7 +19,7 @@ import {
ErrorType,
HttpError,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
} from "@gnu-taler/web-util/browser";
import { ErrorMessage } from "./hooks/notification.js";
/**