diff --git a/packages/core-web/rollup.config.js b/packages/core-web/rollup.config.js index 2124e51..fdf4705 100644 --- a/packages/core-web/rollup.config.js +++ b/packages/core-web/rollup.config.js @@ -4,7 +4,7 @@ import terser from '@rollup/plugin-terser' export default [ { - input: { worker: 'src/worker.js', index: 'src/index.ts' }, + input: { worker: 'src/worker/worker.js', index: 'src/index.ts' }, output: { dir: 'dist', format: 'esm', diff --git a/packages/core-web/src/FedimintWallet.ts b/packages/core-web/src/FedimintWallet.ts index c28d943..4a45e9c 100644 --- a/packages/core-web/src/FedimintWallet.ts +++ b/packages/core-web/src/FedimintWallet.ts @@ -1,4 +1,4 @@ -import { WorkerClient } from './transport/WorkerClient' +import { WorkerClient } from './worker/WorkerClient' import { BalanceService, MintService, diff --git a/packages/core-web/src/services/BalanceService.ts b/packages/core-web/src/services/BalanceService.ts index 9ca2ecc..418ed0d 100644 --- a/packages/core-web/src/services/BalanceService.ts +++ b/packages/core-web/src/services/BalanceService.ts @@ -1,4 +1,4 @@ -import { WorkerClient } from '../transport' +import { WorkerClient } from '../worker' export class BalanceService { constructor(private client: WorkerClient) {} diff --git a/packages/core-web/src/services/FederationService.ts b/packages/core-web/src/services/FederationService.ts index 27acfc4..653a498 100644 --- a/packages/core-web/src/services/FederationService.ts +++ b/packages/core-web/src/services/FederationService.ts @@ -1,5 +1,5 @@ import { JSONValue } from '../types/wallet' -import { WorkerClient } from '../transport' +import { WorkerClient } from '../worker' export class FederationService { constructor(private client: WorkerClient) {} diff --git a/packages/core-web/src/services/LightningService.ts b/packages/core-web/src/services/LightningService.ts index eda971b..5e18974 100644 --- a/packages/core-web/src/services/LightningService.ts +++ b/packages/core-web/src/services/LightningService.ts @@ -1,4 +1,4 @@ -import { WorkerClient } from '../transport' +import { WorkerClient } from '../worker' import { CreateBolt11Response, GatewayInfo, diff --git a/packages/core-web/src/services/MintService.ts b/packages/core-web/src/services/MintService.ts index 8a07a2f..6270379 100644 --- a/packages/core-web/src/services/MintService.ts +++ b/packages/core-web/src/services/MintService.ts @@ -1,4 +1,4 @@ -import { WorkerClient } from '../transport' +import { WorkerClient } from '../worker' import { JSONObject, JSONValue } from '../types/wallet' export class MintService { diff --git a/packages/core-web/src/services/RecoveryService.ts b/packages/core-web/src/services/RecoveryService.ts index 678ade6..f225d43 100644 --- a/packages/core-web/src/services/RecoveryService.ts +++ b/packages/core-web/src/services/RecoveryService.ts @@ -1,5 +1,5 @@ import { JSONValue } from '../types/wallet' -import { WorkerClient } from '../transport' +import { WorkerClient } from '../worker' export class RecoveryService { constructor(private client: WorkerClient) {} diff --git a/packages/core-web/src/transport/WorkerClient.ts b/packages/core-web/src/worker/WorkerClient.ts similarity index 98% rename from packages/core-web/src/transport/WorkerClient.ts rename to packages/core-web/src/worker/WorkerClient.ts index bbf93c4..8ed4d25 100644 --- a/packages/core-web/src/transport/WorkerClient.ts +++ b/packages/core-web/src/worker/WorkerClient.ts @@ -16,7 +16,7 @@ export class WorkerClient { constructor() { // Must create the URL inside the constructor for vite - this.worker = new Worker(new URL('../worker.js', import.meta.url), { + this.worker = new Worker(new URL('./worker.js', import.meta.url), { type: 'module', }) this.worker.onmessage = this.handleWorkerMessage.bind(this) diff --git a/packages/core-web/src/transport/index.ts b/packages/core-web/src/worker/index.ts similarity index 100% rename from packages/core-web/src/transport/index.ts rename to packages/core-web/src/worker/index.ts diff --git a/packages/core-web/src/worker.js b/packages/core-web/src/worker/worker.js similarity index 100% rename from packages/core-web/src/worker.js rename to packages/core-web/src/worker/worker.js diff --git a/packages/core-web/tsconfig.json b/packages/core-web/tsconfig.json index 420a57d..b4c474d 100644 --- a/packages/core-web/tsconfig.json +++ b/packages/core-web/tsconfig.json @@ -10,5 +10,5 @@ "types": ["node"] }, "include": ["src/**/*.ts"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "src/**/*.test.ts"] }