Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
node_modules
src/registered_funds.ts
.netlify
lib/
tobcalc-lib/
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@
},
"dependencies": {
"@samjmck/tobcalc-lib": "npm:@jsr/samjmck__tobcalc-lib@^1.0.10"
},
"imports": {
"#lib": [
"./tobcalc-lib/lib/esm/export",
"@samjmck/tobcalc-lib"
]
}
}
4 changes: 2 additions & 2 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
setECBUrlStart,
setJustETFUrlStart,
setYahooFinanceQuery1UrlStart,
} from "@samjmck/tobcalc-lib";
} from "#lib";
import { runTests } from "./tests";
import type { TaxFormData, fillPdf, FormRow } from "@samjmck/tobcalc-lib";
import type { TaxFormData, fillPdf, FormRow } from "#lib";
import PdfDownload from "./components/PdfDownload.svelte";
import Brokers from "./components/Brokers.svelte";
import PaymentInfo from "./components/modal/PaymentInfo.svelte";
Expand Down
6 changes: 3 additions & 3 deletions src/components/BrokerAdapter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
FormRow,
Security,
TaxableTransaction
} from "@samjmck/tobcalc-lib";
import { formatMoney, isNameRegistered, SecurityType, getTaxableTransactions, getTaxFormData } from "@samjmck/tobcalc-lib";
} from "#lib";
import { formatMoney, isNameRegistered, SecurityType, getTaxableTransactions, getTaxFormData } from "#lib";
import { Broker } from "../broker";
import { getSecuritiesMapWithOverrides, getTaxRateWithOverrides } from "../overrides";
import { formatPercentage } from "../format";
Expand Down Expand Up @@ -187,4 +187,4 @@
overflow: hidden;
}

</style>
</style>
2 changes: 1 addition & 1 deletion src/components/Brokers.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DEGIROAdapter,
Trading212Adapter,
BoursoramaAdapter
} from "@samjmck/tobcalc-lib";
} from "#lib";
import { adapterNumber, totalTaxFormData } from "../stores";
import BrokerAdapter from "./BrokerAdapter.svelte";
import { Broker, brokers } from "../broker";
Expand Down
4 changes: 2 additions & 2 deletions src/components/modal/PaymentInfo.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { openPaymentInfo, nationalRegistrationNumber, lastSession } from "../../stores";
import { formatMoney } from "@samjmck/tobcalc-lib";
import { formatMoney } from "#lib";
import QrCode from "../ui/QrCode.svelte";
import Modal from "./Modal.svelte";
import Input from "../ui/Input.svelte";
Expand Down Expand Up @@ -100,4 +100,4 @@
display: flex;
flex-direction: column;
}
</style>
</style>
4 changes: 2 additions & 2 deletions src/components/modal/PromptFailedSecurityFetches.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { Security } from "@samjmck/tobcalc-lib";
import { SecurityType } from "@samjmck/tobcalc-lib";
import type { Security } from "#lib";
import { SecurityType } from "#lib";
import Modal from "./Modal.svelte";
import Table from "../ui/Table.svelte";
import Button from "../ui/Button.svelte";
Expand Down
4 changes: 2 additions & 2 deletions src/components/modal/PromptFilterBrokerTransactions.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { BrokerTransaction } from "@samjmck/tobcalc-lib";
import { formatMoney } from "@samjmck/tobcalc-lib";
import type { BrokerTransaction } from "#lib";
import { formatMoney } from "#lib";
import { formatDate } from "../../format";
import { alwaysOpenFilterDialog } from "../../stores";
import Modal from "./Modal.svelte";
Expand Down
4 changes: 2 additions & 2 deletions src/components/modal/PromptMergeTransactions.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { BrokerTransaction } from "@samjmck/tobcalc-lib";
import { formatMoney } from "@samjmck/tobcalc-lib";
import type { BrokerTransaction } from "#lib";
import { formatMoney } from "#lib";
import { formatDate } from "../../format";
import Modal from "./Modal.svelte";
import Table from "../ui/Table.svelte";
Expand Down
6 changes: 3 additions & 3 deletions src/overrides.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Security, TaxableTransaction, TaxRateFunction } from "@samjmck/tobcalc-lib";
import { getDefaultTaxRate, getSecurity, SecurityType } from "@samjmck/tobcalc-lib";
import type { Security, TaxableTransaction, TaxRateFunction } from "#lib";
import { getDefaultTaxRate, getSecurity, SecurityType } from "#lib";

export const taxRates = [
0.0012,
Expand Down Expand Up @@ -55,4 +55,4 @@ export async function getSecuritiesMapWithOverrides(
const failedSecuritiesMap = await getFailedIsinsSecurities(failedIsins);

return new Map([...securitiesMap, ...failedSecuritiesMap]);
}
}
4 changes: 2 additions & 2 deletions src/pdf-worker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { workerMessageEventListener } from "@samjmck/tobcalc-lib";
import { workerMessageEventListener } from "#lib";

self.onmessage = workerMessageEventListener;
self.onmessage = workerMessageEventListener;
2 changes: 1 addition & 1 deletion src/stores.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Writable, writable } from "svelte/store";
import type { TaxFormData } from "@samjmck/tobcalc-lib";
import type { TaxFormData } from "#lib";

export interface SessionInfo {
lang: string;
Expand Down
4 changes: 2 additions & 2 deletions src/tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CurrencyCode, getCurrencyExchangeRatesMap, getSecurity, SecurityType } from "@samjmck/tobcalc-lib";
import type { ETF } from "@samjmck/tobcalc-lib";
import { CurrencyCode, getCurrencyExchangeRatesMap, getSecurity, SecurityType } from "#lib";
import type { ETF } from "#lib";

// TODO: use informative error instead of string?
export async function runTests(): Promise<string | null> {
Expand Down