From 6074ef7c03ce1654ccfdc199cc41bd1a9067aa10 Mon Sep 17 00:00:00 2001 From: Mirco Bartels Date: Mon, 14 Sep 2026 23:28:16 +0800 Subject: [PATCH 1/2] fix: mark type-only re-exports so isolated-module runtimes can load the source Bun (and any transpiler running with isolatedModules / verbatimModuleSyntax) strips interface exports per file, so a plain re-export of a type fails at load time with e.g. "export 'Statement' not found in './statement.js'". Found by importing src/index.ts directly under Bun 1.3. --- src/index.ts | 8 ++++---- src/mt940parser.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 66c53cf..2432880 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,13 +12,13 @@ export * from './config.js'; export * from './dialog.js'; export * from './electronicStatement.js'; export * from './httpClient.js'; -export { AccountBalanceResponse } from './interactions/balanceInteraction.js'; -export { ClientResponse, StatementResponse } from './interactions/customerInteraction.js'; -export { +export type { AccountBalanceResponse } from './interactions/balanceInteraction.js'; +export type { ClientResponse, StatementResponse } from './interactions/customerInteraction.js'; +export type { ElectronicStatementOptions, ElectronicStatementResponse, } from './interactions/electronicStatementInteraction.js'; -export { PortfolioResponse } from './interactions/portfolioInteraction.js'; +export type { PortfolioResponse } from './interactions/portfolioInteraction.js'; export * from './message.js'; export * from './mt535parser.js'; export * from './mt940parser.js'; diff --git a/src/mt940parser.ts b/src/mt940parser.ts index 9020321..0405fe9 100644 --- a/src/mt940parser.ts +++ b/src/mt940parser.ts @@ -1,6 +1,6 @@ -import { Balance, Statement, Transaction } from './statement.js'; +import type { Balance, Statement, Transaction } from './statement.js'; -export { Statement, Transaction, Balance }; +export type { Statement, Transaction, Balance }; export enum TokenType { Tag = 'Tag', From 7fdb5ac40d21995ab012b059f44b5094f8aaf7e2 Mon Sep 17 00:00:00 2001 From: Robert Weber Date: Tue, 15 Sep 2026 16:34:28 +0200 Subject: [PATCH 2/2] find isolated module problems at build time --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 6ccab66..848c333 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -70,7 +70,7 @@ "declarationDir": "./dist/types" /* Specify the output directory for generated declaration files. */, // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */, // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,