Skip to content

Commit

Permalink
Fix build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
twk3 committed Jan 17, 2024
1 parent dd5da5d commit 486e316
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
11 changes: 4 additions & 7 deletions packages/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-ignore: false-positive commonjs module error on build until typescript 5.3
import type {
RequestInfo as FetchRequestInfo,
RequestInit as FetchRequestInit,
RequestInfo as FetchInfo,
RequestInit as FetchInit,
// @ts-ignore: false-positive commonjs module error on build until typescript 5.3
} from 'node-fetch'; // with { 'resolution-mode': 'import' };

// loot-core types
Expand Down Expand Up @@ -32,10 +32,7 @@ export async function init(config: initConfig = {}) {
if (!globalThis.fetch) {
globalThis.fetch = (url: URL | RequestInfo, init?: RequestInit) => {
return import('node-fetch').then(({ default: fetch }) =>
fetch(
url as unknown as FetchRequestInfo,
init as unknown as FetchRequestInit,
),
fetch(url as unknown as FetchInfo, init as unknown as FetchInit),
) as unknown as Promise<Response>;
};
}
Expand Down
10 changes: 3 additions & 7 deletions packages/loot-core/src/shared/schedules.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// @ts-strict-ignore
import type { IRuleOptions } from '@rschedule/core';
// eslint-disable-next-line import/no-duplicates
import type { IByHourOfDayRuleRuleOptions } from '@rschedule/core/rules/ByHourOfDay';
// eslint-disable-next-line import/no-duplicates
import type { IFrequencyRuleOptions } from '@rschedule/core/rules/Frequency';

import * as monthUtils from './months';
import { q } from './query';
Expand Down Expand Up @@ -187,15 +183,15 @@ export function getRecurringDescription(config, dateFormat) {
}

export function recurConfigToRSchedule(config) {
const base: IRuleOptions &
IFrequencyRuleOptions &
IByHourOfDayRuleRuleOptions = {
const base: IRuleOptions = {
start: monthUtils.parseDate(config.start),
// @ts-ignore: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
frequency: config.frequency.toUpperCase(),
byHourOfDay: [12],
};

if (config.interval) {
// @ts-ignore: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
base.interval = config.interval;
}

Expand Down

0 comments on commit 486e316

Please sign in to comment.