commit eddb1980419c2b15829b40e30f63de3ada28dda7 parent 19221ad5af9a2411de30e7992f70470361fea14f Author: Florian Dold <dold@taler.net> Date: Wed, 29 Jul 2026 12:31:39 +0200 move typescript targets and esbuild bundles from es2020 to es2023 Issue: https://bugs.taler.net/n/10370 Diffstat:
33 files changed, 31 insertions(+), 41 deletions(-)
diff --git a/packages/anastasis-cli/build-node.mjs b/packages/anastasis-cli/build-node.mjs @@ -46,7 +46,7 @@ export const buildConfig = { outfile: "dist/anastasis-cli-bundled.cjs", bundle: true, minify: false, - target: ["es2020"], + target: ["es2023"], format: "cjs", platform: "node", sourcemap: true, diff --git a/packages/anastasis-cli/tsconfig.json b/packages/anastasis-cli/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020"], + "lib": ["ES2023"], "outDir": "lib", "rootDir": "src", "types": ["node"] diff --git a/packages/anastasis-core/tsconfig.json b/packages/anastasis-core/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.defaults.json", "compilerOptions": { "lib": [ - "ES2020", + "ES2023", "DOM" ], "outDir": "lib", diff --git a/packages/anastasis-webui/tsconfig.json b/packages/anastasis-webui/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["DOM", "ES2020"], + "lib": ["DOM", "ES2023"], "types": ["node"], "allowJs": true /* Allow javascript files to be compiled. */, "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, diff --git a/packages/challenger-webui/tsconfig.json b/packages/challenger-webui/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.defaults.json", "compilerOptions": { /* Basic Options */ - "lib": ["DOM", "ES2020"], + "lib": ["DOM", "ES2023"], "allowJs": true /* Allow javascript files to be compiled. */, "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, "jsxFactory": "h", diff --git a/packages/idb-bridge/tsconfig.json b/packages/idb-bridge/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.defaults.json", "compilerOptions": { "lib": [ - "ES2020" + "ES2023" ], "types": [ "node" diff --git a/packages/libeufin-bank-webui/tsconfig.json b/packages/libeufin-bank-webui/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["DOM", "ES2020"], + "lib": ["DOM", "ES2023"], "types": ["node"], "jsx": "react", "jsxFactory": "h", diff --git a/packages/merchant-backend-ui/build.mjs b/packages/merchant-backend-ui/build.mjs @@ -130,7 +130,7 @@ export const buildConfig = { '.woff2': 'file', '.eot': 'file', }, - target: ["es2020"], + target: ["es2023"], format: "iife", platform: "browser", sourcemap: false, @@ -163,7 +163,7 @@ export const testingConfig = { '.woff2': 'file', '.eot': 'file', }, - target: ["es2020"], + target: ["es2023"], format: "iife", platform: "node", sourcemap: true, diff --git a/packages/pogen/example/proj1/tsconfig.json b/packages/pogen/example/proj1/tsconfig.json @@ -4,7 +4,7 @@ "composite": true, "declaration": true, "declarationMap": false, - "target": "ES2020", + "target": "ES2023", "module": "ESNext", "moduleResolution": "node", "sourceMap": true, diff --git a/packages/pogen/src/potextract.test.ts b/packages/pogen/src/potextract.test.ts @@ -32,7 +32,7 @@ function process(src: string): string { const source = ts.createSourceFile( "test.tsx", wrapIntoFunction(src), - ts.ScriptTarget.ES2020, + ts.ScriptTarget.ES2023, ); return processFileForTesting(source).trim(); } diff --git a/packages/pogen/tsconfig.json b/packages/pogen/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "lib", "rootDir": "./src", "lib": [ - "ES2020" + "ES2023" ], "types": [ "node" diff --git a/packages/taler-auditor-webui/tsconfig.json b/packages/taler-auditor-webui/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["es2020", "dom"], + "lib": ["es2023", "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 diff --git a/packages/taler-exchange-aml-webui/tsconfig.json b/packages/taler-exchange-aml-webui/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["DOM", "ES2020"], + "lib": ["DOM", "ES2023"], "types": ["node"], "allowJs": true, "jsx": "react", diff --git a/packages/taler-exchange-kyc-webui/tsconfig.json b/packages/taler-exchange-kyc-webui/tsconfig.json @@ -2,9 +2,9 @@ "extends": "../../tsconfig.defaults.json", "compilerOptions": { /* Basic Options */ - "target": "ES2020", + "target": "ES2023", "module": "Node16", - "lib": ["DOM", "ES2020"], + "lib": ["DOM", "ES2023"], "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'. */, diff --git a/packages/taler-harness/build.mjs b/packages/taler-harness/build.mjs @@ -48,7 +48,7 @@ export const buildConfig = { outfile: "dist/taler-harness-bundled.cjs", bundle: true, minify: false, - target: ["es2020"], + target: ["es2023"], format: "cjs", platform: "node", sourcemap: true, diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts @@ -717,8 +717,6 @@ export class FakebankService extends BankServiceBase implements BankServiceHandle { - proc: ProcessWrapper | undefined; - http = createPlatformHttpLib({ enableThrottling: false }); // We store "created" accounts during setup and @@ -1037,8 +1035,6 @@ export class LibeufinBankService extends BankServiceBase implements BankServiceHandle { - proc: ProcessWrapper | undefined; - http = createPlatformHttpLib({ enableThrottling: false }); private adminAuth: TokenAuth; diff --git a/packages/taler-harness/tsconfig.json b/packages/taler-harness/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020"], + "lib": ["ES2023"], "types": ["node"], "outDir": "lib", "rootDir": "./src" diff --git a/packages/taler-merchant-webui/tsconfig.json b/packages/taler-merchant-webui/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["es2020", "dom"], + "lib": ["es2023", "dom"], "types": ["node"], "jsx": "react", "jsxFactory": "h", diff --git a/packages/taler-util/tsconfig.json b/packages/taler-util/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020"], + "lib": ["ES2023"], "types": ["node"], "outDir": "lib", "rootDir": "./src" diff --git a/packages/taler-wallet-cli/build-node.mjs b/packages/taler-wallet-cli/build-node.mjs @@ -46,7 +46,7 @@ export const buildConfig = { outfile: "dist/taler-wallet-cli-bundled.cjs", bundle: true, minify: false, - target: ["es2020"], + target: ["es2023"], format: "cjs", platform: "node", sourcemap: true, diff --git a/packages/taler-wallet-cli/build-qtart.mjs b/packages/taler-wallet-cli/build-qtart.mjs @@ -43,7 +43,7 @@ export const buildConfig = { outfile: "dist/taler-wallet-cli.qtart.mjs", bundle: true, minify: false, - target: ["es2020"], + target: ["es2023"], format: "esm", platform: "neutral", mainFields: ["module", "main"], diff --git a/packages/taler-wallet-cli/tsconfig.json b/packages/taler-wallet-cli/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020"], + "lib": ["ES2023"], "types": ["node"], "outDir": "lib", "rootDir": "src" diff --git a/packages/taler-wallet-core/src/db-indexeddb.ts b/packages/taler-wallet-core/src/db-indexeddb.ts @@ -2010,7 +2010,6 @@ function upgradeFromStoreMap( const moreInfo = e instanceof Error ? ` Reason: ${e.message}` : ""; throw new Error( `Migration failed. Could not create store ${swi.storeName}.${moreInfo}`, - // @ts-expect-error no support for options.cause yet { cause: e }, ); } @@ -2038,7 +2037,6 @@ function upgradeFromStoreMap( const moreInfo = e instanceof Error ? ` Reason: ${e.message}` : ""; throw Error( `Migration failed. Could not create index ${indexDesc.name}/${indexDesc.keyPath}. ${moreInfo}`, - // @ts-expect-error no support for options.cause yet { cause: e }, ); } diff --git a/packages/taler-wallet-core/src/query.ts b/packages/taler-wallet-core/src/query.ts @@ -329,7 +329,6 @@ export function openDatabase( return new Promise<IDBDatabase>((resolve, reject) => { const req = idbFactory.open(databaseName, databaseVersion); req.onerror = (event) => { - // @ts-expect-error reject(new Error(`database opening error`, { cause: req.error })); }; req.onsuccess = (e) => { @@ -346,14 +345,12 @@ export function openDatabase( const db = req.result; const newVersion = e.newVersion; if (!newVersion) { - // @ts-expect-error throw Error("upgrade needed, but new version unknown", { cause: req.error, }); } const transaction = req.transaction; if (!transaction) { - // @ts-expect-error throw Error("no transaction handle available in upgrade handler", { cause: req.error, }); diff --git a/packages/taler-wallet-core/tsconfig.json b/packages/taler-wallet-core/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.defaults.json", "compilerOptions": { "lib": [ - "ES2020" + "ES2023" ], "types": [ "node" diff --git a/packages/taler-wallet-embedded/build.mjs b/packages/taler-wallet-embedded/build.mjs @@ -46,7 +46,7 @@ export const buildConfig = { outfile: "dist/taler-wallet-core-qjs.mjs", bundle: true, minify: false, - target: ["es2020"], + target: ["es2023"], external: ["os", "std", "node:child_process", "node:fs"], format: "esm", platform: "neutral", diff --git a/packages/taler-wallet-embedded/tsconfig.json b/packages/taler-wallet-embedded/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020"], + "lib": ["ES2023"], "outDir": "lib", "allowJs": true, "checkJs": true, diff --git a/packages/taler-wallet-webextension/src/wallet/AddExchange/state.ts b/packages/taler-wallet-webextension/src/wallet/AddExchange/state.ts @@ -192,7 +192,6 @@ function useDebounce<T>( if (er instanceof Error) { setError(er); } else { - // @ts-expect-error cause still not in typescript setError(new Error("unknown error on debounce", { cause: er })); } setLoading(false); diff --git a/packages/taler-wallet-webextension/tsconfig.json b/packages/taler-wallet-webextension/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["es2020", "DOM"], + "lib": ["es2023", "DOM"], "types": ["chrome", "node"], "jsx": "react", "jsxFactory": "h", diff --git a/packages/web-util/build.mjs b/packages/web-util/build.mjs @@ -96,7 +96,7 @@ const buildConfigBase = { absWorkingDir: BASE_DIR, bundle: true, minify: false, - target: ["es2020"], + target: ["es2023"], loader: { ".key": "text", ".crt": "text", diff --git a/packages/web-util/src/index.build.ts b/packages/web-util/src/index.build.ts @@ -151,7 +151,7 @@ const defaultEsBuildConfig: esbuild.BuildOptions = { ".woff2": "file", ".eot": "file", }, - target: ["es2020"], + target: ["es2023"], format: "esm", platform: "browser", jsxFactory: "h", diff --git a/packages/web-util/tsconfig.json b/packages/web-util/tsconfig.json @@ -4,7 +4,7 @@ "jsx": "react", "jsxFactory": "h", "jsxFragmentFactory": "Fragment", - "lib": ["DOM", "ES2020"], + "lib": ["DOM", "ES2023"], "outDir": "lib", "paths": { "@assets/*": ["../../contrib/taler-assets/*"], diff --git a/tsconfig.defaults.json b/tsconfig.defaults.json @@ -21,7 +21,7 @@ "resolveJsonModule": true, "resolvePackageJsonImports": true, "importHelpers": true, - "target": "ES2020", + "target": "ES2023", "module": "Node16", "moduleResolution": "Node16", "esModuleInterop": true,